| Crates.io | komsi |
| lib.rs | komsi |
| version | 0.5.0 |
| created_at | 2026-01-19 02:25:02.680763+00 |
| updated_at | 2026-01-19 10:13:30.634532+00 |
| description | Library for the KOMSI protocol |
| homepage | |
| repository | https://github.com/thatzok/komsi-lib |
| max_upload_size | |
| id | 2053562 |
| size | 22,454 |
This Rust crate is a library for the KOMSI protocol, primarily used for vehicle telemetry (speed, lamps, etc.) in simulators (e.g., "The Bus", "OMSI 2") using the KOMSI protocol.
Add komsi to your Cargo.toml:
cargo add komsi
Or manually add it to your Cargo.toml:
[dependencies]
komsi = "0.5" # Replace with the latest version
use komsi::vehicle::{VehicleState, VehicleLogger};
struct MyLogger;
impl VehicleLogger for MyLogger {
fn log(&self, msg: String) {
println!("LOG: {}", msg);
}
}
fn main() {
let old_state = VehicleState::new();
let mut new_state = old_state.clone();
new_state.ignition = 1;
new_state.speed = 50;
let logger = MyLogger;
let commands = old_state.compare(&new_state, false, Some(&logger));
// 'commands' now contains the byte buffer to be sent via KOMSI
println!("Generated {} bytes of commands", commands.len());
}
For detailed API documentation, run:
cargo doc --open
This project is licensed under the MIT License - see the LICENSE file for details.