VR-Link API Documentation for DIS
Link16Structs.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 * ** Copyright (c) 2011 VT MAK
00003 * ** All rights reserved.
00004 * *********************************************************************/
00005 /*********************************************************************
00006 * ** $RCSfile: Link16Structs.h,v $ $Revision: 1.1 $ $State: Exp $
00007 * *********************************************************************/
00008 
00009 #ifdef DtHLA
00010 
00011 #ifndef Link16Structs_H_
00012 #define Link16Structs_H_
00013 
00014 #include <vlutil/vlNetTypes.h>
00015 
00016 const DtU32 DtJtidsHeaderSize = 6;
00017 typedef struct DtJtidsHeaderStruct
00018 {
00019    DtU8 data[DtJtidsHeaderSize];
00020 } DtJtidsHeaderStruct;
00021 
00022 const DtU32 DtTadilJWordSize = 10;
00023 typedef struct DtTadilJWordStruct
00024 {
00025    DtU8 data[DtTadilJWordSize];
00026 } DtTadilJWordStruct;
00027 
00028 const DtU32 DtVoiceDataWordSize = 10;
00029 
00030 const DtU32 DtLetHeaderSize = 6;
00031 typedef struct DtLetHeaderStruct
00032 {
00033    DtU8 data[DtLetHeaderSize];
00034 } DtLetHeaderStruct;
00035 
00036 const DtU32 DtRttabSize = 6;
00037 typedef struct DtRttabStruct
00038 {
00039    DtU8 data[DtRttabSize];
00040 } DtRttabStruct;
00041 
00043 inline void networkByteArraySwap(DtU8* byteArray, int size)
00044 {
00045 #if DT_LITTLE_ENDIAN
00046    if (DtNetworkByteOrdering() == DtBigEndian)
00047    {
00048 #else
00049    if (DtNetworkByteOrdering() == DtLittleEndian)
00050    {
00051 #endif
00052       int theEnd = 0;
00053       for( int i = 0; i < ( size >> 1 ); ++i )
00054       {
00055          theEnd = ( size - 1 ) - i;
00056          byteArray[ i ] ^= byteArray[ theEnd ];
00057          byteArray[ theEnd ] ^= byteArray[ i ];
00058          byteArray[ i ] ^= byteArray[ theEnd ];
00059       }
00060    }
00061 }
00062 
00063 #endif
00064 #endif

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)