// Copyright (C) 2021 Robin Krahl // SPDX-License-Identifier: Apache-2.0 or MIT //! Lists all connected Nitrokey 3 devices and their firmware version. fn main() -> Result<(), nitrokey3::Error> { let hidapi = hidapi::HidApi::new()?; let devices = nitrokey3::list(&hidapi); println!("Found {} Nitrokey 3 devices", devices.len()); for device in devices { let device = device.connect()?; let firmware_version = device.firmware_version()?; let uuid = device.uuid()?; print!("- Nitrokey 3 "); if let Some(uuid) = uuid { print!("{} ", uuid); } println!("with firmware version {}", firmware_version); } Ok(()) }