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
75 changes: 36 additions & 39 deletions c/include/libsbp/integrity_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,35 @@
#ifndef LIBSBP_INTEGRITY_MACROS_H
#define LIBSBP_INTEGRITY_MACROS_H

/**
* Encoded length of sbp_integrity_ssr_header_t (V4 API) and
* integrity_ssr_header_t (legacy API)
*/
#define SBP_INTEGRITY_SSR_HEADER_ENCODED_LEN 14u

#define SBP_MSG_SSR_FLAG_HIGH_LEVEL 0x0BB9
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_flag_high_level_t::stub (V4 API) or
* msg_ssr_flag_high_level_t::stub (legacy API) before the maximum SBP message
* size is exceeded
* sbp_msg_ssr_flag_high_level_t::reserved (V4 API) or
* msg_ssr_flag_high_level_t::reserved (legacy API) before the maximum SBP
* message size is exceeded
*/
#define SBP_MSG_SSR_FLAG_HIGH_LEVEL_STUB_MAX 255u
#define SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX 6u

/**
* Encoded length of sbp_msg_ssr_flag_high_level_t (V4 API) and
* msg_ssr_flag_high_level_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_flag_high_level_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_FLAG_HIGH_LEVEL_ENCODED_OVERHEAD 0u
#define SBP_MSG_SSR_FLAG_HIGH_LEVEL_ENCODED_LEN 31u

#define SBP_MSG_SSR_FLAG_SATELLITES 0x0BBD
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_flag_satellites_t::stub (V4 API) or
* msg_ssr_flag_satellites_t::stub (legacy API) before the maximum SBP message
* size is exceeded
* sbp_msg_ssr_flag_satellites_t::faulty_sats (V4 API) or
* msg_ssr_flag_satellites_t::faulty_sats (legacy API) before the maximum SBP
* message size is exceeded
*/
#define SBP_MSG_SSR_FLAG_SATELLITES_STUB_MAX 255u
#define SBP_MSG_SSR_FLAG_SATELLITES_FAULTY_SATS_MAX 243u

/**
* Encoded length of sbp_msg_ssr_flag_satellites_t (V4 API) and
Expand All @@ -64,16 +61,16 @@
* See the documentation for libsbp for more details regarding the message
* structure and its variable length component(s)
*/
#define SBP_MSG_SSR_FLAG_SATELLITES_ENCODED_OVERHEAD 0u
#define SBP_MSG_SSR_FLAG_SATELLITES_ENCODED_OVERHEAD 12u

#define SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS 0x0BC3
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_flag_tropo_grid_points_t::stub (V4 API) or
* msg_ssr_flag_tropo_grid_points_t::stub (legacy API) before the maximum SBP
* message size is exceeded
* sbp_msg_ssr_flag_tropo_grid_points_t::faulty_points (V4 API) or
* msg_ssr_flag_tropo_grid_points_t::faulty_points (legacy API) before the
* maximum SBP message size is exceeded
*/
#define SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS_STUB_MAX 255u
#define SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS_FAULTY_POINTS_MAX 120u

/**
* Encoded length of sbp_msg_ssr_flag_tropo_grid_points_t (V4 API) and
Expand All @@ -88,16 +85,16 @@
* See the documentation for libsbp for more details regarding the message
* structure and its variable length component(s)
*/
#define SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS_ENCODED_OVERHEAD 0u
#define SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS_ENCODED_OVERHEAD 15u

#define SBP_MSG_SSR_FLAG_IONO_GRID_POINTS 0x0BC7
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_flag_iono_grid_points_t::stub (V4 API) or
* msg_ssr_flag_iono_grid_points_t::stub (legacy API) before the maximum SBP
* message size is exceeded
* sbp_msg_ssr_flag_iono_grid_points_t::faulty_points (V4 API) or
* msg_ssr_flag_iono_grid_points_t::faulty_points (legacy API) before the
* maximum SBP message size is exceeded
*/
#define SBP_MSG_SSR_FLAG_IONO_GRID_POINTS_STUB_MAX 255u
#define SBP_MSG_SSR_FLAG_IONO_GRID_POINTS_FAULTY_POINTS_MAX 120u

/**
* Encoded length of sbp_msg_ssr_flag_iono_grid_points_t (V4 API) and
Expand All @@ -112,16 +109,16 @@
* See the documentation for libsbp for more details regarding the message
* structure and its variable length component(s)
*/
#define SBP_MSG_SSR_FLAG_IONO_GRID_POINTS_ENCODED_OVERHEAD 0u
#define SBP_MSG_SSR_FLAG_IONO_GRID_POINTS_ENCODED_OVERHEAD 15u

