2012/10/1 Stefano Di Martino <stefan...@gmx.net>:
> Hi Tormod,
> ok thanks for your reply!
> Can I assume, that the address 0x40 is custom, too?
>
> If I use following code,
>
> assert dev.ctrl_transfer(0x40, usb.util.CTRL_OUT, 0, 0, msg) == len(msg)
> ret = dev.ctrl_transfer(0x40, usb.util.CTRL_IN, 0, 0, len(msg))
>
> I get the error message:
> "usb.core.USBError: [Errno None] libusb0-dll:err [control_msg] sending 
> control message failed, win error: A device attached to the system is not 
> functioning."
>
> I programmed an example that shows me the Endpoints and its directions. The 
> output is:
> EP 0x81 Direction: IN
> EP 0x1 Direction: OUT
>
> So, if I change the address like this:
>
> assert dev.ctrl_transfer(0x1, usb.util.CTRL_OUT, 0, 0, msg) == len(msg)
> ret = dev.ctrl_transfer(0x81, usb.util.CTRL_IN, 0, 0, len(msg))
>
> I get following error message:
> "usb.core.USBError: [Errno None] libusb0-dll:err [control_msg] sending 
> control message failed, win error: The parameter is incorrect."
>
> Do you know what's wrong?
>

ctrl_transfer only deals with endpoint 0, for endpoints 0x01 and 0x81,
you should use "write" and "read" methods.

-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to