AeroRust / AeroRust/nmea

xxGNS parsing issue

Aperta
#108 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Hacktoberfest
Lingua principale
Rust
Stelle
109
Fork
64
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi. Hope all is well.

I've encountered a parsing problem while trying to parse a GNS message from my u-blox SAM-M10Q module. I think I've narrowed it down, but some help will be appreciated.
The message received from the module (no gps fix): `$GNGNS,,,,,,NNNNNN,00,99.99,,,,,V*07`
The error I got while trying to parse the message:
```rust
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParsingError(Failure(Error { input: "NNNN", code: Fail }))', src\main.rs:6:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\gpsdecoder.exe` (exit code: 101)
```

Now from what I can gather, the NNNNNN is fix flags for each of the satellite constellations supported and being used by the u-blox module, parsed with the `parse_faa_modes` function.

However, the `parse_faa_modes` function checks the next character to parse (in this case the first GNSS's flag), parses it and builds a `FaaModes` struct, and since there is still characters to parse (the rest of the GNSS's flags), it adds a second system state to the same `FaaModes` struct it just created for the first one. Thereafter, the rest of the GNSS's flags are still there, the `parse_faa_modes` function doesn't know what to do and returns an error.

Now I think this can be solved by running the `parse_faa_modes` function on each character in this group and not on the group as a whole.

I am willing to create a PR for this, but I need some help.

Thanks for your assistance,
Stefan

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.