Skip to content

Commit

Permalink
Better interface filter, OSX portability
Browse files Browse the repository at this point in the history
  • Loading branch information
BTChip github committed Mar 12, 2018
1 parent ede307f commit ab58917
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ledgerblue/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ def getDongle(debug=False, selectCommand=None):
hidDevicePath = None
ledger = True
for hidDevice in hid.enumerate(0, 0):
if hidDevice['vendor_id'] == 0x2c97 and ('interface_number' not in hidDevice or hidDevice['interface_number'] == 0):
hidDevicePath = hidDevice['path']
if hidDevice['vendor_id'] == 0x2c97:
if ('interface_number' in hidDevice and hidDevice['interface_number'] == 0) or ('usage_page' in hidDevice and hidDevice['usage_page'] == 0xffa0):
hidDevicePath = hidDevice['path']
if hidDevicePath is not None:
dev = hid.device()
dev.open_path(hidDevicePath)
Expand Down

0 comments on commit ab58917

Please sign in to comment.