46 ubx_message validCS = {0xB5, 0x62, 0x06, 0x02, 0x0001, {0x01}, 0x0A, 0x2A, 0x00};
47 ubx_message invalidCS = {0xB5, 0x62, 0x06, 0x02, 0x0001, {0x01}, 0xFF, 0xFF, 0x00};
52 fprintf(stderr,
"[Failed] %s\n", hex);
53 fprintf(stderr,
"[Error] Valid checksum failed test\n");
57 printf(
"[Pass] Valid checksum: %s\n", hex);
65 fprintf(stderr,
"[Failed] %s\n", hex);
66 fprintf(stderr,
"[Error] Invalid checksum passed test\n");
70 printf(
"[Pass] Invalid checksum: %s\n", hex);
80 fprintf(stderr,
"[Failed] %s\n", hex);
81 fprintf(stderr,
"[Error] Corrected checksum failed test\n");
85 printf(
"[Pass] Corrected checksum: %s\n", hex);
90 if (passed) {
return 0; }
bool ubx_check_checksum(const ubx_message *msg)
Verify checksum bytes of UBX message.
void ubx_set_checksum(ubx_message *msg)
Set checksum bytes for UBX message.
char * ubx_string_hex(const ubx_message *msg)
Return UBX message as string of hexadecimal pairs.
Internal representation of a UBX message.