SELKIELogger
1.0.0
|
Functions | |
void | ubx_calc_checksum (const ubx_message *msg, uint8_t *csA, uint8_t *csB) |
Calculate checksum for UBX message. More... | |
void | ubx_set_checksum (ubx_message *msg) |
Set checksum bytes for UBX message. More... | |
bool | ubx_check_checksum (const ubx_message *msg) |
Verify checksum bytes of UBX message. More... | |
size_t | ubx_flat_array (const ubx_message *msg, uint8_t **out) |
Convert UBX message to flat array of bytes. More... | |
char * | ubx_string_hex (const ubx_message *msg) |
Return UBX message as string of hexadecimal pairs. More... | |
void | ubx_print_hex (const ubx_message *msg) |
Print UBX message in hexadecimal form. More... | |
bool | ubx_decode_nav_pvt (const ubx_message *msg, ubx_nav_pvt *out) |
Decode UBX NAV-PVT message. More... | |
Convert and verify UBX protocol messages
void ubx_calc_checksum | ( | const ubx_message * | msg, |
uint8_t * | csA, | ||
uint8_t * | csB | ||
) |
Calculate checksum for UBX message.
Calculates the checksum for a UBX message using the algorithm described in the receiver description and protocol specification document.
[in] | msg | Input message |
[out] | csA | Checksum byte A |
[out] | csB | Checksum byte B |
Definition at line 38 of file GPSMessages.c.
bool ubx_check_checksum | ( | const ubx_message * | msg | ) |
Verify checksum bytes of UBX message.
Calculates checksum with ubx_calc_checksum() and compares to bytes stored in the provided message.
[in] | msg | Input message |
Definition at line 82 of file GPSMessages.c.
bool ubx_decode_nav_pvt | ( | const ubx_message * | msg, |
ubx_nav_pvt * | out | ||
) |
Decode UBX NAV-PVT message.
Decode data in ubx_message object into individual fields
[in] | msg | UBX Message to decode (must be NAV-PVT) |
[out] | out | Pointer to output message (allocated by caller) |
Definition at line 175 of file GPSMessages.c.
size_t ubx_flat_array | ( | const ubx_message * | msg, |
uint8_t ** | out | ||
) |
Convert UBX message to flat array of bytes.
Allocates a new array of bytes and copies message into array in transmission order (e.g. out[0] to be sent first).
Will handle large data arrays if required. Output array must be freed by caller.
[in] | msg | Input message |
[out] | out | Base address of output array |
Definition at line 100 of file GPSMessages.c.
void ubx_print_hex | ( | const ubx_message * | msg | ) |
Print UBX message in hexadecimal form.
Primarily for debug purposes. Will print string generated by ubx_string_hex() to stdout.
[in] | *msg | Input message |
Definition at line 158 of file GPSMessages.c.
void ubx_set_checksum | ( | ubx_message * | msg | ) |
Set checksum bytes for UBX message.
Simple wrapper around ubx_calc_checksum() to update the checksum bytes within the structure.
[in,out] | msg | Message to update |
Definition at line 71 of file GPSMessages.c.
char* ubx_string_hex | ( | const ubx_message * | msg | ) |
Return UBX message as string of hexadecimal pairs.
Allocates a character array and fills with hexadecimal character pairs representing the message content.
Character array must be freed by caller.
[in] | msg | Input message |
Definition at line 134 of file GPSMessages.c.