webusb: check if a device is functional when enumerating
this fixes issue #223 on Windows, where a device would be returned in two copies, only one of which works
This commit is contained in:
parent
f75b90d260
commit
9f2583f893
|
@ -101,7 +101,16 @@ class WebUsbTransport(Transport):
|
||||||
continue
|
continue
|
||||||
if not is_vendor_class(dev):
|
if not is_vendor_class(dev):
|
||||||
continue
|
continue
|
||||||
devices.append(WebUsbTransport(dev))
|
try:
|
||||||
|
# workaround for issue #223:
|
||||||
|
# on certain combinations of Windows USB drivers and libusb versions,
|
||||||
|
# Trezor is returned twice (possibly because Windows know it as both
|
||||||
|
# a HID and a WebUSB device), and one of the returned devices is
|
||||||
|
# non-functional.
|
||||||
|
dev.getProduct()
|
||||||
|
devices.append(WebUsbTransport(dev))
|
||||||
|
except usb1.USBErrorNotSupported:
|
||||||
|
pass
|
||||||
return devices
|
return devices
|
||||||
|
|
||||||
def find_debug(self):
|
def find_debug(self):
|
||||||
|
|
Loading…
Reference in New Issue