From ac59d70e8af7073c2fc921243ba52445ba6d07fa Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Thu, 21 Dec 2023 16:40:42 +0100 Subject: [PATCH 01/33] Add epsilon parameter to data definition An epsilon parameter is added to the data definition in the SimConnect_AddToDataDefinition function in lib.rs. This replaces the previously hard-coded value of 0.0, allowing for more flexibility depending on the specific requirements of different use cases. --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 0f673ea..d7c46c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -144,6 +144,7 @@ impl SimConnector { units_name: &str, datum_type: SIMCONNECT_DATATYPE, datum_id: DWORD, + epsilon: f32, ) -> bool { unsafe { SimConnect_AddToDataDefinition( @@ -152,7 +153,7 @@ impl SimConnector { as_c_string!(datum_name), as_c_string!(units_name), datum_type, - 0.0, + epsilon, datum_id, ) == 0 } From b694463c1f7ab47e8f4df674ea1f5c580e6e5843 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Thu, 21 Dec 2023 16:43:31 +0100 Subject: [PATCH 02/33] upped v --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 0c24948..990c59a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "simconnect" license = "MIT" description = "Rust bindings for SimConnect" -version = "0.2.0" +version = "0.2.1" authors = ["Connor T"] edition = "2018" From cdafdf23e8933cd955bb38e549caf2c4244fcb1a Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Thu, 21 Dec 2023 16:50:36 +0100 Subject: [PATCH 03/33] Add optional epsilon parameter to add_data_definition functions The `add_data_definition` functions in `src/lib.rs` now accept an optional 'epsilon' parameter as opposed to a mandatory float. This modification enhances versatility by accommodating scenarios where 'epsilon' doesn't require a specific value and defaults to 0.0 if not explicitly given. --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d7c46c0..93f0806 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,9 +27,9 @@ struct DataStruct { let mut conn = simconnect::SimConnector::new(); conn.connect("Simple Program"); // Intialize connection with SimConnect -conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX); // Assign a sim variable to a client defined id -conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX); -conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX); //define_id, units, data_type, datum_id +conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); // Assign a sim variable to a client defined id +conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); +conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); //define_id, units, data_type, datum_id, epsilon (per X change in sim variable, send data) conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, 0, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft loop { @@ -153,7 +153,7 @@ impl SimConnector { as_c_string!(datum_name), as_c_string!(units_name), datum_type, - epsilon, + 0.0, datum_id, ) == 0 } From 75538ba0e6d73729d5ef05603590fc28db7b6156 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Thu, 21 Dec 2023 17:00:50 +0100 Subject: [PATCH 04/33] Updated add_data_definition method to include optional epsilon parameter The add_data_definition method has been updated to include an optional epsilon parameter. This parameter is used to set a threshold for updates, providing more flexibility for data definition. If no specific value for epsilon is provided, it defaults to 0.0. --- Readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 5f8b21d..f2f9acc 100644 --- a/Readme.md +++ b/Readme.md @@ -29,9 +29,9 @@ struct DataStruct { let mut conn = simconnect::SimConnector::new(); conn.connect("Simple Program"); // Intialize connection with SimConnect -conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX); // Assign a sim variable to a client defined id -conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX); -conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX); //define_id, units, data_type, datum_id +conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); // Assign a sim variable to a client defined id +conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); +conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 1.0); //define_id, units, data_type, datum_id, epsilon (update threshold) conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, 0, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft loop { From 14b1974f8435798863ae35ca253a89a2f917c4e9 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Thu, 21 Dec 2023 17:05:28 +0100 Subject: [PATCH 05/33] Update simconnect dependency in README The simconnect dependency version in the README file is updated from "0.2.0" to "0.2.1". This reflects the current version the project is using and ensures consistency across all parts of the documentation. --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index f2f9acc..bd692ee 100644 --- a/Readme.md +++ b/Readme.md @@ -3,7 +3,7 @@ Add this to your `Cargo.toml` ```toml [dependencies] -simconnect = "0.2.0" +simconnect = "0.2.1" ``` ## Building From fe44a42f9f805a5bcafbef69cb1f8dd112d08a98 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Thu, 21 Dec 2023 20:13:28 +0100 Subject: [PATCH 06/33] Update unsafe block code in Readme and lib.rs The handling of raw pointers and data transmutation in the unsafe blocks has been refactored for better safety and code clarity. Instead of using transmute_copy, it now uses std::ptr::addr_of and std::ptr::read_unaligned to obtain data values. --- Readme.md | 6 ++++-- src/lib.rs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index bd692ee..9483f09 100644 --- a/Readme.md +++ b/Readme.md @@ -40,8 +40,10 @@ loop { unsafe { match data.dwDefineID { 0 => { - let sim_data: DataStruct = transmute_copy(&data.dwData); - println!("{:?} {:?} {:?}", sim_data.lat, sim_data.lon, sim_data.alt); + let sim_data = std::ptr::addr_of!(data.dwData); + let sim_data_ptr = sim_data as *const DataStruct; + let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); + println!("{:?} {:?} {:?}", sim_data_value.lat, sim_data_value.lon, sim_data_value.alt); }, _ => () } diff --git a/src/lib.rs b/src/lib.rs index 93f0806..c8b197d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,8 +38,10 @@ loop { unsafe { match data.dwDefineID { 0 => { - let sim_data: DataStruct = transmute_copy(&data.dwData); - println!("{:?} {:?} {:?}", sim_data.lat, sim_data.lon, sim_data.alt); + let sim_data = std::ptr::addr_of!(data.dwData); + let sim_data_ptr = sim_data as *const DataStruct; + let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); + println!("{:?} {:?} {:?}", sim_data_value.lat, sim_data_value.lon, sim_data_value.alt); }, _ => () } From c70a077d327177ff9d69442b5a137ec1e98a0e15 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Sun, 24 Dec 2023 11:50:58 +0100 Subject: [PATCH 07/33] Update simconnect version and add new examples Updated `simconnect` package from version `0.2.0` to `0.2.1` in `Cargo.lock` file. Introduced two new example scripts `aircraft_updates_on_change` and `aircraft_updates` to demonstrate usage of the libraries. Also, made a minor change in `lib.rs` on how `epsilon` is handled inside `add_data_definition` function. --- Cargo.lock | 2 +- Cargo.toml | 8 ++ examples/aircraft_updates/main.rs | 38 ++++++++ examples/aircraft_updates_on_change/main.rs | 100 ++++++++++++++++++++ src/lib.rs | 2 +- 5 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 examples/aircraft_updates/main.rs create mode 100644 examples/aircraft_updates_on_change/main.rs diff --git a/Cargo.lock b/Cargo.lock index dd19a03..d371c37 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -197,7 +197,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "simconnect" -version = "0.2.0" +version = "0.2.1" dependencies = [ "bindgen", ] diff --git a/Cargo.toml b/Cargo.toml index 990c59a..453fca5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,14 @@ authors = ["Connor T"] edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[example]] +name = "aircraft_updates_on_change_demo" +path = "examples/aircraft_updates_on_change/main.rs" + +[[example]] +name = "aircraft_updates" +path = "examples/aircraft_updates/main.rs" + [build-dependencies] bindgen = "0.65" diff --git a/examples/aircraft_updates/main.rs b/examples/aircraft_updates/main.rs new file mode 100644 index 0000000..68700a1 --- /dev/null +++ b/examples/aircraft_updates/main.rs @@ -0,0 +1,38 @@ +use simconnect; +use std::time::Duration; +use std::thread::sleep; + +struct DataStruct { + lat: f64, + lon: f64, + alt: f64, +} +fn main() { + let mut conn = simconnect::SimConnector::new(); + conn.connect("Simple Program"); // Intialize connection with SimConnect + conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); // Assign a sim variable to a client defined id + conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); + conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 1.0); //define_id, units, data_type, datum_id, epsilon (update threshold) + conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, 0, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft + + loop { + match conn.get_next_message() { + Ok(simconnect::DispatchResult::SimobjectData(data)) => { + unsafe { + match data.dwDefineID { + 0 => { + let sim_data = std::ptr::addr_of!(data.dwData); + let sim_data_ptr = sim_data as *const DataStruct; + let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); + println!("{:?} {:?} {:?}", sim_data_value.lat, sim_data_value.lon, sim_data_value.alt); + }, + _ => () + } + } + }, + _ => () + } + + sleep(Duration::from_millis(16)); // Will use up lots of CPU if this is not included, as get_next_message() is non-blocking + } +} \ No newline at end of file diff --git a/examples/aircraft_updates_on_change/main.rs b/examples/aircraft_updates_on_change/main.rs new file mode 100644 index 0000000..3701ba3 --- /dev/null +++ b/examples/aircraft_updates_on_change/main.rs @@ -0,0 +1,100 @@ +use simconnect; +use simconnect::DWORD; +use std::time::Duration; +use std::thread::sleep; + +// To allign the memory we have to set a fixed max size to the returned variables from the game +const MAX_RETURNED_ITEMS: usize = 255; + +#[repr(C, packed)] +struct KeyValuePairFloat { + id: DWORD, + value: f64 +} +struct DataFloatStruct { + data: [KeyValuePairFloat; MAX_RETURNED_ITEMS] +} +#[repr(C, packed)] +struct KeyValuePairString { + id: DWORD, + // Strings get returned as max 255 bytes + value: [u8; 255], +} + +struct DataStringStruct { + data: [KeyValuePairString; MAX_RETURNED_ITEMS] +} + +fn main() { + let mut conn = simconnect::SimConnector::new(); + conn.connect("Program that returns data on changes"); // Intialize connection with SimConnect + + // Here we define all our variable that get returned as floats + // (including integers, the memory allignment will handle the) + conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 1, 1.0); // Assign a sim variable to a client defined id + conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 2, 1.0); + conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 3, 1.0); //define_id, units, data_type, datum_id, epsilon (update threshold) + + // Here we define all our variabes that get returned as Strings + // Notice how the define_id differs from the float values + // This variable returns the name of the plane found in the aircraft.cfg (max 255 characters) + conn.add_data_definition(1, "TITLE", "", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_STRING256, 4, 0.0); + + // Request the data from define_id 0 (floats) and only return the value if the value has changed including the id we passed in the datum_id + // So if the latitude changes we receive: key 1 value X, if the longitude changes we receive key 2 value X. + // If both have changed we receive both variables in an packed array. + // The amount of variables returned is defined in the data.dwDefineCount of the response + conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED | simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft + // Request the data from our define_id 1 (strings) + conn.request_data_on_sim_object(1, 1, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED | simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft + + loop { + match conn.get_next_message() { + Ok(simconnect::DispatchResult::SimobjectData(data)) => { + unsafe { + match data.dwDefineID { + 0 => { + let sim_data = std::ptr::addr_of!(data.dwData); + let sim_data_ptr = sim_data as *const DataFloatStruct; + let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); + // The amount of floats received from the sim + let count = data.dwDefineCount as usize; + + // itterate through the array of data structs + // To allign the memory we have allocated an array of 255 elements to the datastruct + // The game might return 255 or 2 values + // To only itterate over valid elements in the array + // We are able to leverage the dwDefineCount to loop over valid elements + for i in 0..count { + let value = sim_data_value.data[i].value; + let key = sim_data_value.data[i].id; + println!("{}", key.to_string()); + println!("{}", value); + } + }, + 1 => { + let sim_data = std::ptr::addr_of!(data.dwData); + let sim_data_ptr = sim_data as *const DataStringStruct; + // The amount of strings received from the sim + let count = data.dwDefineCount as usize; + let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); + for i in 0..count { + //since we only defined 1 string variable the key returned should be 4 + let key = sim_data_value.data[0].id; + //byte array to string + let string = std::str::from_utf8(&sim_data_value.data[i].value).unwrap(); + println!("{}", key.to_string()); + println!("{}", string); + } + + } + _ => () + } + } + }, + _ => () + } + + sleep(Duration::from_millis(16)); // Will use up lots of CPU if this is not included, as get_next_message() is non-blocking + } +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index c8b197d..b1357c3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -155,7 +155,7 @@ impl SimConnector { as_c_string!(datum_name), as_c_string!(units_name), datum_type, - 0.0, + epsilon, datum_id, ) == 0 } From 574f5d6c33532fa3a2ee70d7f472eadfe9aeef5f Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Sun, 24 Dec 2023 11:55:16 +0100 Subject: [PATCH 08/33] Improve data update definition in aircraft example Updated how data is defined in aircraft_updates_on_change example. Epsilon is now defined to control the frequency of updates from the game, reducing the amount of data sent to the client. For instance, latitude and longitude values update every degree, whereas altitude updates are now received every 100 feet, as opposed to every foot previously. --- examples/aircraft_updates_on_change/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/aircraft_updates_on_change/main.rs b/examples/aircraft_updates_on_change/main.rs index 3701ba3..7a09fdd 100644 --- a/examples/aircraft_updates_on_change/main.rs +++ b/examples/aircraft_updates_on_change/main.rs @@ -31,9 +31,13 @@ fn main() { // Here we define all our variable that get returned as floats // (including integers, the memory allignment will handle the) + // The epsilon determines per X change do we want to receive an update from the game + // This greatly reduces the amount of data send to your client + // In this example the lat, lon values get an update every degree while the altitude only gets an + // update every 100 feet conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 1, 1.0); // Assign a sim variable to a client defined id conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 2, 1.0); - conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 3, 1.0); //define_id, units, data_type, datum_id, epsilon (update threshold) + conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 3, 100.0); //define_id, units, data_type, datum_id, epsilon (update threshold) // Here we define all our variabes that get returned as Strings // Notice how the define_id differs from the float values From 7f557efab0596603d03000e014ad3e5033507690 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Sun, 24 Dec 2023 11:57:43 +0100 Subject: [PATCH 09/33] Update aircraft data request to prevent overwrite Added comments in the aircraft_updates_on_change example to explain how different requests need to have unique request_id values in order to prevent data overwrite. Also included a pointer about the way sim_data_ptr uses the passed define_id for better clarity. --- examples/aircraft_updates_on_change/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/aircraft_updates_on_change/main.rs b/examples/aircraft_updates_on_change/main.rs index 7a09fdd..8fcfd27 100644 --- a/examples/aircraft_updates_on_change/main.rs +++ b/examples/aircraft_updates_on_change/main.rs @@ -50,6 +50,7 @@ fn main() { // The amount of variables returned is defined in the data.dwDefineCount of the response conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED | simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft // Request the data from our define_id 1 (strings) + // The request_id has to differ from the float request. Or else it will overwrite the previous request conn.request_data_on_sim_object(1, 1, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED | simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft loop { @@ -57,6 +58,7 @@ fn main() { Ok(simconnect::DispatchResult::SimobjectData(data)) => { unsafe { match data.dwDefineID { + //Here we match the define_id we've passed using the request_data_on_sim_object 0 => { let sim_data = std::ptr::addr_of!(data.dwData); let sim_data_ptr = sim_data as *const DataFloatStruct; From 2a4e742fab31b32b99f4bef138efe7128ec88ed6 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Sun, 24 Dec 2023 11:59:27 +0100 Subject: [PATCH 10/33] Add structured definitions to aircraft example Expanded on the usage of KeyValuePairFloat and the need for unique request_id values in the aircraft_updates_on_change example. Clarified how define_id is used with simconnect data by adding detailed comments, helping prevent potential overwrite of data. --- examples/aircraft_updates_on_change/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/aircraft_updates_on_change/main.rs b/examples/aircraft_updates_on_change/main.rs index 8fcfd27..c4e08ae 100644 --- a/examples/aircraft_updates_on_change/main.rs +++ b/examples/aircraft_updates_on_change/main.rs @@ -6,6 +6,8 @@ use std::thread::sleep; // To allign the memory we have to set a fixed max size to the returned variables from the game const MAX_RETURNED_ITEMS: usize = 255; +// Rust will add padding to the inner parts of a struct if it isn't marked as packed +// The way simconnect returns values is unalligned data in C style #[repr(C, packed)] struct KeyValuePairFloat { id: DWORD, From e2e18d01485bf780cb94d5caf2894938db510fb3 Mon Sep 17 00:00:00 2001 From: Connor T <33789660+Sequal32@users.noreply.github.com> Date: Tue, 26 Dec 2023 03:46:50 -0500 Subject: [PATCH 11/33] Update Readme.md --- Readme.md | 61 ++++++++++++++++--------------------------------------- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/Readme.md b/Readme.md index 9483f09..851ce3c 100644 --- a/Readme.md +++ b/Readme.md @@ -11,49 +11,24 @@ simconnect = "0.2.1" 1. Install [CLang](https://clang.llvm.org/get_started.html). More information available at the [Rust Bindgen Documentation](https://rust-lang.github.io/rust-bindgen/requirements.html). 2. run `cargo build` -3. `use simconnect` - -### Sample Program -*Note: You must have SimConnect.dll in your current working directory or in the exe directory to be able to successfully use SimConnect* -```rust -use simconnect; -use std::time::Duration; -use std::thread::sleep; -use std::mem::transmute_copy; - -struct DataStruct { - lat: f64, - lon: f64, - alt: f64, -} - -let mut conn = simconnect::SimConnector::new(); -conn.connect("Simple Program"); // Intialize connection with SimConnect -conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); // Assign a sim variable to a client defined id -conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); -conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 1.0); //define_id, units, data_type, datum_id, epsilon (update threshold) -conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, 0, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft - -loop { - match conn.get_next_message() { - Ok(simconnect::DispatchResult::SimobjectData(data)) => { - unsafe { - match data.dwDefineID { - 0 => { - let sim_data = std::ptr::addr_of!(data.dwData); - let sim_data_ptr = sim_data as *const DataStruct; - let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); - println!("{:?} {:?} {:?}", sim_data_value.lat, sim_data_value.lon, sim_data_value.alt); - }, - _ => () - } - } - }, - _ => () - } - - sleep(Duration::from_millis(16)); // Will use up lots of CPU if this is not included, as get_next_message() is non-blocking -} +3. Add `use simconnect` at the top of your file + +## Example +Read float position data + +``` +cargo run --example aircraft_updates +``` + +Requests tagged data with thresholds from SimConnect and reads floats/strings ``` +cargo run --example aircraft_updates_on_change_demo +``` + +*You must have SimConnect.dll in the same directory as the compiled exe for it to run (eg. in )* + +## Building +*The SimConnect.dll is included in this repository, but might not be up to date* + ### Remarks I have not tested every single function from the api. If you find an error, feel free to make an issue or a pull request. From 4f51b6ab4681c2bfb78129aad3e1105709211ba9 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Tue, 26 Dec 2023 11:56:38 +0100 Subject: [PATCH 12/33] Update code comments and fix typographical issues This commit rectifies typographical errors and improves the readability of code comments in both the README file and example files. Detailed instructions regarding the execution of examples with SimConnect.dll have been included. Additionally, the datastruct memory allocation has been adjusted for optimal performance and accuracy. --- Cargo.toml | 2 +- Readme.md | 13 ++++++++----- examples/aircraft_updates/main.rs | 3 +-- examples/aircraft_updates_on_change/main.rs | 18 ++++++++---------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 453fca5..bbd4c6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [[example]] -name = "aircraft_updates_on_change_demo" +name = "aircraft_updates_on_change" path = "examples/aircraft_updates_on_change/main.rs" [[example]] diff --git a/Readme.md b/Readme.md index 9483f09..74c7039 100644 --- a/Readme.md +++ b/Readme.md @@ -7,7 +7,7 @@ simconnect = "0.2.1" ``` ## Building -*The SimConnect binaries are included within this repository, but they may not be up to date.* +*The SimConnect binaries are included within this repository, but they may not be up-to-date.* 1. Install [CLang](https://clang.llvm.org/get_started.html). More information available at the [Rust Bindgen Documentation](https://rust-lang.github.io/rust-bindgen/requirements.html). 2. run `cargo build` @@ -28,11 +28,11 @@ struct DataStruct { } let mut conn = simconnect::SimConnector::new(); -conn.connect("Simple Program"); // Intialize connection with SimConnect +conn.connect("Simple Program"); // Initialize connection with SimConnect conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); // Assign a sim variable to a client defined id conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 1.0); //define_id, units, data_type, datum_id, epsilon (update threshold) -conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, 0, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft +conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, 0, 0, 0, 0); //request_id, define_id, object_id (user), period, flags, origin, interval, limit - tells Simconnect to send data for the defined id and on the user aircraft loop { match conn.get_next_message() { @@ -40,8 +40,7 @@ loop { unsafe { match data.dwDefineID { 0 => { - let sim_data = std::ptr::addr_of!(data.dwData); - let sim_data_ptr = sim_data as *const DataStruct; + let sim_data_ptr = std::ptr::addr_of!(data.dwData) as *const DataStruct; let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); println!("{:?} {:?} {:?}", sim_data_value.lat, sim_data_value.lon, sim_data_value.alt); }, @@ -55,5 +54,9 @@ loop { sleep(Duration::from_millis(16)); // Will use up lots of CPU if this is not included, as get_next_message() is non-blocking } ``` +### Examples +You can find examples in the `examples` directory. To run them, you must have SimConnect.dll in your current working directory or in the exe directory. +* `cargo run --example aircraft_updates` - Prints the user aircraft's latitude, longitude, and altitude on a interval +* `cargo run --example aircraft_updates_on_change` - Prints the user aircraft's latitude, longitude, and altitude when the values change in SimConnect ### Remarks I have not tested every single function from the api. If you find an error, feel free to make an issue or a pull request. diff --git a/examples/aircraft_updates/main.rs b/examples/aircraft_updates/main.rs index 68700a1..41fdd2b 100644 --- a/examples/aircraft_updates/main.rs +++ b/examples/aircraft_updates/main.rs @@ -21,8 +21,7 @@ fn main() { unsafe { match data.dwDefineID { 0 => { - let sim_data = std::ptr::addr_of!(data.dwData); - let sim_data_ptr = sim_data as *const DataStruct; + let sim_data_ptr = std::ptr::addr_of!(data.dwData) as *const DataStruct; let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); println!("{:?} {:?} {:?}", sim_data_value.lat, sim_data_value.lon, sim_data_value.alt); }, diff --git a/examples/aircraft_updates_on_change/main.rs b/examples/aircraft_updates_on_change/main.rs index c4e08ae..0c4972c 100644 --- a/examples/aircraft_updates_on_change/main.rs +++ b/examples/aircraft_updates_on_change/main.rs @@ -7,7 +7,7 @@ use std::thread::sleep; const MAX_RETURNED_ITEMS: usize = 255; // Rust will add padding to the inner parts of a struct if it isn't marked as packed -// The way simconnect returns values is unalligned data in C style +// The way Simconnect returns values is unaligned data in C style #[repr(C, packed)] struct KeyValuePairFloat { id: DWORD, @@ -32,7 +32,7 @@ fn main() { conn.connect("Program that returns data on changes"); // Intialize connection with SimConnect // Here we define all our variable that get returned as floats - // (including integers, the memory allignment will handle the) + // (including integers, which the memory alignment will handle) // The epsilon determines per X change do we want to receive an update from the game // This greatly reduces the amount of data send to your client // In this example the lat, lon values get an update every degree while the altitude only gets an @@ -60,18 +60,17 @@ fn main() { Ok(simconnect::DispatchResult::SimobjectData(data)) => { unsafe { match data.dwDefineID { - //Here we match the define_id we've passed using the request_data_on_sim_object + // Here we match the define_id we've passed using the request_data_on_sim_object 0 => { - let sim_data = std::ptr::addr_of!(data.dwData); - let sim_data_ptr = sim_data as *const DataFloatStruct; + let sim_data_ptr = std::ptr::addr_of!(data.dwData) as *const DataFloatStruct; let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); // The amount of floats received from the sim let count = data.dwDefineCount as usize; - // itterate through the array of data structs - // To allign the memory we have allocated an array of 255 elements to the datastruct + // iterate through the array of data structs + // To align the memory we have allocated an array of 255 elements to the datastruct // The game might return 255 or 2 values - // To only itterate over valid elements in the array + // To only iterate over valid elements in the array // We are able to leverage the dwDefineCount to loop over valid elements for i in 0..count { let value = sim_data_value.data[i].value; @@ -81,8 +80,7 @@ fn main() { } }, 1 => { - let sim_data = std::ptr::addr_of!(data.dwData); - let sim_data_ptr = sim_data as *const DataStringStruct; + let sim_data_ptr = std::ptr::addr_of!(data.dwData) as *const DataStringStruct; // The amount of strings received from the sim let count = data.dwDefineCount as usize; let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); From 01253eeacf7b51ae632dd46030c656f0d78cd714 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Tue, 26 Dec 2023 11:58:52 +0100 Subject: [PATCH 13/33] Update terminology in Readme.md This commit corrects typographical errors in the Readme.md file. It also enhances the instructions on building the code and running the examples to help users understand them easily. Hyphenations are also updated to ensure grammatical correctness. --- Readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index eedeccf..a1b0d6f 100644 --- a/Readme.md +++ b/Readme.md @@ -7,7 +7,7 @@ simconnect = "0.2.1" ``` ## Building -*The SimConnect binaries are included within this repository, but they may not be up to date.* +*The SimConnect binaries are included within this repository, but they may not be up-to-date.* 1. Install [CLang](https://clang.llvm.org/get_started.html). More information available at the [Rust Bindgen Documentation](https://rust-lang.github.io/rust-bindgen/requirements.html). 2. run `cargo build` @@ -25,10 +25,10 @@ Requests tagged data with thresholds from SimConnect and reads floats/strings cargo run --example aircraft_updates_on_change ``` -*You must have SimConnect.dll in the same directory as the compiled exe for it to run (eg. in )* +*You must have SimConnect.dll in the same directory as the compiled exe for it to run (e.g. in )* ## Building -*The SimConnect.dll is included in this repository, but might not be up to date* +*The SimConnect.dll is included in this repository, but might not be up-to-date* ### Remarks I have not tested every single function from the api. If you find an error, feel free to make an issue or a pull request. From 36cff2c83aee074131f2ba17e28d5008171f597b Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Tue, 26 Dec 2023 12:01:32 +0100 Subject: [PATCH 14/33] Fix typo in connect function comment in main.rs This commit corrects a typographical error in the inline comment when connecting with SimConnect in main.rs within the aircraft_updates_on_change directory. Instead of "Intialize", the correct spelling "Initialize" is now used. --- examples/aircraft_updates_on_change/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/aircraft_updates_on_change/main.rs b/examples/aircraft_updates_on_change/main.rs index 0c4972c..f728f6a 100644 --- a/examples/aircraft_updates_on_change/main.rs +++ b/examples/aircraft_updates_on_change/main.rs @@ -29,7 +29,7 @@ struct DataStringStruct { fn main() { let mut conn = simconnect::SimConnector::new(); - conn.connect("Program that returns data on changes"); // Intialize connection with SimConnect + conn.connect("Program that returns data on changes"); // Initialize connection with SimConnect // Here we define all our variable that get returned as floats // (including integers, which the memory alignment will handle) From 3215639b3fb67896f33fd577ab1664702691cf61 Mon Sep 17 00:00:00 2001 From: Sequal32 Date: Wed, 27 Dec 2023 01:07:33 -0500 Subject: [PATCH 15/33] fix: cleanup clippy warnings --- examples/aircraft_updates/main.rs | 71 ++++++--- examples/aircraft_updates_on_change/main.rs | 157 +++++++++++++------- src/lib.rs | 101 ++++++++----- 3 files changed, 223 insertions(+), 106 deletions(-) diff --git a/examples/aircraft_updates/main.rs b/examples/aircraft_updates/main.rs index 41fdd2b..776b2ac 100644 --- a/examples/aircraft_updates/main.rs +++ b/examples/aircraft_updates/main.rs @@ -1,6 +1,7 @@ -use simconnect; -use std::time::Duration; use std::thread::sleep; +use std::time::Duration; + +use simconnect::DispatchResult; struct DataStruct { lat: f64, @@ -10,28 +11,62 @@ struct DataStruct { fn main() { let mut conn = simconnect::SimConnector::new(); conn.connect("Simple Program"); // Intialize connection with SimConnect - conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); // Assign a sim variable to a client defined id - conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 0.0); - conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, u32::MAX, 1.0); //define_id, units, data_type, datum_id, epsilon (update threshold) - conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, 0, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft + conn.add_data_definition( + 0, + "PLANE LATITUDE", + "Degrees", + simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, + u32::MAX, + 0.0, + ); // Assign a sim variable to a client defined id + conn.add_data_definition( + 0, + "PLANE LONGITUDE", + "Degrees", + simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, + u32::MAX, + 0.0, + ); + conn.add_data_definition( + 0, + "PLANE ALTITUDE", + "Feet", + simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, + u32::MAX, + 1.0, + ); //define_id, units, data_type, datum_id, epsilon (update threshold) + conn.request_data_on_sim_object( + 0, + 0, + 0, + simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, + 0, + 0, + 0, + 0, + ); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft loop { match conn.get_next_message() { - Ok(simconnect::DispatchResult::SimobjectData(data)) => { - unsafe { - match data.dwDefineID { - 0 => { - let sim_data_ptr = std::ptr::addr_of!(data.dwData) as *const DataStruct; - let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); - println!("{:?} {:?} {:?}", sim_data_value.lat, sim_data_value.lon, sim_data_value.alt); - }, - _ => () - } + Ok(DispatchResult::SimobjectData(data)) => unsafe { + if data.dwDefineID == 0 { + let sim_data_ptr = std::ptr::addr_of!(data.dwData) as *const DataStruct; + let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); + println!( + "{:?} {:?} {:?}", + sim_data_value.lat, sim_data_value.lon, sim_data_value.alt + ); } }, - _ => () + Ok(DispatchResult::Open(_)) => { + println!("Connected to simulator."); + } + Ok(DispatchResult::Quit(_)) => { + println!("Disconnected from simulator."); + } + _ => (), } sleep(Duration::from_millis(16)); // Will use up lots of CPU if this is not included, as get_next_message() is non-blocking } -} \ No newline at end of file +} diff --git a/examples/aircraft_updates_on_change/main.rs b/examples/aircraft_updates_on_change/main.rs index f728f6a..49c71dc 100644 --- a/examples/aircraft_updates_on_change/main.rs +++ b/examples/aircraft_updates_on_change/main.rs @@ -1,7 +1,6 @@ -use simconnect; -use simconnect::DWORD; -use std::time::Duration; +use simconnect::{DispatchResult, DWORD}; use std::thread::sleep; +use std::time::Duration; // To allign the memory we have to set a fixed max size to the returned variables from the game const MAX_RETURNED_ITEMS: usize = 255; @@ -11,10 +10,10 @@ const MAX_RETURNED_ITEMS: usize = 255; #[repr(C, packed)] struct KeyValuePairFloat { id: DWORD, - value: f64 + value: f64, } struct DataFloatStruct { - data: [KeyValuePairFloat; MAX_RETURNED_ITEMS] + data: [KeyValuePairFloat; MAX_RETURNED_ITEMS], } #[repr(C, packed)] struct KeyValuePairString { @@ -24,7 +23,7 @@ struct KeyValuePairString { } struct DataStringStruct { - data: [KeyValuePairString; MAX_RETURNED_ITEMS] + data: [KeyValuePairString; MAX_RETURNED_ITEMS], } fn main() { @@ -37,70 +36,124 @@ fn main() { // This greatly reduces the amount of data send to your client // In this example the lat, lon values get an update every degree while the altitude only gets an // update every 100 feet - conn.add_data_definition(0, "PLANE LATITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 1, 1.0); // Assign a sim variable to a client defined id - conn.add_data_definition(0, "PLANE LONGITUDE", "Degrees", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 2, 1.0); - conn.add_data_definition(0, "PLANE ALTITUDE", "Feet", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, 3, 100.0); //define_id, units, data_type, datum_id, epsilon (update threshold) + conn.add_data_definition( + 0, + "PLANE LATITUDE", + "Degrees", + simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, + 1, + 1.0, + ); // Assign a sim variable to a client defined id + conn.add_data_definition( + 0, + "PLANE LONGITUDE", + "Degrees", + simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, + 2, + 1.0, + ); + conn.add_data_definition( + 0, + "PLANE ALTITUDE", + "Feet", + simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_FLOAT64, + 3, + 100.0, + ); //define_id, units, data_type, datum_id, epsilon (update threshold) // Here we define all our variabes that get returned as Strings // Notice how the define_id differs from the float values // This variable returns the name of the plane found in the aircraft.cfg (max 255 characters) - conn.add_data_definition(1, "TITLE", "", simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_STRING256, 4, 0.0); + conn.add_data_definition( + 1, + "TITLE", + "", + simconnect::SIMCONNECT_DATATYPE_SIMCONNECT_DATATYPE_STRING256, + 4, + 0.0, + ); // Request the data from define_id 0 (floats) and only return the value if the value has changed including the id we passed in the datum_id // So if the latitude changes we receive: key 1 value X, if the longitude changes we receive key 2 value X. // If both have changed we receive both variables in an packed array. // The amount of variables returned is defined in the data.dwDefineCount of the response - conn.request_data_on_sim_object(0, 0, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED | simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft - // Request the data from our define_id 1 (strings) - // The request_id has to differ from the float request. Or else it will overwrite the previous request - conn.request_data_on_sim_object(1, 1, 0, simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED | simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED, 0, 0, 0); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft + conn.request_data_on_sim_object( + 0, + 0, + 0, + simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, + simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED + | simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED, + 0, + 0, + 0, + ); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft + // Request the data from our define_id 1 (strings) + // The request_id has to differ from the float request. Or else it will overwrite the previous request + conn.request_data_on_sim_object( + 1, + 1, + 0, + simconnect::SIMCONNECT_PERIOD_SIMCONNECT_PERIOD_SIM_FRAME, + simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED + | simconnect::SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED, + 0, + 0, + 0, + ); //request_id, define_id, object_id (user), period, falgs, origin, interval, limit - tells simconnect to send data for the defined id and on the user aircraft loop { match conn.get_next_message() { - Ok(simconnect::DispatchResult::SimobjectData(data)) => { - unsafe { - match data.dwDefineID { - // Here we match the define_id we've passed using the request_data_on_sim_object - 0 => { - let sim_data_ptr = std::ptr::addr_of!(data.dwData) as *const DataFloatStruct; - let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); - // The amount of floats received from the sim - let count = data.dwDefineCount as usize; - - // iterate through the array of data structs - // To align the memory we have allocated an array of 255 elements to the datastruct - // The game might return 255 or 2 values - // To only iterate over valid elements in the array - // We are able to leverage the dwDefineCount to loop over valid elements - for i in 0..count { - let value = sim_data_value.data[i].value; - let key = sim_data_value.data[i].id; - println!("{}", key.to_string()); - println!("{}", value); - } - }, - 1 => { - let sim_data_ptr = std::ptr::addr_of!(data.dwData) as *const DataStringStruct; - // The amount of strings received from the sim - let count = data.dwDefineCount as usize; - let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); - for i in 0..count { - //since we only defined 1 string variable the key returned should be 4 - let key = sim_data_value.data[0].id; - //byte array to string - let string = std::str::from_utf8(&sim_data_value.data[i].value).unwrap(); - println!("{}", key.to_string()); - println!("{}", string); - } + Ok(DispatchResult::SimobjectData(data)) => unsafe { + match data.dwDefineID { + // Here we match the define_id we've passed using the request_data_on_sim_object + 0 => { + let sim_data_ptr = + std::ptr::addr_of!(data.dwData) as *const DataFloatStruct; + let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); + // The amount of floats received from the sim + let count = data.dwDefineCount as usize; + // iterate through the array of data structs + // To align the memory we have allocated an array of 255 elements to the datastruct + // The game might return 255 or 2 values + // To only iterate over valid elements in the array + // We are able to leverage the dwDefineCount to loop over valid elements + for i in 0..count { + let value = sim_data_value.data[i].value; + let key = sim_data_value.data[i].id; + println!("{}", key); + println!("{}", value); } - _ => () } + 1 => { + let sim_data_ptr = + std::ptr::addr_of!(data.dwData) as *const DataStringStruct; + // The amount of strings received from the sim + let count = data.dwDefineCount as usize; + let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); + for i in 0..count { + //since we only defined 1 string variable the key returned should be 4 + let key = sim_data_value.data[0].id; + //byte array to string + let string = + std::str::from_utf8(&sim_data_value.data[i].value).unwrap(); + println!("{}", key); + println!("{}", string); + } + } + _ => (), } }, - _ => () + Ok(DispatchResult::Open(_)) => { + println!("Connected to simulator."); + } + Ok(DispatchResult::Quit(_)) => { + println!("Disconnected from simulator."); + } + _ => (), } sleep(Duration::from_millis(16)); // Will use up lots of CPU if this is not included, as get_next_message() is non-blocking } -} \ No newline at end of file +} diff --git a/src/lib.rs b/src/lib.rs index b1357c3..c1a043e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,17 +59,12 @@ loop { #![allow(non_camel_case_types)] #![allow(non_snake_case)] +use std::ffi::CString; use std::mem::transmute_copy; use std::ptr; include!(concat!(env!("OUT_DIR"), "/bindings.rs")); -macro_rules! as_c_string { - ($target:expr) => { - std::ffi::CString::new($target).unwrap().as_ptr() - }; -} - /// Enumerations for all the possible data types received from SimConnect #[derive(Debug)] pub enum DispatchResult<'a> { @@ -126,9 +121,11 @@ impl SimConnector { let temp_1 = ptr::null_mut(); let temp_2 = ptr::null_mut(); + let program_name = CString::new(program_name).unwrap(); + SimConnect_Open( &mut self.sim_connect_handle, - as_c_string!(program_name), + program_name.as_ptr(), temp_1, 0, temp_2, @@ -148,12 +145,15 @@ impl SimConnector { datum_id: DWORD, epsilon: f32, ) -> bool { + let datum_name = CString::new(datum_name).unwrap(); + let units_name = CString::new(units_name).unwrap(); + unsafe { SimConnect_AddToDataDefinition( self.sim_connect_handle, define_id, - as_c_string!(datum_name), - as_c_string!(units_name), + datum_name.as_ptr(), + units_name.as_ptr(), datum_type, epsilon, datum_id, @@ -229,11 +229,13 @@ impl SimConnector { group_id: SIMCONNECT_INPUT_GROUP_ID, input_definition: &str, ) -> bool { + let input_definition = CString::new(input_definition).unwrap(); + unsafe { SimConnect_RemoveInputEvent( self.sim_connect_handle, group_id, - as_c_string!(input_definition), + input_definition.as_ptr(), ) == 0 } } @@ -249,13 +251,17 @@ impl SimConnector { key_choice_2: &str, key_choice_3: &str, ) -> bool { + let key_choice_1 = CString::new(key_choice_1).unwrap(); + let key_choice_2 = CString::new(key_choice_2).unwrap(); + let key_choice_3 = CString::new(key_choice_3).unwrap(); + unsafe { SimConnect_RequestReservedKey( self.sim_connect_handle, event_id, - as_c_string!(key_choice_1), - as_c_string!(key_choice_2), - as_c_string!(key_choice_3), + key_choice_1.as_ptr(), + key_choice_2.as_ptr(), + key_choice_3.as_ptr(), ) == 0 } } @@ -271,12 +277,16 @@ impl SimConnector { airport_id: &str, request_id: SIMCONNECT_DATA_REQUEST_ID, ) -> bool { + let container_title = CString::new(container_title).unwrap(); + let tail_number = CString::new(tail_number).unwrap(); + let airport_id = CString::new(airport_id).unwrap(); + unsafe { SimConnect_AICreateParkedATCAircraft( self.sim_connect_handle, - as_c_string!(container_title), - as_c_string!(tail_number), - as_c_string!(airport_id), + container_title.as_ptr(), + tail_number.as_ptr(), + airport_id.as_ptr(), request_id, ) == 0 } @@ -292,13 +302,17 @@ impl SimConnector { touch_and_go: bool, request_id: SIMCONNECT_DATA_REQUEST_ID, ) -> bool { + let container_title = CString::new(container_title).unwrap(); + let tail_number = CString::new(tail_number).unwrap(); + let flight_plan_path = CString::new(flight_plan_path).unwrap(); + unsafe { SimConnect_AICreateEnrouteATCAircraft( self.sim_connect_handle, - as_c_string!(container_title), - as_c_string!(tail_number), + container_title.as_ptr(), + tail_number.as_ptr(), flight_number, - as_c_string!(flight_plan_path), + flight_plan_path.as_ptr(), flight_plan_position, touch_and_go as i32, request_id, @@ -313,11 +327,14 @@ impl SimConnector { init_pos: SIMCONNECT_DATA_INITPOSITION, request_id: SIMCONNECT_DATA_REQUEST_ID, ) -> bool { + let container_title = CString::new(container_title).unwrap(); + let tail_number = CString::new(tail_number).unwrap(); + unsafe { SimConnect_AICreateNonATCAircraft( self.sim_connect_handle, - as_c_string!(container_title), - as_c_string!(tail_number), + container_title.as_ptr(), + tail_number.as_ptr(), init_pos, request_id, ) == 0 @@ -330,10 +347,12 @@ impl SimConnector { init_pos: SIMCONNECT_DATA_INITPOSITION, request_id: SIMCONNECT_DATA_REQUEST_ID, ) -> bool { + let container_title = CString::new(container_title).unwrap(); + unsafe { SimConnect_AICreateSimulatedObject( self.sim_connect_handle, - as_c_string!(container_title), + container_title.as_ptr(), init_pos, request_id, ) == 0 @@ -362,11 +381,13 @@ impl SimConnector { flight_plan_path: &str, request_id: SIMCONNECT_DATA_REQUEST_ID, ) -> bool { + let flight_plan_path = CString::new(flight_plan_path).unwrap(); + unsafe { SimConnect_AISetAircraftFlightPlan( self.sim_connect_handle, object_id, - as_c_string!(flight_plan_path), + flight_plan_path.as_ptr(), request_id, ) == 0 } @@ -431,13 +452,10 @@ impl SimConnector { event_id: SIMCONNECT_CLIENT_EVENT_ID, data: DWORD, ) -> bool { + let menu_item = CString::new(menu_item).unwrap(); + unsafe { - SimConnect_MenuAddItem( - self.sim_connect_handle, - as_c_string!(menu_item), - event_id, - data, - ) == 0 + SimConnect_MenuAddItem(self.sim_connect_handle, menu_item.as_ptr(), event_id, data) == 0 } } @@ -460,9 +478,10 @@ impl SimConnector { request_id: SIMCONNECT_DATA_REQUEST_ID, state: &str, ) -> bool { + let state = CString::new(state).unwrap(); + unsafe { - SimConnect_RequestSystemState(self.sim_connect_handle, request_id, as_c_string!(state)) - == 0 + SimConnect_RequestSystemState(self.sim_connect_handle, request_id, state.as_ptr()) == 0 } } @@ -471,10 +490,12 @@ impl SimConnector { client_data_name: &str, data_id: SIMCONNECT_CLIENT_DATA_ID, ) -> bool { + let client_data_name = CString::new(client_data_name).unwrap(); + unsafe { SimConnect_MapClientDataNameToID( self.sim_connect_handle, - as_c_string!(client_data_name), + client_data_name.as_ptr(), data_id, ) == 0 } @@ -553,7 +574,9 @@ impl SimConnector { } pub fn flight_load(&self, file_name: &str) -> bool { - unsafe { SimConnect_FlightLoad(self.sim_connect_handle, as_c_string!(file_name)) == 0 } + let file_name = CString::new(file_name).unwrap(); + + unsafe { SimConnect_FlightLoad(self.sim_connect_handle, file_name.as_ptr()) == 0 } } pub unsafe fn text( @@ -653,11 +676,13 @@ impl SimConnector { event_id: SIMCONNECT_CLIENT_EVENT_ID, event_name: &str, ) -> bool { + let event_name = CString::new(event_name).unwrap(); + unsafe { SimConnect_SubscribeToSystemEvent( self.sim_connect_handle, event_id, - as_c_string!(event_name), + event_name.as_ptr(), ) == 0 } } @@ -667,11 +692,13 @@ impl SimConnector { event_id: SIMCONNECT_CLIENT_EVENT_ID, event_name: &str, ) -> bool { + let event_name = CString::new(event_name).unwrap(); + unsafe { SimConnect_MapClientEventToSimEvent( self.sim_connect_handle, event_id, - as_c_string!(event_name), + event_name.as_ptr(), ) == 0 } } @@ -733,11 +760,13 @@ impl SimConnector { up_return_value: DWORD, maskable: bool, ) -> bool { + let input_definition = CString::new(input_definition).unwrap(); + unsafe { SimConnect_MapInputEventToClientEvent( self.sim_connect_handle, group_id, - as_c_string!(input_definition), + input_definition.as_ptr(), down_event, down_return_value, up_event, From 93108237a94f6a3bb6a6900f6e5b415e799017e0 Mon Sep 17 00:00:00 2001 From: Sequal32 Date: Wed, 27 Dec 2023 01:10:51 -0500 Subject: [PATCH 16/33] refactor: renamed SimobjectData -> SimObjectData --- examples/aircraft_updates/main.rs | 2 +- examples/aircraft_updates_on_change/main.rs | 2 +- src/lib.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/aircraft_updates/main.rs b/examples/aircraft_updates/main.rs index 776b2ac..5e6eedf 100644 --- a/examples/aircraft_updates/main.rs +++ b/examples/aircraft_updates/main.rs @@ -48,7 +48,7 @@ fn main() { loop { match conn.get_next_message() { - Ok(DispatchResult::SimobjectData(data)) => unsafe { + Ok(DispatchResult::SimObjectData(data)) => unsafe { if data.dwDefineID == 0 { let sim_data_ptr = std::ptr::addr_of!(data.dwData) as *const DataStruct; let sim_data_value = std::ptr::read_unaligned(sim_data_ptr); diff --git a/examples/aircraft_updates_on_change/main.rs b/examples/aircraft_updates_on_change/main.rs index 49c71dc..dca89ec 100644 --- a/examples/aircraft_updates_on_change/main.rs +++ b/examples/aircraft_updates_on_change/main.rs @@ -104,7 +104,7 @@ fn main() { loop { match conn.get_next_message() { - Ok(DispatchResult::SimobjectData(data)) => unsafe { + Ok(DispatchResult::SimObjectData(data)) => unsafe { match data.dwDefineID { // Here we match the define_id we've passed using the request_data_on_sim_object 0 => { diff --git a/src/lib.rs b/src/lib.rs index c1a043e..465e464 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,8 +76,8 @@ pub enum DispatchResult<'a> { EventObjectAddRemove(&'a SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE), EventFilename(&'a SIMCONNECT_RECV_EVENT_FILENAME), EventFrame(&'a SIMCONNECT_RECV_EVENT_FRAME), - SimobjectData(&'a SIMCONNECT_RECV_SIMOBJECT_DATA), - SimobjectDataBytype(&'a SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE), + SimObjectData(&'a SIMCONNECT_RECV_SIMOBJECT_DATA), + SimObjectDataByType(&'a SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE), WeatherObservation(&'a SIMCONNECT_RECV_WEATHER_OBSERVATION), CloudState(&'a SIMCONNECT_RECV_CLOUD_STATE), AssignedObjectId(&'a SIMCONNECT_RECV_ASSIGNED_OBJECT_ID), @@ -833,12 +833,12 @@ impl SimConnector { ))) } SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_SIMOBJECT_DATA => { - Ok(DispatchResult::SimobjectData(transmute_copy( + Ok(DispatchResult::SimObjectData(transmute_copy( &(data_buf as *const SIMCONNECT_RECV_SIMOBJECT_DATA), ))) } SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE => { - Ok(DispatchResult::SimobjectDataBytype(transmute_copy( + Ok(DispatchResult::SimObjectDataByType(transmute_copy( &(data_buf as *const SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE), ))) } From 7e752ae87b44a6c56752db902944bbf146185342 Mon Sep 17 00:00:00 2001 From: Sequal32 Date: Wed, 27 Dec 2023 01:11:10 -0500 Subject: [PATCH 17/33] chore: increment breaking change version num --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d371c37..3753238 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -197,7 +197,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "simconnect" -version = "0.2.1" +version = "0.3.0" dependencies = [ "bindgen", ] diff --git a/Cargo.toml b/Cargo.toml index bbd4c6f..661890e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "simconnect" license = "MIT" description = "Rust bindings for SimConnect" -version = "0.2.1" +version = "0.3.0" authors = ["Connor T"] edition = "2018" From ac79e7f8e03fd59d1916cc3cbacd5925ff67ab8b Mon Sep 17 00:00:00 2001 From: Dave <77780263+BitsAndDroids@users.noreply.github.com> Date: Sat, 6 Jan 2024 17:19:14 +0100 Subject: [PATCH 18/33] Update Readme.md --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index a1b0d6f..f9aa41a 100644 --- a/Readme.md +++ b/Readme.md @@ -3,7 +3,7 @@ Add this to your `Cargo.toml` ```toml [dependencies] -simconnect = "0.2.1" +simconnect = "0.3.0" ``` ## Building From 328dcbbe0b6a81b5a54762d3db1dd2c403b172e5 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Sat, 6 Jan 2024 17:22:55 +0100 Subject: [PATCH 19/33] shield because I always believe them to look shiny --- Readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Readme.md b/Readme.md index f9aa41a..a9b17a0 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,4 @@ +![crates.io](https://img.shields.io/crates/v/simconnect) # SimConnect Bindings for Rust ## Using Add this to your `Cargo.toml` From 9fabb215e9237966afcfa6d952146cb5321e28bd Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Mon, 8 Jan 2024 20:04:04 +0100 Subject: [PATCH 20/33] Add debug trait to SimConnector struct The 'Debug' trait has been derived for the SimConnector struct in lib.rs. This will facilitate easier debugging by allowing SimConnector instances to be formatted using "{:?}" or "{:#?}" for pretty-print, primarily used during development. --- Cargo.toml | 2 +- src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 661890e..9dd57c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "simconnect" license = "MIT" description = "Rust bindings for SimConnect" -version = "0.3.0" +version = "0.3.1" authors = ["Connor T"] edition = "2018" diff --git a/src/lib.rs b/src/lib.rs index 465e464..af21ae8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -99,6 +99,7 @@ pub enum DispatchResult<'a> { /// Handles communication between the client program and SimConnect /// For more information about the functions provided, refer to the SimConnect SDK Documentation. The functions name closely match up with those defined there. +#[derive(Debug)] pub struct SimConnector { sim_connect_handle: HANDLE, } From ed76228f29b55ee14a3aa53b82db71a6a56a0b84 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Mon, 8 Jan 2024 20:06:18 +0100 Subject: [PATCH 21/33] Update simconnect dependency to version 0.3.1 The simconnect dependency in the Cargo.toml file has been upgraded from version 0.3.0 to version 0.3.1. This update may include important bug fixes and improvements vital to the project. --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index a9b17a0..46b3663 100644 --- a/Readme.md +++ b/Readme.md @@ -4,7 +4,7 @@ Add this to your `Cargo.toml` ```toml [dependencies] -simconnect = "0.3.0" +simconnect = "0.3.1" ``` ## Building From 3868da68e56aa4e2ec93839a1a5eab45079ce138 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Mon, 8 Jan 2024 20:47:05 +0100 Subject: [PATCH 22/33] Create aircraft inputs example and update SimConnect Added a new file `examples/aircraft_inputs/main.rs` that provides an example of handling aircraft inputs such as "GEAR_UP", "GEAR_DOWN", and "PARKING_BRAKES". The example includes the setup of a hashmap for input IDs to events cross-referencing and user console input for event triggering. Moreover, SimConnect's version was updated to 0.3.1. --- Cargo.lock | 2 +- Cargo.toml | 3 ++ examples/aircraft_inputs/main.rs | 73 ++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 examples/aircraft_inputs/main.rs diff --git a/Cargo.lock b/Cargo.lock index 3753238..8f205ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -197,7 +197,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "simconnect" -version = "0.3.0" +version = "0.3.1" dependencies = [ "bindgen", ] diff --git a/Cargo.toml b/Cargo.toml index 9dd57c1..ab14675 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,9 @@ path = "examples/aircraft_updates_on_change/main.rs" name = "aircraft_updates" path = "examples/aircraft_updates/main.rs" +[[example]] +name = "aircraft_inputs" +path = "examples/aircraft_inputs/main.rs" [build-dependencies] bindgen = "0.65" diff --git a/examples/aircraft_inputs/main.rs b/examples/aircraft_inputs/main.rs new file mode 100644 index 0000000..83cf69e --- /dev/null +++ b/examples/aircraft_inputs/main.rs @@ -0,0 +1,73 @@ +use std::collections::HashMap; +use simconnect::SIMCONNECT_CLIENT_EVENT_ID; + +// define a struct that holds the event and the input id +// the events can be found in the SimConnect SDK documentation for your sim +struct Input { + event: String, // The event to be triggered i.e. + input_id: u32, // The id we use to trigger the event +} +fn main(){ + let input_parking_brakes = Input { + event: "PARKING_BRAKES".to_string(), + input_id: 1, + }; + let input_gear_up = Input { + event: "GEAR_UP".to_string(), + input_id: 2, + }; + let input_gear_down = Input { + event: "GEAR_DOWN".to_string(), + input_id: 3, + }; + + // Define a hashmap to easily cross reference the input id with the event + let mut events: HashMap = HashMap::new(); + events.insert(input_parking_brakes.input_id, input_parking_brakes); + events.insert(input_gear_up.input_id, input_gear_up); + events.insert(input_gear_down.input_id, input_gear_down); + + let mut conn = simconnect::SimConnector::new(); + conn.connect("Program that inputs commands to the sim"); // Initialize connection with SimConnect + + // loop over all the events we want to define and map them to the input id + for event in &events { + println!("Defining event: {}", event.1.event); + println!("Input id: {}", event.1.input_id); + conn.map_client_event_to_sim_event( + // if input id 1 is triggered, the PARKING_BRAKES event is triggered + event.1.input_id as SIMCONNECT_CLIENT_EVENT_ID, + event.1.event.as_str(), + ); + } + // loop over user input from console and trigger the corresponding events + loop { + println!("Enter an input id to trigger an event"); + let mut input = String::new(); + std::io::stdin().read_line(&mut input).unwrap(); + let input_id: u32 = input.trim().parse().unwrap(); + match events.get(&input_id) { + // if the input id is found in the hashmap, trigger the event + // otherwise print an error message + Some(event) => { + // this is why we've defined a hashmap instead of a vector + println!("Triggering event: {}", event.event); + /* send message to the sim + object_id is 0 because we want to trigger the event on the user aircraft + group_id is 0 because we don't want to group the event with other events + priority is 0 because we don't want to prioritize the event + this is used when multiple events are triggered at the same time + */ + conn.transmit_client_event( + 0, + input_id as u32, + 0, + simconnect::SIMCONNECT_GROUP_PRIORITY_HIGHEST, + simconnect::SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY, + ); + } + None => println!("No event found for input id: {}", input_id), + } + std::thread::sleep(std::time::Duration::from_millis(16)); + } +} \ No newline at end of file From d30ab3b9879dc5f3812ec26f2bb8055e20a08775 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Wed, 17 Jan 2024 16:08:06 +0100 Subject: [PATCH 23/33] added a PR template --- .github/pull_request_template.md | 9 +++++++++ examples/aircraft_inputs/main.rs | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..58f0d21 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,9 @@ + + + diff --git a/examples/aircraft_inputs/main.rs b/examples/aircraft_inputs/main.rs index 83cf69e..2ad18c3 100644 --- a/examples/aircraft_inputs/main.rs +++ b/examples/aircraft_inputs/main.rs @@ -1,5 +1,5 @@ -use std::collections::HashMap; use simconnect::SIMCONNECT_CLIENT_EVENT_ID; +use std::collections::HashMap; // define a struct that holds the event and the input id // the events can be found in the SimConnect SDK documentation for your sim @@ -7,7 +7,7 @@ struct Input { event: String, // The event to be triggered i.e. input_id: u32, // The id we use to trigger the event } -fn main(){ +fn main() { let input_parking_brakes = Input { event: "PARKING_BRAKES".to_string(), input_id: 1, @@ -52,7 +52,7 @@ fn main(){ Some(event) => { // this is why we've defined a hashmap instead of a vector println!("Triggering event: {}", event.event); - /* send message to the sim + /* send message to the sim object_id is 0 because we want to trigger the event on the user aircraft group_id is 0 because we don't want to group the event with other events priority is 0 because we don't want to prioritize the event @@ -70,4 +70,4 @@ fn main(){ } std::thread::sleep(std::time::Duration::from_millis(16)); } -} \ No newline at end of file +} From b97f974e65e79a45268f6e1299fbffb4aac8c941 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Wed, 17 Jan 2024 16:13:20 +0100 Subject: [PATCH 24/33] renamed file to match format --- .github/{pull_request_template.md => PULL_REQUEST_TEMPLATE.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{pull_request_template.md => PULL_REQUEST_TEMPLATE.md} (100%) diff --git a/.github/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .github/pull_request_template.md rename to .github/PULL_REQUEST_TEMPLATE.md From dff5d0f151f40efde5704a9f1887df23ca0466e0 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Sat, 22 Jun 2024 10:34:19 +0200 Subject: [PATCH 25/33] updated bindgen version --- Cargo.lock | 41 ++++++++++++++++++++++------------------- Cargo.toml | 2 +- SimConnect.dll | Bin 58368 -> 67072 bytes 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3753238..18623d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,17 +4,17 @@ version = 3 [[package]] name = "bindgen" -version = "0.65.1" +version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ "bitflags", "cexpr", "clang-sys", + "itertools", "lazy_static", "lazycell", "log", - "peeking_take_while", "prettyplease", "proc-macro2", "quote", @@ -27,9 +27,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.2.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "cexpr" @@ -69,6 +69,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -134,17 +143,11 @@ version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "prettyplease" -version = "0.2.4" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ceca8aaf45b5c46ec7ed39fff75f57290368c1846d33d24a122ca81416ab058" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", "syn", @@ -152,18 +155,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.27" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -204,9 +207,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 661890e..d0b8f57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,4 +17,4 @@ path = "examples/aircraft_updates/main.rs" [build-dependencies] -bindgen = "0.65" +bindgen = "0.69.4" diff --git a/SimConnect.dll b/SimConnect.dll index da40b739e0ba266b6f7fd995421416060d278fcb..2aa284c02b3a18123fd0ae619d1bcd35334b254d 100644 GIT binary patch literal 67072 zcmeFa4R{pQ^*=tFWWy2?WfTYQI{GFQoxmO#lh+0kj&Vl~ie+7+<2c7^phG&$)MIcXqRZ*th@x zd49jilf5(d-nsXlbI&>VoO932l-|5nNEZYl1OJ*P2u(=o@UY)g|JW>oF!%Xwl-3^R^0Sb$F3;!6K*chN;dw7SF9H$jQla z=}o`-$CFd)e*d7w_-}l5fJMgjYdaqjRp@F3j3bib~-NMs{+4YnKb1JEiz91^|3&Py{GKJTUEvPW+bPMM>2c-=jC2U5{ z^*nd)?~vNrc`a*<&eH@TlNZNQp$w&jR2*qSIWG83M$-G5=d6DpxEBSX;;CQcko`UKn)pL;DK`;R~ti3e4h#wy6x4L5CVpJp?3BVPrm(i=<#Q0tR zcb-Y|OqX4fL$2JLq{s)(!sGH}mn7erD@Co#w+VtITO{SMe5Vt6MfmsNUy5Fzr#3%D zg+7;CQhKC@=FlKX*{L}eH48#lx}PKM2JdQ8_G;qkrdhPoV9Il;z97+80dg_)mCcdFo4!_2C*)dyQKy#bf%=V zX^vmM0&d8|U~#2>@e4sHY?kB_H~u9F?YsMKpYUrpIyn!WD4%k~YB^6r=1PjWn~COb z9!luOb9{#-l(V^pU{?01H7F#YiwG5cjDW!>$qV&KmgIX}PVbF0)wRoO1i#X)oCL(7 zOQc9=t>)MW4px@r7BA)gOxj}hBsHPqZ$pz#rjPs zRjzY2>X{&Pv@GW zm2OPv+fVmwA;Lo&gNV+ARn}o&Q8k)TWg#J#$V$1#CD82`q^m7N_(Vw~CFKSim1Js;fi%%1Vu_xfMLkAOm7u38!uk-&z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dgyu7Ss(su&ishV3#zlGQ32a^GI)e7K8 zf(^^-g8>ea(tUhg7zuWEYz(aq2HYISF)=%TdxrMWAq~_d6-&b1(w49JD5e+4m1P?(9YXWg|eK+pW&9ljNI2{*44jVRJvwp&LSFR;oH>XYEy4lWAJX}{9H-4FaJLabxV7@E0 zxUd*4#*3L^zBpRkS?nH*j>X3^WBIYsv1ln?%9ln Date: Sat, 22 Jun 2024 11:11:17 +0200 Subject: [PATCH 26/33] added handle to allowlist --- build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index de6db9c..e43d4da 100644 --- a/build.rs +++ b/build.rs @@ -6,7 +6,7 @@ fn main() { let bindings = bindgen::Builder::default() .header("libsrc/include/SimConnect.hpp") - .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .allowlist_var("SIMCONNECT_UNUSED") .allowlist_var("SIMCONNECT_OBJECT_ID_USER") .allowlist_var("SIMCONNECT_CAMERA_IGNORE_FIELD") @@ -66,6 +66,7 @@ fn main() { .allowlist_var("UNKNOWN_GROUP") .allowlist_var("SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH") .allowlist_var("SIMCONNECT_CLOUD_STATE_ARRAY_SIZE") + .allowlist_type("HANDLE") .allowlist_type("SIMCONNECT_RECV_ID") .allowlist_type("SIMCONNECT_DATATYPE") .allowlist_type("SIMCONNECT_EXCEPTION") From 821aa0d5eb0039cbdc3ccc5817ef8738db64f404 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Sat, 22 Jun 2024 11:18:35 +0200 Subject: [PATCH 27/33] changed include of windows.h --- libsrc/include/SimConnect.hpp | 1093 ++++++++++++++++++++------------- 1 file changed, 668 insertions(+), 425 deletions(-) diff --git a/libsrc/include/SimConnect.hpp b/libsrc/include/SimConnect.hpp index 99cbf68..5fcd651 100644 --- a/libsrc/include/SimConnect.hpp +++ b/libsrc/include/SimConnect.hpp @@ -4,7 +4,7 @@ // //----------------------------------------------------------------------------- -#include "Windows.h" +#include #ifndef _SIMCONNECT_H_ #define _SIMCONNECT_H_ @@ -12,9 +12,9 @@ #pragma once #ifdef _MSFS_WASM - #ifndef SIMCONNECT_WASM_MODULE - #define SIMCONNECT_WASM_MODULE "env" - #endif +#ifndef SIMCONNECT_WASM_MODULE +#define SIMCONNECT_WASM_MODULE "env" +#endif #endif #ifndef DWORD_MAX @@ -29,22 +29,30 @@ typedef DWORD SIMCONNECT_OBJECT_ID; // Constants //---------------------------------------------------------------------------- -static const DWORD SIMCONNECT_UNUSED = DWORD_MAX; // special value to indicate unused event, ID -static const DWORD SIMCONNECT_OBJECT_ID_USER = 0; // proxy value for User vehicle ObjectID - -static const float SIMCONNECT_CAMERA_IGNORE_FIELD = FLT_MAX; //Used to tell the Camera API to NOT modify the value in this part of the argument. +static const DWORD SIMCONNECT_UNUSED = + DWORD_MAX; // special value to indicate unused event, ID +static const DWORD SIMCONNECT_OBJECT_ID_USER = + 0; // proxy value for User vehicle ObjectID -static const DWORD SIMCONNECT_CLIENTDATA_MAX_SIZE = 8192; // maximum value for SimConnect_CreateClientData dwSize parameter +static const float SIMCONNECT_CAMERA_IGNORE_FIELD = + FLT_MAX; // Used to tell the Camera API to NOT modify the value in this part + // of the argument. +static const DWORD SIMCONNECT_CLIENTDATA_MAX_SIZE = + 8192; // maximum value for SimConnect_CreateClientData dwSize parameter // Notification Group priority values -static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST = 1; // highest priority -static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE = 10000000; // highest priority that allows events to be masked -static const DWORD SIMCONNECT_GROUP_PRIORITY_STANDARD = 1900000000; // standard priority -static const DWORD SIMCONNECT_GROUP_PRIORITY_DEFAULT = 2000000000; // default priority -static const DWORD SIMCONNECT_GROUP_PRIORITY_LOWEST = 4000000000; // priorities lower than this will be ignored - -//Weather observations Metar strings +static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST = 1; // highest priority +static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE = + 10000000; // highest priority that allows events to be masked +static const DWORD SIMCONNECT_GROUP_PRIORITY_STANDARD = + 1900000000; // standard priority +static const DWORD SIMCONNECT_GROUP_PRIORITY_DEFAULT = + 2000000000; // default priority +static const DWORD SIMCONNECT_GROUP_PRIORITY_LOWEST = + 4000000000; // priorities lower than this will be ignored + +// Weather observations Metar strings static const DWORD MAX_METAR_LENGTH = 2000; // Maximum thermal size is 100 km. @@ -52,43 +60,51 @@ static const float MAX_THERMAL_SIZE = 100000; static const float MAX_THERMAL_RATE = 1000; // SIMCONNECT_DATA_INITPOSITION.Airspeed -static const DWORD INITPOSITION_AIRSPEED_CRUISE = -1; // aircraft's cruise airspeed -static const DWORD INITPOSITION_AIRSPEED_KEEP = -2; // keep current airspeed +static const DWORD INITPOSITION_AIRSPEED_CRUISE = + -1; // aircraft's cruise airspeed +static const DWORD INITPOSITION_AIRSPEED_KEEP = -2; // keep current airspeed // AddToClientDataDefinition dwSizeOrType parameter type values -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT8 = -1; // 8-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT16 = -2; // 16-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT32 = -3; // 32-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT64 = -4; // 64-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT32 = -5; // 32-bit floating-point number (float) -static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT64 = -6; // 64-bit floating-point number (double) +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT8 = -1; // 8-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT16 = + -2; // 16-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT32 = + -3; // 32-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT64 = + -4; // 64-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT32 = + -5; // 32-bit floating-point number (float) +static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT64 = + -6; // 64-bit floating-point number (double) // AddToClientDataDefinition dwOffset parameter special values -static const DWORD SIMCONNECT_CLIENTDATAOFFSET_AUTO = -1; // automatically compute offset of the ClientData variable +static const DWORD SIMCONNECT_CLIENTDATAOFFSET_AUTO = + -1; // automatically compute offset of the ClientData variable // Open ConfigIndex parameter special value -static const DWORD SIMCONNECT_OPEN_CONFIGINDEX_LOCAL = -1; // ignore SimConnect.cfg settings, and force local connection +static const DWORD SIMCONNECT_OPEN_CONFIGINDEX_LOCAL = + -1; // ignore SimConnect.cfg settings, and force local connection //---------------------------------------------------------------------------- // Enum definitions //---------------------------------------------------------------------------- -//these came from substituteMacros +// these came from substituteMacros #define SIMCONNECT_REFSTRUCT struct #define SIMCONNECT_STRUCT struct #define SIMCONNECT_STRING(name, size) char name[size] #define SIMCONNECT_GUID GUID #define SIMCONNECT_STRINGV(name) char name[1] #define SIMCONNECT_DATAV(name, id, count) DWORD name -#define SIMCONNECT_FIXEDTYPE_DATAV(type, name, count, cliMarshalAs, cliType) type name[1] +#define SIMCONNECT_FIXEDTYPE_DATAV(type, name, count, cliMarshalAs, cliType) \ + type name[1] #define SIMCONNECT_GUID GUID #define SIMCONNECT_ENUM enum #define SIMCONNECT_ENUM_FLAGS typedef DWORD #define SIMCONNECT_USER_ENUM typedef DWORD - // Receive data types -SIMCONNECT_ENUM SIMCONNECT_RECV_ID { +SIMCONNECT_ENUM SIMCONNECT_RECV_ID{ SIMCONNECT_RECV_ID_NULL, SIMCONNECT_RECV_ID_EXCEPTION, SIMCONNECT_RECV_ID_OPEN, @@ -118,37 +134,35 @@ SIMCONNECT_ENUM SIMCONNECT_RECV_ID { SIMCONNECT_RECV_ID_EVENT_RACE_LAP, #ifdef ENABLE_SIMCONNECT_EXPERIMENTAL SIMCONNECT_RECV_ID_PICK, -#endif //ENABLE_SIMCONNECT_EXPERIMENTAL +#endif // ENABLE_SIMCONNECT_EXPERIMENTAL }; - - // Data data types -SIMCONNECT_ENUM SIMCONNECT_DATATYPE { - SIMCONNECT_DATATYPE_INVALID, // invalid data type - SIMCONNECT_DATATYPE_INT32, // 32-bit integer number - SIMCONNECT_DATATYPE_INT64, // 64-bit integer number - SIMCONNECT_DATATYPE_FLOAT32, // 32-bit floating-point number (float) - SIMCONNECT_DATATYPE_FLOAT64, // 64-bit floating-point number (double) - SIMCONNECT_DATATYPE_STRING8, // 8-byte string - SIMCONNECT_DATATYPE_STRING32, // 32-byte string - SIMCONNECT_DATATYPE_STRING64, // 64-byte string - SIMCONNECT_DATATYPE_STRING128, // 128-byte string - SIMCONNECT_DATATYPE_STRING256, // 256-byte string - SIMCONNECT_DATATYPE_STRING260, // 260-byte string - SIMCONNECT_DATATYPE_STRINGV, // variable-length string - - SIMCONNECT_DATATYPE_INITPOSITION, // see SIMCONNECT_DATA_INITPOSITION - SIMCONNECT_DATATYPE_MARKERSTATE, // see SIMCONNECT_DATA_MARKERSTATE - SIMCONNECT_DATATYPE_WAYPOINT, // see SIMCONNECT_DATA_WAYPOINT - SIMCONNECT_DATATYPE_LATLONALT, // see SIMCONNECT_DATA_LATLONALT - SIMCONNECT_DATATYPE_XYZ, // see SIMCONNECT_DATA_XYZ - - SIMCONNECT_DATATYPE_MAX // enum limit +SIMCONNECT_ENUM SIMCONNECT_DATATYPE{ + SIMCONNECT_DATATYPE_INVALID, // invalid data type + SIMCONNECT_DATATYPE_INT32, // 32-bit integer number + SIMCONNECT_DATATYPE_INT64, // 64-bit integer number + SIMCONNECT_DATATYPE_FLOAT32, // 32-bit floating-point number (float) + SIMCONNECT_DATATYPE_FLOAT64, // 64-bit floating-point number (double) + SIMCONNECT_DATATYPE_STRING8, // 8-byte string + SIMCONNECT_DATATYPE_STRING32, // 32-byte string + SIMCONNECT_DATATYPE_STRING64, // 64-byte string + SIMCONNECT_DATATYPE_STRING128, // 128-byte string + SIMCONNECT_DATATYPE_STRING256, // 256-byte string + SIMCONNECT_DATATYPE_STRING260, // 260-byte string + SIMCONNECT_DATATYPE_STRINGV, // variable-length string + + SIMCONNECT_DATATYPE_INITPOSITION, // see SIMCONNECT_DATA_INITPOSITION + SIMCONNECT_DATATYPE_MARKERSTATE, // see SIMCONNECT_DATA_MARKERSTATE + SIMCONNECT_DATATYPE_WAYPOINT, // see SIMCONNECT_DATA_WAYPOINT + SIMCONNECT_DATATYPE_LATLONALT, // see SIMCONNECT_DATA_LATLONALT + SIMCONNECT_DATATYPE_XYZ, // see SIMCONNECT_DATA_XYZ + + SIMCONNECT_DATATYPE_MAX // enum limit }; // Exception error types -SIMCONNECT_ENUM SIMCONNECT_EXCEPTION { +SIMCONNECT_ENUM SIMCONNECT_EXCEPTION{ SIMCONNECT_EXCEPTION_NONE, SIMCONNECT_EXCEPTION_ERROR, @@ -191,39 +205,31 @@ SIMCONNECT_ENUM SIMCONNECT_EXCEPTION { }; // Object types -SIMCONNECT_ENUM SIMCONNECT_SIMOBJECT_TYPE { - SIMCONNECT_SIMOBJECT_TYPE_USER, - SIMCONNECT_SIMOBJECT_TYPE_ALL, - SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT, - SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER, - SIMCONNECT_SIMOBJECT_TYPE_BOAT, - SIMCONNECT_SIMOBJECT_TYPE_GROUND, +SIMCONNECT_ENUM SIMCONNECT_SIMOBJECT_TYPE{ + SIMCONNECT_SIMOBJECT_TYPE_USER, SIMCONNECT_SIMOBJECT_TYPE_ALL, + SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT, SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER, + SIMCONNECT_SIMOBJECT_TYPE_BOAT, SIMCONNECT_SIMOBJECT_TYPE_GROUND, }; // EventState values -SIMCONNECT_ENUM SIMCONNECT_STATE { +SIMCONNECT_ENUM SIMCONNECT_STATE{ SIMCONNECT_STATE_OFF, SIMCONNECT_STATE_ON, }; // Object Data Request Period values -SIMCONNECT_ENUM SIMCONNECT_PERIOD { - SIMCONNECT_PERIOD_NEVER, - SIMCONNECT_PERIOD_ONCE, - SIMCONNECT_PERIOD_VISUAL_FRAME, - SIMCONNECT_PERIOD_SIM_FRAME, +SIMCONNECT_ENUM SIMCONNECT_PERIOD{ + SIMCONNECT_PERIOD_NEVER, SIMCONNECT_PERIOD_ONCE, + SIMCONNECT_PERIOD_VISUAL_FRAME, SIMCONNECT_PERIOD_SIM_FRAME, SIMCONNECT_PERIOD_SECOND, }; - -SIMCONNECT_ENUM SIMCONNECT_MISSION_END { - SIMCONNECT_MISSION_FAILED, - SIMCONNECT_MISSION_CRASHED, - SIMCONNECT_MISSION_SUCCEEDED -}; +SIMCONNECT_ENUM SIMCONNECT_MISSION_END{SIMCONNECT_MISSION_FAILED, + SIMCONNECT_MISSION_CRASHED, + SIMCONNECT_MISSION_SUCCEEDED}; // ClientData Request Period values -SIMCONNECT_ENUM SIMCONNECT_CLIENT_DATA_PERIOD { +SIMCONNECT_ENUM SIMCONNECT_CLIENT_DATA_PERIOD{ SIMCONNECT_CLIENT_DATA_PERIOD_NEVER, SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, SIMCONNECT_CLIENT_DATA_PERIOD_VISUAL_FRAME, @@ -231,7 +237,7 @@ SIMCONNECT_ENUM SIMCONNECT_CLIENT_DATA_PERIOD { SIMCONNECT_CLIENT_DATA_PERIOD_SECOND, }; -SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE { +SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE{ SIMCONNECT_TEXT_TYPE_SCROLL_BLACK, SIMCONNECT_TEXT_TYPE_SCROLL_WHITE, SIMCONNECT_TEXT_TYPE_SCROLL_RED, @@ -240,7 +246,7 @@ SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE { SIMCONNECT_TEXT_TYPE_SCROLL_YELLOW, SIMCONNECT_TEXT_TYPE_SCROLL_MAGENTA, SIMCONNECT_TEXT_TYPE_SCROLL_CYAN, - SIMCONNECT_TEXT_TYPE_PRINT_BLACK=0x0100, + SIMCONNECT_TEXT_TYPE_PRINT_BLACK = 0x0100, SIMCONNECT_TEXT_TYPE_PRINT_WHITE, SIMCONNECT_TEXT_TYPE_PRINT_RED, SIMCONNECT_TEXT_TYPE_PRINT_GREEN, @@ -248,10 +254,10 @@ SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE { SIMCONNECT_TEXT_TYPE_PRINT_YELLOW, SIMCONNECT_TEXT_TYPE_PRINT_MAGENTA, SIMCONNECT_TEXT_TYPE_PRINT_CYAN, - SIMCONNECT_TEXT_TYPE_MENU=0x0200, + SIMCONNECT_TEXT_TYPE_MENU = 0x0200, }; -SIMCONNECT_ENUM SIMCONNECT_TEXT_RESULT { +SIMCONNECT_ENUM SIMCONNECT_TEXT_RESULT{ SIMCONNECT_TEXT_RESULT_MENU_SELECT_1, SIMCONNECT_TEXT_RESULT_MENU_SELECT_2, SIMCONNECT_TEXT_RESULT_MENU_SELECT_3, @@ -269,106 +275,139 @@ SIMCONNECT_ENUM SIMCONNECT_TEXT_RESULT { SIMCONNECT_TEXT_RESULT_TIMEOUT, }; -SIMCONNECT_ENUM SIMCONNECT_WEATHER_MODE { +SIMCONNECT_ENUM SIMCONNECT_WEATHER_MODE{ SIMCONNECT_WEATHER_MODE_THEME, SIMCONNECT_WEATHER_MODE_RWW, SIMCONNECT_WEATHER_MODE_CUSTOM, SIMCONNECT_WEATHER_MODE_GLOBAL, }; -SIMCONNECT_ENUM SIMCONNECT_FACILITY_LIST_TYPE { +SIMCONNECT_ENUM SIMCONNECT_FACILITY_LIST_TYPE{ SIMCONNECT_FACILITY_LIST_TYPE_AIRPORT, - SIMCONNECT_FACILITY_LIST_TYPE_WAYPOINT, - SIMCONNECT_FACILITY_LIST_TYPE_NDB, + SIMCONNECT_FACILITY_LIST_TYPE_WAYPOINT, SIMCONNECT_FACILITY_LIST_TYPE_NDB, SIMCONNECT_FACILITY_LIST_TYPE_VOR, - SIMCONNECT_FACILITY_LIST_TYPE_COUNT // invalid + SIMCONNECT_FACILITY_LIST_TYPE_COUNT // invalid }; - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_VOR_FLAGS; // flags for SIMCONNECT_RECV_ID_VOR_LIST - static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL = 0x00000001; // Has Nav signal - static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER = 0x00000002; // Has localizer - static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE = 0x00000004; // Has Nav signal - static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME = 0x00000008; // Station has DME - - +SIMCONNECT_ENUM_FLAGS + SIMCONNECT_VOR_FLAGS; // flags for SIMCONNECT_RECV_ID_VOR_LIST +static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL = + 0x00000001; // Has Nav signal +static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER = + 0x00000002; // Has localizer +static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE = + 0x00000004; // Has Nav signal +static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME = + 0x00000008; // Station has DME // bits for the Waypoint Flags field: may be combined SIMCONNECT_ENUM_FLAGS SIMCONNECT_WAYPOINT_FLAGS; - static const DWORD SIMCONNECT_WAYPOINT_NONE = 0x00; - static const DWORD SIMCONNECT_WAYPOINT_SPEED_REQUESTED = 0x04; // requested speed at waypoint is valid - static const DWORD SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED = 0x08; // request a specific throttle percentage - static const DWORD SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED = 0x10; // compute vertical to speed to reach waypoint altitude when crossing the waypoint - static const DWORD SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL = 0x20; // AltitudeIsAGL - static const DWORD SIMCONNECT_WAYPOINT_ON_GROUND = 0x00100000; // place this waypoint on the ground - static const DWORD SIMCONNECT_WAYPOINT_REVERSE = 0x00200000; // Back up to this waypoint. Only valid on first waypoint - static const DWORD SIMCONNECT_WAYPOINT_WRAP_TO_FIRST = 0x00400000; // Wrap around back to first waypoint. Only valid on last waypoint. +static const DWORD SIMCONNECT_WAYPOINT_NONE = 0x00; +static const DWORD SIMCONNECT_WAYPOINT_SPEED_REQUESTED = + 0x04; // requested speed at waypoint is valid +static const DWORD SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED = + 0x08; // request a specific throttle percentage +static const DWORD SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED = + 0x10; // compute vertical to speed to reach waypoint altitude when crossing + // the waypoint +static const DWORD SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL = 0x20; // AltitudeIsAGL +static const DWORD SIMCONNECT_WAYPOINT_ON_GROUND = + 0x00100000; // place this waypoint on the ground +static const DWORD SIMCONNECT_WAYPOINT_REVERSE = + 0x00200000; // Back up to this waypoint. Only valid on first waypoint +static const DWORD SIMCONNECT_WAYPOINT_WRAP_TO_FIRST = + 0x00400000; // Wrap around back to first waypoint. Only valid on last + // waypoint. SIMCONNECT_ENUM_FLAGS SIMCONNECT_EVENT_FLAG; - static const DWORD SIMCONNECT_EVENT_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_EVENT_FLAG_FAST_REPEAT_TIMER = 0x00000001; // set event repeat timer to simulate fast repeat - static const DWORD SIMCONNECT_EVENT_FLAG_SLOW_REPEAT_TIMER = 0x00000002; // set event repeat timer to simulate slow repeat - static const DWORD SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY = 0x00000010; // interpret GroupID parameter as priority value +static const DWORD SIMCONNECT_EVENT_FLAG_DEFAULT = 0x00000000; +static const DWORD SIMCONNECT_EVENT_FLAG_FAST_REPEAT_TIMER = + 0x00000001; // set event repeat timer to simulate fast repeat +static const DWORD SIMCONNECT_EVENT_FLAG_SLOW_REPEAT_TIMER = + 0x00000002; // set event repeat timer to simulate slow repeat +static const DWORD SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY = + 0x00000010; // interpret GroupID parameter as priority value SIMCONNECT_ENUM_FLAGS SIMCONNECT_DATA_REQUEST_FLAG; - static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_CHANGED = 0x00000001; // send requested data when value(s) change - static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_TAGGED = 0x00000002; // send requested data in tagged format +static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; +static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_CHANGED = + 0x00000001; // send requested data when value(s) change +static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_TAGGED = + 0x00000002; // send requested data in tagged format SIMCONNECT_ENUM_FLAGS SIMCONNECT_DATA_SET_FLAG; - static const DWORD SIMCONNECT_DATA_SET_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_DATA_SET_FLAG_TAGGED = 0x00000001; // data is in tagged format +static const DWORD SIMCONNECT_DATA_SET_FLAG_DEFAULT = 0x00000000; +static const DWORD SIMCONNECT_DATA_SET_FLAG_TAGGED = + 0x00000001; // data is in tagged format SIMCONNECT_ENUM_FLAGS SIMCONNECT_CREATE_CLIENT_DATA_FLAG; - static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_READ_ONLY = 0x00000001; // permit only ClientData creator to write into ClientData - +static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_DEFAULT = 0x00000000; +static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_READ_ONLY = + 0x00000001; // permit only ClientData creator to write into ClientData SIMCONNECT_ENUM_FLAGS SIMCONNECT_CLIENT_DATA_REQUEST_FLAG; - static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED = 0x00000001; // send requested ClientData when value(s) change - static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED = 0x00000002; // send requested ClientData in tagged format +static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; +static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED = + 0x00000001; // send requested ClientData when value(s) change +static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED = + 0x00000002; // send requested ClientData in tagged format SIMCONNECT_ENUM_FLAGS SIMCONNECT_CLIENT_DATA_SET_FLAG; - static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_TAGGED = 0x00000001; // data is in tagged format - - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_VIEW_SYSTEM_EVENT_DATA; // dwData contains these flags for the "View" System Event - static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_2D = 0x00000001; // 2D Panels in cockpit view - static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_VIRTUAL = 0x00000002; // Virtual (3D) panels in cockpit view - static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_ORTHOGONAL = 0x00000004; // Orthogonal (Map) view - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_SOUND_SYSTEM_EVENT_DATA; // dwData contains these flags for the "Sound" System Event - static const DWORD SIMCONNECT_SOUND_SYSTEM_EVENT_DATA_MASTER = 0x00000001; // Sound Master - +static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT = 0x00000000; +static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_TAGGED = + 0x00000001; // data is in tagged format + +SIMCONNECT_ENUM_FLAGS + SIMCONNECT_VIEW_SYSTEM_EVENT_DATA; // dwData contains these flags for the + // "View" System Event +static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_2D = + 0x00000001; // 2D Panels in cockpit view +static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_VIRTUAL = + 0x00000002; // Virtual (3D) panels in cockpit view +static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_ORTHOGONAL = + 0x00000004; // Orthogonal (Map) view + +SIMCONNECT_ENUM_FLAGS + SIMCONNECT_SOUND_SYSTEM_EVENT_DATA; // dwData contains these flags for the + // "Sound" System Event +static const DWORD SIMCONNECT_SOUND_SYSTEM_EVENT_DATA_MASTER = + 0x00000001; // Sound Master #ifdef ENABLE_SIMCONNECT_EXPERIMENTAL -SIMCONNECT_ENUM_FLAGS SIMCONNECT_PICK_FLAGS -{ - SIMCONNECT_PICK_GROUND = 0x01, // pick ground/ pick result item is ground location - SIMCONNECT_PICK_AI = 0x02, // pick AI / pick result item is AI, (dwSimObjectID is valid) - SIMCONNECT_PICK_SCENERY = 0x04, // pick scenery/ pick result item is scenery object (hSceneryObject is valid) - SIMCONNECT_PICK_ALL = SIMCONNECT_PICK_SCENERY | SIMCONNECT_PICK_AI | SIMCONNECT_PICK_GROUND, // pick all / (not valid on pick result item) - SIMCONNECT_PICK_COORDSASPIXELS = 0x08, +SIMCONNECT_ENUM_FLAGS SIMCONNECT_PICK_FLAGS{ + SIMCONNECT_PICK_GROUND = + 0x01, // pick ground/ pick result item is ground location + SIMCONNECT_PICK_AI = + 0x02, // pick AI / pick result item is AI, (dwSimObjectID is valid) + SIMCONNECT_PICK_SCENERY = 0x04, // pick scenery/ pick result item is scenery + // object (hSceneryObject is valid) + SIMCONNECT_PICK_ALL = + SIMCONNECT_PICK_SCENERY | SIMCONNECT_PICK_AI | + SIMCONNECT_PICK_GROUND, // pick all / (not valid on pick result item) + SIMCONNECT_PICK_COORDSASPIXELS = 0x08, }; -#endif //ENABLE_SIMCONNECT_EXPERIMENTAL +#endif // ENABLE_SIMCONNECT_EXPERIMENTAL //---------------------------------------------------------------------------- // User-defined enums //---------------------------------------------------------------------------- -SIMCONNECT_USER_ENUM SIMCONNECT_NOTIFICATION_GROUP_ID; //client-defined notification group ID -SIMCONNECT_USER_ENUM SIMCONNECT_INPUT_GROUP_ID; //client-defined input group ID -SIMCONNECT_USER_ENUM SIMCONNECT_DATA_DEFINITION_ID; //client-defined data definition ID -SIMCONNECT_USER_ENUM SIMCONNECT_DATA_REQUEST_ID; //client-defined request data ID - -SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_EVENT_ID; //client-defined client event ID -SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_ID; //client-defined client data ID -SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_DEFINITION_ID; //client-defined client data definition ID - +SIMCONNECT_USER_ENUM + SIMCONNECT_NOTIFICATION_GROUP_ID; // client-defined notification group ID +SIMCONNECT_USER_ENUM SIMCONNECT_INPUT_GROUP_ID; // client-defined input group ID +SIMCONNECT_USER_ENUM + SIMCONNECT_DATA_DEFINITION_ID; // client-defined data definition ID +SIMCONNECT_USER_ENUM + SIMCONNECT_DATA_REQUEST_ID; // client-defined request data ID + +SIMCONNECT_USER_ENUM + SIMCONNECT_CLIENT_EVENT_ID; // client-defined client event ID +SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_ID; // client-defined client data ID +SIMCONNECT_USER_ENUM + SIMCONNECT_CLIENT_DATA_DEFINITION_ID; // client-defined client data + // definition ID //---------------------------------------------------------------------------- // Struct definitions @@ -376,307 +415,346 @@ SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_DEFINITION_ID; //client-defined clie #pragma pack(push, 1) -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV -{ - DWORD dwSize; // record size - DWORD dwVersion; // interface version - DWORD dwID; // see SIMCONNECT_RECV_ID +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV { + DWORD dwSize; // record size + DWORD dwVersion; // interface version + DWORD dwID; // see SIMCONNECT_RECV_ID }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EXCEPTION : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EXCEPTION +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EXCEPTION + : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EXCEPTION { - DWORD dwException; // see SIMCONNECT_EXCEPTION - static const DWORD UNKNOWN_SENDID = 0; - DWORD dwSendID; // see SimConnect_GetLastSentPacketID - static const DWORD UNKNOWN_INDEX = DWORD_MAX; - DWORD dwIndex; // index of parameter that was source of error + DWORD dwException; // see SIMCONNECT_EXCEPTION + static const DWORD UNKNOWN_SENDID = 0; + DWORD dwSendID; // see SimConnect_GetLastSentPacketID + static const DWORD UNKNOWN_INDEX = DWORD_MAX; + DWORD dwIndex; // index of parameter that was source of error }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_OPEN : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_OPEN -{ - SIMCONNECT_STRING( szApplicationName, 256); - DWORD dwApplicationVersionMajor; - DWORD dwApplicationVersionMinor; - DWORD dwApplicationBuildMajor; - DWORD dwApplicationBuildMinor; - DWORD dwSimConnectVersionMajor; - DWORD dwSimConnectVersionMinor; - DWORD dwSimConnectBuildMajor; - DWORD dwSimConnectBuildMinor; - DWORD dwReserved1; - DWORD dwReserved2; -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_QUIT : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_QUIT +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_OPEN + : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_OPEN { + SIMCONNECT_STRING(szApplicationName, 256); + DWORD dwApplicationVersionMajor; + DWORD dwApplicationVersionMinor; + DWORD dwApplicationBuildMajor; + DWORD dwApplicationBuildMinor; + DWORD dwSimConnectVersionMajor; + DWORD dwSimConnectVersionMinor; + DWORD dwSimConnectBuildMajor; + DWORD dwSimConnectBuildMinor; + DWORD dwReserved1; + DWORD dwReserved2; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EVENT -{ - static const DWORD UNKNOWN_GROUP = DWORD_MAX; - DWORD uGroupID; - DWORD uEventID; - DWORD dwData; // uEventID-dependent context -}; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_QUIT + : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_QUIT + {}; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FILENAME : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FILENAME +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT + : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EVENT { - SIMCONNECT_STRING( szFileName, MAX_PATH); // uEventID-dependent context - DWORD dwFlags; + static const DWORD UNKNOWN_GROUP = DWORD_MAX; + DWORD uGroupID; + DWORD uEventID; + DWORD dwData; // uEventID-dependent context }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FILENAME +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FILENAME + : public SIMCONNECT_RECV_EVENT // when dwID == + // SIMCONNECT_RECV_ID_EVENT_FILENAME { - SIMCONNECT_SIMOBJECT_TYPE eObjType; + SIMCONNECT_STRING(szFileName, MAX_PATH); // uEventID-dependent context + DWORD dwFlags; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FRAME : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FRAME +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE + : public SIMCONNECT_RECV_EVENT // when dwID == + // SIMCONNECT_RECV_ID_EVENT_FILENAME { - float fFrameRate; - float fSimSpeed; + SIMCONNECT_SIMOBJECT_TYPE eObjType; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FRAME + : public SIMCONNECT_RECV_EVENT // when dwID == + // SIMCONNECT_RECV_ID_EVENT_FRAME { - // No event specific data, for now + float fFrameRate; + float fSimSpeed; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED -{ - // No event specific data, for now -}; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED + : public SIMCONNECT_RECV_EVENT // when dwID == + // SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED + { + // No event specific data, for now + }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED -{ - // No event specific data, for now -}; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED + : public SIMCONNECT_RECV_EVENT // when dwID == + // SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED + { + // No event specific data, for now + }; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED + : public SIMCONNECT_RECV_EVENT // when dwID == + // SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED + { + // No event specific data, for now + }; // SIMCONNECT_DATA_RACE_RESULT -SIMCONNECT_STRUCT SIMCONNECT_DATA_RACE_RESULT -{ - DWORD dwNumberOfRacers; // The total number of racers - SIMCONNECT_GUID MissionGUID; // The name of the mission to execute, NULL if no mission - SIMCONNECT_STRING( szPlayerName, MAX_PATH); // The name of the player - SIMCONNECT_STRING( szSessionType, MAX_PATH); // The type of the multiplayer session: "LAN", "GAMESPY") - SIMCONNECT_STRING( szAircraft, MAX_PATH); // The aircraft type - SIMCONNECT_STRING( szPlayerRole, MAX_PATH); // The player role in the mission - double fTotalTime; // Total time in seconds, 0 means DNF - double fPenaltyTime; // Total penalty time in seconds - DWORD dwIsDisqualified; // non 0 - disqualified, 0 - not disqualified -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_END : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_RACE_END -{ - DWORD dwRacerNumber; // The index of the racer the results are for - SIMCONNECT_DATA_RACE_RESULT RacerData; +SIMCONNECT_STRUCT SIMCONNECT_DATA_RACE_RESULT { + DWORD dwNumberOfRacers; // The total number of racers + SIMCONNECT_GUID + MissionGUID; // The name of the mission to execute, NULL if no mission + SIMCONNECT_STRING(szPlayerName, MAX_PATH); // The name of the player + SIMCONNECT_STRING( + szSessionType, + MAX_PATH); // The type of the multiplayer session: "LAN", "GAMESPY") + SIMCONNECT_STRING(szAircraft, MAX_PATH); // The aircraft type + SIMCONNECT_STRING(szPlayerRole, MAX_PATH); // The player role in the mission + double fTotalTime; // Total time in seconds, 0 means DNF + double fPenaltyTime; // Total penalty time in seconds + DWORD dwIsDisqualified; // non 0 - disqualified, 0 - not disqualified }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_LAP : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_RACE_LAP +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_END + : public SIMCONNECT_RECV_EVENT // when dwID == + // SIMCONNECT_RECV_ID_EVENT_RACE_END { - DWORD dwLapIndex; // The index of the lap the results are for - SIMCONNECT_DATA_RACE_RESULT RacerData; + DWORD dwRacerNumber; // The index of the racer the results are for + SIMCONNECT_DATA_RACE_RESULT RacerData; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_LAP + : public SIMCONNECT_RECV_EVENT // when dwID == + // SIMCONNECT_RECV_ID_EVENT_RACE_LAP { - DWORD dwRequestID; - DWORD dwObjectID; - DWORD dwDefineID; - DWORD dwFlags; // SIMCONNECT_DATA_REQUEST_FLAG - DWORD dwentrynumber; // if multiple objects returned, this is number out of . - DWORD dwoutof; // note: starts with 1, not 0. - DWORD dwDefineCount; // data count (number of datums, *not* byte count) - SIMCONNECT_DATAV( dwData, dwDefineID, ); // data begins here, dwDefineCount data items + DWORD dwLapIndex; // The index of the lap the results are for + SIMCONNECT_DATA_RACE_RESULT RacerData; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA + : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA { + DWORD dwRequestID; + DWORD dwObjectID; + DWORD dwDefineID; + DWORD dwFlags; // SIMCONNECT_DATA_REQUEST_FLAG + DWORD dwentrynumber; // if multiple objects returned, this is number + // out of . + DWORD dwoutof; // note: starts with 1, not 0. + DWORD dwDefineCount; // data count (number of datums, *not* byte count) + SIMCONNECT_DATAV(dwData, + dwDefineID, ); // data begins here, dwDefineCount data items }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLIENT_DATA : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == SIMCONNECT_RECV_ID_CLIENT_DATA -{ -}; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE + : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == + // SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE + {}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLIENT_DATA + : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == + // SIMCONNECT_RECV_ID_CLIENT_DATA + {}; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WEATHER_OBSERVATION : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_WEATHER_OBSERVATION +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WEATHER_OBSERVATION + : public SIMCONNECT_RECV // when dwID == + // SIMCONNECT_RECV_ID_WEATHER_OBSERVATION { - DWORD dwRequestID; - SIMCONNECT_STRINGV( szMetar); // Variable length string whose maximum size is MAX_METAR_LENGTH + DWORD dwRequestID; + SIMCONNECT_STRINGV( + szMetar); // Variable length string whose maximum size is MAX_METAR_LENGTH }; static const int SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH = 64; -static const int SIMCONNECT_CLOUD_STATE_ARRAY_SIZE = SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH*SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH; +static const int SIMCONNECT_CLOUD_STATE_ARRAY_SIZE = + SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH * SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLOUD_STATE : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_CLOUD_STATE +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLOUD_STATE + : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_CLOUD_STATE { - DWORD dwRequestID; - DWORD dwArraySize; - SIMCONNECT_FIXEDTYPE_DATAV(BYTE, rgbData, dwArraySize, U1 /*member of UnmanagedType enum*/ , System::Byte /*cli type*/); + DWORD dwRequestID; + DWORD dwArraySize; + SIMCONNECT_FIXEDTYPE_DATAV(BYTE, rgbData, dwArraySize, + U1 /*member of UnmanagedType enum*/, + System::Byte /*cli type*/); }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_ASSIGNED_OBJECT_ID : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_ASSIGNED_OBJECT_ID + : public SIMCONNECT_RECV // when dwID == + // SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID { - DWORD dwRequestID; - DWORD dwObjectID; + DWORD dwRequestID; + DWORD dwObjectID; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_RESERVED_KEY : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_RESERVED_KEY + : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY { - SIMCONNECT_STRING( szChoiceReserved, 30); - SIMCONNECT_STRING( szReservedKey, 50); + SIMCONNECT_STRING(szChoiceReserved, 30); + SIMCONNECT_STRING(szReservedKey, 50); }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SYSTEM_STATE : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SYSTEM_STATE +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SYSTEM_STATE + : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SYSTEM_STATE { - DWORD dwRequestID; - DWORD dwInteger; - float fFloat; - SIMCONNECT_STRING( szString, MAX_PATH); + DWORD dwRequestID; + DWORD dwInteger; + float fFloat; + SIMCONNECT_STRING(szString, MAX_PATH); }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CUSTOM_ACTION : public SIMCONNECT_RECV_EVENT -{ - SIMCONNECT_GUID guidInstanceId; // Instance id of the action that executed - DWORD dwWaitForCompletion; // Wait for completion flag on the action - SIMCONNECT_STRINGV( szPayLoad); // Variable length string payload associated with the mission action. +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CUSTOM_ACTION + : public SIMCONNECT_RECV_EVENT { + SIMCONNECT_GUID guidInstanceId; // Instance id of the action that executed + DWORD dwWaitForCompletion; // Wait for completion flag on the action + SIMCONNECT_STRINGV(szPayLoad); // Variable length string payload associated + // with the mission action. }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_WEATHER_MODE : public SIMCONNECT_RECV_EVENT -{ - // No event specific data - the new weather mode is in the base structure dwData member. -}; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_WEATHER_MODE + : public SIMCONNECT_RECV_EVENT{ + // No event specific data - the new weather mode is in the base + // structure dwData member. + }; // SIMCONNECT_RECV_FACILITIES_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_FACILITIES_LIST : public SIMCONNECT_RECV -{ - DWORD dwRequestID; - DWORD dwArraySize; - DWORD dwEntryNumber; // when the array of items is too big for one send, which send this is (0..dwOutOf-1) - DWORD dwOutOf; // total number of transmissions the list is chopped into +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_FACILITIES_LIST : public SIMCONNECT_RECV { + DWORD dwRequestID; + DWORD dwArraySize; + DWORD dwEntryNumber; // when the array of items is too big for one send, which + // send this is (0..dwOutOf-1) + DWORD dwOutOf; // total number of transmissions the list is chopped into }; // SIMCONNECT_DATA_FACILITY_AIRPORT -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_AIRPORT -{ - SIMCONNECT_STRING(Icao, 9); // ICAO of the object - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // meters +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_AIRPORT { + SIMCONNECT_STRING(Icao, 9); // ICAO of the object + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // meters }; // SIMCONNECT_RECV_AIRPORT_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_AIRPORT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST -{ - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_AIRPORT, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_AIRPORT /*cli type*/); +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_AIRPORT_LIST + : public SIMCONNECT_RECV_FACILITIES_LIST { + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_AIRPORT, rgData, + dwArraySize, U1 /*member of UnmanagedType enum*/, + SIMCONNECT_DATA_FACILITY_AIRPORT /*cli type*/); }; - // SIMCONNECT_DATA_FACILITY_WAYPOINT -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_WAYPOINT : public SIMCONNECT_DATA_FACILITY_AIRPORT -{ - float fMagVar; // Magvar in degrees +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_WAYPOINT + : public SIMCONNECT_DATA_FACILITY_AIRPORT { + float fMagVar; // Magvar in degrees }; // SIMCONNECT_RECV_WAYPOINT_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WAYPOINT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST -{ - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_WAYPOINT, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_WAYPOINT /*cli type*/); +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WAYPOINT_LIST + : public SIMCONNECT_RECV_FACILITIES_LIST { + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_WAYPOINT, rgData, + dwArraySize, U1 /*member of UnmanagedType enum*/, + SIMCONNECT_DATA_FACILITY_WAYPOINT /*cli type*/); }; // SIMCONNECT_DATA_FACILITY_NDB -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_NDB : public SIMCONNECT_DATA_FACILITY_WAYPOINT -{ - DWORD fFrequency; // frequency in Hz +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_NDB + : public SIMCONNECT_DATA_FACILITY_WAYPOINT { + DWORD fFrequency; // frequency in Hz }; // SIMCONNECT_RECV_NDB_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_NDB_LIST : public SIMCONNECT_RECV_FACILITIES_LIST -{ - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_NDB, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_NDB /*cli type*/); +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_NDB_LIST + : public SIMCONNECT_RECV_FACILITIES_LIST { + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_NDB, rgData, dwArraySize, + U1 /*member of UnmanagedType enum*/, + SIMCONNECT_DATA_FACILITY_NDB /*cli type*/); }; // SIMCONNECT_DATA_FACILITY_VOR -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_VOR : public SIMCONNECT_DATA_FACILITY_NDB -{ - DWORD Flags; // SIMCONNECT_VOR_FLAGS - float fLocalizer; // Localizer in degrees - double GlideLat; // Glide Slope Location (deg, deg, meters) - double GlideLon; - double GlideAlt; - float fGlideSlopeAngle; // Glide Slope in degrees +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_VOR + : public SIMCONNECT_DATA_FACILITY_NDB { + DWORD Flags; // SIMCONNECT_VOR_FLAGS + float fLocalizer; // Localizer in degrees + double GlideLat; // Glide Slope Location (deg, deg, meters) + double GlideLon; + double GlideAlt; + float fGlideSlopeAngle; // Glide Slope in degrees }; // SIMCONNECT_RECV_VOR_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_VOR_LIST : public SIMCONNECT_RECV_FACILITIES_LIST -{ - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_VOR, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_VOR /*cli type*/); +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_VOR_LIST + : public SIMCONNECT_RECV_FACILITIES_LIST { + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_VOR, rgData, dwArraySize, + U1 /*member of UnmanagedType enum*/, + SIMCONNECT_DATA_FACILITY_VOR /*cli type*/); }; #ifdef ENABLE_SIMCONNECT_EXPERIMENTAL -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_PICK : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_PICK + : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY { - HANDLE hContext; - DWORD dwFlags; // - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // feet - int xPos; //reserved - int yPos; //reserved; - DWORD dwSimObjectID; - HANDLE hSceneryObject; - DWORD dwentrynumber; // if multiple objects returned, this is number out of . - DWORD dwoutof; // note: starts with 1, not 0. + HANDLE hContext; + DWORD dwFlags; // + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // feet + int xPos; // reserved + int yPos; // reserved; + DWORD dwSimObjectID; + HANDLE hSceneryObject; + DWORD dwentrynumber; // if multiple objects returned, this is number + // out of . + DWORD dwoutof; // note: starts with 1, not 0. }; -#endif //ENABLE_SIMCONNECT_EXPERIMENTAL - +#endif // ENABLE_SIMCONNECT_EXPERIMENTAL // SIMCONNECT_DATATYPE_INITPOSITION -SIMCONNECT_STRUCT SIMCONNECT_DATA_INITPOSITION -{ - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // feet - double Pitch; // degrees - double Bank; // degrees - double Heading; // degrees - DWORD OnGround; // 1=force to be on the ground - DWORD Airspeed; // knots +SIMCONNECT_STRUCT SIMCONNECT_DATA_INITPOSITION { + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // feet + double Pitch; // degrees + double Bank; // degrees + double Heading; // degrees + DWORD OnGround; // 1=force to be on the ground + DWORD Airspeed; // knots }; - // SIMCONNECT_DATATYPE_MARKERSTATE -SIMCONNECT_STRUCT SIMCONNECT_DATA_MARKERSTATE -{ - SIMCONNECT_STRING( szMarkerName, 64); - DWORD dwMarkerState; +SIMCONNECT_STRUCT SIMCONNECT_DATA_MARKERSTATE { + SIMCONNECT_STRING(szMarkerName, 64); + DWORD dwMarkerState; }; // SIMCONNECT_DATATYPE_WAYPOINT -SIMCONNECT_STRUCT SIMCONNECT_DATA_WAYPOINT -{ - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // feet - unsigned long Flags; - double ktsSpeed; // knots - double percentThrottle; +SIMCONNECT_STRUCT SIMCONNECT_DATA_WAYPOINT { + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // feet + unsigned long Flags; + double ktsSpeed; // knots + double percentThrottle; }; // SIMCONNECT_DATA_LATLONALT -SIMCONNECT_STRUCT SIMCONNECT_DATA_LATLONALT -{ - double Latitude; - double Longitude; - double Altitude; +SIMCONNECT_STRUCT SIMCONNECT_DATA_LATLONALT { + double Latitude; + double Longitude; + double Altitude; }; // SIMCONNECT_DATA_XYZ -SIMCONNECT_STRUCT SIMCONNECT_DATA_XYZ -{ - double x; - double y; - double z; +SIMCONNECT_STRUCT SIMCONNECT_DATA_XYZ { + double x; + double y; + double z; }; #pragma pack(pop) @@ -685,94 +763,259 @@ SIMCONNECT_STRUCT SIMCONNECT_DATA_XYZ // End of Struct definitions //---------------------------------------------------------------------------- -typedef void (CALLBACK *DispatchProc)(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext); +typedef void(CALLBACK *DispatchProc)(SIMCONNECT_RECV *pData, DWORD cbData, + void *pContext); #if !defined(SIMCONNECTAPI) - #ifdef _MSFS_WASM - #ifdef __INTELLISENSE__ - #define MODULE_EXPORT - #define SIMCONNECTAPI extern "C" HRESULT - #else - #define MODULE_EXPORT __attribute__( ( visibility( "default" ) ) ) - #define SIMCONNECTAPI extern "C" __attribute__((import_module(SIMCONNECT_WASM_MODULE))) HRESULT - #endif - #else - #define MODULE_EXPORT - #define SIMCONNECTAPI extern "C" HRESULT __stdcall - #endif +#ifdef _MSFS_WASM +#ifdef __INTELLISENSE__ +#define MODULE_EXPORT +#define SIMCONNECTAPI extern "C" HRESULT +#else +#define MODULE_EXPORT __attribute__((visibility("default"))) +#define SIMCONNECTAPI \ + extern "C" __attribute__((import_module(SIMCONNECT_WASM_MODULE))) HRESULT +#endif +#else +#define MODULE_EXPORT +#define SIMCONNECTAPI extern "C" HRESULT __stdcall +#endif #endif -SIMCONNECTAPI SimConnect_MapClientEventToSimEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * EventName = ""); -SIMCONNECTAPI SimConnect_TransmitClientEvent(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD dwData, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_EVENT_FLAG Flags); -SIMCONNECTAPI SimConnect_SetSystemEventState(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, SIMCONNECT_STATE dwState); -SIMCONNECTAPI SimConnect_AddClientEventToNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_CLIENT_EVENT_ID EventID, BOOL bMaskable = FALSE); -SIMCONNECTAPI SimConnect_RemoveClientEvent(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_CLIENT_EVENT_ID EventID); -SIMCONNECTAPI SimConnect_SetNotificationGroupPriority(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, DWORD uPriority); -SIMCONNECTAPI SimConnect_ClearNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID); -SIMCONNECTAPI SimConnect_RequestNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, DWORD dwReserved = 0, DWORD Flags = 0); -SIMCONNECTAPI SimConnect_AddToDataDefinition(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, const char * DatumName, const char * UnitsName, SIMCONNECT_DATATYPE DatumType = SIMCONNECT_DATATYPE_FLOAT64, float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); -SIMCONNECTAPI SimConnect_ClearDataDefinition(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID); -SIMCONNECTAPI SimConnect_RequestDataOnSimObject(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_PERIOD Period, SIMCONNECT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); -SIMCONNECTAPI SimConnect_RequestDataOnSimObjectType(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_DATA_DEFINITION_ID DefineID, DWORD dwRadiusMeters, SIMCONNECT_SIMOBJECT_TYPE type); -SIMCONNECTAPI SimConnect_SetDataOnSimObject(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_SET_FLAG Flags, DWORD ArrayCount, DWORD cbUnitSize, void * pDataSet); -SIMCONNECTAPI SimConnect_MapInputEventToClientEvent(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, const char * szInputDefinition, SIMCONNECT_CLIENT_EVENT_ID DownEventID, DWORD DownValue = 0, SIMCONNECT_CLIENT_EVENT_ID UpEventID = (SIMCONNECT_CLIENT_EVENT_ID)SIMCONNECT_UNUSED, DWORD UpValue = 0, BOOL bMaskable = FALSE); -SIMCONNECTAPI SimConnect_SetInputGroupPriority(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD uPriority); -SIMCONNECTAPI SimConnect_RemoveInputEvent(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, const char * szInputDefinition); -SIMCONNECTAPI SimConnect_ClearInputGroup(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID); -SIMCONNECTAPI SimConnect_SetInputGroupState(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD dwState); -SIMCONNECTAPI SimConnect_RequestReservedKey(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * szKeyChoice1 = "", const char * szKeyChoice2 = "", const char * szKeyChoice3 = ""); -SIMCONNECTAPI SimConnect_SubscribeToSystemEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * SystemEventName); -SIMCONNECTAPI SimConnect_UnsubscribeFromSystemEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID); -SIMCONNECTAPI SimConnect_WeatherRequestInterpolatedObservation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon, float alt); -SIMCONNECTAPI SimConnect_WeatherRequestObservationAtStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO); -SIMCONNECTAPI SimConnect_WeatherRequestObservationAtNearestStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon); -SIMCONNECTAPI SimConnect_WeatherCreateStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO, const char * szName, float lat, float lon, float alt); -SIMCONNECTAPI SimConnect_WeatherRemoveStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO); -SIMCONNECTAPI SimConnect_WeatherSetObservation(HANDLE hSimConnect, DWORD Seconds, const char * szMETAR); -SIMCONNECTAPI SimConnect_WeatherSetModeServer(HANDLE hSimConnect, DWORD dwPort, DWORD dwSeconds); -SIMCONNECTAPI SimConnect_WeatherSetModeTheme(HANDLE hSimConnect, const char * szThemeName); +SIMCONNECTAPI +SimConnect_MapClientEventToSimEvent(HANDLE hSimConnect, + SIMCONNECT_CLIENT_EVENT_ID EventID, + const char *EventName = ""); +SIMCONNECTAPI SimConnect_TransmitClientEvent( + HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, + SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD dwData, + SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_EVENT_FLAG Flags); +SIMCONNECTAPI SimConnect_SetSystemEventState(HANDLE hSimConnect, + SIMCONNECT_CLIENT_EVENT_ID EventID, + SIMCONNECT_STATE dwState); +SIMCONNECTAPI SimConnect_AddClientEventToNotificationGroup( + HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, + SIMCONNECT_CLIENT_EVENT_ID EventID, BOOL bMaskable = FALSE); +SIMCONNECTAPI +SimConnect_RemoveClientEvent(HANDLE hSimConnect, + SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, + SIMCONNECT_CLIENT_EVENT_ID EventID); +SIMCONNECTAPI SimConnect_SetNotificationGroupPriority( + HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, + DWORD uPriority); +SIMCONNECTAPI +SimConnect_ClearNotificationGroup(HANDLE hSimConnect, + SIMCONNECT_NOTIFICATION_GROUP_ID GroupID); +SIMCONNECTAPI +SimConnect_RequestNotificationGroup(HANDLE hSimConnect, + SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, + DWORD dwReserved = 0, DWORD Flags = 0); +SIMCONNECTAPI SimConnect_AddToDataDefinition( + HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, + const char *DatumName, const char *UnitsName, + SIMCONNECT_DATATYPE DatumType = SIMCONNECT_DATATYPE_FLOAT64, + float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); +SIMCONNECTAPI +SimConnect_ClearDataDefinition(HANDLE hSimConnect, + SIMCONNECT_DATA_DEFINITION_ID DefineID); +SIMCONNECTAPI SimConnect_RequestDataOnSimObject( + HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, + SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, + SIMCONNECT_PERIOD Period, SIMCONNECT_DATA_REQUEST_FLAG Flags = 0, + DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); +SIMCONNECTAPI SimConnect_RequestDataOnSimObjectType( + HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, + SIMCONNECT_DATA_DEFINITION_ID DefineID, DWORD dwRadiusMeters, + SIMCONNECT_SIMOBJECT_TYPE type); +SIMCONNECTAPI SimConnect_SetDataOnSimObject( + HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, + SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_SET_FLAG Flags, + DWORD ArrayCount, DWORD cbUnitSize, void *pDataSet); +SIMCONNECTAPI SimConnect_MapInputEventToClientEvent( + HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, + const char *szInputDefinition, SIMCONNECT_CLIENT_EVENT_ID DownEventID, + DWORD DownValue = 0, + SIMCONNECT_CLIENT_EVENT_ID UpEventID = (SIMCONNECT_CLIENT_EVENT_ID) + SIMCONNECT_UNUSED, + DWORD UpValue = 0, BOOL bMaskable = FALSE); +SIMCONNECTAPI SimConnect_SetInputGroupPriority( + HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD uPriority); +SIMCONNECTAPI SimConnect_RemoveInputEvent(HANDLE hSimConnect, + SIMCONNECT_INPUT_GROUP_ID GroupID, + const char *szInputDefinition); +SIMCONNECTAPI SimConnect_ClearInputGroup(HANDLE hSimConnect, + SIMCONNECT_INPUT_GROUP_ID GroupID); +SIMCONNECTAPI SimConnect_SetInputGroupState(HANDLE hSimConnect, + SIMCONNECT_INPUT_GROUP_ID GroupID, + DWORD dwState); +SIMCONNECTAPI SimConnect_RequestReservedKey(HANDLE hSimConnect, + SIMCONNECT_CLIENT_EVENT_ID EventID, + const char *szKeyChoice1 = "", + const char *szKeyChoice2 = "", + const char *szKeyChoice3 = ""); +SIMCONNECTAPI +SimConnect_SubscribeToSystemEvent(HANDLE hSimConnect, + SIMCONNECT_CLIENT_EVENT_ID EventID, + const char *SystemEventName); +SIMCONNECTAPI +SimConnect_UnsubscribeFromSystemEvent(HANDLE hSimConnect, + SIMCONNECT_CLIENT_EVENT_ID EventID); +SIMCONNECTAPI SimConnect_WeatherRequestInterpolatedObservation( + HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, + float lon, float alt); +SIMCONNECTAPI SimConnect_WeatherRequestObservationAtStation( + HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, + const char *szICAO); +SIMCONNECTAPI SimConnect_WeatherRequestObservationAtNearestStation( + HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, + float lon); +SIMCONNECTAPI SimConnect_WeatherCreateStation( + HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, + const char *szICAO, const char *szName, float lat, float lon, float alt); +SIMCONNECTAPI +SimConnect_WeatherRemoveStation(HANDLE hSimConnect, + SIMCONNECT_DATA_REQUEST_ID RequestID, + const char *szICAO); +SIMCONNECTAPI SimConnect_WeatherSetObservation(HANDLE hSimConnect, + DWORD Seconds, + const char *szMETAR); +SIMCONNECTAPI SimConnect_WeatherSetModeServer(HANDLE hSimConnect, DWORD dwPort, + DWORD dwSeconds); +SIMCONNECTAPI SimConnect_WeatherSetModeTheme(HANDLE hSimConnect, + const char *szThemeName); SIMCONNECTAPI SimConnect_WeatherSetModeGlobal(HANDLE hSimConnect); SIMCONNECTAPI SimConnect_WeatherSetModeCustom(HANDLE hSimConnect); -SIMCONNECTAPI SimConnect_WeatherSetDynamicUpdateRate(HANDLE hSimConnect, DWORD dwRate); -SIMCONNECTAPI SimConnect_WeatherRequestCloudState(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float minLat, float minLon, float minAlt, float maxLat, float maxLon, float maxAlt, DWORD dwFlags = 0); -SIMCONNECTAPI SimConnect_WeatherCreateThermal(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon, float alt, float radius, float height, float coreRate = 3.0f, float coreTurbulence = 0.05f, float sinkRate = 3.0f, float sinkTurbulence = 0.2f, float coreSize = 0.4f, float coreTransitionSize = 0.1f, float sinkLayerSize = 0.4f, float sinkTransitionSize = 0.1f); -SIMCONNECTAPI SimConnect_WeatherRemoveThermal(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID); -SIMCONNECTAPI SimConnect_AICreateParkedATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, const char * szAirportID, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AICreateEnrouteATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, int iFlightNumber, const char * szFlightPlanPath, double dFlightPlanPosition, BOOL bTouchAndGo, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AICreateNonATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AICreateSimulatedObject(HANDLE hSimConnect, const char * szContainerTitle, SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AIReleaseControl(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AIRemoveObject(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AISetAircraftFlightPlan(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, const char * szFlightPlanPath, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_ExecuteMissionAction(HANDLE hSimConnect, const GUID guidInstanceId); -SIMCONNECTAPI SimConnect_CompleteCustomMissionAction(HANDLE hSimConnect, const GUID guidInstanceId); +SIMCONNECTAPI SimConnect_WeatherSetDynamicUpdateRate(HANDLE hSimConnect, + DWORD dwRate); +SIMCONNECTAPI SimConnect_WeatherRequestCloudState( + HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float minLat, + float minLon, float minAlt, float maxLat, float maxLon, float maxAlt, + DWORD dwFlags = 0); +SIMCONNECTAPI SimConnect_WeatherCreateThermal( + HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, + float lon, float alt, float radius, float height, float coreRate = 3.0f, + float coreTurbulence = 0.05f, float sinkRate = 3.0f, + float sinkTurbulence = 0.2f, float coreSize = 0.4f, + float coreTransitionSize = 0.1f, float sinkLayerSize = 0.4f, + float sinkTransitionSize = 0.1f); +SIMCONNECTAPI SimConnect_WeatherRemoveThermal(HANDLE hSimConnect, + SIMCONNECT_OBJECT_ID ObjectID); +SIMCONNECTAPI SimConnect_AICreateParkedATCAircraft( + HANDLE hSimConnect, const char *szContainerTitle, const char *szTailNumber, + const char *szAirportID, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AICreateEnrouteATCAircraft( + HANDLE hSimConnect, const char *szContainerTitle, const char *szTailNumber, + int iFlightNumber, const char *szFlightPlanPath, double dFlightPlanPosition, + BOOL bTouchAndGo, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AICreateNonATCAircraft( + HANDLE hSimConnect, const char *szContainerTitle, const char *szTailNumber, + SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AICreateSimulatedObject( + HANDLE hSimConnect, const char *szContainerTitle, + SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AIReleaseControl(HANDLE hSimConnect, + SIMCONNECT_OBJECT_ID ObjectID, + SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AIRemoveObject(HANDLE hSimConnect, + SIMCONNECT_OBJECT_ID ObjectID, + SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AISetAircraftFlightPlan( + HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, + const char *szFlightPlanPath, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_ExecuteMissionAction(HANDLE hSimConnect, + const GUID guidInstanceId); +SIMCONNECTAPI SimConnect_CompleteCustomMissionAction(HANDLE hSimConnect, + const GUID guidInstanceId); SIMCONNECTAPI SimConnect_Close(HANDLE hSimConnect); -SIMCONNECTAPI SimConnect_RetrieveString(SIMCONNECT_RECV * pData, DWORD cbData, void * pStringV, char ** pszString, DWORD * pcbString); -SIMCONNECTAPI SimConnect_GetLastSentPacketID(HANDLE hSimConnect, DWORD * pdwError); -SIMCONNECTAPI SimConnect_Open(HANDLE * phSimConnect, LPCSTR szName, HWND hWnd, DWORD UserEventWin32, HANDLE hEventHandle, DWORD ConfigIndex); -SIMCONNECTAPI SimConnect_CallDispatch(HANDLE hSimConnect, DispatchProc pfcnDispatch, void * pContext); -SIMCONNECTAPI SimConnect_GetNextDispatch(HANDLE hSimConnect, SIMCONNECT_RECV ** ppData, DWORD * pcbData); -SIMCONNECTAPI SimConnect_RequestResponseTimes(HANDLE hSimConnect, DWORD nCount, float * fElapsedSeconds); -SIMCONNECTAPI SimConnect_InsertString(char * pDest, DWORD cbDest, void ** ppEnd, DWORD * pcbStringV, const char * pSource); -SIMCONNECTAPI SimConnect_CameraSetRelative6DOF(HANDLE hSimConnect, float fDeltaX, float fDeltaY, float fDeltaZ, float fPitchDeg, float fBankDeg, float fHeadingDeg); -SIMCONNECTAPI SimConnect_MenuAddItem(HANDLE hSimConnect, const char * szMenuItem, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, DWORD dwData); -SIMCONNECTAPI SimConnect_MenuDeleteItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID); -SIMCONNECTAPI SimConnect_MenuAddSubItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, const char * szMenuItem, SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID, DWORD dwData); -SIMCONNECTAPI SimConnect_MenuDeleteSubItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, const SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID); -SIMCONNECTAPI SimConnect_RequestSystemState(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szState); -SIMCONNECTAPI SimConnect_SetSystemState(HANDLE hSimConnect, const char * szState, DWORD dwInteger, float fFloat, const char * szString); -SIMCONNECTAPI SimConnect_MapClientDataNameToID(HANDLE hSimConnect, const char * szClientDataName, SIMCONNECT_CLIENT_DATA_ID ClientDataID); -SIMCONNECTAPI SimConnect_CreateClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, DWORD dwSize, SIMCONNECT_CREATE_CLIENT_DATA_FLAG Flags); -SIMCONNECTAPI SimConnect_AddToClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, DWORD dwOffset, DWORD dwSizeOrType, float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); -SIMCONNECTAPI SimConnect_ClearClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID); -SIMCONNECTAPI SimConnect_RequestClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, SIMCONNECT_CLIENT_DATA_PERIOD Period = SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); -SIMCONNECTAPI SimConnect_SetClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, SIMCONNECT_CLIENT_DATA_SET_FLAG Flags, DWORD dwReserved, DWORD cbUnitSize, void * pDataSet); -SIMCONNECTAPI SimConnect_FlightLoad(HANDLE hSimConnect, const char * szFileName); -SIMCONNECTAPI SimConnect_FlightSave(HANDLE hSimConnect, const char * szFileName, const char * szTitle, const char * szDescription, DWORD Flags); -SIMCONNECTAPI SimConnect_FlightPlanLoad(HANDLE hSimConnect, const char * szFileName); -SIMCONNECTAPI SimConnect_Text(HANDLE hSimConnect, SIMCONNECT_TEXT_TYPE type, float fTimeSeconds, SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD cbUnitSize, void * pDataSet); -SIMCONNECTAPI SimConnect_SubscribeToFacilities(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_UnsubscribeToFacilities(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type); -SIMCONNECTAPI SimConnect_RequestFacilitiesList(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_RetrieveString(SIMCONNECT_RECV *pData, DWORD cbData, + void *pStringV, char **pszString, + DWORD *pcbString); +SIMCONNECTAPI SimConnect_GetLastSentPacketID(HANDLE hSimConnect, + DWORD *pdwError); +SIMCONNECTAPI SimConnect_Open(HANDLE *phSimConnect, LPCSTR szName, HWND hWnd, + DWORD UserEventWin32, HANDLE hEventHandle, + DWORD ConfigIndex); +SIMCONNECTAPI SimConnect_CallDispatch(HANDLE hSimConnect, + DispatchProc pfcnDispatch, + void *pContext); +SIMCONNECTAPI SimConnect_GetNextDispatch(HANDLE hSimConnect, + SIMCONNECT_RECV **ppData, + DWORD *pcbData); +SIMCONNECTAPI SimConnect_RequestResponseTimes(HANDLE hSimConnect, DWORD nCount, + float *fElapsedSeconds); +SIMCONNECTAPI SimConnect_InsertString(char *pDest, DWORD cbDest, void **ppEnd, + DWORD *pcbStringV, const char *pSource); +SIMCONNECTAPI SimConnect_CameraSetRelative6DOF(HANDLE hSimConnect, + float fDeltaX, float fDeltaY, + float fDeltaZ, float fPitchDeg, + float fBankDeg, + float fHeadingDeg); +SIMCONNECTAPI SimConnect_MenuAddItem(HANDLE hSimConnect, const char *szMenuItem, + SIMCONNECT_CLIENT_EVENT_ID MenuEventID, + DWORD dwData); +SIMCONNECTAPI SimConnect_MenuDeleteItem(HANDLE hSimConnect, + SIMCONNECT_CLIENT_EVENT_ID MenuEventID); +SIMCONNECTAPI SimConnect_MenuAddSubItem( + HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, + const char *szMenuItem, SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID, + DWORD dwData); +SIMCONNECTAPI +SimConnect_MenuDeleteSubItem(HANDLE hSimConnect, + SIMCONNECT_CLIENT_EVENT_ID MenuEventID, + const SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID); +SIMCONNECTAPI +SimConnect_RequestSystemState(HANDLE hSimConnect, + SIMCONNECT_DATA_REQUEST_ID RequestID, + const char *szState); +SIMCONNECTAPI SimConnect_SetSystemState(HANDLE hSimConnect, const char *szState, + DWORD dwInteger, float fFloat, + const char *szString); +SIMCONNECTAPI +SimConnect_MapClientDataNameToID(HANDLE hSimConnect, + const char *szClientDataName, + SIMCONNECT_CLIENT_DATA_ID ClientDataID); +SIMCONNECTAPI SimConnect_CreateClientData( + HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, DWORD dwSize, + SIMCONNECT_CREATE_CLIENT_DATA_FLAG Flags); +SIMCONNECTAPI SimConnect_AddToClientDataDefinition( + HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, + DWORD dwOffset, DWORD dwSizeOrType, float fEpsilon = 0, + DWORD DatumID = SIMCONNECT_UNUSED); +SIMCONNECTAPI SimConnect_ClearClientDataDefinition( + HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID); +SIMCONNECTAPI SimConnect_RequestClientData( + HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, + SIMCONNECT_DATA_REQUEST_ID RequestID, + SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, + SIMCONNECT_CLIENT_DATA_PERIOD Period = SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, + SIMCONNECT_CLIENT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, + DWORD interval = 0, DWORD limit = 0); +SIMCONNECTAPI +SimConnect_SetClientData(HANDLE hSimConnect, + SIMCONNECT_CLIENT_DATA_ID ClientDataID, + SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, + SIMCONNECT_CLIENT_DATA_SET_FLAG Flags, + DWORD dwReserved, DWORD cbUnitSize, void *pDataSet); +SIMCONNECTAPI SimConnect_FlightLoad(HANDLE hSimConnect, const char *szFileName); +SIMCONNECTAPI SimConnect_FlightSave(HANDLE hSimConnect, const char *szFileName, + const char *szTitle, + const char *szDescription, DWORD Flags); +SIMCONNECTAPI SimConnect_FlightPlanLoad(HANDLE hSimConnect, + const char *szFileName); +SIMCONNECTAPI SimConnect_Text(HANDLE hSimConnect, SIMCONNECT_TEXT_TYPE type, + float fTimeSeconds, + SIMCONNECT_CLIENT_EVENT_ID EventID, + DWORD cbUnitSize, void *pDataSet); +SIMCONNECTAPI +SimConnect_SubscribeToFacilities(HANDLE hSimConnect, + SIMCONNECT_FACILITY_LIST_TYPE type, + SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI +SimConnect_UnsubscribeToFacilities(HANDLE hSimConnect, + SIMCONNECT_FACILITY_LIST_TYPE type); +SIMCONNECTAPI +SimConnect_RequestFacilitiesList(HANDLE hSimConnect, + SIMCONNECT_FACILITY_LIST_TYPE type, + SIMCONNECT_DATA_REQUEST_ID RequestID); #endif // _SIMCONNECT_H_ From fa467310959c2a52885168424566376889bc56ce Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Sat, 22 Jun 2024 11:39:17 +0200 Subject: [PATCH 28/33] upped v --- Cargo.lock | 2 +- Cargo.toml | 2 +- Readme.md | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9114149..ba0edf2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,7 +200,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "simconnect" -version = "0.3.1" +version = "0.4.0" dependencies = [ "bindgen", ] diff --git a/Cargo.toml b/Cargo.toml index 065bb15..1fd4e2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "simconnect" license = "MIT" description = "Rust bindings for SimConnect" -version = "0.3.1" +version = "0.4.0" authors = ["Connor T"] edition = "2018" diff --git a/Readme.md b/Readme.md index 46b3663..11458e7 100644 --- a/Readme.md +++ b/Readme.md @@ -1,20 +1,26 @@ ![crates.io](https://img.shields.io/crates/v/simconnect) + # SimConnect Bindings for Rust + ## Using + Add this to your `Cargo.toml` + ```toml [dependencies] -simconnect = "0.3.1" +simconnect = "0.4.0" ``` ## Building -*The SimConnect binaries are included within this repository, but they may not be up-to-date.* + +_The SimConnect binaries are included within this repository, but they may not be up-to-date._ 1. Install [CLang](https://clang.llvm.org/get_started.html). More information available at the [Rust Bindgen Documentation](https://rust-lang.github.io/rust-bindgen/requirements.html). 2. run `cargo build` 3. Add `use simconnect` at the top of your file ## Example + Read float position data ``` @@ -22,14 +28,17 @@ cargo run --example aircraft_updates ``` Requests tagged data with thresholds from SimConnect and reads floats/strings + ``` cargo run --example aircraft_updates_on_change ``` -*You must have SimConnect.dll in the same directory as the compiled exe for it to run (e.g. in )* +_You must have SimConnect.dll in the same directory as the compiled exe for it to run (e.g. in )_ ## Building -*The SimConnect.dll is included in this repository, but might not be up-to-date* + +_The SimConnect.dll is included in this repository, but might not be up-to-date_ ### Remarks + I have not tested every single function from the api. If you find an error, feel free to make an issue or a pull request. From 15918fa2cf0909134f18880e29a6be10fe93c25c Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Wed, 10 Jul 2024 09:01:17 +0200 Subject: [PATCH 29/33] Revert "changed include of windows.h" This reverts commit 821aa0d5eb0039cbdc3ccc5817ef8738db64f404. --- libsrc/include/SimConnect.hpp | 1093 +++++++++++++-------------------- 1 file changed, 425 insertions(+), 668 deletions(-) diff --git a/libsrc/include/SimConnect.hpp b/libsrc/include/SimConnect.hpp index 5fcd651..99cbf68 100644 --- a/libsrc/include/SimConnect.hpp +++ b/libsrc/include/SimConnect.hpp @@ -4,7 +4,7 @@ // //----------------------------------------------------------------------------- -#include +#include "Windows.h" #ifndef _SIMCONNECT_H_ #define _SIMCONNECT_H_ @@ -12,9 +12,9 @@ #pragma once #ifdef _MSFS_WASM -#ifndef SIMCONNECT_WASM_MODULE -#define SIMCONNECT_WASM_MODULE "env" -#endif + #ifndef SIMCONNECT_WASM_MODULE + #define SIMCONNECT_WASM_MODULE "env" + #endif #endif #ifndef DWORD_MAX @@ -29,30 +29,22 @@ typedef DWORD SIMCONNECT_OBJECT_ID; // Constants //---------------------------------------------------------------------------- -static const DWORD SIMCONNECT_UNUSED = - DWORD_MAX; // special value to indicate unused event, ID -static const DWORD SIMCONNECT_OBJECT_ID_USER = - 0; // proxy value for User vehicle ObjectID +static const DWORD SIMCONNECT_UNUSED = DWORD_MAX; // special value to indicate unused event, ID +static const DWORD SIMCONNECT_OBJECT_ID_USER = 0; // proxy value for User vehicle ObjectID + +static const float SIMCONNECT_CAMERA_IGNORE_FIELD = FLT_MAX; //Used to tell the Camera API to NOT modify the value in this part of the argument. -static const float SIMCONNECT_CAMERA_IGNORE_FIELD = - FLT_MAX; // Used to tell the Camera API to NOT modify the value in this part - // of the argument. +static const DWORD SIMCONNECT_CLIENTDATA_MAX_SIZE = 8192; // maximum value for SimConnect_CreateClientData dwSize parameter -static const DWORD SIMCONNECT_CLIENTDATA_MAX_SIZE = - 8192; // maximum value for SimConnect_CreateClientData dwSize parameter // Notification Group priority values -static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST = 1; // highest priority -static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE = - 10000000; // highest priority that allows events to be masked -static const DWORD SIMCONNECT_GROUP_PRIORITY_STANDARD = - 1900000000; // standard priority -static const DWORD SIMCONNECT_GROUP_PRIORITY_DEFAULT = - 2000000000; // default priority -static const DWORD SIMCONNECT_GROUP_PRIORITY_LOWEST = - 4000000000; // priorities lower than this will be ignored - -// Weather observations Metar strings +static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST = 1; // highest priority +static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE = 10000000; // highest priority that allows events to be masked +static const DWORD SIMCONNECT_GROUP_PRIORITY_STANDARD = 1900000000; // standard priority +static const DWORD SIMCONNECT_GROUP_PRIORITY_DEFAULT = 2000000000; // default priority +static const DWORD SIMCONNECT_GROUP_PRIORITY_LOWEST = 4000000000; // priorities lower than this will be ignored + +//Weather observations Metar strings static const DWORD MAX_METAR_LENGTH = 2000; // Maximum thermal size is 100 km. @@ -60,51 +52,43 @@ static const float MAX_THERMAL_SIZE = 100000; static const float MAX_THERMAL_RATE = 1000; // SIMCONNECT_DATA_INITPOSITION.Airspeed -static const DWORD INITPOSITION_AIRSPEED_CRUISE = - -1; // aircraft's cruise airspeed -static const DWORD INITPOSITION_AIRSPEED_KEEP = -2; // keep current airspeed +static const DWORD INITPOSITION_AIRSPEED_CRUISE = -1; // aircraft's cruise airspeed +static const DWORD INITPOSITION_AIRSPEED_KEEP = -2; // keep current airspeed // AddToClientDataDefinition dwSizeOrType parameter type values -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT8 = -1; // 8-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT16 = - -2; // 16-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT32 = - -3; // 32-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT64 = - -4; // 64-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT32 = - -5; // 32-bit floating-point number (float) -static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT64 = - -6; // 64-bit floating-point number (double) +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT8 = -1; // 8-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT16 = -2; // 16-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT32 = -3; // 32-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT64 = -4; // 64-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT32 = -5; // 32-bit floating-point number (float) +static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT64 = -6; // 64-bit floating-point number (double) // AddToClientDataDefinition dwOffset parameter special values -static const DWORD SIMCONNECT_CLIENTDATAOFFSET_AUTO = - -1; // automatically compute offset of the ClientData variable +static const DWORD SIMCONNECT_CLIENTDATAOFFSET_AUTO = -1; // automatically compute offset of the ClientData variable // Open ConfigIndex parameter special value -static const DWORD SIMCONNECT_OPEN_CONFIGINDEX_LOCAL = - -1; // ignore SimConnect.cfg settings, and force local connection +static const DWORD SIMCONNECT_OPEN_CONFIGINDEX_LOCAL = -1; // ignore SimConnect.cfg settings, and force local connection //---------------------------------------------------------------------------- // Enum definitions //---------------------------------------------------------------------------- -// these came from substituteMacros +//these came from substituteMacros #define SIMCONNECT_REFSTRUCT struct #define SIMCONNECT_STRUCT struct #define SIMCONNECT_STRING(name, size) char name[size] #define SIMCONNECT_GUID GUID #define SIMCONNECT_STRINGV(name) char name[1] #define SIMCONNECT_DATAV(name, id, count) DWORD name -#define SIMCONNECT_FIXEDTYPE_DATAV(type, name, count, cliMarshalAs, cliType) \ - type name[1] +#define SIMCONNECT_FIXEDTYPE_DATAV(type, name, count, cliMarshalAs, cliType) type name[1] #define SIMCONNECT_GUID GUID #define SIMCONNECT_ENUM enum #define SIMCONNECT_ENUM_FLAGS typedef DWORD #define SIMCONNECT_USER_ENUM typedef DWORD + // Receive data types -SIMCONNECT_ENUM SIMCONNECT_RECV_ID{ +SIMCONNECT_ENUM SIMCONNECT_RECV_ID { SIMCONNECT_RECV_ID_NULL, SIMCONNECT_RECV_ID_EXCEPTION, SIMCONNECT_RECV_ID_OPEN, @@ -134,35 +118,37 @@ SIMCONNECT_ENUM SIMCONNECT_RECV_ID{ SIMCONNECT_RECV_ID_EVENT_RACE_LAP, #ifdef ENABLE_SIMCONNECT_EXPERIMENTAL SIMCONNECT_RECV_ID_PICK, -#endif // ENABLE_SIMCONNECT_EXPERIMENTAL +#endif //ENABLE_SIMCONNECT_EXPERIMENTAL }; + + // Data data types -SIMCONNECT_ENUM SIMCONNECT_DATATYPE{ - SIMCONNECT_DATATYPE_INVALID, // invalid data type - SIMCONNECT_DATATYPE_INT32, // 32-bit integer number - SIMCONNECT_DATATYPE_INT64, // 64-bit integer number - SIMCONNECT_DATATYPE_FLOAT32, // 32-bit floating-point number (float) - SIMCONNECT_DATATYPE_FLOAT64, // 64-bit floating-point number (double) - SIMCONNECT_DATATYPE_STRING8, // 8-byte string - SIMCONNECT_DATATYPE_STRING32, // 32-byte string - SIMCONNECT_DATATYPE_STRING64, // 64-byte string - SIMCONNECT_DATATYPE_STRING128, // 128-byte string - SIMCONNECT_DATATYPE_STRING256, // 256-byte string - SIMCONNECT_DATATYPE_STRING260, // 260-byte string - SIMCONNECT_DATATYPE_STRINGV, // variable-length string - - SIMCONNECT_DATATYPE_INITPOSITION, // see SIMCONNECT_DATA_INITPOSITION - SIMCONNECT_DATATYPE_MARKERSTATE, // see SIMCONNECT_DATA_MARKERSTATE - SIMCONNECT_DATATYPE_WAYPOINT, // see SIMCONNECT_DATA_WAYPOINT - SIMCONNECT_DATATYPE_LATLONALT, // see SIMCONNECT_DATA_LATLONALT - SIMCONNECT_DATATYPE_XYZ, // see SIMCONNECT_DATA_XYZ - - SIMCONNECT_DATATYPE_MAX // enum limit +SIMCONNECT_ENUM SIMCONNECT_DATATYPE { + SIMCONNECT_DATATYPE_INVALID, // invalid data type + SIMCONNECT_DATATYPE_INT32, // 32-bit integer number + SIMCONNECT_DATATYPE_INT64, // 64-bit integer number + SIMCONNECT_DATATYPE_FLOAT32, // 32-bit floating-point number (float) + SIMCONNECT_DATATYPE_FLOAT64, // 64-bit floating-point number (double) + SIMCONNECT_DATATYPE_STRING8, // 8-byte string + SIMCONNECT_DATATYPE_STRING32, // 32-byte string + SIMCONNECT_DATATYPE_STRING64, // 64-byte string + SIMCONNECT_DATATYPE_STRING128, // 128-byte string + SIMCONNECT_DATATYPE_STRING256, // 256-byte string + SIMCONNECT_DATATYPE_STRING260, // 260-byte string + SIMCONNECT_DATATYPE_STRINGV, // variable-length string + + SIMCONNECT_DATATYPE_INITPOSITION, // see SIMCONNECT_DATA_INITPOSITION + SIMCONNECT_DATATYPE_MARKERSTATE, // see SIMCONNECT_DATA_MARKERSTATE + SIMCONNECT_DATATYPE_WAYPOINT, // see SIMCONNECT_DATA_WAYPOINT + SIMCONNECT_DATATYPE_LATLONALT, // see SIMCONNECT_DATA_LATLONALT + SIMCONNECT_DATATYPE_XYZ, // see SIMCONNECT_DATA_XYZ + + SIMCONNECT_DATATYPE_MAX // enum limit }; // Exception error types -SIMCONNECT_ENUM SIMCONNECT_EXCEPTION{ +SIMCONNECT_ENUM SIMCONNECT_EXCEPTION { SIMCONNECT_EXCEPTION_NONE, SIMCONNECT_EXCEPTION_ERROR, @@ -205,31 +191,39 @@ SIMCONNECT_ENUM SIMCONNECT_EXCEPTION{ }; // Object types -SIMCONNECT_ENUM SIMCONNECT_SIMOBJECT_TYPE{ - SIMCONNECT_SIMOBJECT_TYPE_USER, SIMCONNECT_SIMOBJECT_TYPE_ALL, - SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT, SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER, - SIMCONNECT_SIMOBJECT_TYPE_BOAT, SIMCONNECT_SIMOBJECT_TYPE_GROUND, +SIMCONNECT_ENUM SIMCONNECT_SIMOBJECT_TYPE { + SIMCONNECT_SIMOBJECT_TYPE_USER, + SIMCONNECT_SIMOBJECT_TYPE_ALL, + SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT, + SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER, + SIMCONNECT_SIMOBJECT_TYPE_BOAT, + SIMCONNECT_SIMOBJECT_TYPE_GROUND, }; // EventState values -SIMCONNECT_ENUM SIMCONNECT_STATE{ +SIMCONNECT_ENUM SIMCONNECT_STATE { SIMCONNECT_STATE_OFF, SIMCONNECT_STATE_ON, }; // Object Data Request Period values -SIMCONNECT_ENUM SIMCONNECT_PERIOD{ - SIMCONNECT_PERIOD_NEVER, SIMCONNECT_PERIOD_ONCE, - SIMCONNECT_PERIOD_VISUAL_FRAME, SIMCONNECT_PERIOD_SIM_FRAME, +SIMCONNECT_ENUM SIMCONNECT_PERIOD { + SIMCONNECT_PERIOD_NEVER, + SIMCONNECT_PERIOD_ONCE, + SIMCONNECT_PERIOD_VISUAL_FRAME, + SIMCONNECT_PERIOD_SIM_FRAME, SIMCONNECT_PERIOD_SECOND, }; -SIMCONNECT_ENUM SIMCONNECT_MISSION_END{SIMCONNECT_MISSION_FAILED, - SIMCONNECT_MISSION_CRASHED, - SIMCONNECT_MISSION_SUCCEEDED}; + +SIMCONNECT_ENUM SIMCONNECT_MISSION_END { + SIMCONNECT_MISSION_FAILED, + SIMCONNECT_MISSION_CRASHED, + SIMCONNECT_MISSION_SUCCEEDED +}; // ClientData Request Period values -SIMCONNECT_ENUM SIMCONNECT_CLIENT_DATA_PERIOD{ +SIMCONNECT_ENUM SIMCONNECT_CLIENT_DATA_PERIOD { SIMCONNECT_CLIENT_DATA_PERIOD_NEVER, SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, SIMCONNECT_CLIENT_DATA_PERIOD_VISUAL_FRAME, @@ -237,7 +231,7 @@ SIMCONNECT_ENUM SIMCONNECT_CLIENT_DATA_PERIOD{ SIMCONNECT_CLIENT_DATA_PERIOD_SECOND, }; -SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE{ +SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE { SIMCONNECT_TEXT_TYPE_SCROLL_BLACK, SIMCONNECT_TEXT_TYPE_SCROLL_WHITE, SIMCONNECT_TEXT_TYPE_SCROLL_RED, @@ -246,7 +240,7 @@ SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE{ SIMCONNECT_TEXT_TYPE_SCROLL_YELLOW, SIMCONNECT_TEXT_TYPE_SCROLL_MAGENTA, SIMCONNECT_TEXT_TYPE_SCROLL_CYAN, - SIMCONNECT_TEXT_TYPE_PRINT_BLACK = 0x0100, + SIMCONNECT_TEXT_TYPE_PRINT_BLACK=0x0100, SIMCONNECT_TEXT_TYPE_PRINT_WHITE, SIMCONNECT_TEXT_TYPE_PRINT_RED, SIMCONNECT_TEXT_TYPE_PRINT_GREEN, @@ -254,10 +248,10 @@ SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE{ SIMCONNECT_TEXT_TYPE_PRINT_YELLOW, SIMCONNECT_TEXT_TYPE_PRINT_MAGENTA, SIMCONNECT_TEXT_TYPE_PRINT_CYAN, - SIMCONNECT_TEXT_TYPE_MENU = 0x0200, + SIMCONNECT_TEXT_TYPE_MENU=0x0200, }; -SIMCONNECT_ENUM SIMCONNECT_TEXT_RESULT{ +SIMCONNECT_ENUM SIMCONNECT_TEXT_RESULT { SIMCONNECT_TEXT_RESULT_MENU_SELECT_1, SIMCONNECT_TEXT_RESULT_MENU_SELECT_2, SIMCONNECT_TEXT_RESULT_MENU_SELECT_3, @@ -275,139 +269,106 @@ SIMCONNECT_ENUM SIMCONNECT_TEXT_RESULT{ SIMCONNECT_TEXT_RESULT_TIMEOUT, }; -SIMCONNECT_ENUM SIMCONNECT_WEATHER_MODE{ +SIMCONNECT_ENUM SIMCONNECT_WEATHER_MODE { SIMCONNECT_WEATHER_MODE_THEME, SIMCONNECT_WEATHER_MODE_RWW, SIMCONNECT_WEATHER_MODE_CUSTOM, SIMCONNECT_WEATHER_MODE_GLOBAL, }; -SIMCONNECT_ENUM SIMCONNECT_FACILITY_LIST_TYPE{ +SIMCONNECT_ENUM SIMCONNECT_FACILITY_LIST_TYPE { SIMCONNECT_FACILITY_LIST_TYPE_AIRPORT, - SIMCONNECT_FACILITY_LIST_TYPE_WAYPOINT, SIMCONNECT_FACILITY_LIST_TYPE_NDB, + SIMCONNECT_FACILITY_LIST_TYPE_WAYPOINT, + SIMCONNECT_FACILITY_LIST_TYPE_NDB, SIMCONNECT_FACILITY_LIST_TYPE_VOR, - SIMCONNECT_FACILITY_LIST_TYPE_COUNT // invalid + SIMCONNECT_FACILITY_LIST_TYPE_COUNT // invalid }; -SIMCONNECT_ENUM_FLAGS - SIMCONNECT_VOR_FLAGS; // flags for SIMCONNECT_RECV_ID_VOR_LIST -static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL = - 0x00000001; // Has Nav signal -static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER = - 0x00000002; // Has localizer -static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE = - 0x00000004; // Has Nav signal -static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME = - 0x00000008; // Station has DME + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_VOR_FLAGS; // flags for SIMCONNECT_RECV_ID_VOR_LIST + static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL = 0x00000001; // Has Nav signal + static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER = 0x00000002; // Has localizer + static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE = 0x00000004; // Has Nav signal + static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME = 0x00000008; // Station has DME + + // bits for the Waypoint Flags field: may be combined SIMCONNECT_ENUM_FLAGS SIMCONNECT_WAYPOINT_FLAGS; -static const DWORD SIMCONNECT_WAYPOINT_NONE = 0x00; -static const DWORD SIMCONNECT_WAYPOINT_SPEED_REQUESTED = - 0x04; // requested speed at waypoint is valid -static const DWORD SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED = - 0x08; // request a specific throttle percentage -static const DWORD SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED = - 0x10; // compute vertical to speed to reach waypoint altitude when crossing - // the waypoint -static const DWORD SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL = 0x20; // AltitudeIsAGL -static const DWORD SIMCONNECT_WAYPOINT_ON_GROUND = - 0x00100000; // place this waypoint on the ground -static const DWORD SIMCONNECT_WAYPOINT_REVERSE = - 0x00200000; // Back up to this waypoint. Only valid on first waypoint -static const DWORD SIMCONNECT_WAYPOINT_WRAP_TO_FIRST = - 0x00400000; // Wrap around back to first waypoint. Only valid on last - // waypoint. + static const DWORD SIMCONNECT_WAYPOINT_NONE = 0x00; + static const DWORD SIMCONNECT_WAYPOINT_SPEED_REQUESTED = 0x04; // requested speed at waypoint is valid + static const DWORD SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED = 0x08; // request a specific throttle percentage + static const DWORD SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED = 0x10; // compute vertical to speed to reach waypoint altitude when crossing the waypoint + static const DWORD SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL = 0x20; // AltitudeIsAGL + static const DWORD SIMCONNECT_WAYPOINT_ON_GROUND = 0x00100000; // place this waypoint on the ground + static const DWORD SIMCONNECT_WAYPOINT_REVERSE = 0x00200000; // Back up to this waypoint. Only valid on first waypoint + static const DWORD SIMCONNECT_WAYPOINT_WRAP_TO_FIRST = 0x00400000; // Wrap around back to first waypoint. Only valid on last waypoint. SIMCONNECT_ENUM_FLAGS SIMCONNECT_EVENT_FLAG; -static const DWORD SIMCONNECT_EVENT_FLAG_DEFAULT = 0x00000000; -static const DWORD SIMCONNECT_EVENT_FLAG_FAST_REPEAT_TIMER = - 0x00000001; // set event repeat timer to simulate fast repeat -static const DWORD SIMCONNECT_EVENT_FLAG_SLOW_REPEAT_TIMER = - 0x00000002; // set event repeat timer to simulate slow repeat -static const DWORD SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY = - 0x00000010; // interpret GroupID parameter as priority value + static const DWORD SIMCONNECT_EVENT_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_EVENT_FLAG_FAST_REPEAT_TIMER = 0x00000001; // set event repeat timer to simulate fast repeat + static const DWORD SIMCONNECT_EVENT_FLAG_SLOW_REPEAT_TIMER = 0x00000002; // set event repeat timer to simulate slow repeat + static const DWORD SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY = 0x00000010; // interpret GroupID parameter as priority value SIMCONNECT_ENUM_FLAGS SIMCONNECT_DATA_REQUEST_FLAG; -static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; -static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_CHANGED = - 0x00000001; // send requested data when value(s) change -static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_TAGGED = - 0x00000002; // send requested data in tagged format + static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_CHANGED = 0x00000001; // send requested data when value(s) change + static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_TAGGED = 0x00000002; // send requested data in tagged format SIMCONNECT_ENUM_FLAGS SIMCONNECT_DATA_SET_FLAG; -static const DWORD SIMCONNECT_DATA_SET_FLAG_DEFAULT = 0x00000000; -static const DWORD SIMCONNECT_DATA_SET_FLAG_TAGGED = - 0x00000001; // data is in tagged format + static const DWORD SIMCONNECT_DATA_SET_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_DATA_SET_FLAG_TAGGED = 0x00000001; // data is in tagged format SIMCONNECT_ENUM_FLAGS SIMCONNECT_CREATE_CLIENT_DATA_FLAG; -static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_DEFAULT = 0x00000000; -static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_READ_ONLY = - 0x00000001; // permit only ClientData creator to write into ClientData + static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_READ_ONLY = 0x00000001; // permit only ClientData creator to write into ClientData + SIMCONNECT_ENUM_FLAGS SIMCONNECT_CLIENT_DATA_REQUEST_FLAG; -static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; -static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED = - 0x00000001; // send requested ClientData when value(s) change -static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED = - 0x00000002; // send requested ClientData in tagged format + static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED = 0x00000001; // send requested ClientData when value(s) change + static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED = 0x00000002; // send requested ClientData in tagged format SIMCONNECT_ENUM_FLAGS SIMCONNECT_CLIENT_DATA_SET_FLAG; -static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT = 0x00000000; -static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_TAGGED = - 0x00000001; // data is in tagged format - -SIMCONNECT_ENUM_FLAGS - SIMCONNECT_VIEW_SYSTEM_EVENT_DATA; // dwData contains these flags for the - // "View" System Event -static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_2D = - 0x00000001; // 2D Panels in cockpit view -static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_VIRTUAL = - 0x00000002; // Virtual (3D) panels in cockpit view -static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_ORTHOGONAL = - 0x00000004; // Orthogonal (Map) view - -SIMCONNECT_ENUM_FLAGS - SIMCONNECT_SOUND_SYSTEM_EVENT_DATA; // dwData contains these flags for the - // "Sound" System Event -static const DWORD SIMCONNECT_SOUND_SYSTEM_EVENT_DATA_MASTER = - 0x00000001; // Sound Master + static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_TAGGED = 0x00000001; // data is in tagged format + + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_VIEW_SYSTEM_EVENT_DATA; // dwData contains these flags for the "View" System Event + static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_2D = 0x00000001; // 2D Panels in cockpit view + static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_VIRTUAL = 0x00000002; // Virtual (3D) panels in cockpit view + static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_ORTHOGONAL = 0x00000004; // Orthogonal (Map) view + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_SOUND_SYSTEM_EVENT_DATA; // dwData contains these flags for the "Sound" System Event + static const DWORD SIMCONNECT_SOUND_SYSTEM_EVENT_DATA_MASTER = 0x00000001; // Sound Master + #ifdef ENABLE_SIMCONNECT_EXPERIMENTAL -SIMCONNECT_ENUM_FLAGS SIMCONNECT_PICK_FLAGS{ - SIMCONNECT_PICK_GROUND = - 0x01, // pick ground/ pick result item is ground location - SIMCONNECT_PICK_AI = - 0x02, // pick AI / pick result item is AI, (dwSimObjectID is valid) - SIMCONNECT_PICK_SCENERY = 0x04, // pick scenery/ pick result item is scenery - // object (hSceneryObject is valid) - SIMCONNECT_PICK_ALL = - SIMCONNECT_PICK_SCENERY | SIMCONNECT_PICK_AI | - SIMCONNECT_PICK_GROUND, // pick all / (not valid on pick result item) - SIMCONNECT_PICK_COORDSASPIXELS = 0x08, +SIMCONNECT_ENUM_FLAGS SIMCONNECT_PICK_FLAGS +{ + SIMCONNECT_PICK_GROUND = 0x01, // pick ground/ pick result item is ground location + SIMCONNECT_PICK_AI = 0x02, // pick AI / pick result item is AI, (dwSimObjectID is valid) + SIMCONNECT_PICK_SCENERY = 0x04, // pick scenery/ pick result item is scenery object (hSceneryObject is valid) + SIMCONNECT_PICK_ALL = SIMCONNECT_PICK_SCENERY | SIMCONNECT_PICK_AI | SIMCONNECT_PICK_GROUND, // pick all / (not valid on pick result item) + SIMCONNECT_PICK_COORDSASPIXELS = 0x08, }; -#endif // ENABLE_SIMCONNECT_EXPERIMENTAL +#endif //ENABLE_SIMCONNECT_EXPERIMENTAL //---------------------------------------------------------------------------- // User-defined enums //---------------------------------------------------------------------------- -SIMCONNECT_USER_ENUM - SIMCONNECT_NOTIFICATION_GROUP_ID; // client-defined notification group ID -SIMCONNECT_USER_ENUM SIMCONNECT_INPUT_GROUP_ID; // client-defined input group ID -SIMCONNECT_USER_ENUM - SIMCONNECT_DATA_DEFINITION_ID; // client-defined data definition ID -SIMCONNECT_USER_ENUM - SIMCONNECT_DATA_REQUEST_ID; // client-defined request data ID - -SIMCONNECT_USER_ENUM - SIMCONNECT_CLIENT_EVENT_ID; // client-defined client event ID -SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_ID; // client-defined client data ID -SIMCONNECT_USER_ENUM - SIMCONNECT_CLIENT_DATA_DEFINITION_ID; // client-defined client data - // definition ID +SIMCONNECT_USER_ENUM SIMCONNECT_NOTIFICATION_GROUP_ID; //client-defined notification group ID +SIMCONNECT_USER_ENUM SIMCONNECT_INPUT_GROUP_ID; //client-defined input group ID +SIMCONNECT_USER_ENUM SIMCONNECT_DATA_DEFINITION_ID; //client-defined data definition ID +SIMCONNECT_USER_ENUM SIMCONNECT_DATA_REQUEST_ID; //client-defined request data ID + +SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_EVENT_ID; //client-defined client event ID +SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_ID; //client-defined client data ID +SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_DEFINITION_ID; //client-defined client data definition ID + //---------------------------------------------------------------------------- // Struct definitions @@ -415,346 +376,307 @@ SIMCONNECT_USER_ENUM #pragma pack(push, 1) -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV { - DWORD dwSize; // record size - DWORD dwVersion; // interface version - DWORD dwID; // see SIMCONNECT_RECV_ID +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV +{ + DWORD dwSize; // record size + DWORD dwVersion; // interface version + DWORD dwID; // see SIMCONNECT_RECV_ID }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EXCEPTION - : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EXCEPTION +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EXCEPTION : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EXCEPTION { - DWORD dwException; // see SIMCONNECT_EXCEPTION - static const DWORD UNKNOWN_SENDID = 0; - DWORD dwSendID; // see SimConnect_GetLastSentPacketID - static const DWORD UNKNOWN_INDEX = DWORD_MAX; - DWORD dwIndex; // index of parameter that was source of error + DWORD dwException; // see SIMCONNECT_EXCEPTION + static const DWORD UNKNOWN_SENDID = 0; + DWORD dwSendID; // see SimConnect_GetLastSentPacketID + static const DWORD UNKNOWN_INDEX = DWORD_MAX; + DWORD dwIndex; // index of parameter that was source of error }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_OPEN - : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_OPEN +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_OPEN : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_OPEN +{ + SIMCONNECT_STRING( szApplicationName, 256); + DWORD dwApplicationVersionMajor; + DWORD dwApplicationVersionMinor; + DWORD dwApplicationBuildMajor; + DWORD dwApplicationBuildMinor; + DWORD dwSimConnectVersionMajor; + DWORD dwSimConnectVersionMinor; + DWORD dwSimConnectBuildMajor; + DWORD dwSimConnectBuildMinor; + DWORD dwReserved1; + DWORD dwReserved2; +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_QUIT : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_QUIT { - SIMCONNECT_STRING(szApplicationName, 256); - DWORD dwApplicationVersionMajor; - DWORD dwApplicationVersionMinor; - DWORD dwApplicationBuildMajor; - DWORD dwApplicationBuildMinor; - DWORD dwSimConnectVersionMajor; - DWORD dwSimConnectVersionMinor; - DWORD dwSimConnectBuildMajor; - DWORD dwSimConnectBuildMinor; - DWORD dwReserved1; - DWORD dwReserved2; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_QUIT - : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_QUIT - {}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT - : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EVENT +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EVENT { - static const DWORD UNKNOWN_GROUP = DWORD_MAX; - DWORD uGroupID; - DWORD uEventID; - DWORD dwData; // uEventID-dependent context + static const DWORD UNKNOWN_GROUP = DWORD_MAX; + DWORD uGroupID; + DWORD uEventID; + DWORD dwData; // uEventID-dependent context }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FILENAME - : public SIMCONNECT_RECV_EVENT // when dwID == - // SIMCONNECT_RECV_ID_EVENT_FILENAME +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FILENAME : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FILENAME { - SIMCONNECT_STRING(szFileName, MAX_PATH); // uEventID-dependent context - DWORD dwFlags; + SIMCONNECT_STRING( szFileName, MAX_PATH); // uEventID-dependent context + DWORD dwFlags; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE - : public SIMCONNECT_RECV_EVENT // when dwID == - // SIMCONNECT_RECV_ID_EVENT_FILENAME +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FILENAME { - SIMCONNECT_SIMOBJECT_TYPE eObjType; + SIMCONNECT_SIMOBJECT_TYPE eObjType; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FRAME - : public SIMCONNECT_RECV_EVENT // when dwID == - // SIMCONNECT_RECV_ID_EVENT_FRAME +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FRAME : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FRAME { - float fFrameRate; - float fSimSpeed; + float fFrameRate; + float fSimSpeed; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED - : public SIMCONNECT_RECV_EVENT // when dwID == - // SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED - { - // No event specific data, for now - }; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED +{ + // No event specific data, for now +}; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED - : public SIMCONNECT_RECV_EVENT // when dwID == - // SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED - { - // No event specific data, for now - }; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED +{ + // No event specific data, for now +}; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED - : public SIMCONNECT_RECV_EVENT // when dwID == - // SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED - { - // No event specific data, for now - }; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED +{ + // No event specific data, for now +}; // SIMCONNECT_DATA_RACE_RESULT -SIMCONNECT_STRUCT SIMCONNECT_DATA_RACE_RESULT { - DWORD dwNumberOfRacers; // The total number of racers - SIMCONNECT_GUID - MissionGUID; // The name of the mission to execute, NULL if no mission - SIMCONNECT_STRING(szPlayerName, MAX_PATH); // The name of the player - SIMCONNECT_STRING( - szSessionType, - MAX_PATH); // The type of the multiplayer session: "LAN", "GAMESPY") - SIMCONNECT_STRING(szAircraft, MAX_PATH); // The aircraft type - SIMCONNECT_STRING(szPlayerRole, MAX_PATH); // The player role in the mission - double fTotalTime; // Total time in seconds, 0 means DNF - double fPenaltyTime; // Total penalty time in seconds - DWORD dwIsDisqualified; // non 0 - disqualified, 0 - not disqualified +SIMCONNECT_STRUCT SIMCONNECT_DATA_RACE_RESULT +{ + DWORD dwNumberOfRacers; // The total number of racers + SIMCONNECT_GUID MissionGUID; // The name of the mission to execute, NULL if no mission + SIMCONNECT_STRING( szPlayerName, MAX_PATH); // The name of the player + SIMCONNECT_STRING( szSessionType, MAX_PATH); // The type of the multiplayer session: "LAN", "GAMESPY") + SIMCONNECT_STRING( szAircraft, MAX_PATH); // The aircraft type + SIMCONNECT_STRING( szPlayerRole, MAX_PATH); // The player role in the mission + double fTotalTime; // Total time in seconds, 0 means DNF + double fPenaltyTime; // Total penalty time in seconds + DWORD dwIsDisqualified; // non 0 - disqualified, 0 - not disqualified +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_END : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_RACE_END +{ + DWORD dwRacerNumber; // The index of the racer the results are for + SIMCONNECT_DATA_RACE_RESULT RacerData; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_END - : public SIMCONNECT_RECV_EVENT // when dwID == - // SIMCONNECT_RECV_ID_EVENT_RACE_END +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_LAP : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_RACE_LAP { - DWORD dwRacerNumber; // The index of the racer the results are for - SIMCONNECT_DATA_RACE_RESULT RacerData; + DWORD dwLapIndex; // The index of the lap the results are for + SIMCONNECT_DATA_RACE_RESULT RacerData; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_LAP - : public SIMCONNECT_RECV_EVENT // when dwID == - // SIMCONNECT_RECV_ID_EVENT_RACE_LAP +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA { - DWORD dwLapIndex; // The index of the lap the results are for - SIMCONNECT_DATA_RACE_RESULT RacerData; + DWORD dwRequestID; + DWORD dwObjectID; + DWORD dwDefineID; + DWORD dwFlags; // SIMCONNECT_DATA_REQUEST_FLAG + DWORD dwentrynumber; // if multiple objects returned, this is number out of . + DWORD dwoutof; // note: starts with 1, not 0. + DWORD dwDefineCount; // data count (number of datums, *not* byte count) + SIMCONNECT_DATAV( dwData, dwDefineID, ); // data begins here, dwDefineCount data items }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA - : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE { - DWORD dwRequestID; - DWORD dwObjectID; - DWORD dwDefineID; - DWORD dwFlags; // SIMCONNECT_DATA_REQUEST_FLAG - DWORD dwentrynumber; // if multiple objects returned, this is number - // out of . - DWORD dwoutof; // note: starts with 1, not 0. - DWORD dwDefineCount; // data count (number of datums, *not* byte count) - SIMCONNECT_DATAV(dwData, - dwDefineID, ); // data begins here, dwDefineCount data items }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE - : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == - // SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE - {}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLIENT_DATA - : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == - // SIMCONNECT_RECV_ID_CLIENT_DATA - {}; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLIENT_DATA : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == SIMCONNECT_RECV_ID_CLIENT_DATA +{ +}; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WEATHER_OBSERVATION - : public SIMCONNECT_RECV // when dwID == - // SIMCONNECT_RECV_ID_WEATHER_OBSERVATION +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WEATHER_OBSERVATION : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_WEATHER_OBSERVATION { - DWORD dwRequestID; - SIMCONNECT_STRINGV( - szMetar); // Variable length string whose maximum size is MAX_METAR_LENGTH + DWORD dwRequestID; + SIMCONNECT_STRINGV( szMetar); // Variable length string whose maximum size is MAX_METAR_LENGTH }; static const int SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH = 64; -static const int SIMCONNECT_CLOUD_STATE_ARRAY_SIZE = - SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH * SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH; +static const int SIMCONNECT_CLOUD_STATE_ARRAY_SIZE = SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH*SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLOUD_STATE - : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_CLOUD_STATE +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLOUD_STATE : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_CLOUD_STATE { - DWORD dwRequestID; - DWORD dwArraySize; - SIMCONNECT_FIXEDTYPE_DATAV(BYTE, rgbData, dwArraySize, - U1 /*member of UnmanagedType enum*/, - System::Byte /*cli type*/); + DWORD dwRequestID; + DWORD dwArraySize; + SIMCONNECT_FIXEDTYPE_DATAV(BYTE, rgbData, dwArraySize, U1 /*member of UnmanagedType enum*/ , System::Byte /*cli type*/); }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_ASSIGNED_OBJECT_ID - : public SIMCONNECT_RECV // when dwID == - // SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_ASSIGNED_OBJECT_ID : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID { - DWORD dwRequestID; - DWORD dwObjectID; + DWORD dwRequestID; + DWORD dwObjectID; }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_RESERVED_KEY - : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_RESERVED_KEY : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY { - SIMCONNECT_STRING(szChoiceReserved, 30); - SIMCONNECT_STRING(szReservedKey, 50); + SIMCONNECT_STRING( szChoiceReserved, 30); + SIMCONNECT_STRING( szReservedKey, 50); }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SYSTEM_STATE - : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SYSTEM_STATE +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SYSTEM_STATE : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SYSTEM_STATE { - DWORD dwRequestID; - DWORD dwInteger; - float fFloat; - SIMCONNECT_STRING(szString, MAX_PATH); + DWORD dwRequestID; + DWORD dwInteger; + float fFloat; + SIMCONNECT_STRING( szString, MAX_PATH); }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CUSTOM_ACTION - : public SIMCONNECT_RECV_EVENT { - SIMCONNECT_GUID guidInstanceId; // Instance id of the action that executed - DWORD dwWaitForCompletion; // Wait for completion flag on the action - SIMCONNECT_STRINGV(szPayLoad); // Variable length string payload associated - // with the mission action. +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CUSTOM_ACTION : public SIMCONNECT_RECV_EVENT +{ + SIMCONNECT_GUID guidInstanceId; // Instance id of the action that executed + DWORD dwWaitForCompletion; // Wait for completion flag on the action + SIMCONNECT_STRINGV( szPayLoad); // Variable length string payload associated with the mission action. }; -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_WEATHER_MODE - : public SIMCONNECT_RECV_EVENT{ - // No event specific data - the new weather mode is in the base - // structure dwData member. - }; +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_WEATHER_MODE : public SIMCONNECT_RECV_EVENT +{ + // No event specific data - the new weather mode is in the base structure dwData member. +}; // SIMCONNECT_RECV_FACILITIES_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_FACILITIES_LIST : public SIMCONNECT_RECV { - DWORD dwRequestID; - DWORD dwArraySize; - DWORD dwEntryNumber; // when the array of items is too big for one send, which - // send this is (0..dwOutOf-1) - DWORD dwOutOf; // total number of transmissions the list is chopped into +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_FACILITIES_LIST : public SIMCONNECT_RECV +{ + DWORD dwRequestID; + DWORD dwArraySize; + DWORD dwEntryNumber; // when the array of items is too big for one send, which send this is (0..dwOutOf-1) + DWORD dwOutOf; // total number of transmissions the list is chopped into }; // SIMCONNECT_DATA_FACILITY_AIRPORT -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_AIRPORT { - SIMCONNECT_STRING(Icao, 9); // ICAO of the object - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // meters +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_AIRPORT +{ + SIMCONNECT_STRING(Icao, 9); // ICAO of the object + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // meters }; // SIMCONNECT_RECV_AIRPORT_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_AIRPORT_LIST - : public SIMCONNECT_RECV_FACILITIES_LIST { - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_AIRPORT, rgData, - dwArraySize, U1 /*member of UnmanagedType enum*/, - SIMCONNECT_DATA_FACILITY_AIRPORT /*cli type*/); +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_AIRPORT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST +{ + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_AIRPORT, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_AIRPORT /*cli type*/); }; + // SIMCONNECT_DATA_FACILITY_WAYPOINT -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_WAYPOINT - : public SIMCONNECT_DATA_FACILITY_AIRPORT { - float fMagVar; // Magvar in degrees +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_WAYPOINT : public SIMCONNECT_DATA_FACILITY_AIRPORT +{ + float fMagVar; // Magvar in degrees }; // SIMCONNECT_RECV_WAYPOINT_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WAYPOINT_LIST - : public SIMCONNECT_RECV_FACILITIES_LIST { - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_WAYPOINT, rgData, - dwArraySize, U1 /*member of UnmanagedType enum*/, - SIMCONNECT_DATA_FACILITY_WAYPOINT /*cli type*/); +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WAYPOINT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST +{ + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_WAYPOINT, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_WAYPOINT /*cli type*/); }; // SIMCONNECT_DATA_FACILITY_NDB -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_NDB - : public SIMCONNECT_DATA_FACILITY_WAYPOINT { - DWORD fFrequency; // frequency in Hz +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_NDB : public SIMCONNECT_DATA_FACILITY_WAYPOINT +{ + DWORD fFrequency; // frequency in Hz }; // SIMCONNECT_RECV_NDB_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_NDB_LIST - : public SIMCONNECT_RECV_FACILITIES_LIST { - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_NDB, rgData, dwArraySize, - U1 /*member of UnmanagedType enum*/, - SIMCONNECT_DATA_FACILITY_NDB /*cli type*/); +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_NDB_LIST : public SIMCONNECT_RECV_FACILITIES_LIST +{ + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_NDB, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_NDB /*cli type*/); }; // SIMCONNECT_DATA_FACILITY_VOR -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_VOR - : public SIMCONNECT_DATA_FACILITY_NDB { - DWORD Flags; // SIMCONNECT_VOR_FLAGS - float fLocalizer; // Localizer in degrees - double GlideLat; // Glide Slope Location (deg, deg, meters) - double GlideLon; - double GlideAlt; - float fGlideSlopeAngle; // Glide Slope in degrees +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_VOR : public SIMCONNECT_DATA_FACILITY_NDB +{ + DWORD Flags; // SIMCONNECT_VOR_FLAGS + float fLocalizer; // Localizer in degrees + double GlideLat; // Glide Slope Location (deg, deg, meters) + double GlideLon; + double GlideAlt; + float fGlideSlopeAngle; // Glide Slope in degrees }; // SIMCONNECT_RECV_VOR_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_VOR_LIST - : public SIMCONNECT_RECV_FACILITIES_LIST { - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_VOR, rgData, dwArraySize, - U1 /*member of UnmanagedType enum*/, - SIMCONNECT_DATA_FACILITY_VOR /*cli type*/); +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_VOR_LIST : public SIMCONNECT_RECV_FACILITIES_LIST +{ + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_VOR, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_VOR /*cli type*/); }; #ifdef ENABLE_SIMCONNECT_EXPERIMENTAL -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_PICK - : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_PICK : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY { - HANDLE hContext; - DWORD dwFlags; // - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // feet - int xPos; // reserved - int yPos; // reserved; - DWORD dwSimObjectID; - HANDLE hSceneryObject; - DWORD dwentrynumber; // if multiple objects returned, this is number - // out of . - DWORD dwoutof; // note: starts with 1, not 0. + HANDLE hContext; + DWORD dwFlags; // + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // feet + int xPos; //reserved + int yPos; //reserved; + DWORD dwSimObjectID; + HANDLE hSceneryObject; + DWORD dwentrynumber; // if multiple objects returned, this is number out of . + DWORD dwoutof; // note: starts with 1, not 0. }; -#endif // ENABLE_SIMCONNECT_EXPERIMENTAL +#endif //ENABLE_SIMCONNECT_EXPERIMENTAL + // SIMCONNECT_DATATYPE_INITPOSITION -SIMCONNECT_STRUCT SIMCONNECT_DATA_INITPOSITION { - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // feet - double Pitch; // degrees - double Bank; // degrees - double Heading; // degrees - DWORD OnGround; // 1=force to be on the ground - DWORD Airspeed; // knots +SIMCONNECT_STRUCT SIMCONNECT_DATA_INITPOSITION +{ + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // feet + double Pitch; // degrees + double Bank; // degrees + double Heading; // degrees + DWORD OnGround; // 1=force to be on the ground + DWORD Airspeed; // knots }; + // SIMCONNECT_DATATYPE_MARKERSTATE -SIMCONNECT_STRUCT SIMCONNECT_DATA_MARKERSTATE { - SIMCONNECT_STRING(szMarkerName, 64); - DWORD dwMarkerState; +SIMCONNECT_STRUCT SIMCONNECT_DATA_MARKERSTATE +{ + SIMCONNECT_STRING( szMarkerName, 64); + DWORD dwMarkerState; }; // SIMCONNECT_DATATYPE_WAYPOINT -SIMCONNECT_STRUCT SIMCONNECT_DATA_WAYPOINT { - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // feet - unsigned long Flags; - double ktsSpeed; // knots - double percentThrottle; +SIMCONNECT_STRUCT SIMCONNECT_DATA_WAYPOINT +{ + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // feet + unsigned long Flags; + double ktsSpeed; // knots + double percentThrottle; }; // SIMCONNECT_DATA_LATLONALT -SIMCONNECT_STRUCT SIMCONNECT_DATA_LATLONALT { - double Latitude; - double Longitude; - double Altitude; +SIMCONNECT_STRUCT SIMCONNECT_DATA_LATLONALT +{ + double Latitude; + double Longitude; + double Altitude; }; // SIMCONNECT_DATA_XYZ -SIMCONNECT_STRUCT SIMCONNECT_DATA_XYZ { - double x; - double y; - double z; +SIMCONNECT_STRUCT SIMCONNECT_DATA_XYZ +{ + double x; + double y; + double z; }; #pragma pack(pop) @@ -763,259 +685,94 @@ SIMCONNECT_STRUCT SIMCONNECT_DATA_XYZ { // End of Struct definitions //---------------------------------------------------------------------------- -typedef void(CALLBACK *DispatchProc)(SIMCONNECT_RECV *pData, DWORD cbData, - void *pContext); +typedef void (CALLBACK *DispatchProc)(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext); #if !defined(SIMCONNECTAPI) -#ifdef _MSFS_WASM -#ifdef __INTELLISENSE__ -#define MODULE_EXPORT -#define SIMCONNECTAPI extern "C" HRESULT -#else -#define MODULE_EXPORT __attribute__((visibility("default"))) -#define SIMCONNECTAPI \ - extern "C" __attribute__((import_module(SIMCONNECT_WASM_MODULE))) HRESULT -#endif -#else -#define MODULE_EXPORT -#define SIMCONNECTAPI extern "C" HRESULT __stdcall -#endif + #ifdef _MSFS_WASM + #ifdef __INTELLISENSE__ + #define MODULE_EXPORT + #define SIMCONNECTAPI extern "C" HRESULT + #else + #define MODULE_EXPORT __attribute__( ( visibility( "default" ) ) ) + #define SIMCONNECTAPI extern "C" __attribute__((import_module(SIMCONNECT_WASM_MODULE))) HRESULT + #endif + #else + #define MODULE_EXPORT + #define SIMCONNECTAPI extern "C" HRESULT __stdcall + #endif #endif -SIMCONNECTAPI -SimConnect_MapClientEventToSimEvent(HANDLE hSimConnect, - SIMCONNECT_CLIENT_EVENT_ID EventID, - const char *EventName = ""); -SIMCONNECTAPI SimConnect_TransmitClientEvent( - HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, - SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD dwData, - SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_EVENT_FLAG Flags); -SIMCONNECTAPI SimConnect_SetSystemEventState(HANDLE hSimConnect, - SIMCONNECT_CLIENT_EVENT_ID EventID, - SIMCONNECT_STATE dwState); -SIMCONNECTAPI SimConnect_AddClientEventToNotificationGroup( - HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, - SIMCONNECT_CLIENT_EVENT_ID EventID, BOOL bMaskable = FALSE); -SIMCONNECTAPI -SimConnect_RemoveClientEvent(HANDLE hSimConnect, - SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, - SIMCONNECT_CLIENT_EVENT_ID EventID); -SIMCONNECTAPI SimConnect_SetNotificationGroupPriority( - HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, - DWORD uPriority); -SIMCONNECTAPI -SimConnect_ClearNotificationGroup(HANDLE hSimConnect, - SIMCONNECT_NOTIFICATION_GROUP_ID GroupID); -SIMCONNECTAPI -SimConnect_RequestNotificationGroup(HANDLE hSimConnect, - SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, - DWORD dwReserved = 0, DWORD Flags = 0); -SIMCONNECTAPI SimConnect_AddToDataDefinition( - HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, - const char *DatumName, const char *UnitsName, - SIMCONNECT_DATATYPE DatumType = SIMCONNECT_DATATYPE_FLOAT64, - float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); -SIMCONNECTAPI -SimConnect_ClearDataDefinition(HANDLE hSimConnect, - SIMCONNECT_DATA_DEFINITION_ID DefineID); -SIMCONNECTAPI SimConnect_RequestDataOnSimObject( - HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, - SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, - SIMCONNECT_PERIOD Period, SIMCONNECT_DATA_REQUEST_FLAG Flags = 0, - DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); -SIMCONNECTAPI SimConnect_RequestDataOnSimObjectType( - HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, - SIMCONNECT_DATA_DEFINITION_ID DefineID, DWORD dwRadiusMeters, - SIMCONNECT_SIMOBJECT_TYPE type); -SIMCONNECTAPI SimConnect_SetDataOnSimObject( - HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, - SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_SET_FLAG Flags, - DWORD ArrayCount, DWORD cbUnitSize, void *pDataSet); -SIMCONNECTAPI SimConnect_MapInputEventToClientEvent( - HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, - const char *szInputDefinition, SIMCONNECT_CLIENT_EVENT_ID DownEventID, - DWORD DownValue = 0, - SIMCONNECT_CLIENT_EVENT_ID UpEventID = (SIMCONNECT_CLIENT_EVENT_ID) - SIMCONNECT_UNUSED, - DWORD UpValue = 0, BOOL bMaskable = FALSE); -SIMCONNECTAPI SimConnect_SetInputGroupPriority( - HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD uPriority); -SIMCONNECTAPI SimConnect_RemoveInputEvent(HANDLE hSimConnect, - SIMCONNECT_INPUT_GROUP_ID GroupID, - const char *szInputDefinition); -SIMCONNECTAPI SimConnect_ClearInputGroup(HANDLE hSimConnect, - SIMCONNECT_INPUT_GROUP_ID GroupID); -SIMCONNECTAPI SimConnect_SetInputGroupState(HANDLE hSimConnect, - SIMCONNECT_INPUT_GROUP_ID GroupID, - DWORD dwState); -SIMCONNECTAPI SimConnect_RequestReservedKey(HANDLE hSimConnect, - SIMCONNECT_CLIENT_EVENT_ID EventID, - const char *szKeyChoice1 = "", - const char *szKeyChoice2 = "", - const char *szKeyChoice3 = ""); -SIMCONNECTAPI -SimConnect_SubscribeToSystemEvent(HANDLE hSimConnect, - SIMCONNECT_CLIENT_EVENT_ID EventID, - const char *SystemEventName); -SIMCONNECTAPI -SimConnect_UnsubscribeFromSystemEvent(HANDLE hSimConnect, - SIMCONNECT_CLIENT_EVENT_ID EventID); -SIMCONNECTAPI SimConnect_WeatherRequestInterpolatedObservation( - HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, - float lon, float alt); -SIMCONNECTAPI SimConnect_WeatherRequestObservationAtStation( - HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, - const char *szICAO); -SIMCONNECTAPI SimConnect_WeatherRequestObservationAtNearestStation( - HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, - float lon); -SIMCONNECTAPI SimConnect_WeatherCreateStation( - HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, - const char *szICAO, const char *szName, float lat, float lon, float alt); -SIMCONNECTAPI -SimConnect_WeatherRemoveStation(HANDLE hSimConnect, - SIMCONNECT_DATA_REQUEST_ID RequestID, - const char *szICAO); -SIMCONNECTAPI SimConnect_WeatherSetObservation(HANDLE hSimConnect, - DWORD Seconds, - const char *szMETAR); -SIMCONNECTAPI SimConnect_WeatherSetModeServer(HANDLE hSimConnect, DWORD dwPort, - DWORD dwSeconds); -SIMCONNECTAPI SimConnect_WeatherSetModeTheme(HANDLE hSimConnect, - const char *szThemeName); +SIMCONNECTAPI SimConnect_MapClientEventToSimEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * EventName = ""); +SIMCONNECTAPI SimConnect_TransmitClientEvent(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD dwData, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_EVENT_FLAG Flags); +SIMCONNECTAPI SimConnect_SetSystemEventState(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, SIMCONNECT_STATE dwState); +SIMCONNECTAPI SimConnect_AddClientEventToNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_CLIENT_EVENT_ID EventID, BOOL bMaskable = FALSE); +SIMCONNECTAPI SimConnect_RemoveClientEvent(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_CLIENT_EVENT_ID EventID); +SIMCONNECTAPI SimConnect_SetNotificationGroupPriority(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, DWORD uPriority); +SIMCONNECTAPI SimConnect_ClearNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID); +SIMCONNECTAPI SimConnect_RequestNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, DWORD dwReserved = 0, DWORD Flags = 0); +SIMCONNECTAPI SimConnect_AddToDataDefinition(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, const char * DatumName, const char * UnitsName, SIMCONNECT_DATATYPE DatumType = SIMCONNECT_DATATYPE_FLOAT64, float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); +SIMCONNECTAPI SimConnect_ClearDataDefinition(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID); +SIMCONNECTAPI SimConnect_RequestDataOnSimObject(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_PERIOD Period, SIMCONNECT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); +SIMCONNECTAPI SimConnect_RequestDataOnSimObjectType(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_DATA_DEFINITION_ID DefineID, DWORD dwRadiusMeters, SIMCONNECT_SIMOBJECT_TYPE type); +SIMCONNECTAPI SimConnect_SetDataOnSimObject(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_SET_FLAG Flags, DWORD ArrayCount, DWORD cbUnitSize, void * pDataSet); +SIMCONNECTAPI SimConnect_MapInputEventToClientEvent(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, const char * szInputDefinition, SIMCONNECT_CLIENT_EVENT_ID DownEventID, DWORD DownValue = 0, SIMCONNECT_CLIENT_EVENT_ID UpEventID = (SIMCONNECT_CLIENT_EVENT_ID)SIMCONNECT_UNUSED, DWORD UpValue = 0, BOOL bMaskable = FALSE); +SIMCONNECTAPI SimConnect_SetInputGroupPriority(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD uPriority); +SIMCONNECTAPI SimConnect_RemoveInputEvent(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, const char * szInputDefinition); +SIMCONNECTAPI SimConnect_ClearInputGroup(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID); +SIMCONNECTAPI SimConnect_SetInputGroupState(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD dwState); +SIMCONNECTAPI SimConnect_RequestReservedKey(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * szKeyChoice1 = "", const char * szKeyChoice2 = "", const char * szKeyChoice3 = ""); +SIMCONNECTAPI SimConnect_SubscribeToSystemEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * SystemEventName); +SIMCONNECTAPI SimConnect_UnsubscribeFromSystemEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID); +SIMCONNECTAPI SimConnect_WeatherRequestInterpolatedObservation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon, float alt); +SIMCONNECTAPI SimConnect_WeatherRequestObservationAtStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO); +SIMCONNECTAPI SimConnect_WeatherRequestObservationAtNearestStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon); +SIMCONNECTAPI SimConnect_WeatherCreateStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO, const char * szName, float lat, float lon, float alt); +SIMCONNECTAPI SimConnect_WeatherRemoveStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO); +SIMCONNECTAPI SimConnect_WeatherSetObservation(HANDLE hSimConnect, DWORD Seconds, const char * szMETAR); +SIMCONNECTAPI SimConnect_WeatherSetModeServer(HANDLE hSimConnect, DWORD dwPort, DWORD dwSeconds); +SIMCONNECTAPI SimConnect_WeatherSetModeTheme(HANDLE hSimConnect, const char * szThemeName); SIMCONNECTAPI SimConnect_WeatherSetModeGlobal(HANDLE hSimConnect); SIMCONNECTAPI SimConnect_WeatherSetModeCustom(HANDLE hSimConnect); -SIMCONNECTAPI SimConnect_WeatherSetDynamicUpdateRate(HANDLE hSimConnect, - DWORD dwRate); -SIMCONNECTAPI SimConnect_WeatherRequestCloudState( - HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float minLat, - float minLon, float minAlt, float maxLat, float maxLon, float maxAlt, - DWORD dwFlags = 0); -SIMCONNECTAPI SimConnect_WeatherCreateThermal( - HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, - float lon, float alt, float radius, float height, float coreRate = 3.0f, - float coreTurbulence = 0.05f, float sinkRate = 3.0f, - float sinkTurbulence = 0.2f, float coreSize = 0.4f, - float coreTransitionSize = 0.1f, float sinkLayerSize = 0.4f, - float sinkTransitionSize = 0.1f); -SIMCONNECTAPI SimConnect_WeatherRemoveThermal(HANDLE hSimConnect, - SIMCONNECT_OBJECT_ID ObjectID); -SIMCONNECTAPI SimConnect_AICreateParkedATCAircraft( - HANDLE hSimConnect, const char *szContainerTitle, const char *szTailNumber, - const char *szAirportID, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AICreateEnrouteATCAircraft( - HANDLE hSimConnect, const char *szContainerTitle, const char *szTailNumber, - int iFlightNumber, const char *szFlightPlanPath, double dFlightPlanPosition, - BOOL bTouchAndGo, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AICreateNonATCAircraft( - HANDLE hSimConnect, const char *szContainerTitle, const char *szTailNumber, - SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AICreateSimulatedObject( - HANDLE hSimConnect, const char *szContainerTitle, - SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AIReleaseControl(HANDLE hSimConnect, - SIMCONNECT_OBJECT_ID ObjectID, - SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AIRemoveObject(HANDLE hSimConnect, - SIMCONNECT_OBJECT_ID ObjectID, - SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AISetAircraftFlightPlan( - HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, - const char *szFlightPlanPath, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_ExecuteMissionAction(HANDLE hSimConnect, - const GUID guidInstanceId); -SIMCONNECTAPI SimConnect_CompleteCustomMissionAction(HANDLE hSimConnect, - const GUID guidInstanceId); +SIMCONNECTAPI SimConnect_WeatherSetDynamicUpdateRate(HANDLE hSimConnect, DWORD dwRate); +SIMCONNECTAPI SimConnect_WeatherRequestCloudState(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float minLat, float minLon, float minAlt, float maxLat, float maxLon, float maxAlt, DWORD dwFlags = 0); +SIMCONNECTAPI SimConnect_WeatherCreateThermal(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon, float alt, float radius, float height, float coreRate = 3.0f, float coreTurbulence = 0.05f, float sinkRate = 3.0f, float sinkTurbulence = 0.2f, float coreSize = 0.4f, float coreTransitionSize = 0.1f, float sinkLayerSize = 0.4f, float sinkTransitionSize = 0.1f); +SIMCONNECTAPI SimConnect_WeatherRemoveThermal(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID); +SIMCONNECTAPI SimConnect_AICreateParkedATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, const char * szAirportID, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AICreateEnrouteATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, int iFlightNumber, const char * szFlightPlanPath, double dFlightPlanPosition, BOOL bTouchAndGo, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AICreateNonATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AICreateSimulatedObject(HANDLE hSimConnect, const char * szContainerTitle, SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AIReleaseControl(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AIRemoveObject(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AISetAircraftFlightPlan(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, const char * szFlightPlanPath, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_ExecuteMissionAction(HANDLE hSimConnect, const GUID guidInstanceId); +SIMCONNECTAPI SimConnect_CompleteCustomMissionAction(HANDLE hSimConnect, const GUID guidInstanceId); SIMCONNECTAPI SimConnect_Close(HANDLE hSimConnect); -SIMCONNECTAPI SimConnect_RetrieveString(SIMCONNECT_RECV *pData, DWORD cbData, - void *pStringV, char **pszString, - DWORD *pcbString); -SIMCONNECTAPI SimConnect_GetLastSentPacketID(HANDLE hSimConnect, - DWORD *pdwError); -SIMCONNECTAPI SimConnect_Open(HANDLE *phSimConnect, LPCSTR szName, HWND hWnd, - DWORD UserEventWin32, HANDLE hEventHandle, - DWORD ConfigIndex); -SIMCONNECTAPI SimConnect_CallDispatch(HANDLE hSimConnect, - DispatchProc pfcnDispatch, - void *pContext); -SIMCONNECTAPI SimConnect_GetNextDispatch(HANDLE hSimConnect, - SIMCONNECT_RECV **ppData, - DWORD *pcbData); -SIMCONNECTAPI SimConnect_RequestResponseTimes(HANDLE hSimConnect, DWORD nCount, - float *fElapsedSeconds); -SIMCONNECTAPI SimConnect_InsertString(char *pDest, DWORD cbDest, void **ppEnd, - DWORD *pcbStringV, const char *pSource); -SIMCONNECTAPI SimConnect_CameraSetRelative6DOF(HANDLE hSimConnect, - float fDeltaX, float fDeltaY, - float fDeltaZ, float fPitchDeg, - float fBankDeg, - float fHeadingDeg); -SIMCONNECTAPI SimConnect_MenuAddItem(HANDLE hSimConnect, const char *szMenuItem, - SIMCONNECT_CLIENT_EVENT_ID MenuEventID, - DWORD dwData); -SIMCONNECTAPI SimConnect_MenuDeleteItem(HANDLE hSimConnect, - SIMCONNECT_CLIENT_EVENT_ID MenuEventID); -SIMCONNECTAPI SimConnect_MenuAddSubItem( - HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, - const char *szMenuItem, SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID, - DWORD dwData); -SIMCONNECTAPI -SimConnect_MenuDeleteSubItem(HANDLE hSimConnect, - SIMCONNECT_CLIENT_EVENT_ID MenuEventID, - const SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID); -SIMCONNECTAPI -SimConnect_RequestSystemState(HANDLE hSimConnect, - SIMCONNECT_DATA_REQUEST_ID RequestID, - const char *szState); -SIMCONNECTAPI SimConnect_SetSystemState(HANDLE hSimConnect, const char *szState, - DWORD dwInteger, float fFloat, - const char *szString); -SIMCONNECTAPI -SimConnect_MapClientDataNameToID(HANDLE hSimConnect, - const char *szClientDataName, - SIMCONNECT_CLIENT_DATA_ID ClientDataID); -SIMCONNECTAPI SimConnect_CreateClientData( - HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, DWORD dwSize, - SIMCONNECT_CREATE_CLIENT_DATA_FLAG Flags); -SIMCONNECTAPI SimConnect_AddToClientDataDefinition( - HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, - DWORD dwOffset, DWORD dwSizeOrType, float fEpsilon = 0, - DWORD DatumID = SIMCONNECT_UNUSED); -SIMCONNECTAPI SimConnect_ClearClientDataDefinition( - HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID); -SIMCONNECTAPI SimConnect_RequestClientData( - HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, - SIMCONNECT_DATA_REQUEST_ID RequestID, - SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, - SIMCONNECT_CLIENT_DATA_PERIOD Period = SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, - SIMCONNECT_CLIENT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, - DWORD interval = 0, DWORD limit = 0); -SIMCONNECTAPI -SimConnect_SetClientData(HANDLE hSimConnect, - SIMCONNECT_CLIENT_DATA_ID ClientDataID, - SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, - SIMCONNECT_CLIENT_DATA_SET_FLAG Flags, - DWORD dwReserved, DWORD cbUnitSize, void *pDataSet); -SIMCONNECTAPI SimConnect_FlightLoad(HANDLE hSimConnect, const char *szFileName); -SIMCONNECTAPI SimConnect_FlightSave(HANDLE hSimConnect, const char *szFileName, - const char *szTitle, - const char *szDescription, DWORD Flags); -SIMCONNECTAPI SimConnect_FlightPlanLoad(HANDLE hSimConnect, - const char *szFileName); -SIMCONNECTAPI SimConnect_Text(HANDLE hSimConnect, SIMCONNECT_TEXT_TYPE type, - float fTimeSeconds, - SIMCONNECT_CLIENT_EVENT_ID EventID, - DWORD cbUnitSize, void *pDataSet); -SIMCONNECTAPI -SimConnect_SubscribeToFacilities(HANDLE hSimConnect, - SIMCONNECT_FACILITY_LIST_TYPE type, - SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI -SimConnect_UnsubscribeToFacilities(HANDLE hSimConnect, - SIMCONNECT_FACILITY_LIST_TYPE type); -SIMCONNECTAPI -SimConnect_RequestFacilitiesList(HANDLE hSimConnect, - SIMCONNECT_FACILITY_LIST_TYPE type, - SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_RetrieveString(SIMCONNECT_RECV * pData, DWORD cbData, void * pStringV, char ** pszString, DWORD * pcbString); +SIMCONNECTAPI SimConnect_GetLastSentPacketID(HANDLE hSimConnect, DWORD * pdwError); +SIMCONNECTAPI SimConnect_Open(HANDLE * phSimConnect, LPCSTR szName, HWND hWnd, DWORD UserEventWin32, HANDLE hEventHandle, DWORD ConfigIndex); +SIMCONNECTAPI SimConnect_CallDispatch(HANDLE hSimConnect, DispatchProc pfcnDispatch, void * pContext); +SIMCONNECTAPI SimConnect_GetNextDispatch(HANDLE hSimConnect, SIMCONNECT_RECV ** ppData, DWORD * pcbData); +SIMCONNECTAPI SimConnect_RequestResponseTimes(HANDLE hSimConnect, DWORD nCount, float * fElapsedSeconds); +SIMCONNECTAPI SimConnect_InsertString(char * pDest, DWORD cbDest, void ** ppEnd, DWORD * pcbStringV, const char * pSource); +SIMCONNECTAPI SimConnect_CameraSetRelative6DOF(HANDLE hSimConnect, float fDeltaX, float fDeltaY, float fDeltaZ, float fPitchDeg, float fBankDeg, float fHeadingDeg); +SIMCONNECTAPI SimConnect_MenuAddItem(HANDLE hSimConnect, const char * szMenuItem, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, DWORD dwData); +SIMCONNECTAPI SimConnect_MenuDeleteItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID); +SIMCONNECTAPI SimConnect_MenuAddSubItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, const char * szMenuItem, SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID, DWORD dwData); +SIMCONNECTAPI SimConnect_MenuDeleteSubItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, const SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID); +SIMCONNECTAPI SimConnect_RequestSystemState(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szState); +SIMCONNECTAPI SimConnect_SetSystemState(HANDLE hSimConnect, const char * szState, DWORD dwInteger, float fFloat, const char * szString); +SIMCONNECTAPI SimConnect_MapClientDataNameToID(HANDLE hSimConnect, const char * szClientDataName, SIMCONNECT_CLIENT_DATA_ID ClientDataID); +SIMCONNECTAPI SimConnect_CreateClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, DWORD dwSize, SIMCONNECT_CREATE_CLIENT_DATA_FLAG Flags); +SIMCONNECTAPI SimConnect_AddToClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, DWORD dwOffset, DWORD dwSizeOrType, float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); +SIMCONNECTAPI SimConnect_ClearClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID); +SIMCONNECTAPI SimConnect_RequestClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, SIMCONNECT_CLIENT_DATA_PERIOD Period = SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); +SIMCONNECTAPI SimConnect_SetClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, SIMCONNECT_CLIENT_DATA_SET_FLAG Flags, DWORD dwReserved, DWORD cbUnitSize, void * pDataSet); +SIMCONNECTAPI SimConnect_FlightLoad(HANDLE hSimConnect, const char * szFileName); +SIMCONNECTAPI SimConnect_FlightSave(HANDLE hSimConnect, const char * szFileName, const char * szTitle, const char * szDescription, DWORD Flags); +SIMCONNECTAPI SimConnect_FlightPlanLoad(HANDLE hSimConnect, const char * szFileName); +SIMCONNECTAPI SimConnect_Text(HANDLE hSimConnect, SIMCONNECT_TEXT_TYPE type, float fTimeSeconds, SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD cbUnitSize, void * pDataSet); +SIMCONNECTAPI SimConnect_SubscribeToFacilities(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_UnsubscribeToFacilities(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type); +SIMCONNECTAPI SimConnect_RequestFacilitiesList(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type, SIMCONNECT_DATA_REQUEST_ID RequestID); #endif // _SIMCONNECT_H_ From 9d4e19bcb0066095a68756b454f2a842a20fb9ef Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Wed, 10 Jul 2024 09:01:38 +0200 Subject: [PATCH 30/33] undone formatting --- libsrc/include/SimConnect.hpp | 779 +--------------------------------- 1 file changed, 1 insertion(+), 778 deletions(-) diff --git a/libsrc/include/SimConnect.hpp b/libsrc/include/SimConnect.hpp index 99cbf68..776a87c 100644 --- a/libsrc/include/SimConnect.hpp +++ b/libsrc/include/SimConnect.hpp @@ -1,778 +1 @@ -//----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All Rights Reserved. -// -//----------------------------------------------------------------------------- - -#include "Windows.h" - -#ifndef _SIMCONNECT_H_ -#define _SIMCONNECT_H_ - -#pragma once - -#ifdef _MSFS_WASM - #ifndef SIMCONNECT_WASM_MODULE - #define SIMCONNECT_WASM_MODULE "env" - #endif -#endif - -#ifndef DWORD_MAX -#define DWORD_MAX 0xFFFFFFFF -#endif - -#include - -typedef DWORD SIMCONNECT_OBJECT_ID; - -//---------------------------------------------------------------------------- -// Constants -//---------------------------------------------------------------------------- - -static const DWORD SIMCONNECT_UNUSED = DWORD_MAX; // special value to indicate unused event, ID -static const DWORD SIMCONNECT_OBJECT_ID_USER = 0; // proxy value for User vehicle ObjectID - -static const float SIMCONNECT_CAMERA_IGNORE_FIELD = FLT_MAX; //Used to tell the Camera API to NOT modify the value in this part of the argument. - -static const DWORD SIMCONNECT_CLIENTDATA_MAX_SIZE = 8192; // maximum value for SimConnect_CreateClientData dwSize parameter - - -// Notification Group priority values -static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST = 1; // highest priority -static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE = 10000000; // highest priority that allows events to be masked -static const DWORD SIMCONNECT_GROUP_PRIORITY_STANDARD = 1900000000; // standard priority -static const DWORD SIMCONNECT_GROUP_PRIORITY_DEFAULT = 2000000000; // default priority -static const DWORD SIMCONNECT_GROUP_PRIORITY_LOWEST = 4000000000; // priorities lower than this will be ignored - -//Weather observations Metar strings -static const DWORD MAX_METAR_LENGTH = 2000; - -// Maximum thermal size is 100 km. -static const float MAX_THERMAL_SIZE = 100000; -static const float MAX_THERMAL_RATE = 1000; - -// SIMCONNECT_DATA_INITPOSITION.Airspeed -static const DWORD INITPOSITION_AIRSPEED_CRUISE = -1; // aircraft's cruise airspeed -static const DWORD INITPOSITION_AIRSPEED_KEEP = -2; // keep current airspeed - -// AddToClientDataDefinition dwSizeOrType parameter type values -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT8 = -1; // 8-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT16 = -2; // 16-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT32 = -3; // 32-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_INT64 = -4; // 64-bit integer number -static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT32 = -5; // 32-bit floating-point number (float) -static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT64 = -6; // 64-bit floating-point number (double) - -// AddToClientDataDefinition dwOffset parameter special values -static const DWORD SIMCONNECT_CLIENTDATAOFFSET_AUTO = -1; // automatically compute offset of the ClientData variable - -// Open ConfigIndex parameter special value -static const DWORD SIMCONNECT_OPEN_CONFIGINDEX_LOCAL = -1; // ignore SimConnect.cfg settings, and force local connection - -//---------------------------------------------------------------------------- -// Enum definitions -//---------------------------------------------------------------------------- - -//these came from substituteMacros -#define SIMCONNECT_REFSTRUCT struct -#define SIMCONNECT_STRUCT struct -#define SIMCONNECT_STRING(name, size) char name[size] -#define SIMCONNECT_GUID GUID -#define SIMCONNECT_STRINGV(name) char name[1] -#define SIMCONNECT_DATAV(name, id, count) DWORD name -#define SIMCONNECT_FIXEDTYPE_DATAV(type, name, count, cliMarshalAs, cliType) type name[1] -#define SIMCONNECT_GUID GUID -#define SIMCONNECT_ENUM enum -#define SIMCONNECT_ENUM_FLAGS typedef DWORD -#define SIMCONNECT_USER_ENUM typedef DWORD - - -// Receive data types -SIMCONNECT_ENUM SIMCONNECT_RECV_ID { - SIMCONNECT_RECV_ID_NULL, - SIMCONNECT_RECV_ID_EXCEPTION, - SIMCONNECT_RECV_ID_OPEN, - SIMCONNECT_RECV_ID_QUIT, - SIMCONNECT_RECV_ID_EVENT, - SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE, - SIMCONNECT_RECV_ID_EVENT_FILENAME, - SIMCONNECT_RECV_ID_EVENT_FRAME, - SIMCONNECT_RECV_ID_SIMOBJECT_DATA, - SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE, - SIMCONNECT_RECV_ID_WEATHER_OBSERVATION, - SIMCONNECT_RECV_ID_CLOUD_STATE, - SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID, - SIMCONNECT_RECV_ID_RESERVED_KEY, - SIMCONNECT_RECV_ID_CUSTOM_ACTION, - SIMCONNECT_RECV_ID_SYSTEM_STATE, - SIMCONNECT_RECV_ID_CLIENT_DATA, - SIMCONNECT_RECV_ID_EVENT_WEATHER_MODE, - SIMCONNECT_RECV_ID_AIRPORT_LIST, - SIMCONNECT_RECV_ID_VOR_LIST, - SIMCONNECT_RECV_ID_NDB_LIST, - SIMCONNECT_RECV_ID_WAYPOINT_LIST, - SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED, - SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED, - SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED, - SIMCONNECT_RECV_ID_EVENT_RACE_END, - SIMCONNECT_RECV_ID_EVENT_RACE_LAP, -#ifdef ENABLE_SIMCONNECT_EXPERIMENTAL - SIMCONNECT_RECV_ID_PICK, -#endif //ENABLE_SIMCONNECT_EXPERIMENTAL -}; - - - -// Data data types -SIMCONNECT_ENUM SIMCONNECT_DATATYPE { - SIMCONNECT_DATATYPE_INVALID, // invalid data type - SIMCONNECT_DATATYPE_INT32, // 32-bit integer number - SIMCONNECT_DATATYPE_INT64, // 64-bit integer number - SIMCONNECT_DATATYPE_FLOAT32, // 32-bit floating-point number (float) - SIMCONNECT_DATATYPE_FLOAT64, // 64-bit floating-point number (double) - SIMCONNECT_DATATYPE_STRING8, // 8-byte string - SIMCONNECT_DATATYPE_STRING32, // 32-byte string - SIMCONNECT_DATATYPE_STRING64, // 64-byte string - SIMCONNECT_DATATYPE_STRING128, // 128-byte string - SIMCONNECT_DATATYPE_STRING256, // 256-byte string - SIMCONNECT_DATATYPE_STRING260, // 260-byte string - SIMCONNECT_DATATYPE_STRINGV, // variable-length string - - SIMCONNECT_DATATYPE_INITPOSITION, // see SIMCONNECT_DATA_INITPOSITION - SIMCONNECT_DATATYPE_MARKERSTATE, // see SIMCONNECT_DATA_MARKERSTATE - SIMCONNECT_DATATYPE_WAYPOINT, // see SIMCONNECT_DATA_WAYPOINT - SIMCONNECT_DATATYPE_LATLONALT, // see SIMCONNECT_DATA_LATLONALT - SIMCONNECT_DATATYPE_XYZ, // see SIMCONNECT_DATA_XYZ - - SIMCONNECT_DATATYPE_MAX // enum limit -}; - -// Exception error types -SIMCONNECT_ENUM SIMCONNECT_EXCEPTION { - SIMCONNECT_EXCEPTION_NONE, - - SIMCONNECT_EXCEPTION_ERROR, - SIMCONNECT_EXCEPTION_SIZE_MISMATCH, - SIMCONNECT_EXCEPTION_UNRECOGNIZED_ID, - SIMCONNECT_EXCEPTION_UNOPENED, - SIMCONNECT_EXCEPTION_VERSION_MISMATCH, - SIMCONNECT_EXCEPTION_TOO_MANY_GROUPS, - SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED, - SIMCONNECT_EXCEPTION_TOO_MANY_EVENT_NAMES, - SIMCONNECT_EXCEPTION_EVENT_ID_DUPLICATE, - SIMCONNECT_EXCEPTION_TOO_MANY_MAPS, - SIMCONNECT_EXCEPTION_TOO_MANY_OBJECTS, - SIMCONNECT_EXCEPTION_TOO_MANY_REQUESTS, - SIMCONNECT_EXCEPTION_WEATHER_INVALID_PORT, - SIMCONNECT_EXCEPTION_WEATHER_INVALID_METAR, - SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_GET_OBSERVATION, - SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_CREATE_STATION, - SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_REMOVE_STATION, - SIMCONNECT_EXCEPTION_INVALID_DATA_TYPE, - SIMCONNECT_EXCEPTION_INVALID_DATA_SIZE, - SIMCONNECT_EXCEPTION_DATA_ERROR, - SIMCONNECT_EXCEPTION_INVALID_ARRAY, - SIMCONNECT_EXCEPTION_CREATE_OBJECT_FAILED, - SIMCONNECT_EXCEPTION_LOAD_FLIGHTPLAN_FAILED, - SIMCONNECT_EXCEPTION_OPERATION_INVALID_FOR_OBJECT_TYPE, - SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION, - SIMCONNECT_EXCEPTION_ALREADY_SUBSCRIBED, - SIMCONNECT_EXCEPTION_INVALID_ENUM, - SIMCONNECT_EXCEPTION_DEFINITION_ERROR, - SIMCONNECT_EXCEPTION_DUPLICATE_ID, - SIMCONNECT_EXCEPTION_DATUM_ID, - SIMCONNECT_EXCEPTION_OUT_OF_BOUNDS, - SIMCONNECT_EXCEPTION_ALREADY_CREATED, - SIMCONNECT_EXCEPTION_OBJECT_OUTSIDE_REALITY_BUBBLE, - SIMCONNECT_EXCEPTION_OBJECT_CONTAINER, - SIMCONNECT_EXCEPTION_OBJECT_AI, - SIMCONNECT_EXCEPTION_OBJECT_ATC, - SIMCONNECT_EXCEPTION_OBJECT_SCHEDULE, -}; - -// Object types -SIMCONNECT_ENUM SIMCONNECT_SIMOBJECT_TYPE { - SIMCONNECT_SIMOBJECT_TYPE_USER, - SIMCONNECT_SIMOBJECT_TYPE_ALL, - SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT, - SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER, - SIMCONNECT_SIMOBJECT_TYPE_BOAT, - SIMCONNECT_SIMOBJECT_TYPE_GROUND, -}; - -// EventState values -SIMCONNECT_ENUM SIMCONNECT_STATE { - SIMCONNECT_STATE_OFF, - SIMCONNECT_STATE_ON, -}; - -// Object Data Request Period values -SIMCONNECT_ENUM SIMCONNECT_PERIOD { - SIMCONNECT_PERIOD_NEVER, - SIMCONNECT_PERIOD_ONCE, - SIMCONNECT_PERIOD_VISUAL_FRAME, - SIMCONNECT_PERIOD_SIM_FRAME, - SIMCONNECT_PERIOD_SECOND, -}; - - -SIMCONNECT_ENUM SIMCONNECT_MISSION_END { - SIMCONNECT_MISSION_FAILED, - SIMCONNECT_MISSION_CRASHED, - SIMCONNECT_MISSION_SUCCEEDED -}; - -// ClientData Request Period values -SIMCONNECT_ENUM SIMCONNECT_CLIENT_DATA_PERIOD { - SIMCONNECT_CLIENT_DATA_PERIOD_NEVER, - SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, - SIMCONNECT_CLIENT_DATA_PERIOD_VISUAL_FRAME, - SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, - SIMCONNECT_CLIENT_DATA_PERIOD_SECOND, -}; - -SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE { - SIMCONNECT_TEXT_TYPE_SCROLL_BLACK, - SIMCONNECT_TEXT_TYPE_SCROLL_WHITE, - SIMCONNECT_TEXT_TYPE_SCROLL_RED, - SIMCONNECT_TEXT_TYPE_SCROLL_GREEN, - SIMCONNECT_TEXT_TYPE_SCROLL_BLUE, - SIMCONNECT_TEXT_TYPE_SCROLL_YELLOW, - SIMCONNECT_TEXT_TYPE_SCROLL_MAGENTA, - SIMCONNECT_TEXT_TYPE_SCROLL_CYAN, - SIMCONNECT_TEXT_TYPE_PRINT_BLACK=0x0100, - SIMCONNECT_TEXT_TYPE_PRINT_WHITE, - SIMCONNECT_TEXT_TYPE_PRINT_RED, - SIMCONNECT_TEXT_TYPE_PRINT_GREEN, - SIMCONNECT_TEXT_TYPE_PRINT_BLUE, - SIMCONNECT_TEXT_TYPE_PRINT_YELLOW, - SIMCONNECT_TEXT_TYPE_PRINT_MAGENTA, - SIMCONNECT_TEXT_TYPE_PRINT_CYAN, - SIMCONNECT_TEXT_TYPE_MENU=0x0200, -}; - -SIMCONNECT_ENUM SIMCONNECT_TEXT_RESULT { - SIMCONNECT_TEXT_RESULT_MENU_SELECT_1, - SIMCONNECT_TEXT_RESULT_MENU_SELECT_2, - SIMCONNECT_TEXT_RESULT_MENU_SELECT_3, - SIMCONNECT_TEXT_RESULT_MENU_SELECT_4, - SIMCONNECT_TEXT_RESULT_MENU_SELECT_5, - SIMCONNECT_TEXT_RESULT_MENU_SELECT_6, - SIMCONNECT_TEXT_RESULT_MENU_SELECT_7, - SIMCONNECT_TEXT_RESULT_MENU_SELECT_8, - SIMCONNECT_TEXT_RESULT_MENU_SELECT_9, - SIMCONNECT_TEXT_RESULT_MENU_SELECT_10, - SIMCONNECT_TEXT_RESULT_DISPLAYED = 0x00010000, - SIMCONNECT_TEXT_RESULT_QUEUED, - SIMCONNECT_TEXT_RESULT_REMOVED, - SIMCONNECT_TEXT_RESULT_REPLACED, - SIMCONNECT_TEXT_RESULT_TIMEOUT, -}; - -SIMCONNECT_ENUM SIMCONNECT_WEATHER_MODE { - SIMCONNECT_WEATHER_MODE_THEME, - SIMCONNECT_WEATHER_MODE_RWW, - SIMCONNECT_WEATHER_MODE_CUSTOM, - SIMCONNECT_WEATHER_MODE_GLOBAL, -}; - -SIMCONNECT_ENUM SIMCONNECT_FACILITY_LIST_TYPE { - SIMCONNECT_FACILITY_LIST_TYPE_AIRPORT, - SIMCONNECT_FACILITY_LIST_TYPE_WAYPOINT, - SIMCONNECT_FACILITY_LIST_TYPE_NDB, - SIMCONNECT_FACILITY_LIST_TYPE_VOR, - SIMCONNECT_FACILITY_LIST_TYPE_COUNT // invalid -}; - - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_VOR_FLAGS; // flags for SIMCONNECT_RECV_ID_VOR_LIST - static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL = 0x00000001; // Has Nav signal - static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER = 0x00000002; // Has localizer - static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE = 0x00000004; // Has Nav signal - static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME = 0x00000008; // Station has DME - - - -// bits for the Waypoint Flags field: may be combined -SIMCONNECT_ENUM_FLAGS SIMCONNECT_WAYPOINT_FLAGS; - static const DWORD SIMCONNECT_WAYPOINT_NONE = 0x00; - static const DWORD SIMCONNECT_WAYPOINT_SPEED_REQUESTED = 0x04; // requested speed at waypoint is valid - static const DWORD SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED = 0x08; // request a specific throttle percentage - static const DWORD SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED = 0x10; // compute vertical to speed to reach waypoint altitude when crossing the waypoint - static const DWORD SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL = 0x20; // AltitudeIsAGL - static const DWORD SIMCONNECT_WAYPOINT_ON_GROUND = 0x00100000; // place this waypoint on the ground - static const DWORD SIMCONNECT_WAYPOINT_REVERSE = 0x00200000; // Back up to this waypoint. Only valid on first waypoint - static const DWORD SIMCONNECT_WAYPOINT_WRAP_TO_FIRST = 0x00400000; // Wrap around back to first waypoint. Only valid on last waypoint. - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_EVENT_FLAG; - static const DWORD SIMCONNECT_EVENT_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_EVENT_FLAG_FAST_REPEAT_TIMER = 0x00000001; // set event repeat timer to simulate fast repeat - static const DWORD SIMCONNECT_EVENT_FLAG_SLOW_REPEAT_TIMER = 0x00000002; // set event repeat timer to simulate slow repeat - static const DWORD SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY = 0x00000010; // interpret GroupID parameter as priority value - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_DATA_REQUEST_FLAG; - static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_CHANGED = 0x00000001; // send requested data when value(s) change - static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_TAGGED = 0x00000002; // send requested data in tagged format - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_DATA_SET_FLAG; - static const DWORD SIMCONNECT_DATA_SET_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_DATA_SET_FLAG_TAGGED = 0x00000001; // data is in tagged format - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_CREATE_CLIENT_DATA_FLAG; - static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_READ_ONLY = 0x00000001; // permit only ClientData creator to write into ClientData - - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_CLIENT_DATA_REQUEST_FLAG; - static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED = 0x00000001; // send requested ClientData when value(s) change - static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED = 0x00000002; // send requested ClientData in tagged format - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_CLIENT_DATA_SET_FLAG; - static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT = 0x00000000; - static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_TAGGED = 0x00000001; // data is in tagged format - - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_VIEW_SYSTEM_EVENT_DATA; // dwData contains these flags for the "View" System Event - static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_2D = 0x00000001; // 2D Panels in cockpit view - static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_VIRTUAL = 0x00000002; // Virtual (3D) panels in cockpit view - static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_ORTHOGONAL = 0x00000004; // Orthogonal (Map) view - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_SOUND_SYSTEM_EVENT_DATA; // dwData contains these flags for the "Sound" System Event - static const DWORD SIMCONNECT_SOUND_SYSTEM_EVENT_DATA_MASTER = 0x00000001; // Sound Master - - -#ifdef ENABLE_SIMCONNECT_EXPERIMENTAL - -SIMCONNECT_ENUM_FLAGS SIMCONNECT_PICK_FLAGS -{ - SIMCONNECT_PICK_GROUND = 0x01, // pick ground/ pick result item is ground location - SIMCONNECT_PICK_AI = 0x02, // pick AI / pick result item is AI, (dwSimObjectID is valid) - SIMCONNECT_PICK_SCENERY = 0x04, // pick scenery/ pick result item is scenery object (hSceneryObject is valid) - SIMCONNECT_PICK_ALL = SIMCONNECT_PICK_SCENERY | SIMCONNECT_PICK_AI | SIMCONNECT_PICK_GROUND, // pick all / (not valid on pick result item) - SIMCONNECT_PICK_COORDSASPIXELS = 0x08, -}; - -#endif //ENABLE_SIMCONNECT_EXPERIMENTAL - -//---------------------------------------------------------------------------- -// User-defined enums -//---------------------------------------------------------------------------- - -SIMCONNECT_USER_ENUM SIMCONNECT_NOTIFICATION_GROUP_ID; //client-defined notification group ID -SIMCONNECT_USER_ENUM SIMCONNECT_INPUT_GROUP_ID; //client-defined input group ID -SIMCONNECT_USER_ENUM SIMCONNECT_DATA_DEFINITION_ID; //client-defined data definition ID -SIMCONNECT_USER_ENUM SIMCONNECT_DATA_REQUEST_ID; //client-defined request data ID - -SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_EVENT_ID; //client-defined client event ID -SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_ID; //client-defined client data ID -SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_DEFINITION_ID; //client-defined client data definition ID - - -//---------------------------------------------------------------------------- -// Struct definitions -//---------------------------------------------------------------------------- - -#pragma pack(push, 1) - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV -{ - DWORD dwSize; // record size - DWORD dwVersion; // interface version - DWORD dwID; // see SIMCONNECT_RECV_ID -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EXCEPTION : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EXCEPTION -{ - DWORD dwException; // see SIMCONNECT_EXCEPTION - static const DWORD UNKNOWN_SENDID = 0; - DWORD dwSendID; // see SimConnect_GetLastSentPacketID - static const DWORD UNKNOWN_INDEX = DWORD_MAX; - DWORD dwIndex; // index of parameter that was source of error -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_OPEN : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_OPEN -{ - SIMCONNECT_STRING( szApplicationName, 256); - DWORD dwApplicationVersionMajor; - DWORD dwApplicationVersionMinor; - DWORD dwApplicationBuildMajor; - DWORD dwApplicationBuildMinor; - DWORD dwSimConnectVersionMajor; - DWORD dwSimConnectVersionMinor; - DWORD dwSimConnectBuildMajor; - DWORD dwSimConnectBuildMinor; - DWORD dwReserved1; - DWORD dwReserved2; -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_QUIT : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_QUIT -{ -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EVENT -{ - static const DWORD UNKNOWN_GROUP = DWORD_MAX; - DWORD uGroupID; - DWORD uEventID; - DWORD dwData; // uEventID-dependent context -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FILENAME : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FILENAME -{ - SIMCONNECT_STRING( szFileName, MAX_PATH); // uEventID-dependent context - DWORD dwFlags; -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FILENAME -{ - SIMCONNECT_SIMOBJECT_TYPE eObjType; -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FRAME : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FRAME -{ - float fFrameRate; - float fSimSpeed; -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED -{ - // No event specific data, for now -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED -{ - // No event specific data, for now -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED -{ - // No event specific data, for now -}; - -// SIMCONNECT_DATA_RACE_RESULT -SIMCONNECT_STRUCT SIMCONNECT_DATA_RACE_RESULT -{ - DWORD dwNumberOfRacers; // The total number of racers - SIMCONNECT_GUID MissionGUID; // The name of the mission to execute, NULL if no mission - SIMCONNECT_STRING( szPlayerName, MAX_PATH); // The name of the player - SIMCONNECT_STRING( szSessionType, MAX_PATH); // The type of the multiplayer session: "LAN", "GAMESPY") - SIMCONNECT_STRING( szAircraft, MAX_PATH); // The aircraft type - SIMCONNECT_STRING( szPlayerRole, MAX_PATH); // The player role in the mission - double fTotalTime; // Total time in seconds, 0 means DNF - double fPenaltyTime; // Total penalty time in seconds - DWORD dwIsDisqualified; // non 0 - disqualified, 0 - not disqualified -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_END : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_RACE_END -{ - DWORD dwRacerNumber; // The index of the racer the results are for - SIMCONNECT_DATA_RACE_RESULT RacerData; -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_LAP : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_RACE_LAP -{ - DWORD dwLapIndex; // The index of the lap the results are for - SIMCONNECT_DATA_RACE_RESULT RacerData; -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA -{ - DWORD dwRequestID; - DWORD dwObjectID; - DWORD dwDefineID; - DWORD dwFlags; // SIMCONNECT_DATA_REQUEST_FLAG - DWORD dwentrynumber; // if multiple objects returned, this is number out of . - DWORD dwoutof; // note: starts with 1, not 0. - DWORD dwDefineCount; // data count (number of datums, *not* byte count) - SIMCONNECT_DATAV( dwData, dwDefineID, ); // data begins here, dwDefineCount data items -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE -{ -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLIENT_DATA : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == SIMCONNECT_RECV_ID_CLIENT_DATA -{ -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WEATHER_OBSERVATION : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_WEATHER_OBSERVATION -{ - DWORD dwRequestID; - SIMCONNECT_STRINGV( szMetar); // Variable length string whose maximum size is MAX_METAR_LENGTH -}; - -static const int SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH = 64; -static const int SIMCONNECT_CLOUD_STATE_ARRAY_SIZE = SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH*SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLOUD_STATE : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_CLOUD_STATE -{ - DWORD dwRequestID; - DWORD dwArraySize; - SIMCONNECT_FIXEDTYPE_DATAV(BYTE, rgbData, dwArraySize, U1 /*member of UnmanagedType enum*/ , System::Byte /*cli type*/); -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_ASSIGNED_OBJECT_ID : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID -{ - DWORD dwRequestID; - DWORD dwObjectID; -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_RESERVED_KEY : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY -{ - SIMCONNECT_STRING( szChoiceReserved, 30); - SIMCONNECT_STRING( szReservedKey, 50); -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SYSTEM_STATE : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SYSTEM_STATE -{ - DWORD dwRequestID; - DWORD dwInteger; - float fFloat; - SIMCONNECT_STRING( szString, MAX_PATH); -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CUSTOM_ACTION : public SIMCONNECT_RECV_EVENT -{ - SIMCONNECT_GUID guidInstanceId; // Instance id of the action that executed - DWORD dwWaitForCompletion; // Wait for completion flag on the action - SIMCONNECT_STRINGV( szPayLoad); // Variable length string payload associated with the mission action. -}; - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_WEATHER_MODE : public SIMCONNECT_RECV_EVENT -{ - // No event specific data - the new weather mode is in the base structure dwData member. -}; - -// SIMCONNECT_RECV_FACILITIES_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_FACILITIES_LIST : public SIMCONNECT_RECV -{ - DWORD dwRequestID; - DWORD dwArraySize; - DWORD dwEntryNumber; // when the array of items is too big for one send, which send this is (0..dwOutOf-1) - DWORD dwOutOf; // total number of transmissions the list is chopped into -}; - -// SIMCONNECT_DATA_FACILITY_AIRPORT -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_AIRPORT -{ - SIMCONNECT_STRING(Icao, 9); // ICAO of the object - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // meters -}; - -// SIMCONNECT_RECV_AIRPORT_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_AIRPORT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST -{ - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_AIRPORT, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_AIRPORT /*cli type*/); -}; - - -// SIMCONNECT_DATA_FACILITY_WAYPOINT -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_WAYPOINT : public SIMCONNECT_DATA_FACILITY_AIRPORT -{ - float fMagVar; // Magvar in degrees -}; - -// SIMCONNECT_RECV_WAYPOINT_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WAYPOINT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST -{ - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_WAYPOINT, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_WAYPOINT /*cli type*/); -}; - -// SIMCONNECT_DATA_FACILITY_NDB -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_NDB : public SIMCONNECT_DATA_FACILITY_WAYPOINT -{ - DWORD fFrequency; // frequency in Hz -}; - -// SIMCONNECT_RECV_NDB_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_NDB_LIST : public SIMCONNECT_RECV_FACILITIES_LIST -{ - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_NDB, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_NDB /*cli type*/); -}; - -// SIMCONNECT_DATA_FACILITY_VOR -SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_VOR : public SIMCONNECT_DATA_FACILITY_NDB -{ - DWORD Flags; // SIMCONNECT_VOR_FLAGS - float fLocalizer; // Localizer in degrees - double GlideLat; // Glide Slope Location (deg, deg, meters) - double GlideLon; - double GlideAlt; - float fGlideSlopeAngle; // Glide Slope in degrees -}; - -// SIMCONNECT_RECV_VOR_LIST -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_VOR_LIST : public SIMCONNECT_RECV_FACILITIES_LIST -{ - SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_VOR, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_VOR /*cli type*/); -}; - -#ifdef ENABLE_SIMCONNECT_EXPERIMENTAL - -SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_PICK : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY -{ - HANDLE hContext; - DWORD dwFlags; // - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // feet - int xPos; //reserved - int yPos; //reserved; - DWORD dwSimObjectID; - HANDLE hSceneryObject; - DWORD dwentrynumber; // if multiple objects returned, this is number out of . - DWORD dwoutof; // note: starts with 1, not 0. -}; - -#endif //ENABLE_SIMCONNECT_EXPERIMENTAL - - -// SIMCONNECT_DATATYPE_INITPOSITION -SIMCONNECT_STRUCT SIMCONNECT_DATA_INITPOSITION -{ - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // feet - double Pitch; // degrees - double Bank; // degrees - double Heading; // degrees - DWORD OnGround; // 1=force to be on the ground - DWORD Airspeed; // knots -}; - - -// SIMCONNECT_DATATYPE_MARKERSTATE -SIMCONNECT_STRUCT SIMCONNECT_DATA_MARKERSTATE -{ - SIMCONNECT_STRING( szMarkerName, 64); - DWORD dwMarkerState; -}; - -// SIMCONNECT_DATATYPE_WAYPOINT -SIMCONNECT_STRUCT SIMCONNECT_DATA_WAYPOINT -{ - double Latitude; // degrees - double Longitude; // degrees - double Altitude; // feet - unsigned long Flags; - double ktsSpeed; // knots - double percentThrottle; -}; - -// SIMCONNECT_DATA_LATLONALT -SIMCONNECT_STRUCT SIMCONNECT_DATA_LATLONALT -{ - double Latitude; - double Longitude; - double Altitude; -}; - -// SIMCONNECT_DATA_XYZ -SIMCONNECT_STRUCT SIMCONNECT_DATA_XYZ -{ - double x; - double y; - double z; -}; - -#pragma pack(pop) - -//---------------------------------------------------------------------------- -// End of Struct definitions -//---------------------------------------------------------------------------- - -typedef void (CALLBACK *DispatchProc)(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext); - -#if !defined(SIMCONNECTAPI) - #ifdef _MSFS_WASM - #ifdef __INTELLISENSE__ - #define MODULE_EXPORT - #define SIMCONNECTAPI extern "C" HRESULT - #else - #define MODULE_EXPORT __attribute__( ( visibility( "default" ) ) ) - #define SIMCONNECTAPI extern "C" __attribute__((import_module(SIMCONNECT_WASM_MODULE))) HRESULT - #endif - #else - #define MODULE_EXPORT - #define SIMCONNECTAPI extern "C" HRESULT __stdcall - #endif -#endif - -SIMCONNECTAPI SimConnect_MapClientEventToSimEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * EventName = ""); -SIMCONNECTAPI SimConnect_TransmitClientEvent(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD dwData, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_EVENT_FLAG Flags); -SIMCONNECTAPI SimConnect_SetSystemEventState(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, SIMCONNECT_STATE dwState); -SIMCONNECTAPI SimConnect_AddClientEventToNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_CLIENT_EVENT_ID EventID, BOOL bMaskable = FALSE); -SIMCONNECTAPI SimConnect_RemoveClientEvent(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_CLIENT_EVENT_ID EventID); -SIMCONNECTAPI SimConnect_SetNotificationGroupPriority(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, DWORD uPriority); -SIMCONNECTAPI SimConnect_ClearNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID); -SIMCONNECTAPI SimConnect_RequestNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, DWORD dwReserved = 0, DWORD Flags = 0); -SIMCONNECTAPI SimConnect_AddToDataDefinition(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, const char * DatumName, const char * UnitsName, SIMCONNECT_DATATYPE DatumType = SIMCONNECT_DATATYPE_FLOAT64, float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); -SIMCONNECTAPI SimConnect_ClearDataDefinition(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID); -SIMCONNECTAPI SimConnect_RequestDataOnSimObject(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_PERIOD Period, SIMCONNECT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); -SIMCONNECTAPI SimConnect_RequestDataOnSimObjectType(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_DATA_DEFINITION_ID DefineID, DWORD dwRadiusMeters, SIMCONNECT_SIMOBJECT_TYPE type); -SIMCONNECTAPI SimConnect_SetDataOnSimObject(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_SET_FLAG Flags, DWORD ArrayCount, DWORD cbUnitSize, void * pDataSet); -SIMCONNECTAPI SimConnect_MapInputEventToClientEvent(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, const char * szInputDefinition, SIMCONNECT_CLIENT_EVENT_ID DownEventID, DWORD DownValue = 0, SIMCONNECT_CLIENT_EVENT_ID UpEventID = (SIMCONNECT_CLIENT_EVENT_ID)SIMCONNECT_UNUSED, DWORD UpValue = 0, BOOL bMaskable = FALSE); -SIMCONNECTAPI SimConnect_SetInputGroupPriority(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD uPriority); -SIMCONNECTAPI SimConnect_RemoveInputEvent(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, const char * szInputDefinition); -SIMCONNECTAPI SimConnect_ClearInputGroup(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID); -SIMCONNECTAPI SimConnect_SetInputGroupState(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD dwState); -SIMCONNECTAPI SimConnect_RequestReservedKey(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * szKeyChoice1 = "", const char * szKeyChoice2 = "", const char * szKeyChoice3 = ""); -SIMCONNECTAPI SimConnect_SubscribeToSystemEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * SystemEventName); -SIMCONNECTAPI SimConnect_UnsubscribeFromSystemEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID); -SIMCONNECTAPI SimConnect_WeatherRequestInterpolatedObservation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon, float alt); -SIMCONNECTAPI SimConnect_WeatherRequestObservationAtStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO); -SIMCONNECTAPI SimConnect_WeatherRequestObservationAtNearestStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon); -SIMCONNECTAPI SimConnect_WeatherCreateStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO, const char * szName, float lat, float lon, float alt); -SIMCONNECTAPI SimConnect_WeatherRemoveStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO); -SIMCONNECTAPI SimConnect_WeatherSetObservation(HANDLE hSimConnect, DWORD Seconds, const char * szMETAR); -SIMCONNECTAPI SimConnect_WeatherSetModeServer(HANDLE hSimConnect, DWORD dwPort, DWORD dwSeconds); -SIMCONNECTAPI SimConnect_WeatherSetModeTheme(HANDLE hSimConnect, const char * szThemeName); -SIMCONNECTAPI SimConnect_WeatherSetModeGlobal(HANDLE hSimConnect); -SIMCONNECTAPI SimConnect_WeatherSetModeCustom(HANDLE hSimConnect); -SIMCONNECTAPI SimConnect_WeatherSetDynamicUpdateRate(HANDLE hSimConnect, DWORD dwRate); -SIMCONNECTAPI SimConnect_WeatherRequestCloudState(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float minLat, float minLon, float minAlt, float maxLat, float maxLon, float maxAlt, DWORD dwFlags = 0); -SIMCONNECTAPI SimConnect_WeatherCreateThermal(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon, float alt, float radius, float height, float coreRate = 3.0f, float coreTurbulence = 0.05f, float sinkRate = 3.0f, float sinkTurbulence = 0.2f, float coreSize = 0.4f, float coreTransitionSize = 0.1f, float sinkLayerSize = 0.4f, float sinkTransitionSize = 0.1f); -SIMCONNECTAPI SimConnect_WeatherRemoveThermal(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID); -SIMCONNECTAPI SimConnect_AICreateParkedATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, const char * szAirportID, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AICreateEnrouteATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, int iFlightNumber, const char * szFlightPlanPath, double dFlightPlanPosition, BOOL bTouchAndGo, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AICreateNonATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AICreateSimulatedObject(HANDLE hSimConnect, const char * szContainerTitle, SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AIReleaseControl(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AIRemoveObject(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_AISetAircraftFlightPlan(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, const char * szFlightPlanPath, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_ExecuteMissionAction(HANDLE hSimConnect, const GUID guidInstanceId); -SIMCONNECTAPI SimConnect_CompleteCustomMissionAction(HANDLE hSimConnect, const GUID guidInstanceId); -SIMCONNECTAPI SimConnect_Close(HANDLE hSimConnect); -SIMCONNECTAPI SimConnect_RetrieveString(SIMCONNECT_RECV * pData, DWORD cbData, void * pStringV, char ** pszString, DWORD * pcbString); -SIMCONNECTAPI SimConnect_GetLastSentPacketID(HANDLE hSimConnect, DWORD * pdwError); -SIMCONNECTAPI SimConnect_Open(HANDLE * phSimConnect, LPCSTR szName, HWND hWnd, DWORD UserEventWin32, HANDLE hEventHandle, DWORD ConfigIndex); -SIMCONNECTAPI SimConnect_CallDispatch(HANDLE hSimConnect, DispatchProc pfcnDispatch, void * pContext); -SIMCONNECTAPI SimConnect_GetNextDispatch(HANDLE hSimConnect, SIMCONNECT_RECV ** ppData, DWORD * pcbData); -SIMCONNECTAPI SimConnect_RequestResponseTimes(HANDLE hSimConnect, DWORD nCount, float * fElapsedSeconds); -SIMCONNECTAPI SimConnect_InsertString(char * pDest, DWORD cbDest, void ** ppEnd, DWORD * pcbStringV, const char * pSource); -SIMCONNECTAPI SimConnect_CameraSetRelative6DOF(HANDLE hSimConnect, float fDeltaX, float fDeltaY, float fDeltaZ, float fPitchDeg, float fBankDeg, float fHeadingDeg); -SIMCONNECTAPI SimConnect_MenuAddItem(HANDLE hSimConnect, const char * szMenuItem, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, DWORD dwData); -SIMCONNECTAPI SimConnect_MenuDeleteItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID); -SIMCONNECTAPI SimConnect_MenuAddSubItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, const char * szMenuItem, SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID, DWORD dwData); -SIMCONNECTAPI SimConnect_MenuDeleteSubItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, const SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID); -SIMCONNECTAPI SimConnect_RequestSystemState(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szState); -SIMCONNECTAPI SimConnect_SetSystemState(HANDLE hSimConnect, const char * szState, DWORD dwInteger, float fFloat, const char * szString); -SIMCONNECTAPI SimConnect_MapClientDataNameToID(HANDLE hSimConnect, const char * szClientDataName, SIMCONNECT_CLIENT_DATA_ID ClientDataID); -SIMCONNECTAPI SimConnect_CreateClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, DWORD dwSize, SIMCONNECT_CREATE_CLIENT_DATA_FLAG Flags); -SIMCONNECTAPI SimConnect_AddToClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, DWORD dwOffset, DWORD dwSizeOrType, float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); -SIMCONNECTAPI SimConnect_ClearClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID); -SIMCONNECTAPI SimConnect_RequestClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, SIMCONNECT_CLIENT_DATA_PERIOD Period = SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); -SIMCONNECTAPI SimConnect_SetClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, SIMCONNECT_CLIENT_DATA_SET_FLAG Flags, DWORD dwReserved, DWORD cbUnitSize, void * pDataSet); -SIMCONNECTAPI SimConnect_FlightLoad(HANDLE hSimConnect, const char * szFileName); -SIMCONNECTAPI SimConnect_FlightSave(HANDLE hSimConnect, const char * szFileName, const char * szTitle, const char * szDescription, DWORD Flags); -SIMCONNECTAPI SimConnect_FlightPlanLoad(HANDLE hSimConnect, const char * szFileName); -SIMCONNECTAPI SimConnect_Text(HANDLE hSimConnect, SIMCONNECT_TEXT_TYPE type, float fTimeSeconds, SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD cbUnitSize, void * pDataSet); -SIMCONNECTAPI SimConnect_SubscribeToFacilities(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type, SIMCONNECT_DATA_REQUEST_ID RequestID); -SIMCONNECTAPI SimConnect_UnsubscribeToFacilities(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type); -SIMCONNECTAPI SimConnect_RequestFacilitiesList(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type, SIMCONNECT_DATA_REQUEST_ID RequestID); - -#endif // _SIMCONNECT_H_ +#include From 69d0494b4e270cb6229bf1df52104dbd2d4c5eac Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Wed, 10 Jul 2024 09:02:40 +0200 Subject: [PATCH 31/33] semver match --- Cargo.lock | 2 +- Cargo.toml | 2 +- Readme.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba0edf2..ec3ca47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,7 +200,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "simconnect" -version = "0.4.0" +version = "0.3.2" dependencies = [ "bindgen", ] diff --git a/Cargo.toml b/Cargo.toml index 1fd4e2f..2a1c35d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "simconnect" license = "MIT" description = "Rust bindings for SimConnect" -version = "0.4.0" +version = "0.3.2" authors = ["Connor T"] edition = "2018" diff --git a/Readme.md b/Readme.md index f15f053..86f4109 100644 --- a/Readme.md +++ b/Readme.md @@ -2,8 +2,8 @@ # SimConnect Bindings for Rust - ## Requirements + - [CLang](https://clang.llvm.org/get_started.html) (See the [Rust Bindgen Documentation](https://rust-lang.github.io/rust-bindgen/requirements.html)) - MSVC x64 Rust build (`x86_64-pc-windows-msvc`, see [The rustup book](https://rust-lang.github.io/rustup/installation/windows.html)) @@ -13,7 +13,7 @@ Add this to your `Cargo.toml` ```toml [dependencies] -simconnect = "0.4.0" +simconnect = "0.3.2" ``` ## Building From 6ed5aae5eb0d2207c9068615c4b130e90ffe7ed4 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Wed, 10 Jul 2024 09:03:35 +0200 Subject: [PATCH 32/33] added rest of file to git --- libsrc/include/SimConnect.hpp | 771 +++++++++++++++++++++++++++++++++- 1 file changed, 770 insertions(+), 1 deletion(-) diff --git a/libsrc/include/SimConnect.hpp b/libsrc/include/SimConnect.hpp index 776a87c..938965b 100644 --- a/libsrc/include/SimConnect.hpp +++ b/libsrc/include/SimConnect.hpp @@ -1 +1,770 @@ -#include +#ifndef _SIMCONNECT_H_ +#define _SIMCONNECT_H_ + +#pragma once + +#ifdef _MSFS_WASM + #ifndef SIMCONNECT_WASM_MODULE + #define SIMCONNECT_WASM_MODULE "env" + #endif +#endif + +#ifndef DWORD_MAX +#define DWORD_MAX 0xFFFFFFFF +#endif + +#include + +typedef DWORD SIMCONNECT_OBJECT_ID; + +//---------------------------------------------------------------------------- +// Constants +//---------------------------------------------------------------------------- + +static const DWORD SIMCONNECT_UNUSED = DWORD_MAX; // special value to indicate unused event, ID +static const DWORD SIMCONNECT_OBJECT_ID_USER = 0; // proxy value for User vehicle ObjectID + +static const float SIMCONNECT_CAMERA_IGNORE_FIELD = FLT_MAX; //Used to tell the Camera API to NOT modify the value in this part of the argument. + +static const DWORD SIMCONNECT_CLIENTDATA_MAX_SIZE = 8192; // maximum value for SimConnect_CreateClientData dwSize parameter + + +// Notification Group priority values +static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST = 1; // highest priority +static const DWORD SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE = 10000000; // highest priority that allows events to be masked +static const DWORD SIMCONNECT_GROUP_PRIORITY_STANDARD = 1900000000; // standard priority +static const DWORD SIMCONNECT_GROUP_PRIORITY_DEFAULT = 2000000000; // default priority +static const DWORD SIMCONNECT_GROUP_PRIORITY_LOWEST = 4000000000; // priorities lower than this will be ignored + +//Weather observations Metar strings +static const DWORD MAX_METAR_LENGTH = 2000; + +// Maximum thermal size is 100 km. +static const float MAX_THERMAL_SIZE = 100000; +static const float MAX_THERMAL_RATE = 1000; + +// SIMCONNECT_DATA_INITPOSITION.Airspeed +static const DWORD INITPOSITION_AIRSPEED_CRUISE = -1; // aircraft's cruise airspeed +static const DWORD INITPOSITION_AIRSPEED_KEEP = -2; // keep current airspeed + +// AddToClientDataDefinition dwSizeOrType parameter type values +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT8 = -1; // 8-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT16 = -2; // 16-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT32 = -3; // 32-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_INT64 = -4; // 64-bit integer number +static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT32 = -5; // 32-bit floating-point number (float) +static const DWORD SIMCONNECT_CLIENTDATATYPE_FLOAT64 = -6; // 64-bit floating-point number (double) + +// AddToClientDataDefinition dwOffset parameter special values +static const DWORD SIMCONNECT_CLIENTDATAOFFSET_AUTO = -1; // automatically compute offset of the ClientData variable + +// Open ConfigIndex parameter special value +static const DWORD SIMCONNECT_OPEN_CONFIGINDEX_LOCAL = -1; // ignore SimConnect.cfg settings, and force local connection + +//---------------------------------------------------------------------------- +// Enum definitions +//---------------------------------------------------------------------------- + +//these came from substituteMacros +#define SIMCONNECT_REFSTRUCT struct +#define SIMCONNECT_STRUCT struct +#define SIMCONNECT_STRING(name, size) char name[size] +#define SIMCONNECT_GUID GUID +#define SIMCONNECT_STRINGV(name) char name[1] +#define SIMCONNECT_DATAV(name, id, count) DWORD name +#define SIMCONNECT_FIXEDTYPE_DATAV(type, name, count, cliMarshalAs, cliType) type name[1] +#define SIMCONNECT_GUID GUID +#define SIMCONNECT_ENUM enum +#define SIMCONNECT_ENUM_FLAGS typedef DWORD +#define SIMCONNECT_USER_ENUM typedef DWORD + + +// Receive data types +SIMCONNECT_ENUM SIMCONNECT_RECV_ID { + SIMCONNECT_RECV_ID_NULL, + SIMCONNECT_RECV_ID_EXCEPTION, + SIMCONNECT_RECV_ID_OPEN, + SIMCONNECT_RECV_ID_QUIT, + SIMCONNECT_RECV_ID_EVENT, + SIMCONNECT_RECV_ID_EVENT_OBJECT_ADDREMOVE, + SIMCONNECT_RECV_ID_EVENT_FILENAME, + SIMCONNECT_RECV_ID_EVENT_FRAME, + SIMCONNECT_RECV_ID_SIMOBJECT_DATA, + SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE, + SIMCONNECT_RECV_ID_WEATHER_OBSERVATION, + SIMCONNECT_RECV_ID_CLOUD_STATE, + SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID, + SIMCONNECT_RECV_ID_RESERVED_KEY, + SIMCONNECT_RECV_ID_CUSTOM_ACTION, + SIMCONNECT_RECV_ID_SYSTEM_STATE, + SIMCONNECT_RECV_ID_CLIENT_DATA, + SIMCONNECT_RECV_ID_EVENT_WEATHER_MODE, + SIMCONNECT_RECV_ID_AIRPORT_LIST, + SIMCONNECT_RECV_ID_VOR_LIST, + SIMCONNECT_RECV_ID_NDB_LIST, + SIMCONNECT_RECV_ID_WAYPOINT_LIST, + SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED, + SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED, + SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED, + SIMCONNECT_RECV_ID_EVENT_RACE_END, + SIMCONNECT_RECV_ID_EVENT_RACE_LAP, +#ifdef ENABLE_SIMCONNECT_EXPERIMENTAL + SIMCONNECT_RECV_ID_PICK, +#endif //ENABLE_SIMCONNECT_EXPERIMENTAL +}; + + + +// Data data types +SIMCONNECT_ENUM SIMCONNECT_DATATYPE { + SIMCONNECT_DATATYPE_INVALID, // invalid data type + SIMCONNECT_DATATYPE_INT32, // 32-bit integer number + SIMCONNECT_DATATYPE_INT64, // 64-bit integer number + SIMCONNECT_DATATYPE_FLOAT32, // 32-bit floating-point number (float) + SIMCONNECT_DATATYPE_FLOAT64, // 64-bit floating-point number (double) + SIMCONNECT_DATATYPE_STRING8, // 8-byte string + SIMCONNECT_DATATYPE_STRING32, // 32-byte string + SIMCONNECT_DATATYPE_STRING64, // 64-byte string + SIMCONNECT_DATATYPE_STRING128, // 128-byte string + SIMCONNECT_DATATYPE_STRING256, // 256-byte string + SIMCONNECT_DATATYPE_STRING260, // 260-byte string + SIMCONNECT_DATATYPE_STRINGV, // variable-length string + + SIMCONNECT_DATATYPE_INITPOSITION, // see SIMCONNECT_DATA_INITPOSITION + SIMCONNECT_DATATYPE_MARKERSTATE, // see SIMCONNECT_DATA_MARKERSTATE + SIMCONNECT_DATATYPE_WAYPOINT, // see SIMCONNECT_DATA_WAYPOINT + SIMCONNECT_DATATYPE_LATLONALT, // see SIMCONNECT_DATA_LATLONALT + SIMCONNECT_DATATYPE_XYZ, // see SIMCONNECT_DATA_XYZ + + SIMCONNECT_DATATYPE_MAX // enum limit +}; + +// Exception error types +SIMCONNECT_ENUM SIMCONNECT_EXCEPTION { + SIMCONNECT_EXCEPTION_NONE, + + SIMCONNECT_EXCEPTION_ERROR, + SIMCONNECT_EXCEPTION_SIZE_MISMATCH, + SIMCONNECT_EXCEPTION_UNRECOGNIZED_ID, + SIMCONNECT_EXCEPTION_UNOPENED, + SIMCONNECT_EXCEPTION_VERSION_MISMATCH, + SIMCONNECT_EXCEPTION_TOO_MANY_GROUPS, + SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED, + SIMCONNECT_EXCEPTION_TOO_MANY_EVENT_NAMES, + SIMCONNECT_EXCEPTION_EVENT_ID_DUPLICATE, + SIMCONNECT_EXCEPTION_TOO_MANY_MAPS, + SIMCONNECT_EXCEPTION_TOO_MANY_OBJECTS, + SIMCONNECT_EXCEPTION_TOO_MANY_REQUESTS, + SIMCONNECT_EXCEPTION_WEATHER_INVALID_PORT, + SIMCONNECT_EXCEPTION_WEATHER_INVALID_METAR, + SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_GET_OBSERVATION, + SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_CREATE_STATION, + SIMCONNECT_EXCEPTION_WEATHER_UNABLE_TO_REMOVE_STATION, + SIMCONNECT_EXCEPTION_INVALID_DATA_TYPE, + SIMCONNECT_EXCEPTION_INVALID_DATA_SIZE, + SIMCONNECT_EXCEPTION_DATA_ERROR, + SIMCONNECT_EXCEPTION_INVALID_ARRAY, + SIMCONNECT_EXCEPTION_CREATE_OBJECT_FAILED, + SIMCONNECT_EXCEPTION_LOAD_FLIGHTPLAN_FAILED, + SIMCONNECT_EXCEPTION_OPERATION_INVALID_FOR_OBJECT_TYPE, + SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION, + SIMCONNECT_EXCEPTION_ALREADY_SUBSCRIBED, + SIMCONNECT_EXCEPTION_INVALID_ENUM, + SIMCONNECT_EXCEPTION_DEFINITION_ERROR, + SIMCONNECT_EXCEPTION_DUPLICATE_ID, + SIMCONNECT_EXCEPTION_DATUM_ID, + SIMCONNECT_EXCEPTION_OUT_OF_BOUNDS, + SIMCONNECT_EXCEPTION_ALREADY_CREATED, + SIMCONNECT_EXCEPTION_OBJECT_OUTSIDE_REALITY_BUBBLE, + SIMCONNECT_EXCEPTION_OBJECT_CONTAINER, + SIMCONNECT_EXCEPTION_OBJECT_AI, + SIMCONNECT_EXCEPTION_OBJECT_ATC, + SIMCONNECT_EXCEPTION_OBJECT_SCHEDULE, +}; + +// Object types +SIMCONNECT_ENUM SIMCONNECT_SIMOBJECT_TYPE { + SIMCONNECT_SIMOBJECT_TYPE_USER, + SIMCONNECT_SIMOBJECT_TYPE_ALL, + SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT, + SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER, + SIMCONNECT_SIMOBJECT_TYPE_BOAT, + SIMCONNECT_SIMOBJECT_TYPE_GROUND, +}; + +// EventState values +SIMCONNECT_ENUM SIMCONNECT_STATE { + SIMCONNECT_STATE_OFF, + SIMCONNECT_STATE_ON, +}; + +// Object Data Request Period values +SIMCONNECT_ENUM SIMCONNECT_PERIOD { + SIMCONNECT_PERIOD_NEVER, + SIMCONNECT_PERIOD_ONCE, + SIMCONNECT_PERIOD_VISUAL_FRAME, + SIMCONNECT_PERIOD_SIM_FRAME, + SIMCONNECT_PERIOD_SECOND, +}; + + +SIMCONNECT_ENUM SIMCONNECT_MISSION_END { + SIMCONNECT_MISSION_FAILED, + SIMCONNECT_MISSION_CRASHED, + SIMCONNECT_MISSION_SUCCEEDED +}; + +// ClientData Request Period values +SIMCONNECT_ENUM SIMCONNECT_CLIENT_DATA_PERIOD { + SIMCONNECT_CLIENT_DATA_PERIOD_NEVER, + SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, + SIMCONNECT_CLIENT_DATA_PERIOD_VISUAL_FRAME, + SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, + SIMCONNECT_CLIENT_DATA_PERIOD_SECOND, +}; + +SIMCONNECT_ENUM SIMCONNECT_TEXT_TYPE { + SIMCONNECT_TEXT_TYPE_SCROLL_BLACK, + SIMCONNECT_TEXT_TYPE_SCROLL_WHITE, + SIMCONNECT_TEXT_TYPE_SCROLL_RED, + SIMCONNECT_TEXT_TYPE_SCROLL_GREEN, + SIMCONNECT_TEXT_TYPE_SCROLL_BLUE, + SIMCONNECT_TEXT_TYPE_SCROLL_YELLOW, + SIMCONNECT_TEXT_TYPE_SCROLL_MAGENTA, + SIMCONNECT_TEXT_TYPE_SCROLL_CYAN, + SIMCONNECT_TEXT_TYPE_PRINT_BLACK=0x0100, + SIMCONNECT_TEXT_TYPE_PRINT_WHITE, + SIMCONNECT_TEXT_TYPE_PRINT_RED, + SIMCONNECT_TEXT_TYPE_PRINT_GREEN, + SIMCONNECT_TEXT_TYPE_PRINT_BLUE, + SIMCONNECT_TEXT_TYPE_PRINT_YELLOW, + SIMCONNECT_TEXT_TYPE_PRINT_MAGENTA, + SIMCONNECT_TEXT_TYPE_PRINT_CYAN, + SIMCONNECT_TEXT_TYPE_MENU=0x0200, +}; + +SIMCONNECT_ENUM SIMCONNECT_TEXT_RESULT { + SIMCONNECT_TEXT_RESULT_MENU_SELECT_1, + SIMCONNECT_TEXT_RESULT_MENU_SELECT_2, + SIMCONNECT_TEXT_RESULT_MENU_SELECT_3, + SIMCONNECT_TEXT_RESULT_MENU_SELECT_4, + SIMCONNECT_TEXT_RESULT_MENU_SELECT_5, + SIMCONNECT_TEXT_RESULT_MENU_SELECT_6, + SIMCONNECT_TEXT_RESULT_MENU_SELECT_7, + SIMCONNECT_TEXT_RESULT_MENU_SELECT_8, + SIMCONNECT_TEXT_RESULT_MENU_SELECT_9, + SIMCONNECT_TEXT_RESULT_MENU_SELECT_10, + SIMCONNECT_TEXT_RESULT_DISPLAYED = 0x00010000, + SIMCONNECT_TEXT_RESULT_QUEUED, + SIMCONNECT_TEXT_RESULT_REMOVED, + SIMCONNECT_TEXT_RESULT_REPLACED, + SIMCONNECT_TEXT_RESULT_TIMEOUT, +}; + +SIMCONNECT_ENUM SIMCONNECT_WEATHER_MODE { + SIMCONNECT_WEATHER_MODE_THEME, + SIMCONNECT_WEATHER_MODE_RWW, + SIMCONNECT_WEATHER_MODE_CUSTOM, + SIMCONNECT_WEATHER_MODE_GLOBAL, +}; + +SIMCONNECT_ENUM SIMCONNECT_FACILITY_LIST_TYPE { + SIMCONNECT_FACILITY_LIST_TYPE_AIRPORT, + SIMCONNECT_FACILITY_LIST_TYPE_WAYPOINT, + SIMCONNECT_FACILITY_LIST_TYPE_NDB, + SIMCONNECT_FACILITY_LIST_TYPE_VOR, + SIMCONNECT_FACILITY_LIST_TYPE_COUNT // invalid +}; + + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_VOR_FLAGS; // flags for SIMCONNECT_RECV_ID_VOR_LIST + static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL = 0x00000001; // Has Nav signal + static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER = 0x00000002; // Has localizer + static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE = 0x00000004; // Has Nav signal + static const DWORD SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME = 0x00000008; // Station has DME + + + +// bits for the Waypoint Flags field: may be combined +SIMCONNECT_ENUM_FLAGS SIMCONNECT_WAYPOINT_FLAGS; + static const DWORD SIMCONNECT_WAYPOINT_NONE = 0x00; + static const DWORD SIMCONNECT_WAYPOINT_SPEED_REQUESTED = 0x04; // requested speed at waypoint is valid + static const DWORD SIMCONNECT_WAYPOINT_THROTTLE_REQUESTED = 0x08; // request a specific throttle percentage + static const DWORD SIMCONNECT_WAYPOINT_COMPUTE_VERTICAL_SPEED = 0x10; // compute vertical to speed to reach waypoint altitude when crossing the waypoint + static const DWORD SIMCONNECT_WAYPOINT_ALTITUDE_IS_AGL = 0x20; // AltitudeIsAGL + static const DWORD SIMCONNECT_WAYPOINT_ON_GROUND = 0x00100000; // place this waypoint on the ground + static const DWORD SIMCONNECT_WAYPOINT_REVERSE = 0x00200000; // Back up to this waypoint. Only valid on first waypoint + static const DWORD SIMCONNECT_WAYPOINT_WRAP_TO_FIRST = 0x00400000; // Wrap around back to first waypoint. Only valid on last waypoint. + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_EVENT_FLAG; + static const DWORD SIMCONNECT_EVENT_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_EVENT_FLAG_FAST_REPEAT_TIMER = 0x00000001; // set event repeat timer to simulate fast repeat + static const DWORD SIMCONNECT_EVENT_FLAG_SLOW_REPEAT_TIMER = 0x00000002; // set event repeat timer to simulate slow repeat + static const DWORD SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY = 0x00000010; // interpret GroupID parameter as priority value + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_DATA_REQUEST_FLAG; + static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_CHANGED = 0x00000001; // send requested data when value(s) change + static const DWORD SIMCONNECT_DATA_REQUEST_FLAG_TAGGED = 0x00000002; // send requested data in tagged format + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_DATA_SET_FLAG; + static const DWORD SIMCONNECT_DATA_SET_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_DATA_SET_FLAG_TAGGED = 0x00000001; // data is in tagged format + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_CREATE_CLIENT_DATA_FLAG; + static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_CREATE_CLIENT_DATA_FLAG_READ_ONLY = 0x00000001; // permit only ClientData creator to write into ClientData + + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_CLIENT_DATA_REQUEST_FLAG; + static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED = 0x00000001; // send requested ClientData when value(s) change + static const DWORD SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED = 0x00000002; // send requested ClientData in tagged format + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_CLIENT_DATA_SET_FLAG; + static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT = 0x00000000; + static const DWORD SIMCONNECT_CLIENT_DATA_SET_FLAG_TAGGED = 0x00000001; // data is in tagged format + + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_VIEW_SYSTEM_EVENT_DATA; // dwData contains these flags for the "View" System Event + static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_2D = 0x00000001; // 2D Panels in cockpit view + static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_COCKPIT_VIRTUAL = 0x00000002; // Virtual (3D) panels in cockpit view + static const DWORD SIMCONNECT_VIEW_SYSTEM_EVENT_DATA_ORTHOGONAL = 0x00000004; // Orthogonal (Map) view + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_SOUND_SYSTEM_EVENT_DATA; // dwData contains these flags for the "Sound" System Event + static const DWORD SIMCONNECT_SOUND_SYSTEM_EVENT_DATA_MASTER = 0x00000001; // Sound Master + + +#ifdef ENABLE_SIMCONNECT_EXPERIMENTAL + +SIMCONNECT_ENUM_FLAGS SIMCONNECT_PICK_FLAGS +{ + SIMCONNECT_PICK_GROUND = 0x01, // pick ground/ pick result item is ground location + SIMCONNECT_PICK_AI = 0x02, // pick AI / pick result item is AI, (dwSimObjectID is valid) + SIMCONNECT_PICK_SCENERY = 0x04, // pick scenery/ pick result item is scenery object (hSceneryObject is valid) + SIMCONNECT_PICK_ALL = SIMCONNECT_PICK_SCENERY | SIMCONNECT_PICK_AI | SIMCONNECT_PICK_GROUND, // pick all / (not valid on pick result item) + SIMCONNECT_PICK_COORDSASPIXELS = 0x08, +}; + +#endif //ENABLE_SIMCONNECT_EXPERIMENTAL + +//---------------------------------------------------------------------------- +// User-defined enums +//---------------------------------------------------------------------------- + +SIMCONNECT_USER_ENUM SIMCONNECT_NOTIFICATION_GROUP_ID; //client-defined notification group ID +SIMCONNECT_USER_ENUM SIMCONNECT_INPUT_GROUP_ID; //client-defined input group ID +SIMCONNECT_USER_ENUM SIMCONNECT_DATA_DEFINITION_ID; //client-defined data definition ID +SIMCONNECT_USER_ENUM SIMCONNECT_DATA_REQUEST_ID; //client-defined request data ID + +SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_EVENT_ID; //client-defined client event ID +SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_ID; //client-defined client data ID +SIMCONNECT_USER_ENUM SIMCONNECT_CLIENT_DATA_DEFINITION_ID; //client-defined client data definition ID + + +//---------------------------------------------------------------------------- +// Struct definitions +//---------------------------------------------------------------------------- + +#pragma pack(push, 1) + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV +{ + DWORD dwSize; // record size + DWORD dwVersion; // interface version + DWORD dwID; // see SIMCONNECT_RECV_ID +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EXCEPTION : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EXCEPTION +{ + DWORD dwException; // see SIMCONNECT_EXCEPTION + static const DWORD UNKNOWN_SENDID = 0; + DWORD dwSendID; // see SimConnect_GetLastSentPacketID + static const DWORD UNKNOWN_INDEX = DWORD_MAX; + DWORD dwIndex; // index of parameter that was source of error +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_OPEN : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_OPEN +{ + SIMCONNECT_STRING( szApplicationName, 256); + DWORD dwApplicationVersionMajor; + DWORD dwApplicationVersionMinor; + DWORD dwApplicationBuildMajor; + DWORD dwApplicationBuildMinor; + DWORD dwSimConnectVersionMajor; + DWORD dwSimConnectVersionMinor; + DWORD dwSimConnectBuildMajor; + DWORD dwSimConnectBuildMinor; + DWORD dwReserved1; + DWORD dwReserved2; +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_QUIT : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_QUIT +{ +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_EVENT +{ + static const DWORD UNKNOWN_GROUP = DWORD_MAX; + DWORD uGroupID; + DWORD uEventID; + DWORD dwData; // uEventID-dependent context +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FILENAME : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FILENAME +{ + SIMCONNECT_STRING( szFileName, MAX_PATH); // uEventID-dependent context + DWORD dwFlags; +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_OBJECT_ADDREMOVE : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FILENAME +{ + SIMCONNECT_SIMOBJECT_TYPE eObjType; +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_FRAME : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_FRAME +{ + float fFrameRate; + float fSimSpeed; +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SERVER_STARTED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SERVER_STARTED +{ + // No event specific data, for now +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_CLIENT_STARTED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_CLIENT_STARTED +{ + // No event specific data, for now +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_MULTIPLAYER_SESSION_ENDED : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_MULTIPLAYER_SESSION_ENDED +{ + // No event specific data, for now +}; + +// SIMCONNECT_DATA_RACE_RESULT +SIMCONNECT_STRUCT SIMCONNECT_DATA_RACE_RESULT +{ + DWORD dwNumberOfRacers; // The total number of racers + SIMCONNECT_GUID MissionGUID; // The name of the mission to execute, NULL if no mission + SIMCONNECT_STRING( szPlayerName, MAX_PATH); // The name of the player + SIMCONNECT_STRING( szSessionType, MAX_PATH); // The type of the multiplayer session: "LAN", "GAMESPY") + SIMCONNECT_STRING( szAircraft, MAX_PATH); // The aircraft type + SIMCONNECT_STRING( szPlayerRole, MAX_PATH); // The player role in the mission + double fTotalTime; // Total time in seconds, 0 means DNF + double fPenaltyTime; // Total penalty time in seconds + DWORD dwIsDisqualified; // non 0 - disqualified, 0 - not disqualified +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_END : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_RACE_END +{ + DWORD dwRacerNumber; // The index of the racer the results are for + SIMCONNECT_DATA_RACE_RESULT RacerData; +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_RACE_LAP : public SIMCONNECT_RECV_EVENT // when dwID == SIMCONNECT_RECV_ID_EVENT_RACE_LAP +{ + DWORD dwLapIndex; // The index of the lap the results are for + SIMCONNECT_DATA_RACE_RESULT RacerData; +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA +{ + DWORD dwRequestID; + DWORD dwObjectID; + DWORD dwDefineID; + DWORD dwFlags; // SIMCONNECT_DATA_REQUEST_FLAG + DWORD dwentrynumber; // if multiple objects returned, this is number out of . + DWORD dwoutof; // note: starts with 1, not 0. + DWORD dwDefineCount; // data count (number of datums, *not* byte count) + SIMCONNECT_DATAV( dwData, dwDefineID, ); // data begins here, dwDefineCount data items +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE +{ +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLIENT_DATA : public SIMCONNECT_RECV_SIMOBJECT_DATA // when dwID == SIMCONNECT_RECV_ID_CLIENT_DATA +{ +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WEATHER_OBSERVATION : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_WEATHER_OBSERVATION +{ + DWORD dwRequestID; + SIMCONNECT_STRINGV( szMetar); // Variable length string whose maximum size is MAX_METAR_LENGTH +}; + +static const int SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH = 64; +static const int SIMCONNECT_CLOUD_STATE_ARRAY_SIZE = SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH*SIMCONNECT_CLOUD_STATE_ARRAY_WIDTH; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CLOUD_STATE : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_CLOUD_STATE +{ + DWORD dwRequestID; + DWORD dwArraySize; + SIMCONNECT_FIXEDTYPE_DATAV(BYTE, rgbData, dwArraySize, U1 /*member of UnmanagedType enum*/ , System::Byte /*cli type*/); +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_ASSIGNED_OBJECT_ID : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID +{ + DWORD dwRequestID; + DWORD dwObjectID; +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_RESERVED_KEY : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY +{ + SIMCONNECT_STRING( szChoiceReserved, 30); + SIMCONNECT_STRING( szReservedKey, 50); +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_SYSTEM_STATE : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_SYSTEM_STATE +{ + DWORD dwRequestID; + DWORD dwInteger; + float fFloat; + SIMCONNECT_STRING( szString, MAX_PATH); +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_CUSTOM_ACTION : public SIMCONNECT_RECV_EVENT +{ + SIMCONNECT_GUID guidInstanceId; // Instance id of the action that executed + DWORD dwWaitForCompletion; // Wait for completion flag on the action + SIMCONNECT_STRINGV( szPayLoad); // Variable length string payload associated with the mission action. +}; + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_EVENT_WEATHER_MODE : public SIMCONNECT_RECV_EVENT +{ + // No event specific data - the new weather mode is in the base structure dwData member. +}; + +// SIMCONNECT_RECV_FACILITIES_LIST +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_FACILITIES_LIST : public SIMCONNECT_RECV +{ + DWORD dwRequestID; + DWORD dwArraySize; + DWORD dwEntryNumber; // when the array of items is too big for one send, which send this is (0..dwOutOf-1) + DWORD dwOutOf; // total number of transmissions the list is chopped into +}; + +// SIMCONNECT_DATA_FACILITY_AIRPORT +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_AIRPORT +{ + SIMCONNECT_STRING(Icao, 9); // ICAO of the object + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // meters +}; + +// SIMCONNECT_RECV_AIRPORT_LIST +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_AIRPORT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST +{ + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_AIRPORT, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_AIRPORT /*cli type*/); +}; + + +// SIMCONNECT_DATA_FACILITY_WAYPOINT +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_WAYPOINT : public SIMCONNECT_DATA_FACILITY_AIRPORT +{ + float fMagVar; // Magvar in degrees +}; + +// SIMCONNECT_RECV_WAYPOINT_LIST +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_WAYPOINT_LIST : public SIMCONNECT_RECV_FACILITIES_LIST +{ + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_WAYPOINT, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_WAYPOINT /*cli type*/); +}; + +// SIMCONNECT_DATA_FACILITY_NDB +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_NDB : public SIMCONNECT_DATA_FACILITY_WAYPOINT +{ + DWORD fFrequency; // frequency in Hz +}; + +// SIMCONNECT_RECV_NDB_LIST +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_NDB_LIST : public SIMCONNECT_RECV_FACILITIES_LIST +{ + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_NDB, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_NDB /*cli type*/); +}; + +// SIMCONNECT_DATA_FACILITY_VOR +SIMCONNECT_REFSTRUCT SIMCONNECT_DATA_FACILITY_VOR : public SIMCONNECT_DATA_FACILITY_NDB +{ + DWORD Flags; // SIMCONNECT_VOR_FLAGS + float fLocalizer; // Localizer in degrees + double GlideLat; // Glide Slope Location (deg, deg, meters) + double GlideLon; + double GlideAlt; + float fGlideSlopeAngle; // Glide Slope in degrees +}; + +// SIMCONNECT_RECV_VOR_LIST +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_VOR_LIST : public SIMCONNECT_RECV_FACILITIES_LIST +{ + SIMCONNECT_FIXEDTYPE_DATAV(SIMCONNECT_DATA_FACILITY_VOR, rgData, dwArraySize, U1 /*member of UnmanagedType enum*/, SIMCONNECT_DATA_FACILITY_VOR /*cli type*/); +}; + +#ifdef ENABLE_SIMCONNECT_EXPERIMENTAL + +SIMCONNECT_REFSTRUCT SIMCONNECT_RECV_PICK : public SIMCONNECT_RECV // when dwID == SIMCONNECT_RECV_ID_RESERVED_KEY +{ + HANDLE hContext; + DWORD dwFlags; // + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // feet + int xPos; //reserved + int yPos; //reserved; + DWORD dwSimObjectID; + HANDLE hSceneryObject; + DWORD dwentrynumber; // if multiple objects returned, this is number out of . + DWORD dwoutof; // note: starts with 1, not 0. +}; + +#endif //ENABLE_SIMCONNECT_EXPERIMENTAL + + +// SIMCONNECT_DATATYPE_INITPOSITION +SIMCONNECT_STRUCT SIMCONNECT_DATA_INITPOSITION +{ + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // feet + double Pitch; // degrees + double Bank; // degrees + double Heading; // degrees + DWORD OnGround; // 1=force to be on the ground + DWORD Airspeed; // knots +}; + + +// SIMCONNECT_DATATYPE_MARKERSTATE +SIMCONNECT_STRUCT SIMCONNECT_DATA_MARKERSTATE +{ + SIMCONNECT_STRING( szMarkerName, 64); + DWORD dwMarkerState; +}; + +// SIMCONNECT_DATATYPE_WAYPOINT +SIMCONNECT_STRUCT SIMCONNECT_DATA_WAYPOINT +{ + double Latitude; // degrees + double Longitude; // degrees + double Altitude; // feet + unsigned long Flags; + double ktsSpeed; // knots + double percentThrottle; +}; + +// SIMCONNECT_DATA_LATLONALT +SIMCONNECT_STRUCT SIMCONNECT_DATA_LATLONALT +{ + double Latitude; + double Longitude; + double Altitude; +}; + +// SIMCONNECT_DATA_XYZ +SIMCONNECT_STRUCT SIMCONNECT_DATA_XYZ +{ + double x; + double y; + double z; +}; + +#pragma pack(pop) + +//---------------------------------------------------------------------------- +// End of Struct definitions +//---------------------------------------------------------------------------- + +typedef void (CALLBACK *DispatchProc)(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext); + +#if !defined(SIMCONNECTAPI) + #ifdef _MSFS_WASM + #ifdef __INTELLISENSE__ + #define MODULE_EXPORT + #define SIMCONNECTAPI extern "C" HRESULT + #else + #define MODULE_EXPORT __attribute__( ( visibility( "default" ) ) ) + #define SIMCONNECTAPI extern "C" __attribute__((import_module(SIMCONNECT_WASM_MODULE))) HRESULT + #endif + #else + #define MODULE_EXPORT + #define SIMCONNECTAPI extern "C" HRESULT __stdcall + #endif +#endif + +SIMCONNECTAPI SimConnect_MapClientEventToSimEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * EventName = ""); +SIMCONNECTAPI SimConnect_TransmitClientEvent(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD dwData, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_EVENT_FLAG Flags); +SIMCONNECTAPI SimConnect_SetSystemEventState(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, SIMCONNECT_STATE dwState); +SIMCONNECTAPI SimConnect_AddClientEventToNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_CLIENT_EVENT_ID EventID, BOOL bMaskable = FALSE); +SIMCONNECTAPI SimConnect_RemoveClientEvent(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, SIMCONNECT_CLIENT_EVENT_ID EventID); +SIMCONNECTAPI SimConnect_SetNotificationGroupPriority(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, DWORD uPriority); +SIMCONNECTAPI SimConnect_ClearNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID); +SIMCONNECTAPI SimConnect_RequestNotificationGroup(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID, DWORD dwReserved = 0, DWORD Flags = 0); +SIMCONNECTAPI SimConnect_AddToDataDefinition(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, const char * DatumName, const char * UnitsName, SIMCONNECT_DATATYPE DatumType = SIMCONNECT_DATATYPE_FLOAT64, float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); +SIMCONNECTAPI SimConnect_ClearDataDefinition(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID); +SIMCONNECTAPI SimConnect_RequestDataOnSimObject(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_PERIOD Period, SIMCONNECT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); +SIMCONNECTAPI SimConnect_RequestDataOnSimObjectType(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_DATA_DEFINITION_ID DefineID, DWORD dwRadiusMeters, SIMCONNECT_SIMOBJECT_TYPE type); +SIMCONNECTAPI SimConnect_SetDataOnSimObject(HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_SET_FLAG Flags, DWORD ArrayCount, DWORD cbUnitSize, void * pDataSet); +SIMCONNECTAPI SimConnect_MapInputEventToClientEvent(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, const char * szInputDefinition, SIMCONNECT_CLIENT_EVENT_ID DownEventID, DWORD DownValue = 0, SIMCONNECT_CLIENT_EVENT_ID UpEventID = (SIMCONNECT_CLIENT_EVENT_ID)SIMCONNECT_UNUSED, DWORD UpValue = 0, BOOL bMaskable = FALSE); +SIMCONNECTAPI SimConnect_SetInputGroupPriority(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD uPriority); +SIMCONNECTAPI SimConnect_RemoveInputEvent(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, const char * szInputDefinition); +SIMCONNECTAPI SimConnect_ClearInputGroup(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID); +SIMCONNECTAPI SimConnect_SetInputGroupState(HANDLE hSimConnect, SIMCONNECT_INPUT_GROUP_ID GroupID, DWORD dwState); +SIMCONNECTAPI SimConnect_RequestReservedKey(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * szKeyChoice1 = "", const char * szKeyChoice2 = "", const char * szKeyChoice3 = ""); +SIMCONNECTAPI SimConnect_SubscribeToSystemEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, const char * SystemEventName); +SIMCONNECTAPI SimConnect_UnsubscribeFromSystemEvent(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID); +SIMCONNECTAPI SimConnect_WeatherRequestInterpolatedObservation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon, float alt); +SIMCONNECTAPI SimConnect_WeatherRequestObservationAtStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO); +SIMCONNECTAPI SimConnect_WeatherRequestObservationAtNearestStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon); +SIMCONNECTAPI SimConnect_WeatherCreateStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO, const char * szName, float lat, float lon, float alt); +SIMCONNECTAPI SimConnect_WeatherRemoveStation(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szICAO); +SIMCONNECTAPI SimConnect_WeatherSetObservation(HANDLE hSimConnect, DWORD Seconds, const char * szMETAR); +SIMCONNECTAPI SimConnect_WeatherSetModeServer(HANDLE hSimConnect, DWORD dwPort, DWORD dwSeconds); +SIMCONNECTAPI SimConnect_WeatherSetModeTheme(HANDLE hSimConnect, const char * szThemeName); +SIMCONNECTAPI SimConnect_WeatherSetModeGlobal(HANDLE hSimConnect); +SIMCONNECTAPI SimConnect_WeatherSetModeCustom(HANDLE hSimConnect); +SIMCONNECTAPI SimConnect_WeatherSetDynamicUpdateRate(HANDLE hSimConnect, DWORD dwRate); +SIMCONNECTAPI SimConnect_WeatherRequestCloudState(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float minLat, float minLon, float minAlt, float maxLat, float maxLon, float maxAlt, DWORD dwFlags = 0); +SIMCONNECTAPI SimConnect_WeatherCreateThermal(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, float lat, float lon, float alt, float radius, float height, float coreRate = 3.0f, float coreTurbulence = 0.05f, float sinkRate = 3.0f, float sinkTurbulence = 0.2f, float coreSize = 0.4f, float coreTransitionSize = 0.1f, float sinkLayerSize = 0.4f, float sinkTransitionSize = 0.1f); +SIMCONNECTAPI SimConnect_WeatherRemoveThermal(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID); +SIMCONNECTAPI SimConnect_AICreateParkedATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, const char * szAirportID, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AICreateEnrouteATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, int iFlightNumber, const char * szFlightPlanPath, double dFlightPlanPosition, BOOL bTouchAndGo, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AICreateNonATCAircraft(HANDLE hSimConnect, const char * szContainerTitle, const char * szTailNumber, SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AICreateSimulatedObject(HANDLE hSimConnect, const char * szContainerTitle, SIMCONNECT_DATA_INITPOSITION InitPos, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AIReleaseControl(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AIRemoveObject(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_AISetAircraftFlightPlan(HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, const char * szFlightPlanPath, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_ExecuteMissionAction(HANDLE hSimConnect, const GUID guidInstanceId); +SIMCONNECTAPI SimConnect_CompleteCustomMissionAction(HANDLE hSimConnect, const GUID guidInstanceId); +SIMCONNECTAPI SimConnect_Close(HANDLE hSimConnect); +SIMCONNECTAPI SimConnect_RetrieveString(SIMCONNECT_RECV * pData, DWORD cbData, void * pStringV, char ** pszString, DWORD * pcbString); +SIMCONNECTAPI SimConnect_GetLastSentPacketID(HANDLE hSimConnect, DWORD * pdwError); +SIMCONNECTAPI SimConnect_Open(HANDLE * phSimConnect, LPCSTR szName, HWND hWnd, DWORD UserEventWin32, HANDLE hEventHandle, DWORD ConfigIndex); +SIMCONNECTAPI SimConnect_CallDispatch(HANDLE hSimConnect, DispatchProc pfcnDispatch, void * pContext); +SIMCONNECTAPI SimConnect_GetNextDispatch(HANDLE hSimConnect, SIMCONNECT_RECV ** ppData, DWORD * pcbData); +SIMCONNECTAPI SimConnect_RequestResponseTimes(HANDLE hSimConnect, DWORD nCount, float * fElapsedSeconds); +SIMCONNECTAPI SimConnect_InsertString(char * pDest, DWORD cbDest, void ** ppEnd, DWORD * pcbStringV, const char * pSource); +SIMCONNECTAPI SimConnect_CameraSetRelative6DOF(HANDLE hSimConnect, float fDeltaX, float fDeltaY, float fDeltaZ, float fPitchDeg, float fBankDeg, float fHeadingDeg); +SIMCONNECTAPI SimConnect_MenuAddItem(HANDLE hSimConnect, const char * szMenuItem, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, DWORD dwData); +SIMCONNECTAPI SimConnect_MenuDeleteItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID); +SIMCONNECTAPI SimConnect_MenuAddSubItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, const char * szMenuItem, SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID, DWORD dwData); +SIMCONNECTAPI SimConnect_MenuDeleteSubItem(HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID MenuEventID, const SIMCONNECT_CLIENT_EVENT_ID SubMenuEventID); +SIMCONNECTAPI SimConnect_RequestSystemState(HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * szState); +SIMCONNECTAPI SimConnect_SetSystemState(HANDLE hSimConnect, const char * szState, DWORD dwInteger, float fFloat, const char * szString); +SIMCONNECTAPI SimConnect_MapClientDataNameToID(HANDLE hSimConnect, const char * szClientDataName, SIMCONNECT_CLIENT_DATA_ID ClientDataID); +SIMCONNECTAPI SimConnect_CreateClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, DWORD dwSize, SIMCONNECT_CREATE_CLIENT_DATA_FLAG Flags); +SIMCONNECTAPI SimConnect_AddToClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, DWORD dwOffset, DWORD dwSizeOrType, float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED); +SIMCONNECTAPI SimConnect_ClearClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID); +SIMCONNECTAPI SimConnect_RequestClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, SIMCONNECT_DATA_REQUEST_ID RequestID, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, SIMCONNECT_CLIENT_DATA_PERIOD Period = SIMCONNECT_CLIENT_DATA_PERIOD_ONCE, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG Flags = 0, DWORD origin = 0, DWORD interval = 0, DWORD limit = 0); +SIMCONNECTAPI SimConnect_SetClientData(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_ID ClientDataID, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, SIMCONNECT_CLIENT_DATA_SET_FLAG Flags, DWORD dwReserved, DWORD cbUnitSize, void * pDataSet); +SIMCONNECTAPI SimConnect_FlightLoad(HANDLE hSimConnect, const char * szFileName); +SIMCONNECTAPI SimConnect_FlightSave(HANDLE hSimConnect, const char * szFileName, const char * szTitle, const char * szDescription, DWORD Flags); +SIMCONNECTAPI SimConnect_FlightPlanLoad(HANDLE hSimConnect, const char * szFileName); +SIMCONNECTAPI SimConnect_Text(HANDLE hSimConnect, SIMCONNECT_TEXT_TYPE type, float fTimeSeconds, SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD cbUnitSize, void * pDataSet); +SIMCONNECTAPI SimConnect_SubscribeToFacilities(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type, SIMCONNECT_DATA_REQUEST_ID RequestID); +SIMCONNECTAPI SimConnect_UnsubscribeToFacilities(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type); +SIMCONNECTAPI SimConnect_RequestFacilitiesList(HANDLE hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE type, SIMCONNECT_DATA_REQUEST_ID RequestID); + +#endif // _SIMCONNECT_H_ From 538445c31477f41a8900f924d237db74e014ace2 Mon Sep 17 00:00:00 2001 From: bitsanddroids Date: Wed, 10 Jul 2024 09:04:14 +0200 Subject: [PATCH 33/33] not sure what is happening but reinstated the header --- libsrc/include/SimConnect.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libsrc/include/SimConnect.hpp b/libsrc/include/SimConnect.hpp index 938965b..0da2083 100644 --- a/libsrc/include/SimConnect.hpp +++ b/libsrc/include/SimConnect.hpp @@ -1,3 +1,11 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All Rights Reserved. +// +//----------------------------------------------------------------------------- + +#include + #ifndef _SIMCONNECT_H_ #define _SIMCONNECT_H_