Expand description
NMEA 0183 sentence assembly and parsing.
Every receiver in the tree speaks the same handful of sentences, so this is the one parser and each board contributes only its power sequencing. Four sentence types carry everything UMSH wants:
- RMC — the time, the date, and whether the fix is valid. The only sentence carrying a date, which is why it is the one that can set a wall clock.
- GGA — fix quality, altitude, and satellites in use.
- GSA — whether the solution is two- or three-dimensional, and the dilution of precision.
- GSV — satellites in view.
§Integers only
No floating point anywhere. Latitude and longitude are parsed into
i32 at 1e-7 degrees, which resolves about 11 mm — two orders finer
than the 7-byte location encoding needs, and exact, so a position
never shifts by a rounding step between the receiver and the wire.
Parsing ddmm.mmmm in binary floating point would introduce error
before the encoder ever saw the value.
§What is not checked
Sentences whose checksum fails, whose fields are malformed, or whose talker is unknown are dropped silently. A receiver emits a torn line on every power-up and whenever the UART resynchronizes, and treating that as an error condition would mean reporting a fault on every cold start.
Structs§
- Assembler
- Assembles bytes from a UART into complete sentences.
- Gga
- The
GGAsentence. - Gsa
- The
GSAsentence. - Gsv
- The
GSVsentence. - Rmc
- The
RMCsentence.
Enums§
- Sentence
- One parsed sentence, reduced to what UMSH uses.
Constants§
- DEGREE_
SCALE - Latitude and longitude scale: 1e-7 degrees per unit.
- MAX_
SENTENCE - Longest NMEA sentence accepted, including
$, the checksum, and the line terminator.
Functions§
- parse
- Parse one sentence body: everything between the
$and the line terminator, checksum included.