MessageHeader Struct
The header present at the beginning of every message. More...
Declaration
Included Headers
Public Member Attributes Index
| 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 0.1 (0x2E, 0x31). More... | |
Public Static Attributes Index
| 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 |
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 616 of file defs.h.
Public Member Attributes
crc
|
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 640 of file defs.h.
message_type
|
Type identifier for the serialized message to follow.
Definition at line 651 of file defs.h.
message_version
|
The version of the message type specified by message_type to follow.
Definition at line 648 of file defs.h.
payload_size_bytes
|
protocol_version
|
sequence_number
|
source_identifier
|
sync
Public Static Attributes
INVALID_SOURCE_ID
| constexpr static |
MAX_MESSAGE_SIZE_BYTES
| static |
SYNC0
| constexpr static |
SYNC1
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.