86#ifndef __FPSDK_COMMON_PARSER_FPB_HPP__
87#define __FPSDK_COMMON_PARSER_FPB_HPP__
124 return (((uint16_t)((uint8_t*)msg)[3] << 8) | (uint16_t)((uint8_t*)msg)[2]);
138 return (((uint16_t)((uint8_t*)msg)[7] << 8) | (uint16_t)((uint8_t*)msg)[6]);
157bool FpbGetMessageName(
char* name,
const std::size_t size,
const uint8_t* msg,
const std::size_t msg_size);
173bool FpbGetMessageInfo(
char* info,
const std::size_t size,
const uint8_t* msg,
const std::size_t msg_size);
187 std::vector<uint8_t>& msg,
const uint16_t msg_id,
const uint16_t msg_time,
const std::vector<uint8_t>& payload);
202bool FpbMakeMessage(std::vector<uint8_t>& msg,
const uint16_t msg_id,
const uint16_t msg_time,
const uint8_t* payload,
203 const std::size_t payload_size);
static constexpr uint16_t FP_B_VERSION_MSGID
FP_B-VERSION message ID.
static constexpr const char * FP_B_GNSSSTATUS_STRID
FP_B-GNSSSTATUS message name.
static constexpr const char * FP_B_VERSION_STRID
FP_B-VERSION message name.
static constexpr const char * FP_B_UNITTEST1_STRID
FP_B-UNITTEST1 message name.
static constexpr uint8_t FP_B_MEASUREMENTS_V1
FP_B-MEASUREMENTS.version value.
static constexpr const char * FP_B_SYSTEMSTATUS_STRID
FP_B-SYSTEMSTATUS message name.
static constexpr uint8_t FP_B_VERSION_V1
FP_B-VERSION.version value.
bool FpbGetMessageName(char *name, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
Get FP_B message name.
static constexpr uint16_t FP_B_GNSSSTATUS_MSGID
FP_B-GNSSSTATUS message ID.
static constexpr std::size_t FP_B_MEASUREMENTS_MAX_NUM_MEAS
Maximum number of measurements.
static constexpr uint16_t FP_B_UNITTEST2_MSGID
FP_B-UNITTEST2 message ID.
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.
static constexpr std::size_t FP_B_MEASUREMENTS_HEAD_SIZE
FP_B-MEASUREMENTS payload head size.
static constexpr uint8_t FP_B_SYNC_1
FP_B frame sync char 1 ('f', 102, 0b0110'0110)
static constexpr std::size_t FP_B_VERSION_PAYLOAD_SIZE
Size of FpbVersionPayload.
static constexpr uint16_t FP_B_SYSTEMSTATUS_MSGID
FP_B-SYSTEMSTATUS message ID.
static constexpr uint16_t FP_B_UNITTEST1_MSGID
FP_B-UNITTEST1 message ID.
static constexpr std::size_t FP_B_FRAME_SIZE
Size (in bytes) of FP_B frame.
static constexpr std::size_t FP_B_HEAD_SIZE
Size of FP_B frame header.
FpbMeasurementsTimestampType
FP_B-MEASUREMENTS timestamp type.
@ MONOTONIC
Use monotonic time [any] (stored in the gps_tow field)
@ UNSPECIFIED
Unspecified.
@ TIMEOFARRIVAL
Use time of arrival of the measurement (ignore gps_wno and gps_tow)
@ GPS
Use GPS time (stored in gps_wno [-] and gps_tow [ms] fields)
static constexpr const char * FP_B_UNITTEST2_STRID
FP_B-UNITTEST2 message name.
FpbMeasurementsMeasType
FP_B-MEASUREMENTS measurement type.
@ UNSPECIFIED
Unspecified.
@ VELOCITY
Velocity measuement (wheel speed)
constexpr uint16_t FpbMsgId(const uint8_t *msg)
Get message ID.
static constexpr const char * FP_B_MEASUREMENTS_STRID
FP_B-MEASUREMENTS message name.
FpbMeasurementsMeasLoc
FP_B-MEASUREMENTS measurement location.
@ FR
Measurement of a sensor at the front-right (FR)
@ UNSPECIFIED
Unspecified.
@ RC
Measurement of a sensor at the rear-center (RC)
@ RL
Measurement of a sensor at the rear-left (RL)
@ FL
Measurement of a sensor at the front-left (FL)
@ RR
Measurement of a sensor at the rear-right (RR)
constexpr uint16_t FpbMsgTime(const uint8_t *msg)
Get message time.
static constexpr uint16_t FP_B_MEASUREMENTS_MSGID
FP_B-MEASUREMENTS message ID.
static constexpr std::size_t FP_B_MEASUREMENTS_MEAS_SIZE
Size of FpbMeasurementsMeas.
bool FpbGetMessageInfo(char *info, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
Get FP_B message info.
static constexpr uint8_t FP_B_SYNC_2
FP_B frame sync char 2 ('!', 33, 0b0010'0001)
constexpr std::underlying_type< T >::type EnumToVal(T enum_val)
Convert enum class constant to the underlying integral type value.
FP_B-MEASUREMENTS payload: head.
uint8_t version
Message version (= FP_B_MEASUREMENTS_V1 for this version of the message)
uint8_t num_meas
Number of measurements in the body (1..FP_B_MEASUREMENTS_MAX_NUM_MEAS)
uint8_t reserved0[6]
Reserved for future use. Set to 0.
FP_B-MEASUREMENTS payload: measurement.
uint8_t timestamp_type
See FpbMeasurementsTimestampType.
int32_t meas_y
Measurement y.
uint8_t meas_y_valid
Validity of measurement y (1 = meas_x contains valid data, 0 = data invalid or n/a)
uint8_t meas_z_valid
Validity of measurement z (1 = meas_x contains valid data, 0 = data invalid or n/a)
uint8_t meas_type
See FpbMeasurementsMeasType.
uint8_t meas_x_valid
Validity of measurement x (1 = meas_x contains valid data, 0 = data invalid or n/a)
uint32_t gps_tow
GPS time of week [ms] or monotonic time [-].
uint16_t gps_wno
GPS week number [-].
int32_t meas_z
Measurement z.
uint8_t reserved1[4]
Reserved for future use. Set to 0.
int32_t meas_x
Measurement x.
uint8_t meas_loc
See FpbMeasurementsMeasLoc.
FP_B-VERSION payload: head.
uint8_t reserved1[64]
Reserved for future use. Set to 0.
uint8_t hw_ver[32]
Hardware version (nul-terminated string)
uint8_t hw_name[32]
Hardware name string (nul-terminated string)
uint8_t reserved0[7]
Reserved for future use. Set to 0.
uint8_t hw_uid[32]
Hardware UID (nul-terminated string)
uint8_t sw_version[64]
Software version (nul-terminated string)
uint8_t version
Message version (= FP_B_VERSION_V1 for this version of the message)
Fixposition SDK: Common types.