Expand description
Communicate with devices implementing the CTAPHID protocol.
This implementation is based on the FIDO Client to Authenticator Protocol (CTAP) specification (version of June 15, 2021), section 11.2.
§Quickstart
let hidapi = hidapi::HidApi::new()?;
let devices = hidapi.device_list().filter(|device| ctaphid::is_known_device(*device));
for device_info in devices {
let hid_device = device_info.open_device(&hidapi)?;
let device = ctaphid::Device::new(hid_device, device_info.to_owned())?;
print!(
"Trying to ping CTAPHID device 0x{:x}:0x{:x} ...",
device_info.vendor_id(),
device_info.product_id(),
);
device.ping(&[0xde, 0xad, 0xbe, 0xef])?;
println!("done");
}
Re-exports§
pub use ctaphid_types as types;
Modules§
- error
- Error types for
ctaphid
operations.
Structs§
Traits§
- HidDevice
- A HID device.
- HidDevice
Info - Information about a HID device.
Functions§
- is_
known_ device - Checks whether the given device is a known CTAPHID device using its vendor and product ID.