call detach_kernel_driver to make endpoints available for raw read/write

This commit is contained in:
Pavol Rusnak 2011-04-05 15:17:49 +02:00
parent c43e3a3bda
commit a690b0b8f1
2 changed files with 3 additions and 0 deletions

View file

@ -5,6 +5,8 @@ import time
usbdev = usb.core.find(idVendor = 0x1fc9, idProduct = 0x1337) usbdev = usb.core.find(idVendor = 0x1fc9, idProduct = 0x1337)
usbdev.detach_kernel_driver(0)
usbdev.set_configuration() usbdev.set_configuration()
epo = usb.util.find_descriptor( epo = usb.util.find_descriptor(

View file

@ -11,6 +11,7 @@ class Device:
usbdev = usb.core.find(idVendor = self.VENDORID, idProduct = self.PRODUCTID) usbdev = usb.core.find(idVendor = self.VENDORID, idProduct = self.PRODUCTID)
if usbdev == None: if usbdev == None:
raise Exception('EduBRM device not found') raise Exception('EduBRM device not found')
usbdev.detach_kernel_driver(0)
usbdev.set_configuration() usbdev.set_configuration()
self.epo = usb.util.find_descriptor(usbdev.get_interface_altsetting(), self.epo = usb.util.find_descriptor(usbdev.get_interface_altsetting(),
custom_match = lambda e: \ custom_match = lambda e: \