2011/1/15 Sridev Nair <sksridevn...@gmail.com>:
> Thank you for the pointers, Manu & Wander!
> Now I have a better understanding. However, this simple control message code
> is throwing up the error,
> ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: wrong type
> Tried all tricks, still am I missing something? Any help appreciated
> Best Regards,
> Sridev
> -------Code -------------
> import usb
> buses = usb.busses()
> for bus in buses:
>    for device in bus.devices:
>        if device.idVendor == 0x10C4 and device.idProduct == 0x81f2:
>            reader = device
> readerHandler = reader.open()
> readerHandler.setConfiguration(1)
> readerHandler.claimInterface(0)
> #get reader info command - first command as per vendor docs - hex string
> msg_str = "020200013803"
> data = 64
> results = readerHandler.controlMsg(64, msg_str, data, timeout=1000)
>
The correct prototype for the method controlMsg is
controlMsg(requestType, request, buffer, value = 0, index = 0, timeout
= 100),
thus you should at least supply the requestType and request
parameters, which is not happening here. Notice that request value is
a value meaningful only to your request, but requestType is bit field
value with format specified in the USB spec.

-- 
Best Regards,
Wander Lairson Costa
LCoN - Laboratório de Computação Natural - Natural Computing Laboratory
(http://www.mackenzie.com.br/lcon.html)
Programa de Pós-Graduação em Engenharia Elétrica (PPGEE)
Faculdade de Computação e Informática (FCI)
Universidade Presbiteriana Mackenzie - SP - Brazil

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to