Files
Mihai Dinculescu d89fa524c2 Rework events and add proper support for client events
Added

- Client events are now implemented through `SimConnect::subscribe_to_client_event`, `SimConnect::unsubscribe_from_client_event` and `SimConnect::unsubscribe_from_all_client_events`.
- `subscribe_to_client_events.rs` example has been added.
- `SimConnectError::EventAlreadySubscribedTo` and `SimConnectError::EventNotSubscribedTo` error variants have been added.

Changed

- A second call to `SimConnect::subscribe_to_system_event` for the same event will now return an error of type `SimConnectError::EventAlreadySubscribedTo` instead of `SimConnectError::SimConnectException`.
- The call to `SimConnect::unsubscribe_from_system_event` is now a NOOP when the system event is not subscribed to.
- `SimConnectError::UnimplementedMessageType` has been renamed to `SimConnectError::UnimplementedNotification`.

Removed

- `SimConnect::register_event` has been replaced by the new client event functions.
- `NotificationGroup` has been removed in favor of an internally managed notification group.
2023-05-01 19:13:30 +01:00

59 lines
976 B
Markdown

# SimConnect SDK Examples
## Checkout the repository
```bash
git clone git@github.com:mihai-dinculescu/simconnect-sdk-rs.git
cd simconnect-sdk-rs
```
## Receiving data
```bash
cargo run --bin data
```
## Receiving data with tracing
To see all tracing information at the `trace` level and above (most verbose), run:
```bash
RUST_LOG=trace cargo run --bin data_with_tracing
```
To see all tracing information at the `debug` level and above (less verbose than `info`), run:
```bash
RUST_LOG=debug cargo run --bin data_with_tracing
```
## Receiving data without the derive macro
```bash
cargo run --bin data_without_macro
```
## Receiving data using multiple objects
```bash
cargo run --bin data_multiple_objects
```
## Receiving facilities from cache
```bash
cargo run --bin facilities
```
## Subscribe to client events
```bash
cargo run --bin subscribe_to_client_events
```
## Subscribe to system events
```bash
cargo run --bin subscribe_to_system_events
```