55 static constexpr uint8_t
PREAMBLE[] = {0xb5, 0x62};
56 static constexpr uint8_t
WAIT = 0xff;
189 uint8_t reserved0[4];
204 uint16_t payloadLength)
205 : message(static_cast<uint16_t>(message)), payloadLength(payloadLength)
233 uint8_t validChecksum[2];
235 return memcmp(
checksum, validChecksum, 2) == 0;
241 memcpy(&frame[2], &
message, 2);
250 memcpy(&
message, &frame[2], 2);
266 for (
size_t i = 0; i <
sizeof(data); ++i)
Driver for the VN100S IMU.
UBXMessage
UBX messages enumeration.
UBX frames UBX-ACK-ACK and UBX-ACK-NAK.
bool isNack() const
Tells whether the frame is a nak.
Payload & getPayload() const
struct __attribute__((packed)) Payload
Payload of UBX frames UBX-ACK-ACK and UBX-ACK-NAK.
bool isValid() const
Tells whether the frame is an ack frame.
bool isAck() const
Tells whether the frame is an ack.
UBXMessage getAckMessage() const
void calcChecksum(uint8_t *checksum) const
Computes the frame checksum.
UBXMessage getMessage() const
static constexpr uint16_t MAX_PAYLOAD_LENGTH
uint16_t getLength() const
Return the total frame length.
static constexpr uint8_t WAIT
static constexpr uint16_t MAX_FRAME_LENGTH
void writePacked(uint8_t *frame) const
Writes the current message into the given array.
bool isValid() const
Tells whether the current frame is valid or not. Checks the preamble and the checksum.
uint16_t getRealPayloadLength() const
Return the stored payload length.
static constexpr uint8_t PREAMBLE[]
uint8_t payload[MAX_PAYLOAD_LENGTH]
void readPacked(const uint8_t *frame)
Reads a raw frame.
Payload & getPayload() const
bool isValid() const
Tells whether the frame is an ack frame.
struct __attribute__((packed)) Payload
Payload of UBX frame UBX-NAV-PVT.