Skip to content

Commit

Permalink
Run make commands
Browse files Browse the repository at this point in the history
  • Loading branch information
cstolowicz committed Jul 9, 2024
1 parent 8441769 commit 718fb5a
Show file tree
Hide file tree
Showing 28 changed files with 264 additions and 86 deletions.
4 changes: 4 additions & 0 deletions c/include/libsbp/gnss_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#define SBP_GNSSSIGNAL_BDS2_B2 (13)
#define SBP_GNSSSIGNAL_GAL_E1B (14)
#define SBP_GNSSSIGNAL_GAL_E7I (20)
#define SBP_GNSSSIGNAL_QZS_L1CA (31)
#define SBP_GNSSSIGNAL_QZS_L2CL (36)
#define SBP_GNSSSIGNAL_QZS_L5Q (39)
#define SBP_GNSSSIGNAL_BDS3_B2A (47)
/**
* Encoded length of sbp_gnss_signal_t
Expand All @@ -58,6 +61,7 @@

#define SBP_SVID_GPS (0)
#define SBP_SVID_BDS (3)
#define SBP_SVID_QZS (4)
#define SBP_SVID_GAL (5)
/**
* Encoded length of sbp_sv_id_t
Expand Down
7 changes: 6 additions & 1 deletion c/include/libsbp/integrity/MSG_SSR_FLAG_HIGH_LEVEL.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C" {
* be a satellite, SSR grid point, or SSR tile. A group of aggregated elements
* being monitored for integrity could refer to:
*
* - Satellites in a particular {GPS, GAL, BDS} constellation.
* - Satellites in a particular {GPS, GAL, BDS, QZSS} constellation.
*
* - Satellites in the line-of-sight of a particular SSR tile.
*
Expand Down Expand Up @@ -111,6 +111,11 @@ typedef struct {
*/
u8 use_bds_sat;

/**
* Use QZSS satellites.
*/
u8 use_qzss_sat;

/**
* Reserved
*/
Expand Down
20 changes: 19 additions & 1 deletion c/include/libsbp/integrity_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,30 @@
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_WARNING (1)
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_ALERT (2)
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_NOT_MONITORED (3)
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_MASK (0x7u)
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_SHIFT (0u)
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_GET(flags) \
((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_SHIFT) & \
SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_MASK))
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_SET(flags, val) \
do { \
(flags) = (u8)( \
(flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_MASK \
<< SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_SHIFT))) | \
(((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_MASK)) \
<< (SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_SHIFT))); \
} while (0)

#define SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_NOMINAL (0)
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_WARNING (1)
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_ALERT (2)
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_QZSS_SATELLITES_NOT_MONITORED (3)
/**
* The maximum number of items that can be stored in
* sbp_msg_ssr_flag_high_level_t::reserved before the maximum SBP message size
* is exceeded
*/
#define SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX 6u
#define SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX 5u

#define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_MASK (0x7u)
#define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SHIFT (0u)
Expand Down
3 changes: 3 additions & 0 deletions c/include/libsbp/ssr_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@

