mirror of
https://github.com/brmlab/edubrm.git
synced 2025-06-08 21:03:59 +02:00
add python test example
This commit is contained in:
parent
785bdec34b
commit
5089785e4a
1 changed files with 20 additions and 0 deletions
20
firmware/test.py
Executable file
20
firmware/test.py
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import usb
|
||||
|
||||
usbdev = usb.core.find(idVendor=0x1fc9, idProduct=0x0003)
|
||||
|
||||
usbdev.set_configuration()
|
||||
|
||||
epo = usb.util.find_descriptor(
|
||||
usbdev.get_interface_altsetting(),
|
||||
custom_match = lambda e: \
|
||||
usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_OUT)
|
||||
|
||||
epi = usb.util.find_descriptor(
|
||||
usbdev.get_interface_altsetting(),
|
||||
custom_match = lambda e: \
|
||||
usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_IN)
|
||||
|
||||
print epo.write('@A')
|
||||
print epi.read(8)
|
Loading…
Add table
Add a link
Reference in a new issue