androidandroid-usb

Transferring data to USB Device using controlTransfer


Can anyone please explain me clearly about controlTransfer in USB Host mode. What exactly does the parameters mean.

I want to know about requestType, requestID, value and index.

controlTransfer(int requestType, int request, int value, int index, byte[] buffer, int length, int timeout)

Parameters:
requestType request type for this transaction
request request ID for this transaction
value value field for this transaction
index index field for this transaction

Thanks


Solution

  • First of all, you should check the spec regarding USB Device like Universal Serial Bus Device Class Definition for Audio Devices.

    In the spec you can easily find 'Control Request Layout' like below capture. enter image description here

    And the below link is a web page for you about USB. http://www.beyondlogic.org/usbnutshell/usb6.shtml#SetupPacket