Trait ecu_diagnostics::hardware::HardwareScanner [−][src]
pub trait HardwareScanner<T: Hardware> {
fn list_devices(&self) -> Vec<HardwareInfo>;
fn open_device_by_index(&self, idx: usize) -> HardwareResult<Arc<Mutex<T>>>;
fn open_device_by_name(&self, name: &str) -> HardwareResult<Arc<Mutex<T>>>;
}
Expand description
Trait for scanning hardware on a system which can be used to diagnose ECUs
Required methods
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. For instance, Passthru API uses the registry to scan for devices, but these devices might not actually be plugged into the computer at the time of the request
fn open_device_by_index(&self, idx: usize) -> HardwareResult<Arc<Mutex<T>>>
fn open_device_by_index(&self, idx: usize) -> HardwareResult<Arc<Mutex<T>>>
Tries to open a device by a specific index from the [list_devices] function.
fn open_device_by_name(&self, name: &str) -> HardwareResult<Arc<Mutex<T>>>
fn open_device_by_name(&self, name: &str) -> HardwareResult<Arc<Mutex<T>>>
Tries to open a device given the devices name