我似乎无法使用 webusb 声明隐藏接口。我正在尝试编写一个 yubikey OATH 包装器
navigator.usb.requestDevice({filters: filters}).then(...);
USBDevice {usbVersionMajor: 2, usbVersionMinor: 0, usbVersionSubminor: 0, deviceClass: 0, deviceSubclass: 0, …}configuration: USBConfiguration {configurationValue: 1, configurationName: null, interfaces: Array(2)}configurations: [USBConfiguration]deviceClass: 0deviceProtocol: 0deviceSubclass: 0deviceVersionMajor: 3deviceVersionMinor: 4deviceVersionSubminor: 9manufacturerName: "Yubico"opened: falseproductId: 273productName: "Yubikey NEO OTP+CCID"serialNumber: "0005610818"usbVersionMajor: 2usbVersionMinor: 0usbVersionSubminor: 0usbVersionSubminor: 0usbVersionSubminor: 0usbVersionSubminor__proto__: 0vend USBDevice: 0vend现在 USBDevice {usbVersionMajor: 2, usbVersionMinor: 0, usbVersionSubminor: 0, deviceClass: 0, deviceSubclass: 0, ...}
ykey.open(...).then(...);
ykey.claimInterface(0)
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined} Uncaught (in promise) DOMException: Unable to claim interface。
我怀疑这是与 chrome.usb api 类似的问题。我是否应该编写一个 udev 规则以不使用该设备上的 usbhid 驱动程序来完成这项工作?