api modifications
This commit is contained in:
parent
db4b4d990d
commit
0994648ed1
7 changed files with 18 additions and 10 deletions
|
@ -22,12 +22,6 @@ pub struct Elm327 {
|
|||
baud_rate: u32,
|
||||
}
|
||||
|
||||
impl Default for Elm327 {
|
||||
fn default() -> Self {
|
||||
Elm327::new().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl Obd2BaseDevice for Elm327 {
|
||||
fn reset(&mut self) -> Result<()> {
|
||||
self.flush_buffers()?;
|
||||
|
@ -66,7 +60,7 @@ impl Obd2Reader for Elm327 {
|
|||
|
||||
impl Elm327 {
|
||||
fn new() -> Result<Self> {
|
||||
let mut ftdi_device = ftdi::find_by_vid_pid(0x0403, 0x6001)
|
||||
let mut ftdi_device = ftdi::find_by_vid_pid(0x0404, 0x6001)
|
||||
.interface(ftdi::Interface::A)
|
||||
.open()?;
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
mod elm327;
|
||||
pub use elm327::Elm327;
|
||||
|
||||
mod elm327_linux;
|
||||
pub use elm327_linux::Elm327Linux;
|
||||
|
||||
type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
/// A lower-level API for using an OBD-II device
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue