资源说明:主要研究usb host的数据传送问题,里面有对 相关usb传送关系进行解析,并对 关键函数 :
//first field ox21 is bin 00100001 which splits into 0 01 00001 for
direction(1bit)/type(2b)/recipient(5b)
//To set direction as 'host to Device' we need 0, To set type to HID we need 11 (3), and for recipient we want 00001
//second field 0x09 is class specific request code, 0x09 is listed as 'reserved for future use'
//third field 0x200 is value
//int transfer = mConnectionRead.controlTransfer(0x21, 0x9, 0x200, 0, message, message.length, 0);
//try with type set to HID
int transfer = mConnectionRead.controlTransfer(0xC1, 0x9, 0x200, 0, message, message.length, 0);
controlTransfer(USB_DIR_OUT, VENDOR_DEFINED_REQUEST, VENDOR_DEFINED_VALUE, USB_INTERFACE_INDEX, message, message.length, 1000);
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。