point_one::fusion_engine::messages::MessageHeader Struct Reference

The header present at the beginning of every message. More...

#include <point_one/fusion_engine/messages/defs.h>

Public Attributes

uint32_t crc = 0
 The 32-bit CRC of all bytes from and including the protocol_version field to the last byte in the message, including the message payload. More...
 
MessageType message_type = MessageType::INVALID
 Type identifier for the serialized message to follow. More...
 
uint8_t message_version = 0
 The version of the message type specified by message_type to follow. More...
 
uint32_t payload_size_bytes = 0
 The size of the serialized message (bytes). More...
 
uint8_t protocol_version = 2
 The version of the P1 binary protocol being used. More...
 
uint32_t sequence_number = 0
 The sequence number of this message. More...
 
uint32_t source_identifier = INVALID_SOURCE_ID
 Identifies the source of the serialized data. More...
 
uint8_t sync [2] = {SYNC0, SYNC1}
 Message sync bytes: always set to ASCII .1 (0x2E, 0x31). More...
 

Static Public Attributes

static constexpr uint32_t INVALID_SOURCE_ID = 0xFFFFFFFF
 
static const size_t MAX_MESSAGE_SIZE_BYTES = (1 << 24)
 The maximum expected message size (in bytes), used for sanity checking. More...
 
static constexpr uint8_t SYNC0 = 0x2E
 
static constexpr uint8_t SYNC1 = 0x31
 

Detailed Description

The header present at the beginning of every message.

The header is followed immediately in the binary stream by the message payload specified by message_type.

Definition at line 446 of file defs.h.

Member Data Documentation

◆ crc

uint32_t point_one::fusion_engine::messages::MessageHeader::crc = 0

The 32-bit CRC of all bytes from and including the protocol_version field to the last byte in the message, including the message payload.

This uses the standard CRC-32 generator polynomial in reversed order (0xEDB88320).

See also CRC Calculation/Message Validation Support.

Definition at line 470 of file defs.h.

◆ INVALID_SOURCE_ID

constexpr uint32_t point_one::fusion_engine::messages::MessageHeader::INVALID_SOURCE_ID = 0xFFFFFFFF
staticconstexpr

Definition at line 450 of file defs.h.

◆ MAX_MESSAGE_SIZE_BYTES

const size_t point_one::fusion_engine::messages::MessageHeader::MAX_MESSAGE_SIZE_BYTES = (1 << 24)
static

The maximum expected message size (in bytes), used for sanity checking.

Definition at line 455 of file defs.h.

◆ message_type

MessageType point_one::fusion_engine::messages::MessageHeader::message_type = MessageType::INVALID

Type identifier for the serialized message to follow.

Definition at line 481 of file defs.h.

◆ message_version

uint8_t point_one::fusion_engine::messages::MessageHeader::message_version = 0

The version of the message type specified by message_type to follow.

Definition at line 478 of file defs.h.

◆ payload_size_bytes

uint32_t point_one::fusion_engine::messages::MessageHeader::payload_size_bytes = 0

The size of the serialized message (bytes).

Definition at line 487 of file defs.h.

◆ protocol_version

uint8_t point_one::fusion_engine::messages::MessageHeader::protocol_version = 2

The version of the P1 binary protocol being used.

Definition at line 473 of file defs.h.

◆ sequence_number

uint32_t point_one::fusion_engine::messages::MessageHeader::sequence_number = 0

The sequence number of this message.

Definition at line 484 of file defs.h.

◆ source_identifier

uint32_t point_one::fusion_engine::messages::MessageHeader::source_identifier = INVALID_SOURCE_ID

Identifies the source of the serialized data.

Definition at line 490 of file defs.h.

◆ sync

uint8_t point_one::fusion_engine::messages::MessageHeader::sync[2] = {SYNC0, SYNC1}

Message sync bytes: always set to ASCII .1 (0x2E, 0x31).

Definition at line 458 of file defs.h.

◆ SYNC0

constexpr uint8_t point_one::fusion_engine::messages::MessageHeader::SYNC0 = 0x2E
staticconstexpr

Definition at line 447 of file defs.h.

◆ SYNC1

constexpr uint8_t point_one::fusion_engine::messages::MessageHeader::SYNC1 = 0x31
staticconstexpr

Definition at line 448 of file defs.h.


The documentation for this struct was generated from the following file: