On Wed, Jun 13, 2012 at 7:04 PM, Toby Gray <toby.g...@realvnc.com> wrote: > Sorry, my email client decided to send that email as HTML. > > Here is the contents as plain text: > > > On 13/06/12 11:13, Toby Gray wrote: >> >> Hi, >> >> I've been trying to use libusbx to connect to an Android device via the >> Android Open Accessory protocol. The Windows machine (as USB host) is >> treated as an accessory to the Android device. >> >> Details of the protocol can be found here: >> http://developer.android.com/guide/topics/usb/adk.html#accessory-protocol >> >> The problematic step I'm having is with the SET_CONFIGURATION described in >> " Establish communication with the device" >> >> libusbx currently will automatically complete any attempt to set the >> configuration to the currently active configuration. This is problematic as >> it means the device never sees the SET_CONFIGURATION message. >> >> The attached patch fixes this by allowing the SET_CONFIGURATION message to >> be sent on the bus if it matches the currently active configuration. >> >> Would this be a change considered for inclusion in v1.0.13 of libusbx? Or >> is there a reason for the current behavior, other than just avoiding >> unnecessary bus activity?
I believe one of the reason is that some device chock on this request. On the other hand, I think your patch is not necessary. If the SET_CONFIGURATION control request is really desired for your device, you can do that with the explicit control request. >> The rest of this email is some extra information about the Android Open >> Accessory protocol and why the device needs to see the SET_CONFIGURATION >> transfer. >> >> You might be wondering why the Android device needs to see multiple >> SET_CONFIGURATION messages, as Windows will have sent it one when >> configuration the device when it was first plugged in. The reason for this >> is that the Android side API for the Android Open Accessory Protocol looks >> like a socket based API. >> >> Once you've opened, used and then closed the accessory (in your Android >> code) on the device then you can't open the accessory again until the device >> has sent another SET_CONFIGURATION message. -- Xiaofan ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel