Reputation: 11053
I am trying to get bulkTransfer to work in USB host mode but the reference docs do not really explain it well.
When calling
bufferTmpLen = mDeviceConnection.bulkTransfer(mEPIN,
bufferTmp, 4096, TIMEOUT_MS);
I am really confused that such important information about this method is not described anywhere.
Please let me know if there is a better source than the standard ref.
Many thank!
Upvotes: 1
Views: 2278
Reputation: 23819
The timeout is the maximum time to wait on a response before giving up. If a response comes sooner, the method finishes sooner. You may get back less than 4096 bytes. Worst case, five seconds elapses, during which time your thread is blocked, and finally the method returns -1 to indicate failure.
As for the first two bytes, there is nothing special about them. It just depends on the specifics of what the device chooses to communicate over this endpoint.
Upvotes: 5