|
imu_advanced_navigation_anpp
|
#include <Protocol.hpp>
Public Member Functions | |
| Header () | |
| Header (uint8_t packet_id, uint8_t const *begin, uint8_t const *end) | |
| size_t | getPacketLength () const |
| bool | isValid () const |
| bool | isPacketValid (uint8_t const *begin, uint8_t const *end) const |
| uint8_t | computeHeaderChecksum () const |
Public Attributes | |
| uint8_t | header_checksum |
| uint8_t | packet_id |
| uint8_t | payload_length |
| uint8_t | payload_checksum_lsb |
| uint8_t | payload_checksum_msb |
Static Public Attributes | |
| static constexpr int | SIZE = 5 |
Generic packet header
The data in the packet is stored in little endian byte order
| Header::Header | ( | ) |
Construct an uninitialized header
The header and payload checksums won't validate
| Header::Header | ( | uint8_t | packet_id, |
| uint8_t const * | begin, | ||
| uint8_t const * | end | ||
| ) |
Initialize a header by filling all the fields based on data in the packet
| uint8_t Header::computeHeaderChecksum | ( | ) | const |
Compute the checksum of the header
| size_t Header::getPacketLength | ( | ) | const |
The length of the whole packet (header + payload)
| bool Header::isPacketValid | ( | uint8_t const * | begin, |
| uint8_t const * | end | ||
| ) | const |
Check if the data in the header validates the packet data
| bool Header::isValid | ( | ) | const |
Check if the data in the header validates the header checksum
| uint8_t imu_advanced_navigation_anpp::protocol::Header::header_checksum |
Longitudinal redundancy check for the header
LRC = ((packet_id + packet_length + crc[0] + crc[1])^0xFF) + 1
| uint8_t imu_advanced_navigation_anpp::protocol::Header::packet_id |
| uint8_t imu_advanced_navigation_anpp::protocol::Header::payload_checksum_lsb |
Least significant byte of a crc-CCITT with starting value 0xFFFF calculated over the packet data only
| uint8_t imu_advanced_navigation_anpp::protocol::Header::payload_checksum_msb |
Most significant byte of a crc-CCITT with starting value 0xFFFF calculated over the packet data only
| uint8_t imu_advanced_navigation_anpp::protocol::Header::payload_length |
|
static |
1.8.13