A comprehensive Rust library for automotive protocol implementations, following the OSI layer model for clear separation of concerns. The library provides support for various automotive protocols including CAN, CAN-FD, ISO-TP, J1939, ISOBUS, UDS, and OBD-II.
- Complete automotive protocol stack implementation
- Modular and extensible design following OSI layers
- High-performance implementations
- Strong type safety and error handling
- Easy-to-use abstractions
- Physical Layer: CAN and CAN-FD implementations
- Data Link Layer: Raw CAN frame handling
- Network Layer: J1939 and ISOBUS protocol implementations
- Transport Layer: ISO-TP (ISO 15765-2) implementation
- Application Layer:
- UDS (ISO 14229) implementation
- OBD-II implementation
- ISOBUS Diagnostic Protocol (DM1, DM2, DM3, DM11, DM13, DM22)
- Ensure you have Rust and Cargo installed (https://rustup.rs/)
- Clone the repository:
git clone https://github.com/shishir-dey/libautomotive.git cd libautomotive
- Build the library:
cargo build
- For release build:
cargo build --release
Run the test suite:
cargo test
For verbose test output:
cargo test -- --nocapture
use libautomotive::application::{uds, obdii};
use libautomotive::transport::isobus_diagnostic;
// UDS example
let uds_config = uds::Config::default();
let uds_interface = uds::Interface::new(uds_config);
// OBD-II example
let obd_config = obdii::Config::default();
let obd_interface = obdii::Interface::new(obd_config);
// ISOBUS Diagnostic example
let mut isobus_diag = isobus_diagnostic::ISOBUSDiagnosticProtocol::new();
let dtc = isobus_diagnostic::DiagnosticTroubleCode::new(100, 1); // SPN: 100, FMI: 1
isobus_diag.add_dtc(dtc);
MIT
This library draws inspiration from and acknowledges the following open-source projects:
- esp32-isotp-ble-bridge - ESP32-IDF based BLE<->ISO-TP bridge
- Open-SAE-J1939 - Open source SAE J1939 implementation
- uds-c - Unified Diagnostic Services (UDS) C library
- obdii - OBD-II diagnostic protocol implementation
- canis-can-sdk - CAN protocol stack implementation
- AgIsoStack++ - Open-source C++ ISOBUS library
- open-LIN-c - Implementation of Local Interconnect Network in C
- doip-library - Diagnostic over IP (DoIP) protocol implementation