Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import usb.core
- import usb.util
- VENDOR_ID = 0x0C45
- PRODUCT_ID = 0x7100
- # find our device
- device = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)
- # was it found?
- if device is None:
- sys.exit("Could not find BitFenix Recon.")
- # make sure the hiddev kernel driver is not active
- if device.is_kernel_driver_active(0):
- try:
- device.detach_kernel_driver(0)
- except usb.core.USBError as e:
- sys.exit("Could not detatch kernel driver: %s" % str(e))
- try:
- device.set_configuration()
- #device.reset()
- usb.util.claim_interface(device, 0)
- except usb.core.USBError as e:
- sys.exit("Could not set configuration: %s" % str(e))
- endpoint = device[0][(0,0)][0]
- while 1:
- try:
- print endpoint.bEndpointAddress
- print device.read(endpoint.bEndpointAddress, 8)
- except usb.core.USBError as e:
- print e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement