Serialport Support
- allow communication to elm327 device via a serialport - allow creation of elm327 device without requiring unwrap() - added some extra documentation - expose reset() functionality of device - serial_comm and ftdi_comm abstractions added
This commit is contained in:
parent
83ce026d23
commit
c1cea1e488
11 changed files with 194 additions and 58 deletions
10
src/lib.rs
10
src/lib.rs
|
@ -6,14 +6,20 @@
|
|||
//!
|
||||
//! # Usage
|
||||
//! ```
|
||||
//! use obd2::{commands::Obd2DataRetrieval, device::Elm327, Obd2};
|
||||
//! use obd2::{commands::Obd2DataRetrieval, device::{Elm327, FTDIDevice}, Obd2};
|
||||
//!
|
||||
//! fn main() -> Result<(), obd2::Error> {
|
||||
//! let mut device = Obd2::<Elm327>::default();
|
||||
//! let mut device = Obd2::new(Elm327::new(FTDIDevice::new()?)?)?;
|
||||
//! println!("VIN: {}", device.get_vin()?);
|
||||
//! Ok(())
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
//! alternatively, you could use a serial port provided by your operating system such as
|
||||
//! /dev/ttyUSB0 on unix-like systems
|
||||
//! ```
|
||||
//! let mut device = Obd2::new(Elm327::new(SerialPort::new("/dev/ttyUSB0")?)?)?;
|
||||
//! ```
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
#![warn(missing_docs, clippy::panic)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue