- UsbInterface usbInterface = usbDevice.getInterface(0);
-
- UsbEndpoint inEndpoint = usbInterface.getEndpoint(0);
- UsbEndpoint outEndpoint = usbInterface.getEndpoint(1);
- UsbDeviceConnection connection = usbManager.openDevice(usbDevice);
- connection.claimInterface(usbInterface, true);
-
-
- byte[] byte2 = new byte[64];
- int out = connection.bulkTransfer(outEndpoint, cmd, cmd.length, 3000);
-
-
- int ret = connection.bulkTransfer(inEndpoint, byte2, byte2.length, 3000);
- Log.e("ret", "ret:"+ret);
- for(Byte byte1 : byte2){
- System.err.println(byte1);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
原文:http://blog.csdn.net/centralperk/article/details/9312401
参考:http://hi.baidu.com/intel88888/item/9a194171438dd9356dc37ca7
Android 下的 USB HID 设备读写
原文:http://www.cnblogs.com/blueice-007/p/3534338.html