SELKIELogger  1.0.0
Collaboration diagram for UBX Message handling:

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...
 

Detailed Description

Convert and verify UBX protocol messages

Function Documentation

◆ ubx_calc_checksum()

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.

Parameters
[in]msgInput message
[out]csAChecksum byte A
[out]csBChecksum byte B

Definition at line 38 of file GPSMessages.c.

◆ ubx_check_checksum()

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.

Parameters
[in]msgInput message
Returns
Checksum validity (true/false)

Definition at line 82 of file GPSMessages.c.

◆ ubx_decode_nav_pvt()

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

Parameters
[in]msgUBX Message to decode (must be NAV-PVT)
[out]outPointer to output message (allocated by caller)
Returns
True on success, false on error

Definition at line 175 of file GPSMessages.c.

◆ ubx_flat_array()

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.

Parameters
[in]msgInput message
[out]outBase address of output array
Returns
Size of output array

Definition at line 100 of file GPSMessages.c.

◆ ubx_print_hex()

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.

Parameters
[in]*msgInput message

Definition at line 158 of file GPSMessages.c.

◆ ubx_set_checksum()

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.

Parameters
[in,out]msgMessage to update

Definition at line 71 of file GPSMessages.c.

◆ ubx_string_hex()

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.

Parameters
[in]msgInput message
Returns
Pointer to character array

Definition at line 134 of file GPSMessages.c.