diff --git a/framework_lib/src/camera.rs b/framework_lib/src/camera.rs index 0c4b6c36..c99d9915 100644 --- a/framework_lib/src/camera.rs +++ b/framework_lib/src/camera.rs @@ -3,7 +3,7 @@ pub const FRAMEWORK13_16_2ND_GEN_PID: u16 = 0x001C; pub const FRAMEWORK12_PID: u16 = 0x001D; /// Get and print the firmware version of the camera -pub fn check_camera_version() { +pub fn check_camera_version() -> Result<(), rusb::Error> { for dev in rusb::devices().unwrap().iter() { let dev_descriptor = dev.device_descriptor().unwrap(); if dev_descriptor.vendor_id() != FRAMEWORK_VID @@ -19,11 +19,12 @@ pub fn check_camera_version() { } let handle = dev.open().unwrap(); - let dev_descriptor = dev.device_descriptor().unwrap(); + let dev_descriptor = dev.device_descriptor()?; let i_product = dev_descriptor .product_string_index() .and_then(|x| handle.read_string_descriptor_ascii(x).ok()); println!("{}", i_product.unwrap_or_default()); println!(" Firmware Version: {}", dev_descriptor.device_version()); } + Ok(()) } diff --git a/framework_lib/src/commandline/mod.rs b/framework_lib/src/commandline/mod.rs index c134bb09..20d77a81 100644 --- a/framework_lib/src/commandline/mod.rs +++ b/framework_lib/src/commandline/mod.rs @@ -473,7 +473,7 @@ fn print_versions(ec: &CrosEc) { } } #[cfg(feature = "rusb")] - check_camera_version(); + let _ignore_err = check_camera_version(); } fn print_esrt() {