Fixposition SDK 0.0.0-heads/main-0-gd0a6ce2
Collection of c++ libraries and apps for use with Fixposition products
Loading...
Searching...
No Matches
fpsdk::common::parser::fpb Namespace Reference

Parser FP_B routines and types. More...

Classes

struct  FpbMeasurementsHead
 FP_B-MEASUREMENTS payload: head. More...
 
struct  FpbMeasurementsMeas
 FP_B-MEASUREMENTS payload: measurement. More...
 
struct  FpbVersionPayload
 FP_B-VERSION payload: head. More...
 

Functions

constexpr uint16_t FpbMsgId (const uint8_t *msg)
 Get message ID.
 
constexpr uint16_t FpbMsgTime (const uint8_t *msg)
 Get message time.
 
bool FpbGetMessageName (char *name, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
 Get FP_B message name.
 
bool FpbGetMessageInfo (char *info, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
 Get FP_B message info.
 
bool FpbMakeMessage (std::vector< uint8_t > &msg, const uint16_t msg_id, const uint16_t msg_time, const std::vector< uint8_t > &payload)
 Make a FP_B message.
 
bool FpbMakeMessage (std::vector< uint8_t > &msg, const uint16_t msg_id, const uint16_t msg_time, const uint8_t *payload, const std::size_t payload_size)
 Make a FP_B message.
 

Variables

static constexpr std::size_t FP_B_FRAME_SIZE = 12
 Size (in bytes) of FP_B frame.
 
static constexpr std::size_t FP_B_HEAD_SIZE = 8
 Size of FP_B frame header.
 
static constexpr uint8_t FP_B_SYNC_1 = 0x66
 FP_B frame sync char 1 ('f', 102, 0b0110'0110)
 
static constexpr uint8_t FP_B_SYNC_2 = 0x21
 FP_B frame sync char 2 ('!', 33, 0b0010'0001)
 
FP_B messages (names and IDs)
  • 1- 999: unused
  • 1000-1999: messages with payload binary serialised data
    • 1101-1199: Fusion
    • 1201-1299: GNSS
    • 1301-1399: System
    • 1401-1499: Configuration
    • 1501-1599: Sensor data
    • 1601-1699: Reserved
    • 1701-1699: Reserved
    • 1801-1699: Reserved
    • 1901-1999: Reserved
  • 2000-3000: messages with static payload
    • 2001-2099: Input data messages (measurements, ...)
    • 2101-2199: Input command message
    • 2201-2299: Input config message
    • 2301-2399: System
    • 2401-2499: Reserved
    • 2501-2599: Reserved
    • 2601-2699: Reserved
    • 2701-2799: Reserved
    • 2801-2899: Reserved
    • 2901-2999: Reserved
  • 3000-65000: Reserved
  • 65001-...: Test messages
static constexpr uint16_t FP_B_GNSSSTATUS_MSGID = 1201
 FP_B-GNSSSTATUS message ID.
 
static constexpr const char * FP_B_GNSSSTATUS_STRID = "FP_B-GNSSSTATUS"
 FP_B-GNSSSTATUS message name.
 
static constexpr uint16_t FP_B_SYSTEMSTATUS_MSGID = 1301
 FP_B-SYSTEMSTATUS message ID.
 
static constexpr const char * FP_B_SYSTEMSTATUS_STRID = "FP_B-SYSTEMSTATUS"
 FP_B-SYSTEMSTATUS message name.
 
static constexpr uint16_t FP_B_MEASUREMENTS_MSGID = 2001
 FP_B-MEASUREMENTS message ID.
 
static constexpr const char * FP_B_MEASUREMENTS_STRID = "FP_B-MEASUREMENTS"
 FP_B-MEASUREMENTS message name.
 
static constexpr uint16_t FP_B_VERSION_MSGID = 2301
 FP_B-VERSION message ID.
 
static constexpr const char * FP_B_VERSION_STRID = "FP_B-VERSION"
 FP_B-VERSION message name.
 
static constexpr uint16_t FP_B_UNITTEST1_MSGID = 65001
 FP_B-UNITTEST1 message ID.
 
static constexpr const char * FP_B_UNITTEST1_STRID = "FP_B-UNITTEST1"
 FP_B-UNITTEST1 message name.
 
static constexpr uint16_t FP_B_UNITTEST2_MSGID = 65002
 FP_B-UNITTEST2 message ID.
 
static constexpr const char * FP_B_UNITTEST2_STRID = "FP_B-UNITTEST2"
 FP_B-UNITTEST2 message name.
 
FP_B-VERSION

Description:

This message contains version strings.

Payload fields:

# Offset Field Type Unit Description
1 0 version uint8_t - Version of the FP_B_VERSION message (currently 1)
2 1 reserved0 uint8_t[7] - Reserved for future use. Set to 0.
3 8 sw_version uint8_t[64] - Software version (nul-terminated string)
4 72 hw_name uint8_t[32] - Hardware name string (nul-terminated string)
5 104 hw_ver uint8_t[32] - Hardware version (nul-terminated string)
6 136 hw_uid uint8_t[32] - Hardware UID (nul-terminated string)
7 168 reserved1 uint8_t[64] - Reserved for future use. Set to 0.
static constexpr uint8_t FP_B_VERSION_V1 = 0x01
 FP_B-VERSION.version value.
 
static constexpr std::size_t FP_B_VERSION_PAYLOAD_SIZE = 232
 Size of FpbVersionPayload.
 

FP_B-MEASUREMENTS

Description:

This message is used to input measurements, such as wheelspeeds, to the sensor.

Notes:

  • The supported meas_type, meas_loc and timestamp_type values depend on the sensor software and configuration used. Refer to the sensor documentation for valid combinations of values for these fields.

Payload fields:

# Offset Field Type Unit Description
1 0 version uint8_t - Version of the FP_B_MEASUREMENTS message (currently 1)
2 1 num_meas uint8_t - Number of measurements present in the body of the message (1…10)
3 2 reserved0 uint8_t[6] - Reserved for future use. Set to 0.
The following fields are repeated num_meas times (i = 0…num_meas-1):
4 + i·12 8 + i·28 meas_x int32_t * Measurement x axis (for example, [mm/s])
5 + i·12 12 + i·28 meas_y int32_t * Measurement y axis (for example, [mm/s])
6 + i·12 16 + i·28 meas_z int32_t * Measurement z axis (for example, [mm/s])
7 + i·12 20 + i·28 meas_x_valid uint8_t - Validity of meas_x (1 = valid data, 0 = invalid data or n/a)
8 + i·12 21 + i·28 meas_y_valid uint8_t - Validity of meas_y (1 = valid data, 0 = invalid data or n/a)
9 + i·12 22 + i·28 meas_z_valid uint8_t - Validity of meas_z (1 = valid data, 0 = invalid data or n/a)
10 + i·12 23 + i·28 meas_type uint8_t - Type of measurement (see below)
11 + i·12 24 + i·28 meas_loc uint8_t - Location of measurement (see below)
12 + i·12 25 + i·28 reserved1 uint8_t[4] - Reserved for future use. Set to 0.
13 + i·12 29 + i·28 timestamp_type uint8_t - Type of timestamp (see below)
14 + i·12 30 + i·28 gps_wno uint16_t - GPS week number
15 + i·12 32 + i·28 gps_tow uint32_t * GPS time of week [ms] or monotonic time [-]

Valid meas_type values are:

Value Description
0 Unspecified
1 Velocity (wheel speed)

Valid meas_loc values are:

Value Description
0 Unspecified
1 Measurement of a sensor at the rear-center (RC)
2 Measurement of a sensor at the front-right (FR)
3 Measurement of a sensor at the front-left (FL)
4 Measurement of a sensor at the rear-right (RR)
5 Measurement of a sensor at the rear-left (RL)

Valid timestamp_type values are:

Value Description
0 Unspecified
1 Use time of arrival of the measurement (ignore gps_wno and gps_tow)
2 Use monotonic time [any] (stored in the gps_tow field)
3 Use GPS time (stored in gps_wno [-] and gps_tow [ms] fields)
enum class  FpbMeasurementsMeasType : uint8_t { UNSPECIFIED = 0 , VELOCITY = 1 }
 FP_B-MEASUREMENTS measurement type. More...
 
enum class  FpbMeasurementsMeasLoc : uint8_t {
  UNSPECIFIED = 0 , RC = 1 , FR = 2 , FL = 3 ,
  RR = 4 , RL = 5
}
 FP_B-MEASUREMENTS measurement location. More...
 
enum class  FpbMeasurementsTimestampType : uint8_t { UNSPECIFIED = 0 , TIMEOFARRIVAL = 1 , MONOTONIC = 2 , GPS = 3 }
 FP_B-MEASUREMENTS timestamp type. More...
 
static constexpr uint8_t FP_B_MEASUREMENTS_V1 = 0x01
 FP_B-MEASUREMENTS.version value.
 
static constexpr std::size_t FP_B_MEASUREMENTS_HEAD_SIZE = 8
 FP_B-MEASUREMENTS payload head size.
 
static constexpr std::size_t FP_B_MEASUREMENTS_MEAS_SIZE = 28
 Size of FpbMeasurementsMeas.
 
static constexpr std::size_t FP_B_MEASUREMENTS_MAX_NUM_MEAS = 10
 Maximum number of measurements.
 

Detailed Description

Parser FP_B routines and types.

Enumeration Type Documentation

◆ FpbMeasurementsMeasType

FP_B-MEASUREMENTS measurement type.

Enumerator
UNSPECIFIED 

Unspecified.

VELOCITY 

Velocity measuement (wheel speed)

Definition at line 340 of file fpb.hpp.

◆ FpbMeasurementsMeasLoc

FP_B-MEASUREMENTS measurement location.

Enumerator
UNSPECIFIED 

Unspecified.

RC 

Measurement of a sensor at the rear-center (RC)

FR 

Measurement of a sensor at the front-right (FR)

FL 

Measurement of a sensor at the front-left (FL)

RR 

Measurement of a sensor at the rear-right (RR)

RL 

Measurement of a sensor at the rear-left (RL)

Definition at line 348 of file fpb.hpp.

◆ FpbMeasurementsTimestampType

FP_B-MEASUREMENTS timestamp type.

Enumerator
UNSPECIFIED 

Unspecified.

TIMEOFARRIVAL 

Use time of arrival of the measurement (ignore gps_wno and gps_tow)

MONOTONIC 

Use monotonic time [any] (stored in the gps_tow field)

GPS 

Use GPS time (stored in gps_wno [-] and gps_tow [ms] fields)

Definition at line 359 of file fpb.hpp.

Function Documentation

◆ FpbMsgId()

uint16_t fpsdk::common::parser::fpb::FpbMsgId ( const uint8_t * msg)
constexpr

Get message ID.

Parameters
[in]msgPointer to the start of the message
Note
No check on the data provided is done. The caller must ensure that the data is a valid FP_B message.
Returns
message ID

Definition at line 122 of file fpb.hpp.

◆ FpbMsgTime()

uint16_t fpsdk::common::parser::fpb::FpbMsgTime ( const uint8_t * msg)
constexpr

Get message time.

Parameters
[in]msgPointer to the start of the message
Note
No check on the data provided is done. The caller must ensure that the data is a valid FP_B message.
Returns
message time

Definition at line 136 of file fpb.hpp.

◆ FpbGetMessageName()

bool fpsdk::common::parser::fpb::FpbGetMessageName ( char * name,
const std::size_t size,
const uint8_t * msg,
const std::size_t msg_size )

Get FP_B message name.

Generates a name (string) in the form "FP_B-NAME", where NAME is a suitable stringifications of the message ID if known (for example, "FP_B-SYSTEMSTATUS", respectively "%05u" formatted message ID if unknown (for example, "FP_B-MSG01234").

Parameters
[out]nameString to write the name to
[in]sizeSize of name (incl. nul termination)
[in]msgPointer to the FP_B message
[in]msg_sizeSize of the msg
Note
No check on the data provided is done. The caller must ensure that the data is a valid FP_B message.
Returns
true if message name was generated, false if name buffer was too small

◆ FpbGetMessageInfo()

bool fpsdk::common::parser::fpb::FpbGetMessageInfo ( char * info,
const std::size_t size,
const uint8_t * msg,
const std::size_t msg_size )

Get FP_B message info.

This stringifies the content of some FP_B messages, for debugging.

Parameters
[out]infoString to write the info to
[in]sizeSize of name (incl. nul termination)
[in]msgPointer to the FP_B message
[in]msg_sizeSize of the msg
Note
No check on the data provided is done. The caller must ensure that the data is a valid FP_B message.
Returns
true if message info was generated (even if info is empty), false if name buffer was too small

◆ FpbMakeMessage() [1/2]

bool fpsdk::common::parser::fpb::FpbMakeMessage ( std::vector< uint8_t > & msg,
const uint16_t msg_id,
const uint16_t msg_time,
const std::vector< uint8_t > & payload )

Make a FP_B message.

Parameters
[out]msgThe message frame
[in]msg_idMessage ID
[in]msg_timeMessage time [ms]
[in]payloadThe message payload (up to MAX_FP_B_SIZE - FP_B_FRAME_SIZE bytes, can be empty)
Returns
true if the message was successfully constructed (msg now contains the message), false if failed contructing the message (payload too large)

◆ FpbMakeMessage() [2/2]

bool fpsdk::common::parser::fpb::FpbMakeMessage ( std::vector< uint8_t > & msg,
const uint16_t msg_id,
const uint16_t msg_time,
const uint8_t * payload,
const std::size_t payload_size )

Make a FP_B message.

Parameters
[out]msgThe message frame
[in]msg_idMessage ID
[in]msg_timeMessage time [ms]
[in]payloadThe message payload (up to MAX_FP_B_SIZE - FP_B_FRAME_SIZE bytes, can be NULL)
[in]payload_sizeThe message payload (up to MAX_FP_B_SIZE - FP_B_FRAME_SIZE, can be 0, even if payload is not NULL)
Returns
true if the message was successfully constructed (msg now contains the message), false if failed contructing the message (payload too large, bad arguments)

Variable Documentation

◆ FP_B_FRAME_SIZE

std::size_t fpsdk::common::parser::fpb::FP_B_FRAME_SIZE = 12
staticconstexpr

Size (in bytes) of FP_B frame.

Definition at line 108 of file fpb.hpp.

◆ FP_B_HEAD_SIZE

std::size_t fpsdk::common::parser::fpb::FP_B_HEAD_SIZE = 8
staticconstexpr

Size of FP_B frame header.

Definition at line 109 of file fpb.hpp.

◆ FP_B_SYNC_1

uint8_t fpsdk::common::parser::fpb::FP_B_SYNC_1 = 0x66
staticconstexpr

FP_B frame sync char 1 ('f', 102, 0b0110'0110)

Definition at line 110 of file fpb.hpp.

◆ FP_B_SYNC_2

uint8_t fpsdk::common::parser::fpb::FP_B_SYNC_2 = 0x21
staticconstexpr

FP_B frame sync char 2 ('!', 33, 0b0010'0001)

Definition at line 111 of file fpb.hpp.

◆ FP_B_GNSSSTATUS_MSGID

uint16_t fpsdk::common::parser::fpb::FP_B_GNSSSTATUS_MSGID = 1201
staticconstexpr

FP_B-GNSSSTATUS message ID.

Definition at line 236 of file fpb.hpp.

◆ FP_B_GNSSSTATUS_STRID

const char* fpsdk::common::parser::fpb::FP_B_GNSSSTATUS_STRID = "FP_B-GNSSSTATUS"
staticconstexpr

FP_B-GNSSSTATUS message name.

Definition at line 237 of file fpb.hpp.

◆ FP_B_SYSTEMSTATUS_MSGID

uint16_t fpsdk::common::parser::fpb::FP_B_SYSTEMSTATUS_MSGID = 1301
staticconstexpr

FP_B-SYSTEMSTATUS message ID.

Definition at line 238 of file fpb.hpp.

◆ FP_B_SYSTEMSTATUS_STRID

const char* fpsdk::common::parser::fpb::FP_B_SYSTEMSTATUS_STRID = "FP_B-SYSTEMSTATUS"
staticconstexpr

FP_B-SYSTEMSTATUS message name.

Definition at line 239 of file fpb.hpp.

◆ FP_B_MEASUREMENTS_MSGID

uint16_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_MSGID = 2001
staticconstexpr

FP_B-MEASUREMENTS message ID.

Definition at line 240 of file fpb.hpp.

◆ FP_B_MEASUREMENTS_STRID

const char* fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_STRID = "FP_B-MEASUREMENTS"
staticconstexpr

FP_B-MEASUREMENTS message name.

Definition at line 241 of file fpb.hpp.

◆ FP_B_VERSION_MSGID

uint16_t fpsdk::common::parser::fpb::FP_B_VERSION_MSGID = 2301
staticconstexpr

FP_B-VERSION message ID.

Definition at line 242 of file fpb.hpp.

◆ FP_B_VERSION_STRID

const char* fpsdk::common::parser::fpb::FP_B_VERSION_STRID = "FP_B-VERSION"
staticconstexpr

FP_B-VERSION message name.

Definition at line 243 of file fpb.hpp.

◆ FP_B_UNITTEST1_MSGID

uint16_t fpsdk::common::parser::fpb::FP_B_UNITTEST1_MSGID = 65001
staticconstexpr

FP_B-UNITTEST1 message ID.

Definition at line 244 of file fpb.hpp.

◆ FP_B_UNITTEST1_STRID

const char* fpsdk::common::parser::fpb::FP_B_UNITTEST1_STRID = "FP_B-UNITTEST1"
staticconstexpr

FP_B-UNITTEST1 message name.

Definition at line 245 of file fpb.hpp.

◆ FP_B_UNITTEST2_MSGID

uint16_t fpsdk::common::parser::fpb::FP_B_UNITTEST2_MSGID = 65002
staticconstexpr

FP_B-UNITTEST2 message ID.

Definition at line 246 of file fpb.hpp.

◆ FP_B_UNITTEST2_STRID

const char* fpsdk::common::parser::fpb::FP_B_UNITTEST2_STRID = "FP_B-UNITTEST2"
staticconstexpr

FP_B-UNITTEST2 message name.

Definition at line 247 of file fpb.hpp.

◆ FP_B_MEASUREMENTS_V1

uint8_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_V1 = 0x01
staticconstexpr

FP_B-MEASUREMENTS.version value.

Definition at line 324 of file fpb.hpp.

◆ FP_B_MEASUREMENTS_HEAD_SIZE

std::size_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_HEAD_SIZE = 8
staticconstexpr

FP_B-MEASUREMENTS payload head size.

Definition at line 337 of file fpb.hpp.

◆ FP_B_MEASUREMENTS_MEAS_SIZE

std::size_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_MEAS_SIZE = 28
staticconstexpr

Size of FpbMeasurementsMeas.

Definition at line 390 of file fpb.hpp.

◆ FP_B_MEASUREMENTS_MAX_NUM_MEAS

std::size_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_MAX_NUM_MEAS = 10
staticconstexpr

Maximum number of measurements.

Definition at line 393 of file fpb.hpp.

◆ FP_B_VERSION_V1

uint8_t fpsdk::common::parser::fpb::FP_B_VERSION_V1 = 0x01
staticconstexpr

FP_B-VERSION.version value.

Definition at line 428 of file fpb.hpp.

◆ FP_B_VERSION_PAYLOAD_SIZE

std::size_t fpsdk::common::parser::fpb::FP_B_VERSION_PAYLOAD_SIZE = 232
staticconstexpr

Size of FpbVersionPayload.

Definition at line 443 of file fpb.hpp.