Hi there,
I just started to use PyUSB and want to talk to an AVR.
I ran into a problem with the ctrl_transfer method, here is my listing:
import usb.core
import usb.util
vendorID = 0x16c0
productID = 0x05dc
dev = usb.core.find(idVendor=vendorID, idProduct=productID)
if dev is None:
raise ValueError('Device not found')
else:
print('Device found')
dev.set_configuration()
#try to get the Firmware
bmRequestType = usb.util.CTRL_TYPE_VENDOR |
usb.util.CTRL_RECIPIENT_DEVICE | usb.util.CTRL_IN
firmware = dev.ctrl_transfer(bmRequestType, 0x00, 0x0e00, 0,
data_or_wLength = 2, timeout = 500)
> In [61]: firmware
> Out[61]: array('B', [0])
The code runs fine, but the firmware contains only one byte, although it should
contain two. Is the code buggy?
Thanks for any help!
Benno
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
pyusb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyusb-users