I only have one device set up with libusb, but to be sure I have changed 
the code to

import usb.core as core
usbDevice = core.find(idVendor=0x06C2, idProduct=0x0039)
if usbDevice != None:
     usbDevice .set_configuration()
     rawRead = usbDevice .read(0x81, 8)
     print('Raw: ' + str(rawRead))
else:
     print('Device not found')

I tried reinstalling the driver inf, and when I ran this program I was 
able to read the block data, but when I tried to write I got an error 
message saying 0x81 was not a valid endpoint.  Also, all I have ever 
been able to get back from read is:
array('B', (0, 0, 0, 0, 0, 0, 0, 0))

Is there any way to guarantee that I am getting valid data back from the 
device?

On 6/2/2011 10:44 AM, wander.lairson wrote:
> 2011/6/2 Elab<[email protected]>:
>
> [snip]
>
>> My code is simply:
>>
>> import usb.core as core
>>
>> usbDevice = core.find()
> How can you be sure your device has been returned here?
>
>> usbDevice.set_configuration()
>> rawRead = usbDevice.read(0x81, 5, 0, 100)
>> print(rawRead)
>>
> Wander
>
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with vRanger.
> Installation's a snap, and flexible recovery options mean your data is safe,
> secure and there when you need it. Data protection magic?
> Nope - It's vRanger. Get your free trial download today.
> http://p.sf.net/sfu/quest-sfdev2dev
> _______________________________________________
> pyusb-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyusb-users


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
pyusb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to