// #Utility functions
private int sendControlTransfer(byte requestType, byte request,
short value, short index, byte[] data) {
UsbControlIrp irp = mUsbDevice.createUsbControlIrp(requestType,
request, value, index);
if (data != null)
irp.setData(data);
try {
mUsbDevice.syncSubmit(irp);
} catch (Exception e) {
log.error("Failed to send Usb Control", e);
return -1;
}
return irp.getActualLength();
}