fix ledger: nano s did not work reliably since last fw update

follow LedgerHQ/btchip-python@6e985b558f
This commit is contained in:
SomberNight 2018-03-22 15:48:48 +01:00
parent db9cb63e79
commit cd19f788cc

View file

@ -523,8 +523,15 @@ class LedgerPlugin(HW_PluginBase):
def get_btchip_device(self, device):
ledger = False
if (device.product_key[0] == 0x2581 and device.product_key[1] == 0x3b7c) or (device.product_key[0] == 0x2581 and device.product_key[1] == 0x4b7c) or (device.product_key[0] == 0x2c97):
if device.product_key[0] == 0x2581 and device.product_key[1] == 0x3b7c:
ledger = True
if device.product_key[0] == 0x2581 and device.product_key[1] == 0x4b7c:
ledger = True
if device.product_key[0] == 0x2c97:
if device.interface_number == 0 or device.usage_page == 0xffa0:
ledger = True
else:
return None # non-compatible interface of a nano s or blue
dev = hid.device()
dev.open_path(device.path)
dev.set_nonblocking(True)