AeroRust / AeroRust/nmea

xxGNS parsing issue

Abierto
#108 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Hacktoberfest
Lenguaje dominante
Rust
Estrellas
109
Forks
64
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.