pub struct PassthruDevice { /* private fields */ }
Expand description

Passthru device

Implementations§

source§

impl PassthruDevice

source

pub fn toggle_sw_channel(&mut self, state: bool)

Toggles software channel emulation. This is useful if you are trying to run a concurrent ISO-TP and CAN channel. As the J2534 API does not support this (Confliting channels). Instead, the ISO-TP channel will be emulated in software and the CAN packets are manually sent over an opened CAN channel.

The CAN channel can then be accessed as normal, in parallel!

§CAUTION

Since this relys on a fully unfiltered CAN channel, some cheaper J2534 devices may struggle with this mode, and result in unstable ISO-TP connections!

Note that this toggled state will only affect newly created channels, currently opened channels will not be affected, so it would be best to close them prior to toggling this function

source

pub fn toggle_sw_channel_raw(dev: &mut Arc<RwLock<PassthruDevice>>, state: bool)

Do it on raw device

Trait Implementations§

source§

impl Clone for PassthruDevice

source§

fn clone(&self) -> PassthruDevice

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PassthruDevice

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for PassthruDevice

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Hardware for PassthruDevice

source§

fn create_iso_tp_channel(&mut self) -> HardwareResult<Box<dyn IsoTPChannel>>

Creates an ISO-TP channel on the devices. This channel will live for as long as the hardware trait. Upon being dropped, the channel will automatically be closed, if it has been opened.
source§

fn create_can_channel(&mut self) -> HardwareResult<Box<dyn CanChannel>>

Creates a CAN Channel on the devices. This channel will live for as long as the hardware trait. Upon being dropped, the channel will automatically be closed, if it has been opened.
source§

fn is_iso_tp_channel_open(&self) -> bool

Returns true if the ISO-TP channel is current open and in use
source§

fn is_can_channel_open(&self) -> bool

Returns true if the CAN channel is currently open and in use
source§

fn read_battery_voltage(&mut self) -> Option<f32>

Tries to read battery voltage from Pin 16 of an OBD port (+12V). This is mainly used by diagnostic adapters, and is purely optional Should the adapter not support this feature, std::option::Option::None is returned
source§

fn read_ignition_voltage(&mut self) -> Option<f32>

Tries to read battery voltage from the igntion pin on the OBD2 port. A reading would indicate ignition is on in the vehicle. This is mainly used by diagnostic adapters, and is purely optional Should the adapter not support this feature, std::option::Option::None is returned
source§

fn get_info(&self) -> &HardwareInfo

Returns the information of the hardware
source§

fn is_connected(&self) -> bool

Returns if the hardware is currently connected
source§

impl HardwareScanner<PassthruDevice> for PassthruScanner

source§

fn list_devices(&self) -> Vec<HardwareInfo>

Lists all scanned devices. This does not necessarily mean that the hardware can be used, just that the system known it exists.
source§

fn open_device_by_index(&self, idx: usize) -> HardwareResult<PassthruDevice>

Tries to open a device by a specific index from the HardwareScanner::list_devices function.
source§

fn open_device_by_name(&self, name: &str) -> HardwareResult<PassthruDevice>

Tries to open a device given the devices name

Auto Trait Implementations§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.