- for intf in config:
- if usb.util.find_descriptor(config, custom_match=lambda d: (d.bInterfaceClass == 0x02 or d.bInterfaceClass == 0xFF)):
- print("Found serial device with 0x02 | 0xFF")
- if self.dev.is_kernel_driver_active(intf.bInterfaceNumber):
- print("Found kernel driver, detaching ... ")
- self.dev.detach_kernel_driver(intf.bInterfaceNumber)
- for ep in intf:
- if (ep.bmAttributes == 0x02):
- if ep.bEndpointAddress == self.ep_in:
- self.rx_ep = ep
- print(ep)
- elif ep.bEndpointAddress == self.ep_out:
- self.tx_ep = ep
- print(ep)
- return True
+ #print(config)
+ intf = config[(1,0)]
+ #for intf in config:
+
+ #if usb.util.find_descriptor(config, custom_match=lambda d: (d.bInterfaceClass == 0xa or d.bInterfaceClass == 0xBB)):
+ print("Found serial device with 0x0a | 0xFF")
+ if self.dev.is_kernel_driver_active(intf.bInterfaceNumber):
+ print("Found kernel driver, detaching ... ")
+ self.dev.detach_kernel_driver(intf.bInterfaceNumber)
+ for ep in intf:
+ #print("=========")
+ #print(ep)
+ if (ep.bmAttributes == 0x02):
+ if ep.bEndpointAddress == self.ep_in:
+ self.rx_ep = ep
+ print(ep)
+ elif ep.bEndpointAddress == self.ep_out:
+ self.tx_ep = ep
+ print(ep)
+ return True