Skip to content

Commit

Permalink
pyusb backend: select the iface with the right bInterfaceClass right …
Browse files Browse the repository at this point in the history
…away
  • Loading branch information
pklaus committed Aug 14, 2018
1 parent d209040 commit fe55344
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions brother_ql/backends/pyusb.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def __init__(self, device_specifier):
self.dev.set_configuration()

cfg = self.dev.get_active_configuration()
intf = cfg[(0,0)] # (bInterfaceNumber, bAlternateSetting)
assert intf.bInterfaceClass == 7 # 'Printer' not 'Vendor Specific' or the likes...
intf = usb.util.find_descriptor(cfg, bInterfaceClass=7)
assert intf is not None

ep_match_in = lambda e: usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_IN
ep_match_out = lambda e: usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_OUT
Expand Down

0 comments on commit fe55344

Please sign in to comment.