komsi

Crates.iokomsi
lib.rskomsi
version0.5.0
created_at2026-01-19 02:25:02.680763+00
updated_at2026-01-19 10:13:30.634532+00
descriptionLibrary for the KOMSI protocol
homepage
repositoryhttps://github.com/thatzok/komsi-lib
max_upload_size
id2053562
size22,454
(thatzok)

documentation

README

komsi

github crates.io Build maintenance-status

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.

Features

  • KOMSI Protocol Implementation: Support for various KOMSI protocol commands like Ignition, Engine, Speed, RPM, etc.
  • Vehicle State Tracking: Easily manage and track the state of a vehicle.

Installation

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

Usage Example

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());
}

Documentation

For detailed API documentation, run:

cargo doc --open

License

This project is licensed under the MIT License - see the LICENSE file for details.

Commit count: 6

cargo fmt