Skip to content

added some missing message types - #70

Merged
joe-saronic merged 6 commits into
masterfrom
more-messages
Jul 27, 2026
Merged

added some missing message types#70
joe-saronic merged 6 commits into
masterfrom
more-messages

Conversation

@joe-saronic

@joe-saronic joe-saronic commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Adds support for some message types I am messing with for possible state estimation use:

  • SatVisibility: predicted sat positions
  • ChannelStatus: actual sats positions
  • BaseVectorGeod: same as *Cart, but in LLA
  • DiskStatus: random diagnostic
  • RxMessage: random diagnostic
  • XPPSOffset: timing insights
  • ReceiverTime: timing insights
  • EndOfAtt: framing
  • EndOfPVT: framing
  • Comment

Only XPPSOffset is not found in the mega message dump: everything else is tested.

This PR introduces some other small changes:

  1. Sub-block infrastructure for nested is formalized a bit (so we can add stuff like OutputLink much more simply later). This also allows round-tripping nested arrays, which was not a thing before
  2. Makes a couple of types binrw instead of just br. This makes everything correctly round-trippable. Only types present in the mega dump are tested. This uses the same approach as chore: fix fuzzing #50 (which is why I felt free to add it here), with the addition of the relatively transparent nested block handling.
  3. Fixes a couple of minor clippy issues.

Comment thread src/lib.rs
Comment thread src/reader.rs
Comment thread src/parser.rs
@joe-saronic
joe-saronic changed the base branch from cargo-lock to timing July 16, 2026 01:12
@joe-saronic
joe-saronic force-pushed the more-messages branch 3 times, most recently from 99665c5 to b2a05f9 Compare July 16, 2026 06:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands libsbf’s SBF parsing/writing coverage by adding several additional message/block types and by formalizing nested/sub-block handling so more block families can be round-tripped using binrw.

Changes:

  • Added parsing support for additional message kinds (e.g., SatVisibility, ChannelStatus, BaseVectorGeod, DiskStatus, RxMessage, ReceiverTime, EndOfAtt, EndOfPVT, Comment, XPPSOffset).
  • Introduced SubBlock/NestedBlock infrastructure to correctly pad and round-trip nested and fixed-length sub-block arrays.
  • Converted many existing message structs from BinRead-only to #[binrw] + explicit #[bw(map=...)] so sentinel-based Option fields serialize back to SBF.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Cargo.toml Bumps crate version to 0.16.0.
src/lib.rs Adds SubBlock/NestedBlock infrastructure and registers new message kinds.
src/parser.rs Adds parsing branches for newly supported message kinds (stream + datagram).
src/reader.rs Minor doc/test cleanup.
src/mega_test.rs Extends mega-file tests for new message kinds + roundtrip harness.
src/messages/mod.rs Exposes new message modules and re-exports new types.
src/messages/att_cov_euler.rs (Not changed in provided diff).
src/messages/aux_ant_positions.rs Moves to #[binrw] and uses SubBlock for padded sub-block arrays.
src/messages/base_vector_cart.rs Moves to #[binrw] and uses SubBlock for vector sub-block arrays.
src/messages/base_vector_geod.rs New: BaseVectorGeod block support (LLA/ENU baseline).
src/messages/bds_ion.rs (Not changed in provided diff).
src/messages/channel_status.rs New: ChannelStatus with nested sub-block structure.
src/messages/comment.rs New: Comment block.
src/messages/disk_status.rs New: DiskStatus and DiskData sub-block.
src/messages/end_of_att.rs New: EndOfAtt framing block.
src/messages/end_of_pvt.rs New: EndOfPVT framing block.
src/messages/ext_event.rs Moves to #[binrw] + #[bw(map=...)] for sentinel options.
src/messages/ext_event_ins_nav_cart.rs Moves to #[binrw] + #[bw(map=...)] for sentinel options.
src/messages/ext_event_ins_nav_geod.rs Moves to #[binrw] + #[bw(map=...)] for sentinel options.
src/messages/ext_sensor_meas.rs Uses SubBlock for padded sub-block arrays + adds missing #[bw(map=...)].
src/messages/ins_nav_cart.rs Moves to #[binrw] + #[bw(map=...)] for sentinel options.
src/messages/ins_nav_geod.rs Moves to #[binrw] + #[bw(map=...)] for sentinel options.
src/messages/meas_epoch.rs Formalizes nested sub-block parsing/writing via NestedBlock.
src/messages/meas_extra.rs Uses SubBlock for padded sub-block arrays and removes per-item align padding.
src/messages/nav_cart.rs Moves to #[binrw] + #[bw(map=...)] for sentinel options.
src/messages/pos_cart.rs Moves to #[binrw] + #[bw(map=...)] for sentinel options.
src/messages/pvt_cartesian.rs Moves to #[binrw] + #[bw(map=...)] for sentinel options.
src/messages/pvt_geodetic.rs Moves to #[binrw], adds Datum/PvtError write conversions, and sentinel #[bw(map=...)].
src/messages/quality_ind.rs Adds QualityIndicator -> u16 encoding and round-trip support.
src/messages/receiver_status.rs Moves to #[binrw] and uses SubBlock for padded sub-block arrays.
src/messages/receiver_time.rs New: ReceiverTime timing block.
src/messages/rf_status.rs Moves to #[binrw] and uses SubBlock for padded sub-block arrays.
src/messages/rx_message.rs New: RxMessage diagnostic block.
src/messages/sat_visibility.rs New: SatVisibility and SatInfo sub-block.
src/messages/x_pps_offset.rs New: XPPSOffset timing block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/messages/receiver_time.rs Outdated
Comment thread src/messages/receiver_time.rs
Comment thread src/messages/x_pps_offset.rs Outdated
Comment thread src/messages/end_of_pvt.rs Outdated
Comment thread src/messages/end_of_att.rs Outdated
Comment thread src/mega_test.rs
Comment thread src/mega_test.rs
@joe-saronic
joe-saronic force-pushed the more-messages branch 3 times, most recently from 0190ff6 to 3db2d2f Compare July 16, 2026 09:50
@joe-saronic
joe-saronic merged commit 83115f2 into master Jul 27, 2026
1 check passed
@joe-saronic
joe-saronic deleted the more-messages branch July 27, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants