Expand description
A no_std, allocation-free parser and encoder for AIS (Automatic
Identification System) messages, per ITU-R M.1371, as carried over NMEA
0183 !AIVDM/!AIVDO sentences.
§Layering
nmeaparses and checksum-validates!AIVDM/!AIVDOsentences and reassembles multi-fragment messages into a single armored payload.bitsreads and writes arbitrary-width fields directly against the six-bit ASCII-armored payload bytes; there is no separate “unpacked bitstream” buffer, since AIS fields do not align to byte boundaries.messagedecodes/encodes the bit-packed payload into a typedAisMessage, one variant per ITU-R M.1371 message type.
§No allocation
Nothing in this crate uses alloc. Multi-fragment reassembly
(nmea::FragmentAssembler) uses a fixed-capacity, caller-sized buffer
instead of a growable one, so it works with no allocator at all.
Re-exports§
pub use error::AisError;pub use message::AisMessage;pub use nmea::Channel;pub use nmea::CompleteMessage;pub use nmea::FragmentAssembler;pub use nmea::Sentence;pub use message::common::*;
Modules§
- bits
- Bit-level codec for AIS payload data.
- error
- Error types for every layer of the decode/encode pipeline.
- message
- ITU-R M.1371 message layer: typed messages decoded from (and encoded to) a bit-packed AIS payload.
- nmea
- NMEA 0183 sentence layer: checksum,
!AIVDM/!AIVDOparsing, and multi-fragment reassembly. - string
- Six-bit ASCII conversions and a fixed-capacity string type for decoded text fields (vessel name, callsign, destination).
Structs§
- Line
Decoder - A stateful decoder that handles both single- and multi-fragment
!AIVDM/!AIVDOsentences, so callers reading a live/mixed feed don’t need to hand-roll the parse/assemble/decode state machine themselves.
Functions§
- decode_
line - Decodes a single, complete NMEA line into a typed AIS message.
- decode_
payload - Decodes a typed AIS message from an already-assembled six-bit ASCII-armored payload.
- encode_
line - Encodes a typed AIS message into a single, complete
!AIVDM/!AIVDONMEA line on the givenchannel, writing intobufand returning the written slice. Setis_own_shipto emit!AIVDO(a simulated/own-ship report) rather than!AIVDM. - encode_
payload - Encodes a typed AIS message into
bufas a six-bit ASCII-armored payload.