#truck #telemetry #sdk #american #shared-memory #euro #ets2

nightly scs-sdk-telemetry

Rust wrapper for the ETS2 (Euro Truck Simulator 2) and ATS (American Truck Simulator) Telemetry SDK plug-in

10 releases (2 stable)

1.1.0 Sep 25, 2023
1.0.0 Sep 10, 2023
0.2.0 Sep 9, 2023
0.1.6 Sep 9, 2023

#196 in Simulation

MPL-2.0 license

52KB
1K SLoC

scs-sdk-telemetry

Docs

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

Getting Started

Follow the installation section in RenCloud/scs-sdk-plugin

Examples

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.

License

This project is licensed under MPL-2.0.

Dependencies

~130MB
~2M SLoC