Skip to main content

Crate squitter_ffi

Crate squitter_ffi 

Source
Expand description

C FFI bindings for the squitter 1090ES/DF17 (ADS-B extended squitter) decoder.

Exposes a decode-only subset of squitter’s API: decode a single hex frame into an opaque message handle, then read common fields off it (ICAO address, callsign, altitude, raw CPR position fields, ground speed, vertical rate). See include/squitter.h for the generated C declarations.

A single decoded squitter position message never carries a resolved latitude/longitude by itself: CPR position decoding needs one even- and one odd-format frame paired together (see squitter::message::cpr). This FFI surface exposes the raw CPR fields (format, encoded latitude/longitude) rather than hiding that pairing requirement; a C caller wanting resolved positions needs to pair frames itself (or, in Rust, use squitter::message::AirbornePosition::decode’s squitter::message::PositionPair).

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 squitter itself supports. Embedded consumers should use the squitter Rust crate directly.

Structs§

SquitterMessage
Opaque handle to a decoded ADS-B message, owned by the caller until freed with squitter_message_free.

Enums§

SquitterError
Error codes returned by squitter_decode_line.

Functions§

squitter_decode_line⚠
Decodes a single hex-encoded DF17 frame (bare hex or dump1090’s *...; framing).
squitter_message_altitude_feet⚠
Reads barometric altitude, in feet, off a message.
squitter_message_altitude_gnss_meters⚠
Reads GNSS height, in meters, off a message.
squitter_message_callsign⚠
Reads the aircraft callsign into buf as a NUL-terminated string.
squitter_message_cpr⚠
Reads the raw CPR-encoded position fields off a message.
squitter_message_free⚠
Frees a message handle returned by squitter_decode_line. Passing NULL is a no-op.
squitter_message_ground_speed_knots⚠
Reads ground speed, in knots, off a message.
squitter_message_heading_degrees⚠
True airspeed/indicated airspeed heading, in decimal degrees, off an airspeed-subtype airborne velocity message.
squitter_message_icao_address⚠
The transmitting aircraft’s 24-bit ICAO address.
squitter_message_kind⚠
Which message family this handle holds: 1 = identification, 2 = surface position, 3 = airborne position, 4 = airborne velocity, 0 for a NULL handle.
squitter_message_vertical_rate_fpm⚠
Reads vertical rate, in feet/minute (positive = climb), off a message.
squitter_version
The squitter crate version, as a NUL-terminated, statically allocated string (e.g. "0.1.1"). Do not free.