![]() |
Fixposition SDK 0.0.0-heads/main-0-gd0a6ce2
Collection of c++ libraries and apps for use with Fixposition products
|
API: fpsdk_common/parser/fpb.hpp and fpsdk::common::parser::fpb
Framing:
The structure of a FP_B message (frame) is:
Offs | Size | Type | Content |
---|---|---|---|
0 | 1 | uint8_t | Sync 1: f = 102 = 0x66 = 0b0110'0110 |
1 | 1 | uint8_t | Sync 1: ! = 33 = 0x21 = 0b0010'0001 |
2 | 2 | uint16_t | Message ID (message_id ), 1...65534 |
4 | 2 | uint16_t | Payload size (payload_size ) |
6 | 2 | uint16_t | Monotonic time [ms] (message_time ), overflows/wraps around at ~65s |
8… | … | … | Payload |
8 + payload_size | 4 | uint32_t | Checksum |
The checksum is a 32 bit cyclic redundancy check (CRC) with the polynomial 0x32c00699. See Koopman's CRC polynomial zoo at http://users.ece.cmu.edu/~koopman/crc/crc32.html for details.
Payload:
The payload encoding can be:
Example:
A short FP_B frame with the bytes in order they appear on the wire:
First byte Last byte | | 66 21 34 12 04 00 21 43 01 02 03 04 61 c4 c5 9c ^^ ^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ | | | | | | | | | | | | | CRC (= 0x9cc5c461) | | | | | Payload (= [ 0x01, 0x02, 0x03, 0x04 ]) | | | | Message time (= 0x4321 = 17185 = 17.185s) | | | Payload size = (=x0004 = 4) | | Message ID (= 0x1234) | Sync 2 Sync 1
Fixed payload definition:
A short and incomplete guideline:
uint8_t reserved[3] //!< Reserved for future use. Set to 0.
num_foo
field in the static part.uint8_t
for a bool, instead of a bit in a bitfield)foo_valid
flag field.