Skip to content

Commit

Permalink
[IOTE-2][IOTE-326] Add local timestamp week rollover flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jakalm committed Mar 15, 2024
1 parent 0a3878f commit 7242917
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 8 deletions.
2 changes: 1 addition & 1 deletion c/include/libsbp/legacy/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
s32 milliseconds; /**< Milliseconds portion of the time offset [ms] */
s16 microseconds; /**< Microseconds portion of the time offset [microseconds]
*/
u8 flags; /**< Status flags (reserved) */
u8 flags; /**< Status flags */
} msg_gnss_time_offset_t;

/** Local time at detection of PPS pulse
Expand Down
2 changes: 1 addition & 1 deletion c/include/libsbp/system/MSG_GNSS_TIME_OFFSET.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ typedef struct {
s16 microseconds;

/**
* Status flags (reserved)
* Status flags
*/
u8 flags;
} sbp_msg_gnss_time_offset_t;
Expand Down
41 changes: 41 additions & 0 deletions c/include/libsbp/system_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,47 @@
#define SBP_MSG_INS_UPDATES_ENCODED_LEN 10u

#define SBP_MSG_GNSS_TIME_OFFSET 0xFF07
#define SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_MASK (0x7fu)
#define SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_SHIFT (1u)
#define SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_GET(flags) \
((u8)((u8)((flags) >> SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_SHIFT) & \
SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_MASK))
#define SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_SET(flags, val) \
do { \
(flags) = (u8)( \
(flags & (~(SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_MASK \
<< SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_SHIFT))) | \
(((val) & (SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_MASK)) \
<< (SBP_GNSS_TIME_OFFSET_RESERVED_SET_TO_ZERO_SHIFT))); \
} while (0)

#define SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_MASK \
(0x1u)
#define SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_SHIFT \
(0u)
#define SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_GET( \
flags) \
((u8)( \
(u8)( \
(flags) >> \
SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_SHIFT) & \
SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_MASK))
#define SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_SET( \
flags, val) \
do { \
(flags) = (u8)( \
(flags & \
(~(SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_MASK \
<< SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_SHIFT))) | \
(((val) & \
(SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_MASK)) \
<< (SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_SHIFT))); \
} while (0)

#define SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_NOT_AFFECTED_BY_LOCAL_TIMESTAMP_WEEK_ROLLOVER \
(0)
#define SBP_GNSS_TIME_OFFSET_ALIGNED_WITH_LOCAL_TIMESTAMP_WEEK_ROLLOVER_WEEK_NUMBER_INCREMENTED_ON_LOCAL_TIMESTAMP_WEEK_ROLLOVER \
(1)
/**
* Encoded length of sbp_msg_gnss_time_offset_t (V4 API) and
* msg_gnss_time_offset_t (legacy API)
Expand Down
2 changes: 1 addition & 1 deletion c/include/libsbp/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define SBP_PATCH_VERSION 6

/** Full SBP version string. */
#define SBP_VERSION "5.0.6"
#define SBP_VERSION "5.0.7-alpha"

/** Is this a staging branch? */
#define SBP_STAGING 0
Expand Down
2 changes: 1 addition & 1 deletion haskell/sbp.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sbp
version: 5.0.6
version: 5.0.7-alpha
synopsis: SwiftNav's SBP Library
homepage: https://github.com/swift-nav/libsbp
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion haskell/src/SwiftNav/SBP/System.hs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ data MsgGnssTimeOffset = MsgGnssTimeOffset
, _msgGnssTimeOffset_microseconds :: !Int16
-- ^ Microseconds portion of the time offset
, _msgGnssTimeOffset_flags :: !Word8
-- ^ Status flags (reserved)
-- ^ Status flags
} deriving ( Show, Read, Eq )

instance Binary MsgGnssTimeOffset where
Expand Down
2 changes: 1 addition & 1 deletion python/sbp/RELEASE-VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.6
5.0.7-alpha
2 changes: 1 addition & 1 deletion python/sbp/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ class MsgGnssTimeOffset(SBP):
microseconds : int
Microseconds portion of the time offset
flags : int
Status flags (reserved)
Status flags
sender : int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
Expand Down
10 changes: 9 additions & 1 deletion spec/yaml/swiftnav/sbp/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,15 @@ definitions:
desc: Microseconds portion of the time offset
- flags:
type: u8
desc: Status flags (reserved)
desc: Status flags
fields:
- 1-7:
desc: Reserved, set to zero
- 0:
desc: Aligned with local timestamp week rollover
values:
- 0: Not affected by local timestamp week rollover
- 1: Week number incremented on local timestamp week rollover

- MSG_PPS_TIME:
id: 0xFF08
Expand Down

0 comments on commit 7242917

Please sign in to comment.