Android 4.0.3. USB Host - sending data via controlTransfer

I am new to Android and just got started with Android 4.0.3. which allows you to connect USB Host. I am trying to send some signal via USB to the camera, suppose it should be some characters that the camera should receive and for example start recording. I wanted to do it with controlTransfer (), but I can't figure out what each piece of logic in this method means. I've checked many forums, but everywhere I see people keep linking to it as if it's obvious. What are the request id, value and index? Or maybe there is another approach to the problem that I am not aware of. I know for sure that you can send a signal via USB from Linux terminal to this camera, and since Android has a linux kernel, perhaps the startup path should beto start a terminal and do it the Linux way? Thanks for any advice :)

+3


source to share


1 answer


controlTransfer()

is designed to send commands through the management endpoint (endpoint 0). Request id, index and value and part of the USB protocol. See http://www.beyondlogic.org/usbnutshell/usb6.shtml#SetupPacket for more information .



Do you have a protocol description for your camera? I suppose you need to use a different endpoint (as described in the camera protocol) to send characters to the camera.

+1


source







All Articles