#define SBP_SSR_ORBIT_CLOCK_BOUNDS_GPS (0)
#define SBP_SSR_ORBIT_CLOCK_BOUNDS_BDS (3)
#define SBP_SSR_ORBIT_CLOCK_BOUNDS_QZS (4)
#define SBP_SSR_ORBIT_CLOCK_BOUNDS_GAL (5)
/**
* The maximum number of items that can be stored in
Expand Down Expand Up @@ -476,6 +477,7 @@

#define SBP_SSR_CODE_PHASE_BIASES_BOUNDS_GPS (0)
#define SBP_SSR_CODE_PHASE_BIASES_BOUNDS_BDS (3)
#define SBP_SSR_CODE_PHASE_BIASES_BOUNDS_QZS (4)
#define SBP_SSR_CODE_PHASE_BIASES_BOUNDS_GAL (5)
/**
* The maximum number of items that can be stored in
Expand Down Expand Up @@ -518,6 +520,7 @@

#define SBP_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION_GPS (0)
#define SBP_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION_BDS (3)
#define SBP_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION_QZS (4)
#define SBP_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION_GAL (5)
/**
* Encoded length of sbp_msg_ssr_orbit_clock_bounds_degradation_t
Expand Down
11 changes: 11 additions & 0 deletions c/src/integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ bool sbp_msg_ssr_flag_high_level_encode_internal(
if (!sbp_u8_encode(ctx, &msg->use_bds_sat)) {
return false;
}
if (!sbp_u8_encode(ctx, &msg->use_qzss_sat)) {
return false;
}
for (size_t i = 0; i < SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX; i++) {
if (!sbp_u8_encode(ctx, &msg->reserved[i])) {
return false;
Expand Down Expand Up @@ -233,6 +236,9 @@ bool sbp_msg_ssr_flag_high_level_decode_internal(
if (!sbp_u8_decode(ctx, &msg->use_bds_sat)) {
return false;
}
if (!sbp_u8_decode(ctx, &msg->use_qzss_sat)) {
return false;
}
for (uint8_t i = 0; i < SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX; i++) {
if (!sbp_u8_decode(ctx, &msg->reserved[i])) {
return false;
Expand Down Expand Up @@ -332,6 +338,11 @@ int sbp_msg_ssr_flag_high_level_cmp(const sbp_msg_ssr_flag_high_level_t *a,
return ret;
}

ret = sbp_u8_cmp(&a->use_qzss_sat, &b->use_qzss_sat);
if (ret != 0) {
return ret;
}

for (uint8_t i = 0; i < SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX; i++) {
ret = sbp_u8_cmp(&a->reserved[i], &b->reserved[i]);
if (ret != 0) {
Expand Down
15 changes: 8 additions & 7 deletions c/test/auto_check_sbp_integrity_MsgSsrFlagHighLevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagHighLevel) {

test_msg.ssr_flag_high_level.reserved[4] = 0;

test_msg.ssr_flag_high_level.reserved[5] = 0;

test_msg.ssr_flag_high_level.ssr_sol_id = 10;

test_msg.ssr_flag_high_level.tile_id = 30;
Expand All @@ -144,6 +142,8 @@ START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagHighLevel) {

test_msg.ssr_flag_high_level.use_iono_tile_sat_los = 6;

test_msg.ssr_flag_high_level.use_qzss_sat = 0;

test_msg.ssr_flag_high_level.use_tropo_grid_points = 4;

sbp_message_send(&sbp_state, SbpMsgSsrFlagHighLevel, 66, &test_msg,
Expand Down Expand Up @@ -225,11 +225,6 @@ START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagHighLevel) {
"incorrect value for last_msg.msg.ssr_flag_high_level.reserved[4], "
"expected 0, is %" PRId64,
(int64_t)last_msg.msg.ssr_flag_high_level.reserved[4]);
ck_assert_msg(
last_msg.msg.ssr_flag_high_level.reserved[5] == 0,
"incorrect value for last_msg.msg.ssr_flag_high_level.reserved[5], "
"expected 0, is %" PRId64,
(int64_t)last_msg.msg.ssr_flag_high_level.reserved[5]);

ck_assert_msg(
last_msg.msg.ssr_flag_high_level.ssr_sol_id == 10,
Expand Down Expand Up @@ -288,6 +283,12 @@ START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagHighLevel) {
"is %" PRId64,
(int64_t)last_msg.msg.ssr_flag_high_level.use_iono_tile_sat_los);

ck_assert_msg(
last_msg.msg.ssr_flag_high_level.use_qzss_sat == 0,
"incorrect value for last_msg.msg.ssr_flag_high_level.use_qzss_sat, "
"expected 0, is %" PRId64,
(int64_t)last_msg.msg.ssr_flag_high_level.use_qzss_sat);

ck_assert_msg(
last_msg.msg.ssr_flag_high_level.use_tropo_grid_points == 4,
"incorrect value for "
Expand Down
16 changes: 7 additions & 9 deletions c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagHighLevel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class Testauto_check_sbp_integrity_MsgSsrFlagHighLevel0
assign(test_msg_.reserved[3], 0);

assign(test_msg_.reserved[4], 0);

assign(test_msg_.reserved[5], 0);
assign(test_msg_.ssr_sol_id, 10);
assign(test_msg_.tile_id, 30);
assign(test_msg_.tile_set_id, 20);
Expand All @@ -56,6 +54,7 @@ class Testauto_check_sbp_integrity_MsgSsrFlagHighLevel0
assign(test_msg_.use_iono_grid_point_sat_los, 7);
assign(test_msg_.use_iono_grid_points, 5);
assign(test_msg_.use_iono_tile_sat_los, 6);
assign(test_msg_.use_qzss_sat, 0);
assign(test_msg_.use_tropo_grid_points, 4);
}

Expand Down Expand Up @@ -726,13 +725,6 @@ TEST_F(Testauto_check_sbp_integrity_MsgSsrFlagHighLevel0, Comparison) {
make_lesser_greater(lesser.reserved[4], greater.reserved[4]);
comparison_tests(lesser, greater);
}

{
sbp_msg_ssr_flag_high_level_t lesser = info.test_msg;
sbp_msg_ssr_flag_high_level_t greater = info.test_msg;
make_lesser_greater(lesser.reserved[5], greater.reserved[5]);
comparison_tests(lesser, greater);
}
{
sbp_msg_ssr_flag_high_level_t lesser = info.test_msg;
sbp_msg_ssr_flag_high_level_t greater = info.test_msg;
Expand Down Expand Up @@ -790,6 +782,12 @@ TEST_F(Testauto_check_sbp_integrity_MsgSsrFlagHighLevel0, Comparison) {
greater.use_iono_tile_sat_los);
comparison_tests(lesser, greater);
}
{
sbp_msg_ssr_flag_high_level_t lesser = info.test_msg;
sbp_msg_ssr_flag_high_level_t greater = info.test_msg;
make_lesser_greater(lesser.use_qzss_sat, greater.use_qzss_sat);
comparison_tests(lesser, greater);
}
{
sbp_msg_ssr_flag_high_level_t lesser = info.test_msg;
sbp_msg_ssr_flag_high_level_t greater = info.test_msg;
Expand Down
Binary file modified docs/sbp.pdf
Binary file not shown.
8 changes: 6 additions & 2 deletions haskell/src/SwiftNav/SBP/Integrity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ msgSsrFlagHighLevel = 0x0BB9
-- could be a satellite, SSR grid point, or SSR tile. A group of aggregated
-- elements being monitored for integrity could refer to:
--
-- - Satellites in a particular {GPS, GAL, BDS} constellation.
-- - Satellites in a particular {GPS, GAL, BDS, QZSS} constellation.
--
-- - Satellites in the line-of-sight of a particular SSR tile.
--
Expand Down Expand Up @@ -125,6 +125,8 @@ data MsgSsrFlagHighLevel = MsgSsrFlagHighLevel
-- ^ Use GAL satellites.
, _msgSsrFlagHighLevel_use_bds_sat :: !Word8
-- ^ Use BDS satellites.
, _msgSsrFlagHighLevel_use_qzss_sat :: !Word8
-- ^ Use QZSS satellites.
, _msgSsrFlagHighLevel_reserved :: ![Word8]
-- ^ Reserved
, _msgSsrFlagHighLevel_use_tropo_grid_points :: !Word8
Expand All @@ -148,7 +150,8 @@ instance Binary MsgSsrFlagHighLevel where
_msgSsrFlagHighLevel_use_gps_sat <- getWord8
_msgSsrFlagHighLevel_use_gal_sat <- getWord8
_msgSsrFlagHighLevel_use_bds_sat <- getWord8
_msgSsrFlagHighLevel_reserved <- replicateM 6 getWord8
_msgSsrFlagHighLevel_use_qzss_sat <- getWord8
_msgSsrFlagHighLevel_reserved <- replicateM 5 getWord8
_msgSsrFlagHighLevel_use_tropo_grid_points <- getWord8
_msgSsrFlagHighLevel_use_iono_grid_points <- getWord8
_msgSsrFlagHighLevel_use_iono_tile_sat_los <- getWord8
Expand All @@ -165,6 +168,7 @@ instance Binary MsgSsrFlagHighLevel where
putWord8 _msgSsrFlagHighLevel_use_gps_sat
putWord8 _msgSsrFlagHighLevel_use_gal_sat
putWord8 _msgSsrFlagHighLevel_use_bds_sat
putWord8 _msgSsrFlagHighLevel_use_qzss_sat
mapM_ putWord8 _msgSsrFlagHighLevel_reserved
putWord8 _msgSsrFlagHighLevel_use_tropo_grid_points
putWord8 _msgSsrFlagHighLevel_use_iono_grid_points
Expand Down
12 changes: 9 additions & 3 deletions java/src/com/swiftnav/sbp/integrity/MsgSsrFlagHighLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* SSR grid point, or SSR tile. A group of aggregated elements being monitored for integrity could
* refer to:
*
* <p>- Satellites in a particular {GPS, GAL, BDS} constellation.
* <p>- Satellites in a particular {GPS, GAL, BDS, QZSS} constellation.
*
* <p>- Satellites in the line-of-sight of a particular SSR tile.
*
Expand Down Expand Up @@ -81,6 +81,9 @@ public class MsgSsrFlagHighLevel extends SBPMessage {
/** Use BDS satellites. */
public int use_bds_sat;

