Crates.io | scs-sdk-telemetry |
lib.rs | scs-sdk-telemetry |
version | 1.1.0 |
source | src |
created_at | 2023-09-09 06:48:14.234297 |
updated_at | 2023-09-25 06:48:39.245306 |
description | Rust wrapper for the ETS2 (Euro Truck Simulator 2) and ATS (American Truck Simulator) Telemetry SDK plug-in. |
homepage | https://github.com/NightFeather0615/scs-sdk-telemetry |
repository | https://github.com/NightFeather0615/scs-sdk-telemetry |
max_upload_size | |
id | 967963 |
size | 73,285 |
This library reads telemetry data from Euro Truck Simulator 2 and American Truck Simulator then parse data into Rust struct.
Based on RenCloud/scs-sdk-plugin
Follow the installation section in RenCloud/scs-sdk-plugin
Read data:
// main.rs
use scs_sdk_telemetry::shared_memory::SharedMemory;
fn main() {
let mut shared_mem: SharedMemory = SharedMemory::connect();
println!("{:#?}", shared_mem.read());
}
With serde-rs/json:
# Cargo.toml
[dependencies.scs_sdk_telemetry]
features = ["json"]
// main.rs
use scs_sdk_telemetry::shared_memory::SharedMemory;
fn main() {
let mut shared_mem: SharedMemory = SharedMemory::connect();
println!("{:#?}", shared_mem.read().to_json().unwrap().to_string());
}
See the docs for all the details.
This project is licensed under MPL-2.0.