Expand description
USB HID enumeration for FIDO / security-key devices.
On Linux this enumerates /dev/hidraw* device nodes by reading sysfs
metadata — no external dependencies, no ioctls, no device-open required.
That keeps enumeration root-free and means it works even when the user has
not yet installed the udev rules in udev/70-keyroost-fido.rules.
On macOS and Windows it uses the hidapi crate (IOKit / hid.dll),
selected automatically off Linux. The hidapi-backend feature forces that
path on for building/testing the cross-platform backend on Linux too. USB
topology (usb_bus/usb_address) is only available via the sysfs backend.
Structs§
- HidDevice
- Metadata for a single connected HID device.
Enums§
- HidError
- Things that can go wrong enumerating HID devices.
Constants§
- HID_
USAGE_ FIDO_ AUTHENTICATOR - HID usage within the FIDO page used by U2F / CTAP HID authenticators.
- HID_
USAGE_ PAGE_ FIDO - HID usage page assigned to FIDO U2F / CTAP HID by usb.org.
Functions§
- bootloader_
device_ present - Scan all connected HID devices for any recognized security key in bootloader / DFU mode, returning the first match’s description. A front-end that finds no FIDO devices can call this to explain why (e.g. a Solo 2 stuck in DFU) rather than just reporting an empty list.
- enumerate
- List all
/dev/hidraw*devices visible to the current user via sysfs. - hid_
supported - Whether this platform has a HID backend: Linux (sysfs), macOS (IOKit via
hidapi), and Windows (hid.dll via hidapi). When
false,enumeratereturns an empty list and FIDO/CTAP is unavailable — front-ends should say so explicitly rather than reporting “no FIDO devices”, which would imply none are plugged in.