
Messages
GPStation-6 User Manual Rev 2
44
Not all logs may be available. Every effort is made to ensure examples are correct, however, a
checksum may be created for promptness in publication. In this case it will appear as ‘9999’.
Example:
BESTPOSA and BESTPOSB from an OEM6 family receiver.
ASCII:
#BESTPOSA,COM1,0,78.0,FINESTEERING,1427,325298.000,00000000,6145,2748;
SOL_COMPUTED,SINGLE,51.11678928753,-114.03886216575,1064.3470,-16.2708,
WGS84,2.3434,1.3043,4.7300,"",0.000,0.000,7,7,0,0,0,06,0,03*
9
c9a92bb
BINARY:
0xaa, 0x44, 0x12, 0x1c 0x2a, 0x00, 0x02, 0x20, 0x48, 0x00, 0x00, 0x00, 0x90, 0xb4, 0x93,
0x05, 0xb0, 0xab, 0xb9, 0x12, 0x00, 0x00, 0x00, 0x00, 0x45, 0x61, 0xbc, 0x0a, 0x00,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1b, 0x04, 0x50, 0xb3, 0xf2, 0x8e, 0x49,
0x40, 0x16, 0xfa, 0x6b, 0xbe, 0x7c, 0x82, 0x5c, 0xc0, 0x00, 0x60, 0x76, 0x9f, 0x44, 0x9f,
0x90, 0x40, 0xa6, 0x2a, 0x82, 0xc1, 0x3d, 0x00, 0x00, 0x00, 0x12, 0x5a, 0xcb, 0x3f, 0xcd,
0x9e, 0x98, 0x3f, 0xdb, 0x66, 0x40, 0x40, 0x00, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x0b, 0x00, 0x00, 0x00, 0x06, 0x00, 0x03,
0x
42
, 0x
dc,
0x
4c,
0x
48
Below is a demonstration of how to generate the CRC from both ASCII and BINARY messages using
the function described above.
ASCII:
#include
<iostream.h>
#include
<string.h>
void
main()
{
char
_
*i
_
=
_
”BESTPOSA,COM2,0,77.5,FINESTEERING,1285,160578.000,00000020,5941,11
64;
SOL_COMPUTED,SINGLE,51.11640941570,-114.03830951024,1062.6963,-16.2712,
WGS84,1.6890,1.2564,2.7826,\"\",0.000,0.000,10,10,0,0,0,0,0,0";
unsigned long
iLen = strlen(i);
unsigned long
CRC =
CalculateBlockCRC32
(iLen, (unsigned char*)i);
cout << hex << CRC <<endl;
}
The NMEA checksum is an XOR of all the bytes (including delimiters such as ',' but
excluding the * and $) in the message output. It is therefore an 8-bit and not a 32-bit
checksum.
When you pass the data into the code that follows, exclude the checksum shown in
bold italics
above.