/** Use QZSS satellites. */
public int use_qzss_sat;

/** Reserved */
public int[] reserved;

Expand Down Expand Up @@ -123,7 +126,8 @@ protected void parse(Parser parser) throws SBPBinaryException {
use_gps_sat = parser.getU8();
use_gal_sat = parser.getU8();
use_bds_sat = parser.getU8();
reserved = parser.getArrayofU8(6);
use_qzss_sat = parser.getU8();
reserved = parser.getArrayofU8(5);
use_tropo_grid_points = parser.getU8();
use_iono_grid_points = parser.getU8();
use_iono_tile_sat_los = parser.getU8();
Expand All @@ -141,7 +145,8 @@ protected void build(Builder builder) {
builder.putU8(use_gps_sat);
builder.putU8(use_gal_sat);
builder.putU8(use_bds_sat);
builder.putArrayofU8(reserved, 6);
builder.putU8(use_qzss_sat);
builder.putArrayofU8(reserved, 5);
builder.putU8(use_tropo_grid_points);
builder.putU8(use_iono_grid_points);
builder.putU8(use_iono_tile_sat_los);
Expand All @@ -160,6 +165,7 @@ public JSONObject toJSON() {
obj.put("use_gps_sat", use_gps_sat);
obj.put("use_gal_sat", use_gal_sat);
obj.put("use_bds_sat", use_bds_sat);
obj.put("use_qzss_sat", use_qzss_sat);
obj.put("reserved", new JSONArray(reserved));
obj.put("use_tropo_grid_points", use_tropo_grid_points);
obj.put("use_iono_grid_points", use_iono_grid_points);
Expand Down
20 changes: 10 additions & 10 deletions java/test/auto_check_sbp_integrity_MsgSsrFlagHighLevelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,6 @@ public void test1() throws Throwable {
expected = 0L;
org.junit.Assert.assertEquals(value, expected);
}
value = msg.reserved[5];
if (value instanceof BigInteger) {
org.junit.Assert.assertTrue(
"'" + msg.reserved[5] + "' != '" + 0 + "'",
value.equals(BigInteger.valueOf(0L)));
} else {
value = value.longValue();
expected = 0L;
org.junit.Assert.assertEquals(value, expected);
}
value = msg.ssr_sol_id;
if (value instanceof BigInteger) {
org.junit.Assert.assertTrue(
Expand Down Expand Up @@ -268,6 +258,16 @@ public void test1() throws Throwable {
expected = 6L;
org.junit.Assert.assertEquals(value, expected);
}
value = msg.use_qzss_sat;
if (value instanceof BigInteger) {
org.junit.Assert.assertTrue(
"'" + msg.use_qzss_sat + "' != '" + 0 + "'",
value.equals(BigInteger.valueOf(0L)));
} else {
value = value.longValue();
expected = 0L;
org.junit.Assert.assertEquals(value, expected);
}
value = msg.use_tropo_grid_points;
if (value instanceof BigInteger) {
org.junit.Assert.assertTrue(
Expand Down
4 changes: 2 additions & 2 deletions javascript/sbp.bundle.js

Large diffs are not rendered by default.

29 changes: 16 additions & 13 deletions javascript/sbp/integrity.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@ IntegritySSRHeader.prototype.fieldSpec.push(['chain_id', 'writeUInt8', 1]);
* Integrity monitoring flags for multiple aggregated elements. An element could be
* a satellite, SSR grid point, or SSR tile. A group of aggregated elements being
* monitored for integrity could refer to: - Satellites in a particular {GPS, GAL,
* BDS} constellation. - Satellites in the line-of-sight of a particular SSR tile.
* - Satellites in the line-of-sight of a particular SSR grid point. The integrity
* usage for a group of aggregated elements varies according to the integrity flag
* of the satellites comprising that group. SSR_INTEGRITY_USAGE_NOMINAL: All
* satellites received passed the integrity check and have flag INTEGRITY_FLAG_OK.
* SSR_INTEGRITY_USAGE_WARNING: A limited number of elements in the group failed
* the integrity check. Refer to more granular integrity messages for details on
* the specific failing elements. SSR_INTEGRITY_USAGE_ALERT: Most elements in the
* group failed the integrity check, do not use for positioning.
* SSR_INTEGRITY_USAGE_NOT_MONITORED: Unable to verify the integrity flag of
* elements in the group.
* BDS, QZSS} constellation. - Satellites in the line-of-sight of a particular SSR
* tile. - Satellites in the line-of-sight of a particular SSR grid point. The
* integrity usage for a group of aggregated elements varies according to the
* integrity flag of the satellites comprising that group.
* SSR_INTEGRITY_USAGE_NOMINAL: All satellites received passed the integrity check
* and have flag INTEGRITY_FLAG_OK. SSR_INTEGRITY_USAGE_WARNING: A limited number
* of elements in the group failed the integrity check. Refer to more granular
* integrity messages for details on the specific failing elements.
* SSR_INTEGRITY_USAGE_ALERT: Most elements in the group failed the integrity
* check, do not use for positioning. SSR_INTEGRITY_USAGE_NOT_MONITORED: Unable to
* verify the integrity flag of elements in the group.
*
* Fields in the SBP payload (`sbp.payload`):
* @field obs_time GPSTimeSec GNSS reference time of the observation used to generate the flag.
Expand All @@ -101,6 +101,7 @@ IntegritySSRHeader.prototype.fieldSpec.push(['chain_id', 'writeUInt8', 1]);
* @field use_gps_sat number (unsigned 8-bit int, 1 byte) Use GPS satellites.
* @field use_gal_sat number (unsigned 8-bit int, 1 byte) Use GAL satellites.
* @field use_bds_sat number (unsigned 8-bit int, 1 byte) Use BDS satellites.
* @field use_qzss_sat number (unsigned 8-bit int, 1 byte) Use QZSS satellites.
* @field reserved array Reserved
* @field use_tropo_grid_points number (unsigned 8-bit int, 1 byte) Use tropo grid points.
* @field use_iono_grid_points number (unsigned 8-bit int, 1 byte) Use iono grid points.
Expand Down Expand Up @@ -131,7 +132,8 @@ MsgSsrFlagHighLevel.prototype.parser = new Parser()
.uint8('use_gps_sat')
.uint8('use_gal_sat')
.uint8('use_bds_sat')
.array('reserved', { length: 6, type: 'uint8' })
.uint8('use_qzss_sat')
.array('reserved', { length: 5, type: 'uint8' })
.uint8('use_tropo_grid_points')
.uint8('use_iono_grid_points')
.uint8('use_iono_tile_sat_los')
Expand All @@ -146,7 +148,8 @@ MsgSsrFlagHighLevel.prototype.fieldSpec.push(['chain_id', 'writeUInt8', 1]);
MsgSsrFlagHighLevel.prototype.fieldSpec.push(['use_gps_sat', 'writeUInt8', 1]);
MsgSsrFlagHighLevel.prototype.fieldSpec.push(['use_gal_sat', 'writeUInt8', 1]);
MsgSsrFlagHighLevel.prototype.fieldSpec.push(['use_bds_sat', 'writeUInt8', 1]);
MsgSsrFlagHighLevel.prototype.fieldSpec.push(['reserved', 'array', 'writeUInt8', function () { return 1; }, 6]);
MsgSsrFlagHighLevel.prototype.fieldSpec.push(['use_qzss_sat', 'writeUInt8', 1]);
MsgSsrFlagHighLevel.prototype.fieldSpec.push(['reserved', 'array', 'writeUInt8', function () { return 1; }, 5]);
MsgSsrFlagHighLevel.prototype.fieldSpec.push(['use_tropo_grid_points', 'writeUInt8', 1]);
MsgSsrFlagHighLevel.prototype.fieldSpec.push(['use_iono_grid_points', 'writeUInt8', 1]);
MsgSsrFlagHighLevel.prototype.fieldSpec.push(['use_iono_tile_sat_los', 'writeUInt8', 1]);
Expand Down
Loading

0 comments on commit 718fb5a

Please sign in to comment.