Trait ecu_diagnostics::hardware::HardwareScanner
source · [−]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.
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 HardwareScanner::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