ROSaic
|
Declares the functions to compute and validate the CRC of a buffer. More...
#include <septentrio_gnss_driver/packed_structs/sbf_structs.hpp>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Functions | |
uint16_t FW_EXPORT | compute16CCITT (const void *buf, size_t buf_length) |
This function computes the CRC-8-CCITT (Cyclic Redundancy Check) of a buffer "buf" of "buf_length" bytes. More... | |
bool FW_EXPORT | isValid (const void *block) |
Validates whether the calculated CRC of the SBF block at hand matches the CRC field of the streamed SBF block. More... | |
Declares the functions to compute and validate the CRC of a buffer.
Definition in file crc.h.
uint16_t FW_EXPORT compute16CCITT | ( | const void * | buf, |
size_t | buf_length | ||
) |
This function computes the CRC-8-CCITT (Cyclic Redundancy Check) of a buffer "buf" of "buf_length" bytes.
[in] | buf | The buffer at hand |
[in] | buf_length | Number of bytes in "buf" |
Note that a void pointer is a pointer that has no associated data type with it. A void pointer can hold address of any type and can be typcasted to any type.
Definition at line 43 of file crc.c.
Referenced by isValid().
bool FW_EXPORT isValid | ( | const void * | block | ) |
Validates whether the calculated CRC of the SBF block at hand matches the CRC field of the streamed SBF block.
block | The SBF block that we are interested in |
Definition at line 68 of file crc.c.
References compute16CCITT(), BlockHeader_t::crc, BlockHeader_t::id, and BlockHeader_t::length.
Referenced by io_comm_rx::RxMessage::read().