Updated SDK
Some checks failed
CI / Rust checks (push) Failing after 6s

This commit is contained in:
2024-10-20 12:01:48 +02:00
parent 856656e23b
commit bee3553d9e
9 changed files with 499 additions and 338 deletions

View File

@@ -24,41 +24,41 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
Some(Notification::AirportList(data)) => { Some(Notification::AirportList(data)) => {
for record in data { for record in data {
// The returned list is quite large, so we look for a particular record // The returned list is quite large, so we look for a particular record
if record.icao == "EGSC" { // if record.icao == "EGSC" {
println!("{record:?}"); // println!("{record:?}");
// there's no need to unsubscribe // // there's no need to unsubscribe
// because this is a one-off request, not a subscription // // because this is a one-off request, not a subscription
} // }
} }
} }
Some(Notification::WaypointList(data)) => { Some(Notification::WaypointList(data)) => {
for record in data { for record in data {
// The returned list is quite large, so we look for a particular record // The returned list is quite large, so we look for a particular record
if record.icao == "BRAIN" { // if record.icao == "BRAIN" {
println!("{record:?}"); // println!("{record:?}");
// we've got the entry we're interesting in - we can unsubscribe now // // we've got the entry we're interesting in - we can unsubscribe now
client.unsubscribe_to_facilities(FacilityType::Waypoint)?; // client.unsubscribe_to_facilities(FacilityType::Waypoint)?;
} // }
} }
} }
Some(Notification::NdbList(data)) => { Some(Notification::NdbList(data)) => {
for record in data { for record in data {
// The returned list is quite large, so we look for a particular record // The returned list is quite large, so we look for a particular record
if record.icao == "CAM" { // if record.icao == "CAM" {
println!("{record:?}"); // println!("{record:?}");
// we've got the entry we're interesting in - we can unsubscribe now // // we've got the entry we're interesting in - we can unsubscribe now
client.unsubscribe_to_facilities(FacilityType::NDB)?; // client.unsubscribe_to_facilities(FacilityType::NDB)?;
} // }
} }
} }
Some(Notification::VorList(data)) => { Some(Notification::VorList(data)) => {
for record in data { for record in data {
// The returned list is quite large, so we look for a particular record // The returned list is quite large, so we look for a particular record
if record.icao == "LON" { // if record.icao == "LON" {
println!("{record:?}"); // println!("{record:?}");
// we've got the entry we're interesting in - we can unsubscribe now // // we've got the entry we're interesting in - we can unsubscribe now
client.unsubscribe_to_facilities(FacilityType::VOR)?; // client.unsubscribe_to_facilities(FacilityType::VOR)?;
} // }
} }
} }
_ => (), _ => (),

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
0.20.5.0 0.24.3.0

View File

@@ -44,8 +44,10 @@ impl FacilityType {
/// Information on a single airport in the facilities cache. /// Information on a single airport in the facilities cache.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Airport { pub struct Airport {
/// ICAO of the facility. /// Ident of the facility.
pub icao: String, pub ident: String,
/// Region of the facility.
pub region: String,
/// Latitude of the airport in facility. /// Latitude of the airport in facility.
pub lat: f64, pub lat: f64,
/// Longitude of the airport in facility. /// Longitude of the airport in facility.
@@ -57,8 +59,10 @@ pub struct Airport {
/// Information on a single waypoint in the facilities cache. /// Information on a single waypoint in the facilities cache.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Waypoint { pub struct Waypoint {
/// ICAO of the facility. /// Ident of the facility.
pub icao: String, pub ident: String,
/// Region of the facility.
pub region: String,
/// Latitude of the airport in facility. /// Latitude of the airport in facility.
pub lat: f64, pub lat: f64,
/// Longitude of the airport in facility. /// Longitude of the airport in facility.
@@ -72,8 +76,10 @@ pub struct Waypoint {
/// Information on a single NDB station in the facilities cache. /// Information on a single NDB station in the facilities cache.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct NDB { pub struct NDB {
/// ICAO of the facility. /// Ident of the facility.
pub icao: String, pub ident: String,
/// Region of the facility.
pub region: String,
/// Latitude of the airport in facility. /// Latitude of the airport in facility.
pub lat: f64, pub lat: f64,
/// Longitude of the airport in facility. /// Longitude of the airport in facility.
@@ -89,8 +95,10 @@ pub struct NDB {
/// Information on a single VOR station in the facilities cache. /// Information on a single VOR station in the facilities cache.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct VOR { pub struct VOR {
/// ICAO of the facility. /// Ident of the facility.
pub icao: String, pub ident: String,
/// Region of the facility.
pub region: String,
/// Latitude of the airport in facility. /// Latitude of the airport in facility.
pub lat: f64, pub lat: f64,
/// Longitude of the airport in facility. /// Longitude of the airport in facility.

View File

@@ -242,7 +242,8 @@ impl SimConnect {
let record = unsafe { event.rgData.get_unchecked(i) }; let record = unsafe { event.rgData.get_unchecked(i) };
Airport { Airport {
icao: fixed_c_str_to_string(&record.Icao), ident: fixed_c_str_to_string(&record.Ident),
region: fixed_c_str_to_string(&record.Region),
lat: record.Latitude, lat: record.Latitude,
lon: record.Longitude, lon: record.Longitude,
alt: record.Altitude, alt: record.Altitude,
@@ -270,7 +271,8 @@ impl SimConnect {
let record = unsafe { event.rgData.get_unchecked(i) }; let record = unsafe { event.rgData.get_unchecked(i) };
Waypoint { Waypoint {
icao: fixed_c_str_to_string(&record._base.Icao), ident: fixed_c_str_to_string(&record._base.Ident),
region: fixed_c_str_to_string(&record._base.Region),
lat: record._base.Latitude, lat: record._base.Latitude,
lon: record._base.Longitude, lon: record._base.Longitude,
alt: record._base.Altitude, alt: record._base.Altitude,
@@ -299,7 +301,8 @@ impl SimConnect {
let record = unsafe { event.rgData.get_unchecked(i) }; let record = unsafe { event.rgData.get_unchecked(i) };
NDB { NDB {
icao: fixed_c_str_to_string(&record._base._base.Icao), ident: fixed_c_str_to_string(&record._base._base.Ident),
region: fixed_c_str_to_string(&record._base._base.Region),
lat: record._base._base.Latitude, lat: record._base._base.Latitude,
lon: record._base._base.Longitude, lon: record._base._base.Longitude,
alt: record._base._base.Altitude, alt: record._base._base.Altitude,
@@ -342,7 +345,8 @@ impl SimConnect {
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME; == bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME;
VOR { VOR {
icao: fixed_c_str_to_string(&record._base._base._base.Icao), ident: fixed_c_str_to_string(&record._base._base._base.Ident),
region: fixed_c_str_to_string(&record._base._base._base.Region),
lat: record._base._base._base.Latitude, lat: record._base._base._base.Latitude,
lon: record._base._base._base.Longitude, lon: record._base._base._base.Longitude,
alt: record._base._base._base.Altitude, alt: record._base._base._base.Altitude,