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(())
}