#sdk #msfs #simconnect #rust

sys simconnect-sys

FFI bindings for SimConnect

4 releases (breaking)

0.24.3 Jun 15, 2024
0.23.2-pre.1 Dec 9, 2023
0.22.3 Nov 26, 2023
0.1.0 Nov 25, 2023

#294 in #sdk

Download history 35/week @ 2024-07-04 25/week @ 2024-07-11 9/week @ 2024-07-18 47/week @ 2024-07-25 6/week @ 2024-08-01 3/week @ 2024-08-08 1/week @ 2024-08-15 6/week @ 2024-09-05 29/week @ 2024-09-12 41/week @ 2024-09-19 44/week @ 2024-09-26 40/week @ 2024-10-03 41/week @ 2024-10-10 30/week @ 2024-10-17

160 downloads per month

MIT/Apache

1.5MB
97 lines

Contains (static library, 1MB) sdk/lib/static/SimConnect_debug.lib, (static library, 670KB) sdk/lib/static/SimConnect.lib, (Windows DLL, 68KB) sdk/lib/SimConnect.dll, (static library, 28KB) sdk/lib/SimConnect.lib

simconnect-sys

docs license version downloads maintenance

FFI bindings for SimConnect.

Release Support

Currently supported version of simconnect-sys is using SimConnect SDK 0.24.3.

Crate will be updated for each new SimConnect SDK release with the version indicating the SDK version it targets.

Usage

[dependencies]
simconnect-sys = { version = "0.24.3", features = [ "static" ] }

Getting Started

use simconnect_sys::*;

// open handle to SimConnect
let mut handle = std::ptr::null_mut();
let hr = unsafe { SimConnect_Open(
    &mut handle,
    CString::new("Example").as_ptr(),
    std::ptr::null_mut(),
    0,
    std::ptr::null_mut(),
    0,
) };
if hr != 0 || handle.is_null() {
    println!("SimConnect_Open failed");
}

See examples/sys-basic for a working example of using the FFI bindings for SimConnect.

Features

  • static - Statically link to SimConnect lib.
  • vendored - Use vendored SimConnect lib.

Environment Variables

  • SIMCONNECT_DIR (default=C:\MSFS SDK\SimConnect SDK)
    • Directory containing these files from the MSFS SimConnect SDK:
    .
    ├── include/
    │   └── SimConnect.h
    └── lib/
        ├── SimConnect.lib
        └── static/
            └── SimConnect.lib          
    
  • SIMCONNECT_NO_VENDOR
    • Provides an override of the vendored feature, ensuring vendored libs are not used.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed under the terms of both the Apache License, Version 2.0 and the MIT license without any additional terms or conditions.

Dependencies

~0–1.9MB
~37K SLoC