Trait ecu_diagnostics::hardware::HardwareScanner
source · pub trait HardwareScanner<T: Hardware> {
// Required methods
fn list_devices(&self) -> Vec<HardwareInfo>;
fn open_device_by_index(&self, idx: usize) -> HardwareResult<T>;
fn open_device_by_name(&self, name: &str) -> HardwareResult<T>;
}
Expand description
Trait for scanning hardware on a system which can be used to diagnose ECUs
Required Methods§
sourcefn 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.
sourcefn open_device_by_index(&self, idx: usize) -> HardwareResult<T>
fn open_device_by_index(&self, idx: usize) -> HardwareResult<T>
Tries to open a device by a specific index from the HardwareScanner::list_devices function.
sourcefn open_device_by_name(&self, name: &str) -> HardwareResult<T>
fn open_device_by_name(&self, name: &str) -> HardwareResult<T>
Tries to open a device given the devices name