Skip to main content

Crate aivdm_ffi

Crate aivdm_ffi 

Source
Expand description

C FFI bindings for the aivdm AIS decoder.

Exposes a decode-only subset of aivdm’s API: decode a single-fragment !AIVDM/!AIVDO line into an opaque message handle, then read common fields (MMSI, position, speed, course, heading, navigational status) off it. See include/aivdm.h for the generated C declarations.

This crate is a plain (non-no_std) library: it targets host environments linking a shared or static C library, not the embedded no_alloc use case aivdm itself supports. Embedded consumers should use the aivdm Rust crate directly.

Structs§

AivdmMessage
Opaque handle to a decoded AIS message, owned by the caller until freed with aivdm_message_free.

Enums§

AivdmError
Error codes returned by aivdm_decode_line.

Functions§

aivdm_decode_line⚠
Decodes a single, complete, single-fragment !AIVDM/!AIVDO line.
aivdm_message_cog_degrees⚠
Reads course over ground, in degrees, off a message.
aivdm_message_free⚠
Frees a message handle returned by aivdm_decode_line. Passing NULL is a no-op.
aivdm_message_heading_degrees⚠
Reads true heading, in whole degrees (0-359), off a message.
aivdm_message_mmsi⚠
The source station MMSI.
aivdm_message_navigation_status⚠
Reads the raw navigational status code (0-15, ITU-R M.1371 Table 45) off a message.
aivdm_message_position⚠
Reads the position, in decimal degrees, off a message.
aivdm_message_repeat_indicator⚠
How many times a repeater has relayed this message (0-3).
aivdm_message_sog_knots⚠
Reads speed over ground, in knots, off a message.
aivdm_message_type⚠
The ITU-R M.1371 message type number (1-27) of a decoded message.
aivdm_version
The aivdm crate version, as a NUL-terminated, statically allocated string (e.g. "0.1.0"). Do not free.