1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-22 20:42:03 +00:00

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:
matejcik 2018-03-06 13:28:26 +01:00
parent f75b90d260
commit 9f2583f893

View File

@ -101,7 +101,16 @@ class WebUsbTransport(Transport):
continue
if not is_vendor_class(dev):
continue
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
def find_debug(self):