AeroRust / AeroRust/nmea

xxGNS parsing issue

オープン
#108 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
Hacktoberfest
主要言語
Rust
スター
109
フォーク
64
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。