Code example for UsbDeviceConnection

Methods: controlTransfer

0
		return false; 
	} 
	@SuppressLint("NewApi") 
	private boolean hidSetReport(byte [] data) {
		if (mConnection != null) {
			int nTransferred = mConnection.controlTransfer(
					UsbConstants.USB_TYPE_CLASS | UsbConstants.USB_DIR_OUT,		// output
					USBRQ_HID_SET_REPORT, USB_HID_REPORT_TYPE_FEATURE << 8,
					0, 
					data, data.length, 0);
			 
			return  (nTransferred > 0) ? true : false;
		} 
		return false; 
	} 
	 
	private boolean read(byte [] data) {
		return hidGetReport(data);
	} 
	 
	private boolean write(byte cmd) {