I have a game controller connected to my Android device which has 1 interface with a interrupt in endpoint. I know that Android does list endpoint 0 (the control endpoint) when it enumerates endpoints and I know that I can make a control transfer to endpoint 0 by just sending it through any of the other endpoints.
My question is: Do I need to claim an interface (any interface), before I make this control transfer? Does the Android framework require that you gain exclusive access to the interface before talking to endpoint 0, which technically doesn't belong to any interface?
Yes. You'll see that without force claiming the interface, any call of controlTransfer
fails.
Unfortunately, claiming disconnects the USB device from kernel driver. So, if you thought of e.g. changing the resolution of a USB mouse while using it, you'll notice that after changing, the mouse is no longer controlling your Android device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With