nmeasis
nmeasis is safe, zero-copy, no_std compatible NMEA0183 protocol parser written in Rust meant for use in embedded and constrainted contexts. It also comes with a C FFI, allowing you to integrate with projects in other languages.
Features
- Written entirely in
#![deny(unsafe_code)]no_stdRust. - Fully complete C FFI, allowing for use in C (with a provided example).
- No memory allocations at all.
NmeaNumberperserves the precision of provided, eliding floating point error.- Access to raw sentence fields alongside parsed fields.
- Parser is fuzzed on input, hardening against runtime panics.
Example
Rust
use NmeaParser;
C
static void
int
Sentences
AAM- Waypoint Arrival AlarmGGA- Global Positioning System Fix DataGLL- Geographic Position (Latitude/Longitude)GNS- GNSS Fix DataGSA- GPS Dilution of Precision and Active SatellitesGST- GPS Pseudorange Noise StatisticsGSV- Satellites in ViewRMC- Recommended Minimum Navigation InformationTXT- Text TransmissionVTG- Track made good and Ground SpeedZDA- Time & Date
NmeaTime/NmeaDate/NmeaDateTime/NmeaDateTimeOffset
All of these are our internal representations of dates and times that were parsed from the protocol. They are provided as is but can be converted to friendlier formats if you are using the library from Rust.
All of these have a TryFrom implementation to their analog from the time if you enable the time feature.
All of these have a TryFrom implementation to their analog from the chrono if you enable the chrono feature.
NmeaNumber
This is our internal representation of floating point number that was parsed. This preserves all of the precision and is provided as is.
This has From implementations to f32 and f64 if you enable the float feature. This is also provided in the C FFI under nmea_number_to_f32 and nmea_number_to_f64.
NmeaCoordinates
This is our internal representation of the coordinates provided by the protocol. This mostly just wraps the NmeaNumber with some convenience for parsing.
This has a From implementation for a variety of types from the geo_types crate if you enable the geo feature.
Contributing
Contributions are welcome. Feel free to add any of the missing NMEA sentences.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.