Crate nmea2000

Source
Expand description

This crate provides basic decoding of NMEA 2000 (N2K) messages. It uses no heap allocation whatsoever and is designed to be used in embedded systems. As the author wrote this just a few hours after first learning about N2K, it is very much a work in progress. Nevertheless, the Canboat project’s reverse engineering documentation proved to be very helpful in understanding the protocol.

It has only been tested on the ESP32 microcontroller with the ESP-IDF SDK, but there is no reason it should not work on other platforms.

Re-exports§

pub use fast_packet::FastPacket;
pub use generic_array::typenum;

Modules§

fast_packet
Because the maximum size of a frame is 8 bytes, NMEA 2000 splits larger messages into multiple frames, so-called Fast Packets. Each frame contains some group number, frame number, and the actual data. The first frame also contains the length of the total message transmitted (FastPacket::total_len).

Structs§

Identifier
A NMEA 2000 message identifier. According to N2K specification, this is a 29-bit extended CAN ID with a 3-bit priority, a 19-bit parameter group number (PGN), and an 8-bit source address.

Traits§

Message
A NMEA 2000 message. This trait is very much inspired by the gRPC library Prost’s trait with the same name.
MessageBuf