Following the simple tutorial I'm able to connect to device (usb optical mouse with ADNS-5000 chip inside) and make a bulkTransfer.
UsbInterface intf = device.getInterface(0);
UsbEndpoint endpoint = intf.getEndpoint(0);
UsbDeviceConnection connection = manager.openDevice(device);
connection.claimInterface(intf, forceClaim);
connection.bulkTransfer(endpoint, bytes, bytes.length, TIMEOUT); //do in another thread
ADNS-5000 spec (can be googled out) defines some set of "USB Commands" among which there is for example:
Mnemonic: Get_Status_Device
Command: 80 00 00 00 00 00 02 00
Notes: Normally returns 00 00, Self powered 00 00, Remote wakeup 02 00
So I understand it like: when I write data:
private byte[] bytes = {(byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00};
to the device I should get either 0x00, 0x00
or 0x00, 0x00
(this is probably an error in spec as this byte sequence is defined as result for two different statuses) or 0x20, 0x00
in return, but I don't see any way the api returns anything, am I right?