#define SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS 0x0BCD
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_flag_iono_tile_sat_los_t::stub (V4 API) or
* msg_ssr_flag_iono_tile_sat_los_t::stub (legacy API) before the maximum SBP
* message size is exceeded
* sbp_msg_ssr_flag_iono_tile_sat_los_t::faulty_los (V4 API) or
* msg_ssr_flag_iono_tile_sat_los_t::faulty_los (legacy API) before the maximum
* SBP message size is exceeded
*/
#define SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_STUB_MAX 255u
#define SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_FAULTY_LOS_MAX 120u

/**
* Encoded length of sbp_msg_ssr_flag_iono_tile_sat_los_t (V4 API) and
Expand All @@ -136,16 +133,16 @@
* See the documentation for libsbp for more details regarding the message
* structure and its variable length component(s)
*/
#define SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_ENCODED_OVERHEAD 0u
#define SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_ENCODED_OVERHEAD 15u

#define SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS 0x0BD1
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_flag_iono_grid_point_sat_los_t::stub (V4 API) or
* msg_ssr_flag_iono_grid_point_sat_los_t::stub (legacy API) before the maximum
* SBP message size is exceeded
* sbp_msg_ssr_flag_iono_grid_point_sat_los_t::faulty_los (V4 API) or
* msg_ssr_flag_iono_grid_point_sat_los_t::faulty_los (legacy API) before the
* maximum SBP message size is exceeded
*/
#define SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_STUB_MAX 255u
#define SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_FAULTY_LOS_MAX 119u

/**
* Encoded length of sbp_msg_ssr_flag_iono_grid_point_sat_los_t (V4 API) and
Expand All @@ -160,6 +157,6 @@
* See the documentation for libsbp for more details regarding the message
* structure and its variable length component(s)
*/
#define SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_ENCODED_OVERHEAD 0u
#define SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_ENCODED_OVERHEAD 17u

#endif /* LIBSBP_INTEGRITY_MACROS_H */
62 changes: 56 additions & 6 deletions c/include/libsbp/legacy/integrity.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,77 @@
SBP_PACK_START

typedef struct SBP_ATTR_PACKED {
u8 stub[0];
gps_time_sec_t obs_time; /**< GNSS reference time of the observation
used to generate the flag. */
u8 num_msgs; /**< Number of messages in the dataset */
u8 seq_num; /**< Position of this message in the dataset */
u8 ssr_sol_id; /**< SSR Solution ID. */
u16 tile_set_id; /**< Unique identifier of the set this tile belongs to. */
u16 tile_id; /**< Unique identifier of this tile in the tile set. */
u8 chain_id; /**< Chain and type of flag. */
} integrity_ssr_header_t;

typedef struct SBP_ATTR_PACKED {
gps_time_sec_t obs_time; /**< GNSS reference time of
the observation used to
generate the flag. */
gps_time_sec_t corr_time; /**< GNSS reference time of
the correction
associated to the flag. */
u8 ssr_sol_id; /**< SSR Solution ID. */
u16 tile_set_id; /**< Unique identifier of the set this
tile belongs to. */
u16 tile_id; /**< Unique identifier of this tile in
the tile set. */
u8 chain_id; /**< Chain and type of flag. */
u8 use_gps_sat; /**< Use GPS satellites. */
u8 use_gal_sat; /**< Use GAL satellites. */
u8 use_bds_sat; /**< Use BDS satellites. */
u8 reserved[6]; /**< Reserved */
u8 use_tropo_grid_points; /**< Use tropo grid points. */
u8 use_iono_grid_points; /**< Use iono grid points. */
u8 use_iono_tile_sat_los; /**< Use iono tile satellite LoS. */
u8 use_iono_grid_point_sat_los; /**< Use iono grid point satellite LoS. */
} msg_ssr_flag_high_level_t;

typedef struct SBP_ATTR_PACKED {
u8 stub[0];
gps_time_sec_t obs_time; /**< GNSS reference time of the observation
used to generate the flag. */
u8 num_msgs; /**< Number of messages in the dataset */
u8 seq_num; /**< Position of this message in the dataset */
u8 ssr_sol_id; /**< SSR Solution ID. */
u8 chain_id; /**< Chain and type of flag. */
u8 const_id; /**< Constellation ID. */
u8 n_faulty_sats; /**< Number of faulty satellites. */
u8 faulty_sats[0]; /**< List of faulty satellites. */
} msg_ssr_flag_satellites_t;

