I haven't been having much success in using the android.hardware.usb package in host mode. Has anyone got this working?
Here's what I'm doing:
1) Get the handle to the UsbManager, walk the device list, and select the interface and endpoint I want to communicate with.
2) Obtain permission to talk to that device.
3) Open a UsbDeviceConnection
4) Claim the interface
5) Start a thread to send data.
--- all the above completes without error ----
6) Send data via bulkTransfer. This always returns -1.
Is there any method that returns more descriptive error text? I don't think the source code for android.hardware.usb is available, so I can't look at that. Any ideas?
I'm using a Sony S1 Tablet running Android 3.2
Here's what I'm doing:
1) Get the handle to the UsbManager, walk the device list, and select the interface and endpoint I want to communicate with.
2) Obtain permission to talk to that device.
3) Open a UsbDeviceConnection
4) Claim the interface
5) Start a thread to send data.
--- all the above completes without error ----
6) Send data via bulkTransfer. This always returns -1.
Is there any method that returns more descriptive error text? I don't think the source code for android.hardware.usb is available, so I can't look at that. Any ideas?
I'm using a Sony S1 Tablet running Android 3.2