1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- import usb.core as core
- import usb.util as util
- from usb.core import USBError
- from remotes import tv
- dev = core.find(idVendor=0x2341, idProduct=0x0043)
- detached = False
- if dev is None:
- raise ValueError("Device Not Found!")
- dev.reset()
- cfg = dev.get_active_configuration()
- intf = cfg[(0, 0)]
- print(intf)
- ep = util.find_descriptor(
- intf,
- custom_match = \
- lambda e: \
- util.endpoint_direction(e.bEndpointAddress) == \
- util.ENDPOINT_IN)
- assert ep is not None
- ep.write(b'0x57E3E817,32,1\n')
|