49 .message = {
'X',
'D',
'R'},
51 .raw = {0x43, 0x2c, 0x2c, 0x43, 0x2c, 0x45, 0x4e, 0x56, 0x5f,
52 0x57, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x2c, 0x43,
53 0x2c, 0x31, 0x36, 0x2e, 0x32, 0x34, 0x2c, 0x43, 0x2c,
54 0x45, 0x4e, 0x56, 0x5f, 0x4f, 0x55, 0x54, 0x41, 0x49,
55 0x52, 0x5f, 0x54, 0x2c, 0x50, 0x2c, 0x31, 0x30, 0x31,
56 0x38, 0x30, 0x30, 0x2c, 0x50, 0x2c, 0x45, 0x4e, 0x56,
57 0x5f, 0x41, 0x54, 0x4d, 0x4f, 0x53, 0x5f, 0x50}};
64 .raw = {0x43, 0x2c, 0x2c, 0x43, 0x2c, 0x45, 0x4e, 0x56, 0x5f,
65 0x57, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x2c, 0x43,
66 0x2c, 0x31, 0x36, 0x2e, 0x32, 0x34, 0x2c, 0x43, 0x2c,
67 0x45, 0x4e, 0x56, 0x5f, 0x4f, 0x55, 0x54, 0x41, 0x49,
68 0x52, 0x5f, 0x54, 0x2c, 0x50, 0x2c, 0x31, 0x30, 0x31,
69 0x38, 0x30, 0x30, 0x2c, 0x50, 0x2c, 0x45, 0x4e, 0x56,
70 0x5f, 0x41, 0x54, 0x4d, 0x4f, 0x53, 0x5f, 0x50}};
76 fprintf(stderr,
"[Failed] %s\n", hex);
77 fprintf(stderr,
"[Error] Valid checksum failed test\n");
81 printf(
"[Pass] Valid checksum: %s\n", hex);
89 fprintf(stderr,
"[Failed] %s\n", hex);
90 fprintf(stderr,
"[Error] Invalid checksum passed test\n");
94 printf(
"[Pass] Invalid checksum: %s\n", hex);
104 fprintf(stderr,
"[Failed] %s\n", hex);
105 fprintf(stderr,
"[Error] Corrected checksum failed test\n");
109 printf(
"[Pass] Corrected checksum: %s\n", hex);
114 if (passed) {
return 0; }
char * nmea_string_hex(const nmea_msg_t *msg)
Return NMEA message as string.
void nmea_set_checksum(nmea_msg_t *msg)
Set checksum bytes for NMEA message.
bool nmea_check_checksum(const nmea_msg_t *msg)
Verify checksum bytes of NMEA message.
Generic NMEA message structure.
bool encapsulated
Encapsulated message (all data in raw)
uint8_t checksum
Message Checksum.