Crate ecu_diagnostics[−][src]
Expand description
A crate which provides the most common ECU diagnostic protocols used by modern ECUs in vehicles.
Protocol support
This crate provides the 3 most widely used diagnostic protocols used by modern ECUs from 2000 onwards
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
- ECU flashing
- Clearing and reading of permanent DTCs
- Manipulation of ECU communication parameters
- Low level manipulation of ECU’s EEPROM or RAM
- Gateway access in vehicles which have them
The specification implemented in this crate is v2.2, dated 05-08-2002
Unified diagnostic services (UDS)
ISO14429 - UDS is an advanced diagnostic protocol utilized by almost all vehicle manufacturers from 2006 onwards. Like KWP2000, this protocol allows for reading/writing directly to the ECU, and should therefore be used with caution.
The specification implemented in this crate is the second edition, dated 01-12-2006.
Usage
In order to utilize any of the diagnostic servers, you will need to implement the [channel::BaseChannel] trait, which allows for the diagnostic servers to send and receive data to/from the ECU, regardless of the transport layer used.
Re-exports
pub use channel::ChannelError;
pub use hardware::HardwareError;
Modules
Module for logical communication channels with an ECU
Module for common Diagnostic trouble code data
Dynamic diagnostic session helper
The hardware module contains simplified API’s for interacting with common hardware that can be used for either Bench setups or OBD2 adapters in order to communicate with vehicle ECUs
Module for KWP2000 (Keyword protocol 2000 - ISO142330)
Module for OBD2 (ISO-9141)
Module for UDS (Unified diagnostic services - ISO14229)
Enums
Diagnostic server error
Diagnostic server event
Constants
Version of compiled crate
Traits
Basic diagnostic server payload
Basic diagnostic server settings
Base trait for diagnostic servers
Handler for when ServerEvent get broadcast by the diagnostic servers background thread
Type Definitions
Diagnostic server result