Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed build when used in Github Actions #20

Merged
merged 39 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ac59d70
Add epsilon parameter to data definition
BitsAndDroids Dec 21, 2023
b694463
upped v
BitsAndDroids Dec 21, 2023
cdafdf2
Add optional epsilon parameter to add_data_definition functions
BitsAndDroids Dec 21, 2023
75538ba
Updated add_data_definition method to include optional epsilon parameter
BitsAndDroids Dec 21, 2023
14b1974
Update simconnect dependency in README
BitsAndDroids Dec 21, 2023
fe44a42
Update unsafe block code in Readme and lib.rs
BitsAndDroids Dec 21, 2023
c70a077
Update simconnect version and add new examples
BitsAndDroids Dec 24, 2023
574f5d6
Improve data update definition in aircraft example
BitsAndDroids Dec 24, 2023
7f557ef
Update aircraft data request to prevent overwrite
BitsAndDroids Dec 24, 2023
2a4e742
Add structured definitions to aircraft example
BitsAndDroids Dec 24, 2023
e2e18d0
Update Readme.md
Sequal32 Dec 26, 2023
4f51b6a
Update code comments and fix typographical issues
BitsAndDroids Dec 26, 2023
e8738ff
Merge branch 'master' of https://github.com/BitsAndDroids/simconnect-…
BitsAndDroids Dec 26, 2023
01253ee
Update terminology in Readme.md
BitsAndDroids Dec 26, 2023
36cff2c
Fix typo in connect function comment in main.rs
BitsAndDroids Dec 26, 2023
3215639
fix: cleanup clippy warnings
Sequal32 Dec 27, 2023
9310823
refactor: renamed SimobjectData -> SimObjectData
Sequal32 Dec 27, 2023
7e752ae
chore: increment breaking change version num
Sequal32 Dec 27, 2023
ac79e7f
Update Readme.md
BitsAndDroids Jan 6, 2024
328dcbb
shield because I always believe them to look shiny
BitsAndDroids Jan 6, 2024
9fabb21
Add debug trait to SimConnector struct
BitsAndDroids Jan 8, 2024
ed76228
Update simconnect dependency to version 0.3.1
BitsAndDroids Jan 8, 2024
3868da6
Create aircraft inputs example and update SimConnect
BitsAndDroids Jan 8, 2024
d30ab3b
added a PR template
BitsAndDroids Jan 17, 2024
b97f974
renamed file to match format
BitsAndDroids Jan 17, 2024
dff5d0f
updated bindgen version
BitsAndDroids Jun 22, 2024
6c9cc4f
Merge branch 'longlong-value' into debug_struct
BitsAndDroids Jun 22, 2024
4991d33
added handle to allowlist
BitsAndDroids Jun 22, 2024
821aa0d
changed include of windows.h
BitsAndDroids Jun 22, 2024
7fdec00
Merge pull request #1 from BitsAndDroids/ga-fix
BitsAndDroids Jun 22, 2024
030804a
Merge branch 'Sequal32:master' into master
BitsAndDroids Jun 22, 2024
fa46731
upped v
BitsAndDroids Jun 22, 2024
dff3c61
Merge branch 'master' into ga-fix
BitsAndDroids Jun 22, 2024
5ac17d6
Merge pull request #2 from BitsAndDroids/ga-fix
BitsAndDroids Jun 22, 2024
15918fa
Revert "changed include of windows.h"
BitsAndDroids Jul 10, 2024
9d4e19b
undone formatting
BitsAndDroids Jul 10, 2024
69d0494
semver match
BitsAndDroids Jul 10, 2024
6ed5aae
added rest of file to git
BitsAndDroids Jul 10, 2024
538445c
not sure what is happening but reinstated the header
BitsAndDroids Jul 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "simconnect"
license = "MIT"
description = "Rust bindings for SimConnect"
version = "0.3.1"
version = "0.3.2"
authors = ["Connor T"]
edition = "2018"

Expand All @@ -20,4 +20,4 @@ name = "aircraft_inputs"
path = "examples/aircraft_inputs/main.rs"

[build-dependencies]
bindgen = "0.65"
bindgen = "0.69.4"
14 changes: 11 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
![crates.io](https://img.shields.io/crates/v/simconnect)

# 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))

## Using

Add this to your `Cargo.toml`

```toml
[dependencies]
simconnect = "0.3.1"
simconnect = "0.3.2"
```

## 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. run `cargo build`
2. 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
```

*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 )_

### 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.
Binary file modified SimConnect.dll
Binary file not shown.
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion libsrc/include/SimConnect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
//-----------------------------------------------------------------------------

#include "Windows.h"
#include <windows.h>
BitsAndDroids marked this conversation as resolved.
Show resolved Hide resolved

#ifndef _SIMCONNECT_H_
#define _SIMCONNECT_H_
Expand Down