Skip to content

SN-9079: Add $PGNSSP NMEA sentence, deprecate $PGPSP - #1396

Merged
waltjohnson merged 8 commits into
developfrom
SN-9079_PGNSSP
Nov 26, 2026
Merged

waltjohnson merged 8 commits into
developfrom
SN-9079_PGNSSP

Conversation

@tmcd249

@tmcd249 tmcd249 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Jira: SN-9079. Submodule bump and firmware: inertialsense/imx#1837.

What

Adds the $PGNSSP NMEA sentence (NMEA_MSG_ID_PGNSSP = 20) and deprecates $PGPSP.

$PGNSSP carries every gnss_pos_t field except ecef (it can be computed from lla), plus the GNSS velocity:

Field Contents
1-17 Identical to $PGPSP (time, week, status, LLA, MSL, DOP/accuracy, velocity, sAcc, cnoMean, towOffset, leapS)
18 satsUsed: its own field instead of the deprecated low byte of status
19 cnoMeanSigma
20 status2: jamming/spoofing flags (eGnssStatus2), decimal
  • $PGPSP and $PGNSSP share one field encoder and one parser, so fields 1-17 can't drift apart. A $PGPSP parser only needs the new talker name and fields 18-20.
  • $PGPSP is unchanged on the wire and still parsed; its functions are marked @deprecated.
  • CBOR registry regenerated: NMEA_PGNSSP pseudo-DID 0x3F14, NMEA_MSG_ID_COUNT 20 → 21. Stored flash configs are unaffected: the decoder accepts a shorter nmeaPeriod[] array (if (i < f->count)).

Tests

  • IS-SDK_unit-tests: 133 passed (protocol_nmea, CBOR, data mappings, ISComm), including 6 new $PGNSSP tests: round trip with every new field non-zero, a full time-of-week sweep, fields 1-17 byte-identical to $PGPSP, satsUsed independent of status, talker/ID lookup, and $ASCE enable by name.

Pre-PR check (base d3d6e68)

  • Doc blocks: 13 added or changed (6 headers, 7 .cpp); 13 documented; 0 missing; 0 malformed; 0 forbidden forms
  • Headers: 0 new files; 9 modified, of which 3 had the copyright year extended to 2026, 1 was already current, 2 had headers added, and 3 are generated CBOR registry files (already 2026, not hand-edited)
  • clang-format: 6 modified files formatted on changed lines; 0 added lines over 200 columns. Not applied: the hunks that would reformat the whole hand-aligned tables in data_sets.c, data_sets.h (eNmeaMsgId) and ISDataMappings.cpp around one-row insertions, and the rewrap of the old license comment around the copyright year. Those are lines this PR didn't write (step 3)
  • Naming/language: read all hunks; 2 fixed (static helpers in protocol_nmea.cpp and the test moved to unnamed namespaces). The &a[N] // $TALKER, parser offsets follow the convention of every other parser in the file
  • PR template: none in this repo; /tmp/ check: 0

🤖 Generated with Claude Code

tmcd249 and others added 2 commits November 23, 2026 16:19
$PGNSSP (NMEA_MSG_ID_PGNSSP = 20) carries every gnss_pos_t field except
ecef, plus the GNSS velocity. Fields 1-17 match $PGPSP; it adds satsUsed,
cnoMeanSigma and status2 (jamming/spoofing, eGnssStatus2).

- nmea_pgnssp() / nmea_parse_pgnssp(); $PGPSP and $PGNSSP share one
  field encoder and parser so fields 1-17 cannot drift apart.
- Talker <-> ID lookup, DID_GNSS1/2_POS RMC bits, GRMC bit names.
- CBOR registry regenerated: NMEA_PGNSSP pseudo-DID 0x3F14,
  NMEA_MSG_ID_COUNT 20 -> 21.
- $PGPSP encoder/parser marked @deprecated; behavior unchanged.
- File headers and copyright years brought up to the style guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round trip with every new field non-zero, a full time-of-week sweep,
fields 1-17 byte-identical to $PGPSP, satsUsed independent of status,
talker/ID lookup and RMC bits, and $ASCE enable by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/protocol_nmea.cpp Resolved
Comment thread src/protocol_nmea.cpp Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical buffer-write and parser-read bounds violations remain, alongside acceptance of incomplete sentences and incorrect velocity frame status handling.

3 open issues
What changed in this PR

Adds $PGNSSP to the SDK’s NMEA support, carrying additional GNSS solution fields while deprecating $PGPSP and preserving its wire format.

Changes:

  • Shares encoding and parsing logic for the existing fields, adding satsUsed, cnoMeanSigma, and status2.
  • Registers the new sentence in message lookup, broadcast mappings, and the CBOR registry.
  • Adds six tests covering round trips, legacy-field compatibility, lookup, and $ASCE enablement.
File Description
tests/​test_protocol_nmea.cpp Adds six $PGNSSP tests.
src/​protocol_nmea.h Declares new APIs and marks legacy APIs deprecated.
src/​protocol_nmea.cpp Implements $PGNSSP using shared field encoding and parsing.
src/​ISDataMappings.cpp Adds the broadcast-bit display label.
src/​data_sets.h Defines the new message ID and broadcast bit.
src/​data_sets.c Adds talker lookup and GNSS dataset mappings.
src/​cbor/​cbor_registry.h Defines the $PGNSSP pseudo-DID.
src/​cbor/​cbor_registry.c Updates the message-count assertion to 21.
src/​cbor/​cbor_registry_names.c Adds the CBOR registry name.

Review effort: Balanced

Comment thread src/data_sets.c Resolved
Comment thread src/protocol_nmea.cpp Resolved
Comment thread src/protocol_nmea.cpp Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved findings identify buffer overruns, an unintended legacy wire-format change, and incorrect handling of absent trailing fields.

4 open issues
2 resolved since last review

Review effort: Balanced

Comment thread src/protocol_nmea.cpp Resolved
Comment thread src/protocol_nmea.cpp Resolved
Comment thread src/protocol_nmea.cpp Resolved
@waltjohnson
waltjohnson merged commit acc79a0 into develop Nov 26, 2026
4 checks passed
@waltjohnson
waltjohnson deleted the SN-9079_PGNSSP branch November 26, 2026 07:10
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.

5 participants