1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! `CRadarTargetPositionData` FFI declarations.
//!
//! The handle is an owned `CRadarTargetPositionData*` (created by a position
//! selector, freed with `es_rtposdata_free`); each accessor reads it directly.
use std::ffi::{c_char, c_int};
use crate::EsHandle;
unsafe extern "C" {
/// Free an owned position snapshot.
pub fn es_rtposdata_free(h: EsHandle);
/// `CRadarTargetPositionData::IsValid` — whether the position reference is valid.
pub fn es_rtpos_is_valid(h: EsHandle) -> bool;
/// `CRadarTargetPositionData::IsFPTrackPosition` — whether the position is a
/// reference to the flight-plan track.
pub fn es_rtpos_is_fp_track_position(h: EsHandle) -> bool;
/// `CRadarTargetPositionData::GetReceivedTime` — seconds since the position
/// data was received.
pub fn es_rtpos_received_time(h: EsHandle) -> c_int;
/// `CRadarTargetPositionData::GetPosition` — the lat/lon of the plane, via
/// out-params.
pub fn es_rtpos_position(h: EsHandle, lat: *mut f64, lon: *mut f64);
/// `CRadarTargetPositionData::GetSquawk` — squawk sent by the pilot.
/// Borrowed, NUL-terminated, ANSI.
pub fn es_rtpos_squawk(h: EsHandle) -> *const c_char;
/// `CRadarTargetPositionData::GetTransponderC` — whether the transponder is
/// in C mode.
pub fn es_rtpos_transponder_c(h: EsHandle) -> bool;
/// `CRadarTargetPositionData::GetTransponderI` — whether the transponder is
/// in IDENT mode.
pub fn es_rtpos_transponder_i(h: EsHandle) -> bool;
/// `CRadarTargetPositionData::GetPressureAltitude` — true altitude in feet.
pub fn es_rtpos_pressure_altitude(h: EsHandle) -> c_int;
/// `CRadarTargetPositionData::GetFlightLevel` — altitude on standard
/// pressure, in feet.
pub fn es_rtpos_flight_level(h: EsHandle) -> c_int;
/// `CRadarTargetPositionData::GetReportedGS` — ground speed reported by the
/// pilot client.
pub fn es_rtpos_reported_gs(h: EsHandle) -> c_int;
/// `CRadarTargetPositionData::GetReportedHeading` — heading reported by the
/// pilot client.
pub fn es_rtpos_reported_heading(h: EsHandle) -> c_int;
/// `CRadarTargetPositionData::GetReportedHeadingTrueNorth` — reported
/// heading referenced to true north.
pub fn es_rtpos_reported_heading_true_north(h: EsHandle) -> c_int;
/// `CRadarTargetPositionData::GetReportedPitch` — pitch reported by the
/// pilot client (-180..+180, negative is above horizon).
pub fn es_rtpos_reported_pitch(h: EsHandle) -> c_int;
/// `CRadarTargetPositionData::GetReportedBank` — bank reported by the pilot
/// client (-180..+180, negative is right bank).
pub fn es_rtpos_reported_bank(h: EsHandle) -> c_int;
/// `CRadarTargetPositionData::GetRadarFlags` — OR of the `RADAR_POSITION_*`
/// flags for this position.
pub fn es_rtpos_radar_flags(h: EsHandle) -> c_int;
}