pub struct Device<'a> { /* private fields */ }Expand description
A device created with Interface::open
Implementations§
Source§impl<'a> Device<'a>
impl<'a> Device<'a>
Sourcepub fn read_version(&self) -> Result<VersionInfo, Error>
pub fn read_version(&self) -> Result<VersionInfo, Error>
Reads the version info of the device
Sourcepub fn set_programming_voltage(
&self,
pin_number: u32,
voltage: u32,
) -> Result<(), Error>
pub fn set_programming_voltage( &self, pin_number: u32, voltage: u32, ) -> Result<(), Error>
Outputs a programmable voltage on the specified J1962 connector pin. Only one pin can have a specified voltage applied at a time. The only exception: it is permissible to program pin 15 for SHORT_TO_GROUND, and another pin to a voltage level. When switching pins, the user application must disable the first voltage (VOLTAGE_OFF option) before enabling the second.
§Arguments
pin_number- The J1962 connector pin to which the PassThru device will apply the specified voltagevoltage- The voltage value (in millivolts) that will be applied to the specified pin
Sourcepub fn connect(
&self,
protocol: Protocol,
flags: ConnectFlags,
baudrate: u32,
) -> Result<Channel<'_>, Error>
pub fn connect( &self, protocol: Protocol, flags: ConnectFlags, baudrate: u32, ) -> Result<Channel<'_>, Error>
Creates a channel
§Arguments
- protocol - Protocol to use with the channel
- flags - Protocol-specific flags. This is usually set to zero
- baudrate - Initial baud rate for the channel
Sourcepub fn read_battery_voltage(&self) -> Result<u32, Error>
pub fn read_battery_voltage(&self) -> Result<u32, Error>
Returns the battery voltage in millivolts read from Pin 16 on the J1962 connector.
Sourcepub fn read_programming_voltage(&self) -> Result<u32, Error>
pub fn read_programming_voltage(&self) -> Result<u32, Error>
Returns the current output voltage for ECU reprogramming in millivolts.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Device<'a>
impl<'a> RefUnwindSafe for Device<'a>
impl<'a> !Send for Device<'a>
impl<'a> !Sync for Device<'a>
impl<'a> Unpin for Device<'a>
impl<'a> UnwindSafe for Device<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more