Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have a feeling it has to do with your <code>usb_sndctrlpipe</code> call. The definition of this function is as follows: <code>unsigned int usb_sndctrlpipe(struct usb_device *dev, unsigned int endpoint)</code>. </p> <p>You seem to be passing the device pointer appropriately, however your pass in the value <code>0</code> for your control endpoint, which as you mention, is not the address of your endpoint. I would recommend defining a constant at the beginning with the hex value of your endpoint and passing that to your calls.</p> <p>However, I believe you have a bigger problem.</p> <p>Looking at your lsusb, it seems that your endpoint is not actually a control endpoint, but an interrupt endpoint. This changes the functions that you need to call to communicate. For example, instead of <code>usb_sndctrlpipe</code> you will need <code>usb_rcvintpipe(struct usb_device *dev, unsigned int endpoint)</code> to generate the pipe (since it is an IN endpoint as listed in your lsusb) and use a different function instead of <code>usb_control_msg</code>. Unfortunately, from what I can gather, it seems like there are no functions available to automatically construct interrupt urbs so you will need to create a urb struct as described in section 13.3.2.1 of <a href="http://www.makelinux.net/ldd3/chp-13-sect-3" rel="nofollow">http://www.makelinux.net/ldd3/chp-13-sect-3</a>. Even worse news is that (unless I am missing something) because your only endpoint seems to be the interrupt <strong>IN</strong> endpoint, it would seem that you can only receive interrupts from the device and are not able to send anything to the device. Do you know for sure that changing the colors of the lamp via usb is a functionality supported by the device?</p> <p>More information can be found at the following: </p> <ul> <li><a href="http://www.beyondlogic.org/usbnutshell/usb4.shtml" rel="nofollow">http://www.beyondlogic.org/usbnutshell/usb4.shtml</a> (thorough information on endpoints and how to read the descriptors)</li> <li><a href="http://www.makelinux.net/ldd3/chp-13-sect-3" rel="nofollow">http://www.makelinux.net/ldd3/chp-13-sect-3</a> and </li> <li><a href="http://www.makelinux.net/ldd3/chp-13-sect-5" rel="nofollow">http://www.makelinux.net/ldd3/chp-13-sect-5</a> (function definitions for usb communication)</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload