Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Python 2.7.2 (default, Jul 26 2011, 17:12:52)
- [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.9)] on darwin
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import sys
- >>> import usb.core,usb.util
- >>> dev = usb.core.find(idVendor=0x05ac, idProduct=0x8242)
- >>> dev.set_configuration()
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/core.py", line 530, in set_configuration
- self._ctx.managed_set_configuration(self, configuration)
- File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/core.py", line 92, in managed_set_configuration
- self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
- File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/_debug.py", line 52, in do_trace
- return f(*args, **named_args)
- File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/backend/libusb10.py", line 455, in set_configuration
- _check(_lib.libusb_set_configuration(dev_handle, config_value))
- File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/backend/libusb10.py", line 357, in _check
- raise USBError(_str_error[retval.value])
- usb.core.USBError: Unknown error
- >>> dev.iProduct
- 2
- >>> dev.idProduct
- 33346
- >>> dev.idVendor
- 1452
- >>> dev.iSerialNumber
- 0
- #touch any button on the control
- >>> dev.set_configuration()
- >>> dev.iProduct
- 2
- >>> dev.idProduct
- 33346
- >>> dev.iSerialNumber
- 0
- >>> dev.iSerialNumber
- 0
Advertisement
Add Comment
Please, Sign In to add comment