rnd-ash / ecu_diagnostics

A Rust crate for ECU diagnostic protocols (UDS / KWP)
GNU General Public License v3.0
171 stars 28 forks source link

ecu_diagnostics

crates.io version docs.rs docs

A cross-platform crate for the diagnostic servers used for ECU diagnostics.

Ensure you are running Rust 1.56.0 (2021 edition) or higher to use this crate!

Features

A quick overview of diagnostic servers used by ECUs

On-board diagnostics (OBD2)

ISO9141 - OBD2 is a legal requirement on all vehicles produced from 2002, allowing for reading of sensor data, reading and clearing standard DTCs, and reading basic vehicle information. OBD2 is designed to be safe and simple, and does not write data to the ECU.

Keyword protocol 2000 (KWP2000)

ISO14230 - KWP2000 is a advanced diagnostic protocol utilized by many vehicle manufacturers from 2000-2006 (Superseded by UDS). Unlike OBD2, KWP2000 allows for much more complex operations, which could potentially cause damage to a vehicle if used incorrectly.
A few examples of features allowed by KWP2000 are

NEW (as of v0.91 UNIFIED DIAGNOSTIC SERVER)

The individual diagnostic servers are now merged into 1 diagnostic server that can handle all the different protocols (Diagnostic protocol is specified at the servers creation). This dramatically reduces the crates bloat (Less copy/paste code), and the refactoring has also introduced some new features:

Diagnostic server checklist

OBD2

Custom service support: YES

Working specification services:

KWP2000

Custom service support: YES

Working specification services:

UDS

Custom service support: YES

Working specification services:

Hardware API checklist

The Hardware API contains a common interface for scanning for compatible devices on a system as well as an API for creating Channels for diagnostic servers using the hardware

Passthru (SAE J2534)

SocketCAN

SLCAN

D-PDU (ISO 22900-2)

TBA

Notable contributions