(timeout=1000)
| 20 | dev.ctrl_transfer(0x21, 0x09, 0x200, 0x04, bytes(data) + bytes(64 - len(data))) |
| 21 | |
| 22 | def recv(timeout=1000): |
| 23 | try: |
| 24 | return dev.read(0x85, 64, timeout=timeout).tobytes() |
| 25 | except usb.core.USBTimeoutError: |
| 26 | return None |
| 27 | |
| 28 | def recv_all(timeout=500): |
| 29 | """Drain all pending responses""" |