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
40 changes: 40 additions & 0 deletions c/include/libsbp/cpp/message_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -5581,6 +5581,46 @@ struct MessageTraits<sbp_msg_ssr_code_biases_t> {
}
};

template <>
struct MessageTraits<sbp_msg_ssr_code_phase_biases_bounds_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrCodePhaseBiasesBounds;
static const sbp_msg_ssr_code_phase_biases_bounds_t &get(
const sbp_msg_t &msg) {
return msg.ssr_code_phase_biases_bounds;
}
static sbp_msg_ssr_code_phase_biases_bounds_t &get(sbp_msg_t &msg) {
return msg.ssr_code_phase_biases_bounds;
}
static void to_sbp_msg(const sbp_msg_ssr_code_phase_biases_bounds_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->ssr_code_phase_biases_bounds = msg;
}
static sbp_msg_t to_sbp_msg(
const sbp_msg_ssr_code_phase_biases_bounds_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.ssr_code_phase_biases_bounds = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_ssr_code_phase_biases_bounds_t &msg,
sbp_write_fn_t write) {
return sbp_msg_ssr_code_phase_biases_bounds_send(state, sender_id, &msg,
write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_ssr_code_phase_biases_bounds_t &msg) {
return sbp_msg_ssr_code_phase_biases_bounds_encode(buf, len, n_written,
&msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_ssr_code_phase_biases_bounds_t *msg) {
return sbp_msg_ssr_code_phase_biases_bounds_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_ssr_code_phase_biases_bounds_t &msg) {
return sbp_msg_ssr_code_phase_biases_bounds_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_ssr_grid_definition_dep_a_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrGridDefinitionDepA;
Expand Down
6 changes: 6 additions & 0 deletions c/include/libsbp/legacy/cpp/message_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,12 @@ struct MessageTraits<msg_ssr_stec_correction_dep_a_t> {
};


template<>
struct MessageTraits<msg_ssr_code_phase_biases_bounds_t> {
static constexpr u16 id = 1516;
};


template<>
struct MessageTraits<msg_ssr_gridded_correction_no_std_dep_a_t> {
static constexpr u16 id = 1520;
Expand Down
27 changes: 27 additions & 0 deletions c/include/libsbp/legacy/ssr.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,33 @@ typedef struct SBP_ATTR_PACKED {
Satellite */
} msg_ssr_orbit_clock_bounds_t;

typedef struct SBP_ATTR_PACKED {
u8 sat_id; /**< Satellite ID. Similar to either RTCM DF068
(GPS), DF252 (Galileo), or DF488 (BDS)
depending on the constellation. */
u8 signal_id; /**< Signal and Tracking Mode Identifier.
Similar to either RTCM DF380 (GPS), DF382
(Galileo) or DF467 (BDS) depending on the
constellation. */
u8 code_bias_bound_mu; /**< Code Bias Mean (range 0-1.275) [0.005 m] */
u8 code_bias_bound_sig; /**< Code Bias Standard Deviation (range
0-1.275) [0.005 m] */
u8 phase_bias_bound_mu; /**< Phase Bias Mean (range 0-1.275) [0.005 m] */
u8 phase_bias_bound_sig; /**< Phase Bias Standard Deviation (range
0-1.275) [0.005 m] */
} code_phase_biases_sat_sig_t;

typedef struct SBP_ATTR_PACKED {
bounds_header_t header; /**< Header of a bounds message. */
u8 ssr_iod; /**< IOD of the SSR bound. */
u8 const_id; /**< Constellation ID to which the SVs belong. */
u8 n_sats_signals; /**< Number of satellite-signal couples. */
code_phase_biases_sat_sig_t satellites_signals[0]; /**< Code and Phase
Biases Bounds per
Satellite-Signal
couple. */
} msg_ssr_code_phase_biases_bounds_t;

/** \} */

SBP_PACK_END
Expand Down
1 change: 1 addition & 0 deletions c/include/libsbp/sbp_msg_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ typedef enum {
SbpMsgSpecanDep = SBP_MSG_SPECAN_DEP,
SbpMsgSpecan = SBP_MSG_SPECAN,
SbpMsgSsrCodeBiases = SBP_MSG_SSR_CODE_BIASES,
SbpMsgSsrCodePhaseBiasesBounds = SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS,
SbpMsgSsrGridDefinitionDepA = SBP_MSG_SSR_GRID_DEFINITION_DEP_A,
SbpMsgSsrGriddedCorrectionDepA = SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A,
SbpMsgSsrGriddedCorrectionNoStdDepA =
Expand Down
30 changes: 30 additions & 0 deletions c/include/libsbp/ssr_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,34 @@
*/
#define SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_ENCODED_OVERHEAD 13u

/**
* Encoded length of sbp_code_phase_biases_sat_sig_t (V4 API) and
* code_phase_biases_sat_sig_t (legacy API)
*/
#define SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN 6u

#define SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS 0x05EC
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_code_phase_biases_bounds_t::satellites_signals (V4 API) or
* msg_ssr_code_phase_biases_bounds_t::satellites_signals (legacy API) before
* the maximum SBP message size is exceeded
*/
#define SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_SATELLITES_SIGNALS_MAX 40u

/**
* Encoded length of sbp_msg_ssr_code_phase_biases_bounds_t (V4 API) and
* msg_ssr_code_phase_biases_bounds_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_code_phase_biases_bounds_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_CODE_PHASE_BIASES_BOUNDS_ENCODED_OVERHEAD 13u

#endif /* LIBSBP_SSR_MACROS_H */
13 changes: 13 additions & 0 deletions c/include/libsbp/v4/sbp_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ typedef union {
sbp_msg_specan_dep_t specan_dep;
sbp_msg_specan_t specan;
sbp_msg_ssr_code_biases_t ssr_code_biases;
sbp_msg_ssr_code_phase_biases_bounds_t ssr_code_phase_biases_bounds;
sbp_msg_ssr_grid_definition_dep_a_t ssr_grid_definition_dep_a;
sbp_msg_ssr_gridded_correction_dep_a_t ssr_gridded_correction_dep_a;
sbp_msg_ssr_gridded_correction_no_std_dep_a_t
Expand Down Expand Up @@ -707,6 +708,9 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len,
case SbpMsgSsrCodeBiases:
return sbp_msg_ssr_code_biases_encode(buf, len, n_written,
&msg->ssr_code_biases);
case SbpMsgSsrCodePhaseBiasesBounds:
return sbp_msg_ssr_code_phase_biases_bounds_encode(
buf, len, n_written, &msg->ssr_code_phase_biases_bounds);
case SbpMsgSsrGridDefinitionDepA:
return sbp_msg_ssr_grid_definition_dep_a_encode(
buf, len, n_written, &msg->ssr_grid_definition_dep_a);
Expand Down Expand Up @@ -1280,6 +1284,9 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len,
case SbpMsgSsrCodeBiases:
return sbp_msg_ssr_code_biases_decode(buf, len, n_read,
&msg->ssr_code_biases);
case SbpMsgSsrCodePhaseBiasesBounds:
return sbp_msg_ssr_code_phase_biases_bounds_decode(
buf, len, n_read, &msg->ssr_code_phase_biases_bounds);
case SbpMsgSsrGridDefinitionDepA:
return sbp_msg_ssr_grid_definition_dep_a_decode(
buf, len, n_read, &msg->ssr_grid_definition_dep_a);
Expand Down Expand Up @@ -1766,6 +1773,9 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type,
return sbp_msg_specan_encoded_len(&msg->specan);
case SbpMsgSsrCodeBiases:
return sbp_msg_ssr_code_biases_encoded_len(&msg->ssr_code_biases);
case SbpMsgSsrCodePhaseBiasesBounds:
return sbp_msg_ssr_code_phase_biases_bounds_encoded_len(
&msg->ssr_code_phase_biases_bounds);
case SbpMsgSsrGridDefinitionDepA:
return sbp_msg_ssr_grid_definition_dep_a_encoded_len(
&msg->ssr_grid_definition_dep_a);
Expand Down Expand Up @@ -2288,6 +2298,9 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a,
case SbpMsgSsrCodeBiases:
return sbp_msg_ssr_code_biases_cmp(&a->ssr_code_biases,
&b->ssr_code_biases);
case SbpMsgSsrCodePhaseBiasesBounds:
return sbp_msg_ssr_code_phase_biases_bounds_cmp(
&a->ssr_code_phase_biases_bounds, &b->ssr_code_phase_biases_bounds);
case SbpMsgSsrGridDefinitionDepA:
return sbp_msg_ssr_grid_definition_dep_a_cmp(
&a->ssr_grid_definition_dep_a, &b->ssr_grid_definition_dep_a);
Expand Down
2 changes: 2 additions & 0 deletions c/include/libsbp/v4/ssr.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
#define LIBSBP_V4_SSR_MESSAGES_H
#include <libsbp/v4/ssr/BoundsHeader.h>
#include <libsbp/v4/ssr/CodeBiasesContent.h>
#include <libsbp/v4/ssr/CodePhaseBiasesSatSig.h>
#include <libsbp/v4/ssr/GridDefinitionHeaderDepA.h>
#include <libsbp/v4/ssr/GriddedCorrectionHeader.h>
#include <libsbp/v4/ssr/GriddedCorrectionHeaderDepA.h>
#include <libsbp/v4/ssr/MSG_SSR_CODE_BIASES.h>
#include <libsbp/v4/ssr/MSG_SSR_CODE_PHASE_BIASES_BOUNDS.h>
#include <libsbp/v4/ssr/MSG_SSR_GRIDDED_CORRECTION.h>
#include <libsbp/v4/ssr/MSG_SSR_GRIDDED_CORRECTION_DEP_A.h>
#include <libsbp/v4/ssr/MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A.h>
Expand Down
185 changes: 185 additions & 0 deletions c/include/libsbp/v4/ssr/CodePhaseBiasesSatSig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
/*
* Copyright (C) 2015-2021 Swift Navigation Inc.
* Contact: https://support.swiftnav.com
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/

/*****************************************************************************
* Automatically generated from yaml/swiftnav/sbp/ssr.yaml
* with generate.py. Please do not hand edit!
*****************************************************************************/

#ifndef LIBSBP_V4_SSR_CODEPHASEBIASESSATSIG_H
#define LIBSBP_V4_SSR_CODEPHASEBIASESSATSIG_H

#include <math.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>

#include <libsbp/common.h>
#include <libsbp/ssr_macros.h>
#include <libsbp/v4/string/sbp_string.h>

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* SBP_CODEPHASEBIASESSATSIG
*
*****************************************************************************/
typedef struct {
/**
* Satellite ID. Similar to either RTCM DF068 (GPS), DF252 (Galileo), or DF488
* (BDS) depending on the constellation.
*/
u8 sat_id;

/**
* Signal and Tracking Mode Identifier. Similar to either RTCM DF380 (GPS),
* DF382 (Galileo) or DF467 (BDS) depending on the constellation.
*/
u8 signal_id;

/**
* Code Bias Mean (range 0-1.275) [0.005 m]
*/
u8 code_bias_bound_mu;

/**
* Code Bias Standard Deviation (range 0-1.275) [0.005 m]
*/
u8 code_bias_bound_sig;

/**
* Phase Bias Mean (range 0-1.275) [0.005 m]
*/
u8 phase_bias_bound_mu;

/**
* Phase Bias Standard Deviation (range 0-1.275) [0.005 m]
*/
u8 phase_bias_bound_sig;
} sbp_code_phase_biases_sat_sig_t;

/**
* Get encoded size of an instance of sbp_code_phase_biases_sat_sig_t
*
* @param msg sbp_code_phase_biases_sat_sig_t instance
* @return Length of on-wire representation
*/
static inline size_t sbp_code_phase_biases_sat_sig_encoded_len(
const sbp_code_phase_biases_sat_sig_t *msg) {
(void)msg;
return SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN;
}

/**
* Encode an instance of sbp_code_phase_biases_sat_sig_t to wire representation
*
* This function encodes the given instance in to the user provided buffer. The
* buffer provided to this function must be large enough to store the encoded
* message otherwise it will return SBP_ENCODE_ERROR without writing anything to
* the buffer.
*
* Specify the length of the destination buffer in the \p len parameter. If
* non-null the number of bytes written to the buffer will be returned in \p
* n_written.
*
* @param buf Destination buffer
* @param len Length of \p buf
* @param n_written If not null, on success will be set to the number of bytes
* written to \p buf
* @param msg Instance of sbp_code_phase_biases_sat_sig_t to encode
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_code_phase_biases_sat_sig_encode(
uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_code_phase_biases_sat_sig_t *msg);

/**
* Decode an instance of sbp_code_phase_biases_sat_sig_t from wire
* representation
*
* This function decodes the wire representation of a
* sbp_code_phase_biases_sat_sig_t message to the given instance. The caller
* must specify the length of the buffer in the \p len parameter. If non-null
* the number of bytes read from the buffer will be returned in \p n_read.
*
* @param buf Wire representation of the sbp_code_phase_biases_sat_sig_t
* instance
* @param len Length of \p buf
* @param n_read If not null, on success will be set to the number of bytes read
* from \p buf
* @param msg Destination
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_code_phase_biases_sat_sig_decode(
const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_code_phase_biases_sat_sig_t *msg);

/**
* Compare two instances of sbp_code_phase_biases_sat_sig_t
*
* The two instances will be compared and a value returned consistent with the
* return codes of comparison functions from the C standard library
*
* 0 will be returned if \p a and \p b are considered equal
* A value less than 0 will be returned if \p a is considered to be less than \p
* b A value greater than 0 will be returned if \p b is considered to be greater
* than \p b
*
* @param a sbp_code_phase_biases_sat_sig_t instance
* @param b sbp_code_phase_biases_sat_sig_t instance
* @return 0, <0, >0
*/
SBP_EXPORT int sbp_code_phase_biases_sat_sig_cmp(
const sbp_code_phase_biases_sat_sig_t *a,
const sbp_code_phase_biases_sat_sig_t *b);

#ifdef __cplusplus
}

static inline bool operator==(const sbp_code_phase_biases_sat_sig_t &lhs,
const sbp_code_phase_biases_sat_sig_t &rhs) {
return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) == 0;
}

static inline bool operator!=(const sbp_code_phase_biases_sat_sig_t &lhs,
const sbp_code_phase_biases_sat_sig_t &rhs) {
return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) != 0;
}

static inline bool operator<(const sbp_code_phase_biases_sat_sig_t &lhs,
const sbp_code_phase_biases_sat_sig_t &rhs) {
return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) < 0;
}

static inline bool operator<=(const sbp_code_phase_biases_sat_sig_t &lhs,
const sbp_code_phase_biases_sat_sig_t &rhs) {
return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) <= 0;
}

static inline bool operator>(const sbp_code_phase_biases_sat_sig_t &lhs,
const sbp_code_phase_biases_sat_sig_t &rhs) {
return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) > 0;
}

static inline bool operator>=(const sbp_code_phase_biases_sat_sig_t &lhs,
const sbp_code_phase_biases_sat_sig_t &rhs) {
return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) >= 0;
}

#endif // ifdef __cplusplus

#endif /* LIBSBP_V4_SSR_CODEPHASEBIASESSATSIG_H */
Loading