On Tue, Apr 26, 2011 at 8:34 AM, Prashant Patel <prash...@wipath.co.nz> wrote: > Hi, > > I am new to PyUSB and libusb-win32. I am trying to send data to my HID > device to turn LED ON/OFF along with some characters to display on LCD on > the Device. As my HID Device got the ready made code from Renesas Rx62N USB > Device API. It is working fine.
How do you know it is working fine? Have you tested it with any host program? For example: you can try out SimpleHIDWrite as a testing tool. http://www.lvr.com/hidpage.htm > And Even PyUSB device can read the fields of > device descriptor, configuration descriptor, interface descriptor and > endpoint descriptor. > > Now I want to send 17bytes of data to my device. My device got only > Interrupt IN Endpoint-3. So I think I need to use Control Transfer to send > data to my device. If you only have IN EP3 and you do not have an Interrupt Out Endpoint, then yes you need to use Control transfer for OUT report. > I tried a lot different ways but it is giving me error on > the following line. > I have tried other bmRequestType but does not work. > dev.ctrl_transfer(bmRequestType=0x42, bRequest=0x09, wValue=0x02, > wIndex=0x00, data_or_wLength=msg, timeout=100) In order for this to work, your firmware needs to support this request. And I think you want to use Set_Report request? Right? You may want to read the HID Class specification first. http://www.usb.org/developers/devclass_docs/HID1_11.pdf 7.2.2 Set_Report Request The Set_Report request allows the host to send a report to the device, possibly setting the state of input, output, or feature controls. Part Description bmRequestType 00100001 bRequest SET_REPORT (9) wValue Report Type and Report ID wIndex Interface wLength Report Length Data Report > raise USBError(errmsg) > usb.core.USBError: libusb0-dll:err [control_msg] sending control message > failed, win error: A device attached to the system is not functioning. > > I have attached the descriptor files along with the file of my code. > > Please guide me, what should I do to get it working. Or where am I wrong? I think you need to work on the firmware first before trying out pyusb. -- Xiaofan ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users