mirror of
https://github.com/brmlab/edubrm.git
synced 2025-06-08 04:43:59 +02:00
update to python-usb 1.0.0a1 api
This commit is contained in:
parent
64ad5d3288
commit
2ce865c4c2
1 changed files with 6 additions and 2 deletions
|
@ -17,10 +17,14 @@ class Device:
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
usbdev.set_configuration()
|
usbdev.set_configuration()
|
||||||
self.epo = usb.util.find_descriptor(usbdev.get_interface_altsetting(),
|
cfg = usbdev.get_active_configuration()
|
||||||
|
interface_number = cfg[(0,0)].bInterfaceNumber
|
||||||
|
alternate_setting = usb.control.get_interface(usbdev, interface_number)
|
||||||
|
intf = usb.util.find_descriptor(cfg, bInterfaceNumber = interface_number, bAlternateSetting = alternate_setting)
|
||||||
|
self.epo = usb.util.find_descriptor(intf,
|
||||||
custom_match = lambda e: \
|
custom_match = lambda e: \
|
||||||
usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_OUT)
|
usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_OUT)
|
||||||
self.epi = usb.util.find_descriptor(usbdev.get_interface_altsetting(),
|
self.epi = usb.util.find_descriptor(intf,
|
||||||
custom_match = lambda e: \
|
custom_match = lambda e: \
|
||||||
usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_IN)
|
usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_IN)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue