Struct ecu_diagnostics::hardware::passthru::PassthruDevice
source · pub struct PassthruDevice { /* private fields */ }
Expand description
Passthru device
Implementations§
source§impl PassthruDevice
impl PassthruDevice
sourcepub fn toggle_sw_channel(&mut self, state: bool)
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
sourcepub fn toggle_sw_channel_raw(dev: &mut Arc<RwLock<PassthruDevice>>, state: bool)
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
impl Clone for PassthruDevice
source§fn clone(&self) -> PassthruDevice
fn clone(&self) -> PassthruDevice
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PassthruDevice
impl Debug for PassthruDevice
source§impl Drop for PassthruDevice
impl Drop for PassthruDevice
source§impl Hardware for PassthruDevice
impl Hardware for PassthruDevice
source§fn create_iso_tp_channel(&mut self) -> HardwareResult<Box<dyn IsoTPChannel>>
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>>
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
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
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>
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>
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
fn get_info(&self) -> &HardwareInfo
Returns the information of the hardware
source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Returns if the hardware is currently connected
source§impl HardwareScanner<PassthruDevice> for PassthruScanner
impl HardwareScanner<PassthruDevice> for PassthruScanner
source§fn list_devices(&self) -> Vec<HardwareInfo>
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>
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>
fn open_device_by_name(&self, name: &str) -> HardwareResult<PassthruDevice>
Tries to open a device given the devices name
Auto Trait Implementations§
impl Freeze for PassthruDevice
impl RefUnwindSafe for PassthruDevice
impl Send for PassthruDevice
impl Sync for PassthruDevice
impl Unpin for PassthruDevice
impl UnwindSafe for PassthruDevice
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