kinavis-ais
AIS messages from NMEA 0183 encapsulation sentences to the kinavis-kernel value types.
AIS messages arrive as !AIVDM sentences, 6 bits per character, split across
sentences when long.
kinavis-nmea0183 validates each
sentence and yields the armoured payload; this crate unarmours it, reassembles
fragments and decodes the message into kernel types — Position, Speed,
TrueCourse, TargetId (MMSI), Distance (draught), InlineStr (names). "Not
available" is None, never zero.
- Position reports — messages 1, 2, 3 (class A), 18, 19 (class B) — as
PositionReport; message 19 adds name, ship type and dimensions. - Static and voyage data — message 5 — as
StaticAndVoyageData: IMO, call sign, name, ship and cargo type, dimensions, draught, destination, ETA. - Class B static data — message 24, part A or B — as
StaticDataReport. - Aids to navigation — message 21 — as
AidToNavigation: mark type, name, off-position and virtual flags. - Other types:
Message::Unsupportedwith the type and raw bits. - No allocation: fixed-capacity bit buffer; assembler with fixed slots and a timeout.
- No panics: every failure is an
AisError.
use ;
use ;
use ;
let mut assembler = new;
let now = from_unix_seconds;
let line = b"!AIVDM,1,1,,A,13aEOK?P00PD2wVMdLDRhgvL289?,0*26\r\n";
let Vdm = parse? else ;
let Some = assembler.push? else ;
let PositionReport = decode? else ;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
# Ok::
The navigation algorithms and the list of the other KINAVIS crates are in
kinavis.
Feature flags
std(default) — standard library maths in the kernel.libm— forno_stdtargets:--no-default-features --features libm.serde— serialisation of the messages.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.