Device

Struct Device 

Source
pub struct Device<'a> { /* private fields */ }
Expand description

A device created with Interface::open

Implementations§

Source§

impl<'a> Device<'a>

Source

pub fn read_version(&self) -> Result<VersionInfo, Error>

Reads the version info of the device

Source

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 voltage
  • voltage - The voltage value (in millivolts) that will be applied to the specified pin
Source

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
Source

pub fn read_battery_voltage(&self) -> Result<u32, Error>

Returns the battery voltage in millivolts read from Pin 16 on the J1962 connector.

Source

pub fn read_programming_voltage(&self) -> Result<u32, Error>

Returns the current output voltage for ECU reprogramming in millivolts.

Trait Implementations§

Source§

impl<'a> Drop for Device<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.