Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 95 additions & 19 deletions c/include/libsbp/cpp/message_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -6621,6 +6621,43 @@ struct MessageTraits<sbp_msg_ssr_phase_biases_t> {
}
};

template <>
struct MessageTraits<sbp_msg_ssr_satellite_apc_dep_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrSatelliteApcDep;
static constexpr const char *name = "MSG_SSR_SATELLITE_APC_DEP";
static const sbp_msg_ssr_satellite_apc_dep_t &get(const sbp_msg_t &msg) {
return msg.ssr_satellite_apc_dep;
}
static sbp_msg_ssr_satellite_apc_dep_t &get(sbp_msg_t &msg) {
return msg.ssr_satellite_apc_dep;
}
static void to_sbp_msg(const sbp_msg_ssr_satellite_apc_dep_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->ssr_satellite_apc_dep = msg;
}
static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_satellite_apc_dep_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.ssr_satellite_apc_dep = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_ssr_satellite_apc_dep_t &msg,
sbp_write_fn_t write) {
return sbp_msg_ssr_satellite_apc_dep_send(state, sender_id, &msg, write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_ssr_satellite_apc_dep_t &msg) {
return sbp_msg_ssr_satellite_apc_dep_encode(buf, len, n_written, &msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_ssr_satellite_apc_dep_t *msg) {
return sbp_msg_ssr_satellite_apc_dep_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_ssr_satellite_apc_dep_t &msg) {
return sbp_msg_ssr_satellite_apc_dep_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_ssr_satellite_apc_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrSatelliteApc;
Expand Down Expand Up @@ -6770,39 +6807,78 @@ struct MessageTraits<sbp_msg_ssr_stec_correction_t> {
};

template <>
struct MessageTraits<sbp_msg_ssr_tile_definition_dep_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrTileDefinitionDep;
static constexpr const char *name = "MSG_SSR_TILE_DEFINITION_DEP";
static const sbp_msg_ssr_tile_definition_dep_t &get(const sbp_msg_t &msg) {
return msg.ssr_tile_definition_dep;
struct MessageTraits<sbp_msg_ssr_tile_definition_dep_a_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrTileDefinitionDepA;
static constexpr const char *name = "MSG_SSR_TILE_DEFINITION_DEP_A";
static const sbp_msg_ssr_tile_definition_dep_a_t &get(const sbp_msg_t &msg) {
return msg.ssr_tile_definition_dep_a;
}
static sbp_msg_ssr_tile_definition_dep_a_t &get(sbp_msg_t &msg) {
return msg.ssr_tile_definition_dep_a;
}
static void to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_a_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->ssr_tile_definition_dep_a = msg;
}
static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_a_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.ssr_tile_definition_dep_a = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_ssr_tile_definition_dep_a_t &msg,
sbp_write_fn_t write) {
return sbp_msg_ssr_tile_definition_dep_a_send(state, sender_id, &msg,
write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_ssr_tile_definition_dep_a_t &msg) {
return sbp_msg_ssr_tile_definition_dep_a_encode(buf, len, n_written, &msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_ssr_tile_definition_dep_a_t *msg) {
return sbp_msg_ssr_tile_definition_dep_a_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_ssr_tile_definition_dep_a_t &msg) {
return sbp_msg_ssr_tile_definition_dep_a_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_ssr_tile_definition_dep_b_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrTileDefinitionDepB;
static constexpr const char *name = "MSG_SSR_TILE_DEFINITION_DEP_B";
static const sbp_msg_ssr_tile_definition_dep_b_t &get(const sbp_msg_t &msg) {
return msg.ssr_tile_definition_dep_b;
}
static sbp_msg_ssr_tile_definition_dep_t &get(sbp_msg_t &msg) {
return msg.ssr_tile_definition_dep;
static sbp_msg_ssr_tile_definition_dep_b_t &get(sbp_msg_t &msg) {
return msg.ssr_tile_definition_dep_b;
}
static void to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_t &msg,
static void to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_b_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->ssr_tile_definition_dep = msg;
sbp_msg->ssr_tile_definition_dep_b = msg;
}
static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_t &msg) {
static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_b_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.ssr_tile_definition_dep = msg;
sbp_msg.ssr_tile_definition_dep_b = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_ssr_tile_definition_dep_t &msg,
const sbp_msg_ssr_tile_definition_dep_b_t &msg,
sbp_write_fn_t write) {
return sbp_msg_ssr_tile_definition_dep_send(state, sender_id, &msg, write);
return sbp_msg_ssr_tile_definition_dep_b_send(state, sender_id, &msg,
write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_ssr_tile_definition_dep_t &msg) {
return sbp_msg_ssr_tile_definition_dep_encode(buf, len, n_written, &msg);
const sbp_msg_ssr_tile_definition_dep_b_t &msg) {
return sbp_msg_ssr_tile_definition_dep_b_encode(buf, len, n_written, &msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_ssr_tile_definition_dep_t *msg) {
return sbp_msg_ssr_tile_definition_dep_decode(buf, len, n_read, msg);
sbp_msg_ssr_tile_definition_dep_b_t *msg) {
return sbp_msg_ssr_tile_definition_dep_b_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_ssr_tile_definition_dep_t &msg) {
return sbp_msg_ssr_tile_definition_dep_encoded_len(&msg);
static size_t encoded_len(const sbp_msg_ssr_tile_definition_dep_b_t &msg) {
return sbp_msg_ssr_tile_definition_dep_b_encoded_len(&msg);
}
};

Expand Down
18 changes: 15 additions & 3 deletions c/include/libsbp/legacy/cpp/message_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -1011,17 +1011,23 @@ struct MessageTraits<msg_ssr_grid_definition_dep_a_t> {


template<>
struct MessageTraits<msg_ssr_tile_definition_dep_t> {
struct MessageTraits<msg_ssr_tile_definition_dep_a_t> {
static constexpr u16 id = 1526;
};


template<>
struct MessageTraits<msg_ssr_tile_definition_t> {
struct MessageTraits<msg_ssr_tile_definition_dep_b_t> {
static constexpr u16 id = 1527;
};


template<>
struct MessageTraits<msg_ssr_tile_definition_t> {
static constexpr u16 id = 1528;
};


template<>
struct MessageTraits<msg_ssr_gridded_correction_dep_a_t> {
static constexpr u16 id = 1530;
Expand Down Expand Up @@ -1053,11 +1059,17 @@ struct MessageTraits<msg_ssr_gridded_correction_bounds_t> {


template<>
struct MessageTraits<msg_ssr_satellite_apc_t> {
struct MessageTraits<msg_ssr_satellite_apc_dep_t> {
static constexpr u16 id = 1540;
};


template<>
struct MessageTraits<msg_ssr_satellite_apc_t> {
static constexpr u16 id = 1541;
};


template<>
struct MessageTraits<msg_osr_t> {
static constexpr u16 id = 1600;
Expand Down
93 changes: 92 additions & 1 deletion c/include/libsbp/legacy/ssr.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ typedef struct SBP_ATTR_PACKED {
See GNSS-SSR-ArrayOfCorrectionPoints field
bitmaskOfGrids but note the definition of the
bits is inverted. */
} msg_ssr_tile_definition_dep_t;
} msg_ssr_tile_definition_dep_a_t;

/** Definition of a SSR atmospheric correction tile.

Expand Down Expand Up @@ -507,6 +507,84 @@ typedef struct SBP_ATTR_PACKED {
See GNSS-SSR-ArrayOfCorrectionPoints field
bitmaskOfGrids but note the definition of the
bits is inverted. */
} msg_ssr_tile_definition_dep_b_t;

/** Definition of a SSR atmospheric correction tile.

*
* Provides the correction point coordinates for the atmospheric correction
* values in the MSG_SSR_STEC_CORRECTION and MSG_SSR_GRIDDED_CORRECTION
* messages.
*
* Based on ETSI TS 137 355 V16.1.0 (LTE Positioning Protocol) information
* element GNSS-SSR-CorrectionPoints. SBP only supports gridded arrays of
* correction points, not lists of points.
*/

typedef struct SBP_ATTR_PACKED {
gps_time_sec_t time; /**< GNSS reference time of the
correction */
u8 update_interval; /**< Update interval between consecutive corrections.
Encoded following RTCM DF391 specification. */
u8 sol_id; /**< SSR Solution ID. Similar to RTCM DF415. */
u8 iod_atmo; /**< IOD of the SSR atmospheric correction. */
u16 tile_set_id; /**< Unique identifier of the tile set this tile
belongs to. */
u16 tile_id; /**< Unique identifier of this tile in the tile set.
See GNSS-SSR-ArrayOfCorrectionPoints field
correctionPointSetID. */
s16 corner_nw_lat; /**< North-West corner correction point latitude.

The relation between the latitude X in the
range [-90, 90] and the coded number N is: N =
floor((X / 90) * 2^14)

See GNSS-SSR-ArrayOfCorrectionPoints field
referencePointLatitude. [encoded degrees] */
s16 corner_nw_lon; /**< North-West corner correction point longitude.

The relation between the longitude X in the
range [-180, 180] and the coded number N is: N
= floor((X / 180) * 2^15)

See GNSS-SSR-ArrayOfCorrectionPoints field
referencePointLongitude. [encoded degrees] */
u16 spacing_lat; /**< Spacing of the correction points in the
latitude direction.

See GNSS-SSR-ArrayOfCorrectionPoints field
stepOfLatitude. [0.01 degrees] */
u16 spacing_lon; /**< Spacing of the correction points in the
longitude direction.

See GNSS-SSR-ArrayOfCorrectionPoints field
stepOfLongitude. [0.01 degrees] */
u16 rows; /**< Number of steps in the latitude direction.

See GNSS-SSR-ArrayOfCorrectionPoints field
numberOfStepsLatitude. */
u16 cols; /**< Number of steps in the longitude direction.

See GNSS-SSR-ArrayOfCorrectionPoints field
numberOfStepsLongitude. */
u64 bitmask; /**< Specifies the absence of correction data at the
correction points in the array (grid).

Only the first rows * cols bits are used, and
if a specific bit is enabled (set to 1), the
correction is not available. If there are more
than 64 correction points the remaining
corrections are always available.

The correction points are packed by rows,
starting with the northwest corner of the array
(top-left on a north oriented map), with each
row spanning west to east, ending with the
southeast corner of the array.

See GNSS-SSR-ArrayOfCorrectionPoints field
bitmaskOfGrids but note the definition of the
bits is inverted. */
} msg_ssr_tile_definition_t;

/** Antenna phase center correction
Expand All @@ -531,6 +609,19 @@ typedef struct SBP_ATTR_PACKED {

typedef struct SBP_ATTR_PACKED {
satellite_apc_t apc[0]; /**< Satellite antenna phase center corrections */
} msg_ssr_satellite_apc_dep_t;

typedef struct SBP_ATTR_PACKED {
gps_time_sec_t time; /**< GNSS reference time of the
correction */
u8 update_interval; /**< Update interval between consecutive corrections.
Encoded following RTCM DF391 specification. */
u8 sol_id; /**< SSR Solution ID. Similar to RTCM DF415. */
u8 iod_ssr; /**< IOD of the SSR correction. A change of Issue Of
Data SSR is used to indicate a change in the SSR
generating configuration */
satellite_apc_t apc[0]; /**< Satellite antenna phase center
corrections */
} msg_ssr_satellite_apc_t;

typedef struct SBP_ATTR_PACKED {
Expand Down
4 changes: 3 additions & 1 deletion c/include/libsbp/sbp_msg_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,13 @@ typedef enum {
SbpMsgSsrOrbitClockDepA = SBP_MSG_SSR_ORBIT_CLOCK_DEP_A,
SbpMsgSsrOrbitClock = SBP_MSG_SSR_ORBIT_CLOCK,
SbpMsgSsrPhaseBiases = SBP_MSG_SSR_PHASE_BIASES,
SbpMsgSsrSatelliteApcDep = SBP_MSG_SSR_SATELLITE_APC_DEP,
SbpMsgSsrSatelliteApc = SBP_MSG_SSR_SATELLITE_APC,
SbpMsgSsrStecCorrectionDepA = SBP_MSG_SSR_STEC_CORRECTION_DEP_A,
SbpMsgSsrStecCorrectionDep = SBP_MSG_SSR_STEC_CORRECTION_DEP,
SbpMsgSsrStecCorrection = SBP_MSG_SSR_STEC_CORRECTION,
SbpMsgSsrTileDefinitionDep = SBP_MSG_SSR_TILE_DEFINITION_DEP,
SbpMsgSsrTileDefinitionDepA = SBP_MSG_SSR_TILE_DEFINITION_DEP_A,
SbpMsgSsrTileDefinitionDepB = SBP_MSG_SSR_TILE_DEFINITION_DEP_B,
SbpMsgSsrTileDefinition = SBP_MSG_SSR_TILE_DEFINITION,
SbpMsgStartup = SBP_MSG_STARTUP,
SbpMsgStatusJournal = SBP_MSG_STATUS_JOURNAL,
Expand Down
47 changes: 39 additions & 8 deletions c/include/libsbp/ssr_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,26 @@
*/
#define SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_ENCODED_OVERHEAD 27u

#define SBP_MSG_SSR_TILE_DEFINITION_DEP 0x05F6
#define SBP_MSG_SSR_TILE_DEFINITION_DEP_A 0x05F6
/**
* Encoded length of sbp_msg_ssr_tile_definition_dep_t (V4 API) and
* msg_ssr_tile_definition_dep_t (legacy API)
* Encoded length of sbp_msg_ssr_tile_definition_dep_a_t (V4 API) and
* msg_ssr_tile_definition_dep_a_t (legacy API)
*/
#define SBP_MSG_SSR_TILE_DEFINITION_DEP_ENCODED_LEN 24u
#define SBP_MSG_SSR_TILE_DEFINITION_DEP_A_ENCODED_LEN 24u

#define SBP_MSG_SSR_TILE_DEFINITION 0x05F7
#define SBP_MSG_SSR_TILE_DEFINITION_DEP_B 0x05F7
/**
* Encoded length of sbp_msg_ssr_tile_definition_dep_b_t (V4 API) and
* msg_ssr_tile_definition_dep_b_t (legacy API)
*/
#define SBP_MSG_SSR_TILE_DEFINITION_DEP_B_ENCODED_LEN 25u

#define SBP_MSG_SSR_TILE_DEFINITION 0x05F8
/**
* Encoded length of sbp_msg_ssr_tile_definition_t (V4 API) and
* msg_ssr_tile_definition_t (legacy API)
*/
#define SBP_MSG_SSR_TILE_DEFINITION_ENCODED_LEN 25u
#define SBP_MSG_SSR_TILE_DEFINITION_ENCODED_LEN 33u

#define SBP_SATELLITEAPC_SATELLITE_TYPE_MASK (0x1fu)
#define SBP_SATELLITEAPC_SATELLITE_TYPE_SHIFT (0u)
Expand Down Expand Up @@ -307,7 +314,31 @@
*/
#define SBP_SATELLITE_APC_ENCODED_LEN 32u

#define SBP_MSG_SSR_SATELLITE_APC 0x0604
#define SBP_MSG_SSR_SATELLITE_APC_DEP 0x0604
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_satellite_apc_dep_t::apc (V4 API) or
* msg_ssr_satellite_apc_dep_t::apc (legacy API) before the maximum SBP message
* size is exceeded
*/
#define SBP_MSG_SSR_SATELLITE_APC_DEP_APC_MAX 7u

/**
* Encoded length of sbp_msg_ssr_satellite_apc_dep_t (V4 API) and
* msg_ssr_satellite_apc_dep_t (legacy API)
*
* This type is not fixed size and an instance of this message may be longer
* than the value indicated by this symbol. Users of the V4 API should call
* #sbp_msg_ssr_satellite_apc_dep_encoded_len to determine the actual size of an
* instance of this message. Users of the legacy API are required to track the
* encoded message length when interacting with the legacy type.
*
* See the documentation for libsbp for more details regarding the message
* structure and its variable length component(s)
*/
#define SBP_MSG_SSR_SATELLITE_APC_DEP_ENCODED_OVERHEAD 0u

#define SBP_MSG_SSR_SATELLITE_APC 0x0605
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_satellite_apc_t::apc (V4 API) or msg_ssr_satellite_apc_t::apc
Expand All @@ -328,7 +359,7 @@
* See the documentation for libsbp for more details regarding the message
* structure and its variable length component(s)
*/
#define SBP_MSG_SSR_SATELLITE_APC_ENCODED_OVERHEAD 0u
#define SBP_MSG_SSR_SATELLITE_APC_ENCODED_OVERHEAD 9u

#define SBP_MSG_SSR_ORBIT_CLOCK_DEP_A 0x05DC
/**
Expand Down
Loading