Expand description
SAE J2534 PassThru defines a standard library interface for communicating with vehicle control modules. All automakers in the US are required to provide J2534-compatible service software. J2534 provides access to the communication layers required for accessing vehicle diagnostics services as well as downloading and reflashing control modules.
§Example
use j2534::{Interface, PassThruMsg, Protocol, ConnectFlags, RxStatus, TxFlags};
fn main() -> j2534::Result<()> {
// Open the library and connect to a device
let interface = Interface::new("C:\\device.dll")?;
let device = interface.open_any()?;
// Create a CAN channel
let channel = device
.connect(Protocol::CAN, ConnectFlags::NONE, 500000)
.unwrap();
// Create a new message with an arbitration id of `8` and payload of `[0, 1, 2, 3]`.
let message = PassThruMsg::new_can(8, &[0, 1, 2, 3]);
channel.write(&mut [message], 1000)?;
Ok(())
}
Structs§
- Channel
- A communication channel
- Connect
Flags - Flags used when creating a communication channel
- Device
- A device created with
Interface::open
- Driver
- Information about an installed PassThru driver
- Filter
Id - Message filter ID
- Interface
- A J2534 library
- Message
Id - Periodic message ID
- Pass
Thru Msg - A message sent a received from the device
- RxStatus
- Receive status flags
- TxFlags
- Transmit status flags
- Version
Info - Information about a device’s version.
Enums§
- Config
Id - Channel configuration parameters. Use with
Channel::get_config
andChannel::set_config
- Error
- Filter
Type - IoctlId
- Protocol
Constants§
Functions§
- drivers
- Returns a list of all installed PassThru drivers