typedef struct SBP_ATTR_PACKED {
u8 stub[0];
integrity_ssr_header_t header; /**< Header of an integrity
message. */
u8 n_faulty_points; /**< Number of faulty grid points. */
u16 faulty_points[0]; /**< List of faulty grid points. */
} msg_ssr_flag_tropo_grid_points_t;

typedef struct SBP_ATTR_PACKED {
u8 stub[0];
integrity_ssr_header_t header; /**< Header of an integrity
message. */
u8 n_faulty_points; /**< Number of faulty grid points. */
u16 faulty_points[0]; /**< List of faulty grid points. */
} msg_ssr_flag_iono_grid_points_t;

typedef struct SBP_ATTR_PACKED {
u8 stub[0];
integrity_ssr_header_t header; /**< Header of an integrity message. */
u8 n_faulty_los; /**< Number of faulty LOS. */
sv_id_t faulty_los[0]; /**< List of faulty LOS */
} msg_ssr_flag_iono_tile_sat_los_t;

typedef struct SBP_ATTR_PACKED {
u8 stub[0];
integrity_ssr_header_t header; /**< Header of an integrity
message. */
u16 grid_point_id; /**< Index of the grid point. */
u8 n_faulty_los; /**< Number of faulty LOS. */
sv_id_t faulty_los[0]; /**< List of faulty LOS */
} msg_ssr_flag_iono_grid_point_sat_los_t;

/** \} */
Expand Down
45 changes: 43 additions & 2 deletions c/include/libsbp/legacy/navigation.h
Original file line number Diff line number Diff line change
Expand Up @@ -927,11 +927,52 @@ typedef struct SBP_ATTR_PACKED {
*/

typedef struct SBP_ATTR_PACKED {
u8 stub[0];
s16 bias_coeff; /**< Reserved. Bias coefficient of GPS time scale
with respect to UTC drift model. [2^-35 s] */
s16 drift_coeff; /**< Reserved. Drift coefficient of GPS time scale
with respect to UTC drift model. [2^-51 s/s] */
s8 drift_rate_coeff; /**< Reserved. Drift rate correction coefficient of
GPS time scale with respect to UTC drift model.
[2^-68 s/s^2] */
s8 count_before; /**< Leap second count before insertion. [s] */
u16 tow_s; /**< Reserved. Drift model reference week second. [s] */
u16 wn; /**< Reserved. Drift model reference week number. [weeks] */
u16 ref_wn; /**< Leap second reference week number. [weeks] */
u8 ref_dn; /**< Leap second reference day number. [days] */
s8 count_after; /**< Leap second count after insertion. [s] */
} msg_utc_leap_second_t;

typedef struct SBP_ATTR_PACKED {
u8 stub[0];
u8 ssr_iod; /**< SSR IOD parameter. */
char sn[32]; /**< Name of source coordinate-system using the EPSG
identification code. */
char tn[32]; /**< Name of target coordinate-system using the EPSG
identification code. */
u8 sin; /**< System Identification Number. */
u16 utn; /**< Utilized Transformation Message. */
u16 re_t0; /**< Reference Epoch t0 for transformation parameter
set given as Modified Julian Day (MDJ) Number
minus 44244 days. [1 day] */
s32 delta_X0; /**< Translation in X for Reference Epoch t0. [0.001 m] */
s32 delta_Y0; /**< Translation in Y for Reference Epoch t0. [0.001 m] */
s32 delta_Z0; /**< Translation in Z for Reference Epoch t0. [0.001 m] */
s32 theta_01; /**< Rotation around the X-axis for Reference Epoch t0. [0.00002
"] */
s32 theta_02; /**< Rotation around the Y-axis for Reference Epoch t0. [0.00002
"] */
s32 theta_03; /**< Rotation around the Z-axis for Reference Epoch t0. [0.00002
"] */
s32 scale; /**< Scale correction for Reference Epoch t0. [0.00001 ppm] */
s32 dot_delta_X0; /**< Rate of change of translation in X. [0.00002 m/yr] */
s32 dot_delta_Y0; /**< Rate of change of translation in Y. [0.00002 m/yr] */
s32 dot_delta_Z0; /**< Rate of change of translation in Z. [0.00002 m/yr] */
s32 dot_theta_01; /**< Rate of change of rotation around the X-axis.
[0.0000004 "/yr] */
s32 dot_theta_02; /**< Rate of change of rotation around the Y-axis.
[0.0000004 "/yr] */
s32 dot_theta_03; /**< Rate of change of rotation around the Z-axis.
[0.0000004 "/yr] */
s16 dot_scale; /**< Rate of change of scale correction. [0.0000002 ppm/yr] */
} msg_reference_frame_param_t;

/** \} */
Expand Down
Loading