1

我正在尝试获取端点属性 bmAttributes 的字符串描述符。我可以使用 pyusb 获取值,但不能使用它的字符串描述符。当我这样做时,我得到了那个错误。

dev = usb.core.find(idVendor = 0x0126)
dev.set_configuration()
cfg = dev.get_active_configuration()
intf = cfg[(0,0)]
ep = intf[0]

bmattrib = usb.util.get_string(ep, ep.bmAttributes) <--Where error is

我可以得到值,但不能得到字符串。有谁知道如何让它工作?

4

0 回答 0