Nmea
NMEA 0183 - for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GNSS receivers and many other types of instruments. Defined and controlled by the National Marine Electronics Association (NMEA)
Install / Use
/learn @AeroRust/NmeaREADME
NMEA
Complete documentation can be found on www.docs.rs/nmea
NMEA 0183 sentence parser
Supported sentences (alphabetically ordered):
AAM- Waypoint Arrival Alarm (feature:waypoint)ALM- GPS Almanac Data (feature:GNSS)APA- Autopilot Sentence "A" (feature:GNSS)BOD- Bearing - Waypoint to Waypoint (feature:waypoint)BWC- Bearing & Distance to Waypoint - Great Circle (feature:waypoint)BWW- Bearing - Waypoint to Waypoint (feature:waypoint)DBK- Depth Below Keel (feature:water)DBS- Depth Below Surface (feature:water)DPT- Depth of Water (feature:water)GBS- GPS Satellite Fault Detection (feature:GNSS)GGA- * Global Positioning System Fix Data (feature:GNSS)GLL- * Geographic Position - Latitude/Longitude (feature:GNSS)GNS- * Fix data (feature:GNSS)GSA- * GPS DOP and active satellites (feature:GNSS)GST- GPS Pseudorange Noise Statistics (feature:GNSS)GSV- * Satellites in view (feature:GNSS)HDT- Heading - True (feature:other)MDA- Meterological Composite (feature:other)MTW- Mean Temperature of Water (feature:water)MWV- Wind Speed and Angle (feature:other)RMC- * Recommended Minimum Navigation Information (feature:GNSS)RMZ- PGRMZ - Garmin Altitude (feature:vendor-specific)TTM- Tracked target message (feature:radar)TXT- * Text message (feature:other)VHW- Water speed and heading (feature:water)VTG- * Track made good and Ground speed (feature:GNSS)WNC- Distance - Waypoint to waypoint (feature:waypoint)ZDA- Time & Date - UTC, day, month, year and local time zone (feature:other)ZFO- UTC & Time from origin Waypoint (feature:waypoint)ZTG- UTC & Time to Destination Waypoint (feature:waypoint)
* Nmea::parse() supported sentences
How to contribute
We have an ongoing effort to support as many sentences from NMEA 0183 as possible,
starting with the most well-known.
If you'd like to contribute by writing a parser for a given message, check out the Supporting additional sentences (AeroRust/nmea#54) issue and contribute in 3 easy steps:
- Write a comment in the issue for the sentence(s) you'd like to implement, you will be mentioned on the task to avoid duplicate efforts.
- Implement each sentence in it's own branch alongside:
- At least 2 tests (1 passing and 1 failing) in its own module under the
./src/sentencesdirectory using thenomcrate. - Re-export the structures and parsing function in
./src/sentences.rs - Add a passing test to
tests/all_supported_messages.rs - Add the sentence to the features list in
Cargo.tomlin alphabetical order and assign it to proper category (if you are unsure which category to use, open a PR to discuss it) - Add the sentence to the
README.mdlist of supported sentences above - Passing linters checks. Just run
cargo fmtand fix any issues raised bycargo clippy - Appropriate documentation following the rest of the sentences format. For proper documentation you can take a look at
GSV,APAandWNCsentences.
- At least 2 tests (1 passing and 1 failing) in its own module under the
- Open a PR 🎉
NB: We use https://gpsd.gitlab.io/gpsd/NMEA.html as a reference for most sentences as it's a very well documented project.
What is NMEA 0183?
NMEA 0183 is a combined electrical and data specification for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GPS receivers and many other types of instruments.
- https://en.wikipedia.org/wiki/NMEA_0183
Usage
Add the nmea dependency in your Cargo.toml:
[dependencies]
nmea = "0.7"
For no_std
This crate support no_std without the use of an allocator ( alloc ),
just add the nmea crate without the default features:
[dependencies]
nmea = { version = "0.7", default-features = false }
Parse
To use the NMEA parser create a Nmea struct and feed it with NMEA sentences (only supports GNSS messages, otherwise use the parse_str() and parse_bytes()):
use nmea::Nmea;
fn main() {
let mut nmea = Nmea::default();
let gga = "$GPGGA,092750.000,5321.6802,N,00630.3372,W,1,8,1.03,61.7,M,55.2,M,,*76";
// feature `GGA` should be enabled to parse this sentence.
#[cfg(feature = "GGA")]
{
nmea.parse(gga).unwrap();
println!("{}", nmea);
}
}
Supported Rust Versions
The Minimum supported Rust version (or MSRV) is 1.87.0.
Unsafe-free crate
We use #![deny(unsafe_code)] for a fully unsafe-free crate.
License
This project is licensed under the Apache-2.0.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the project by you, shall be licensed as Apache-2.0, without any additional terms or conditions.
Related Skills
himalaya
339.1kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
339.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
coding-agent
339.1kDelegate coding tasks to Codex, Claude Code, or Pi agents via background process
