On Thu, 12 Oct 2006, zil iram wrote: > Hi, > I am using OSK and gadgetfs as usb gadget driver. I have > successfully tested enumeration, reading, writing in Linux using usb.c as > base code. However, I am having trouble with returning the DeviceId of the > device. The host that the device is connecting to needs the device ID.
You have to be more specific. What do you mean by the device ID? Are you talking about idProduct in the device descriptor? Or do you mean the iProduct string? > I > have looked at the usb.c code and in the handle_control function, I cant > seem to find a case which handles the device id request from the host, only > a case for the device string. For the device string, the setup->bRequest > should be USB_REQ_GET_DESCRIPTOR and the setup->wValue should be > USB_DT_STRING. So what should be the setup->bRequest value and > setup->wValue, when the host requests for the device id? Or, How does the > device/gadget driver send the device id string to the host? I really need > help on this. Thanks! For any string at all, setup->bRequest should be USB_REQ_GET_DESCRIPTOR, setup->wValue should have USB_DT_STRING in its high byte and the string index in its low byte, and setup->wIndex should contain the language ID. This information is all in the USB 2.0 spec, chapter 9. Alan Stern ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
