无法在 windows 上打开具有多接口 USB 设备的设备

fail to open device with multiple interface usb device on windows

我正在尝试使用 webusb api 连接我的 USB 设备,它基本上是一个数字转换器。 USB版本是2.0。 我已在 chrome 中成功请求设备,但无法打开设备,并显示访问拒绝错误。 request device USB 设备有 3 个接口:2 个 HID 和 1 个 USB(已加载 winusb)。这是 xusb 中显示的信息:

Using libusb v1.0.23.11397

Opening device 2D80:1010...
libusb: warning [hid_open] could not open HID device in R/W mode (keyboard or mouse?) - trying without

Device properties:
bus number: 1
port path: 14 (from root hub)
speed: 12 Mbit/s (USB FullSpeed)

Reading device descriptor:
length: 18
device class: 0
S/N: 3
VID:PID: 2D80:1010
bcdDevice: 0100
iMan:iProd:iSer: 1:2:3
nb confs: 1

Reading BOS descriptor: 1 caps
Unknown BOS device capability 05:

Reading first configuration descriptor:
nb interfaces: 3
interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 1
Class.SubClass.Protocol: 03.01.01
endpoint[0].address: 81
max packet size: 0040
polling interval: 01
interface[1]: id = 1
interface[1].altsetting[0]: num endpoints = 1
Class.SubClass.Protocol: 03.01.01
endpoint[0].address: 82
max packet size: 0040
polling interval: 01
interface[2]: id = 2
interface[2].altsetting[0]: num endpoints = 1
Class.SubClass.Protocol: FF.00.00
endpoint[0].address: 83
max packet size: 0040
polling interval: 00

Claiming interface 0...

Claiming interface 1...

Claiming interface 2...

Reading string descriptors:
String (0x01): ""
String (0x02): ""
String (0x03): "******"

Reading Extended Compat ID OS Feature Descriptor (wIndex = 0x0004):
libusb: warning [hid_submit_control_transfer] unsupported HID control request
libusb: warning [hid_submit_control_transfer] unsupported HID control request

00000000 28 00 00 00 00 01 04 00 01 00 00 00 00 00 00 00 (...............
00000010 02 01 57 49 4e 55 53 42 00 00 00 00 00 00 00 00 ..WINUSB........
00000020 00 00 00 00 00 00 00 00 ........

Reading Extended Properties OS Feature Descriptor (wIndex = 0x0005):
libusb: warning [hid_submit_control_transfer] unsupported HID control request
libusb: warning [hid_submit_control_transfer] unsupported HID control request

00000000 8e 00 00 00 00 01 05 00 01 00 84 00 00 00 01 00 ................
00000010 00 00 28 00 44 00 65 00 76 00 69 00 63 00 65 00 ..(.D.e.v.i.c.e.
00000020 49 00 6e 00 74 00 65 00 72 00 66 00 61 00 63 00 I.n.t.e.r.f.a.c.
00000030 65 00 47 00 55 00 49 00 44 00 00 00 4e 00 00 00 e.G.U.I.D...N...
00000040 7b 00 31 00 44 00 34 00 42 00 32 00 33 00 36 00 {.1.D.4.B.2.3.6.
00000050 35 00 2d 00 34 00 37 00 34 00 39 00 2d 00 34 00 5.-.4.7.4.9.-.4.
00000060 38 00 45 00 41 00 2d 00 42 00 33 00 38 00 41 00 8.E.A.-.B.3.8.A.
00000070 2d 00 37 00 43 00 36 00 46 00 44 00 44 00 44 00 -.7.C.6.F.D.D.D.
00000080 44 00 37 00 45 00 32 00 36 00 7d 00 00 00 D.7.E.2.6.}...

Releasing interface 0...
Releasing interface 1...
Releasing interface 2...
Closing device...

第一个 hid 接口用于报告数字转换器,我认为它已经被系统占用。我想这就是问题所在,因为我试图删除两个 hid 接口并重复该过程。这次打开设备成功

但是 Mac OS 上没有出现同样的问题。 所以我想知道是否有人对 windows?

上的问题有任何解决方案

这可能是一个 Chrome 问题。我一直在研究一个新的后端,用于连接到 Windows 上的 USB 设备,它应该更可靠,尤其是对于复杂的复合设备。

请从 https://www.google.com/chrome/canary/ 安装 Chrome canary-channel(至少版本 84.0.4110.2)并尝试在 chrome 中的标志中打开“启用新的 USB 后端”:/ /旗帜。

如果这能解决问题,请告诉我。