15#define ADSBLIB_VERSION_MAJOR 0
16#define ADSBLIB_VERSION_MINOR 2
17#define ADSBLIB_VERSION_PATCH 0
22const char *adsb_version_string(
void);
28#define ADSB_FRAME_BYTES 14U
29#define ADSB_FRAME_BITS 112U
30#define ADSB_ICAO_MAX 0xFFFFFFU
32#define ADSB_CALLSIGN_LEN 8U
45 ENC_INVALID_LONGITUDE,
50 ENC_INVALID_VERTICAL_RATE,
51 ENC_INVALID_EMERGENCY_STATE,
52 ENC_INVALID_MODE_A_CODE,
53 ENC_INVALID_SELECTED_ALTITUDE,
54 ENC_INVALID_BARO_PRESSURE,
58 ENC_INVALID_OPERATIONAL_SUBTYPE,
59 ENC_INVALID_ADSB_VERSION,
84 char callsign[ADSB_CALLSIGN_LEN + 1];
101 cpr_format_t cpr_format;
114 double longitude_deg;
120 double ground_speed_kt;
124 double ground_track_deg;
126 cpr_format_t cpr_format;
142 double ground_speed_kt;
146 int32_t vertical_rate_fpm;
156 ADSB_EMERGENCY_NONE = 0,
157 ADSB_EMERGENCY_GENERAL,
158 ADSB_EMERGENCY_LIFEGUARD,
159 ADSB_EMERGENCY_MINIMUM_FUEL,
160 ADSB_EMERGENCY_NO_COMMUNICATIONS,
161 ADSB_EMERGENCY_UNLAWFUL_INTERFERENCE,
162 ADSB_EMERGENCY_DOWNED_AIRCRAFT
164} adsb_emergency_state_t;
170 adsb_emergency_state_t emergency_state;
173 uint16_t mode_a_code;
183 ADSB_ALTITUDE_SOURCE_MCP = 0,
184 ADSB_ALTITUDE_SOURCE_FMS = 1
186} adsb_altitude_source_t;
193 int32_t selected_altitude_ft;
194 adsb_altitude_source_t selected_altitude_source;
197 double barometric_pressure_mbar;
199 bool selected_heading_valid;
200 double selected_heading_deg;
207 bool autopilot_engaged;
209 bool altitude_hold_mode;
211 bool tcas_operational;
228 uint16_t capability_class;
229 uint16_t operational_mode;
231 uint8_t adsb_version;
232 bool nic_supplement_a;
236 bool heading_reference_magnetic;
248enc_status_t adsb_encode_identification(
250 uint8_t frame[ADSB_FRAME_BYTES]
256enc_status_t adsb_encode_position(
258 uint8_t frame[ADSB_FRAME_BYTES]
264enc_status_t adsb_encode_surface_position(
266 uint8_t frame[ADSB_FRAME_BYTES]
275enc_status_t adsb_encode_velocity(
277 uint8_t frame[ADSB_FRAME_BYTES]
284enc_status_t adsb_encode_emergency(
286 uint8_t frame[ADSB_FRAME_BYTES]
292enc_status_t adsb_encode_target_state(
294 uint8_t frame[ADSB_FRAME_BYTES]
301enc_status_t adsb_encode_operational_status(
303 uint8_t frame[ADSB_FRAME_BYTES]
328 uint8_t frame[ADSB_FRAME_BYTES]
335 const uint8_t frame[ADSB_FRAME_BYTES]
345uint32_t adsb_cpr_encode_latitude(
353uint32_t adsb_cpr_encode_longitude(
355 double longitude_deg,
375void adsb_frame_to_hex(
376 const uint8_t frame[ADSB_FRAME_BYTES],
383void adsb_frame_clear(
384 uint8_t frame[ADSB_FRAME_BYTES]