0x05转换成二进制,就是0000 01001,按照HID类协议5.3 generic item format的定义,这个字节被分成3个部分,bit0~bit1代表的是这个前缀后面跟的数据长度,两位可以表示最大4字节的数据,即bsize;bit2~bit3代表的是这个前缀的类型,总共可以有三种类型:0=main,1=global,2=local,3=reserved;bit4~bit7代表前缀的tag,...
SP_DEVICE_INTERFACE_DATA DeviceInterfaceData; PSP_DEVICE_INTERFACE_DETAIL_DATA DeviceInterfaceDetailData; //PSP_DEVICE_INTERFACE_DETAIL_DATA test; //第一步:获取deviceID GUID deviceId; HidD_GetHidGuid(&deviceId); //第二步:获取设备信息 HDEVINFO handle; handle = SetupDiGetClassDevs(&deviceId, NULL, ...
过程分成3步:1: 列举出所有的HID设备,2: 循环读取HID设备数据,3: 向HID设备写数据,下面我把三部分的程序单独分开,方便大家学习! 在讲具体程序之前,先说一下visual studio的环境配置(我用的是2008版本)! 首先建立一个MFC dialog程序,然后进行配置。 Tools->Options->VC++ Directories Platform (Win32) 第一步...
HID 设备的最大传输速度有限制。主机可以保证低速的中断端点每 10ms 内最多 1 笔事务,每一秒最多是 800B。保证全速端点每 lms 一笔事务,每一秒最多是 64000B。 保证高速端点每 125 us 三笔事务,每一秒最多是 。 HID 设备没有保证的传输速率。如果设备是设置在 10ms 的时距,事务之间的时间 可...
HID 1.11规范 The HID Subclass 1 defines two descriptors for Boot Devices. Devices may append additional data to these boot reports, but the first 8 bytes of keyboard reports and the first 3 bytes of mouse reports must conform to the format defined by the Boot Report descriptor in order for...
连接成功后,你可以开始读取数据。使用以下代码从USB HID设备读取输入: publicvoidread(){byte[]buffer=newbyte[64];// 定义一个字节数组用于接收数据intbytesRead=hidDevice.read(buffer);// 从设备读取数据if(bytesRead>0){// 处理读取到的数据System.out.println("Data received: "+byteArrayToHex(buffer));...
5、a->cbSize=sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);DeviceInfoData.cbSize=s第一步:列举所有的HID设备:m_ctllHIDdevices.ResetContent(); /这是MFC里面一个list控件,用来显示所有的HID设备的,如果你没有界面,可以不需要此行UpdateData(FALSE); /更新界面CString temp;int Count = 0; /Total number of de...
No. Hard drives are mass storage devices and, as such, have some form of data format provisions. For the devices to work, as opposed to just recognize each other, the file and interface protocols must also match. For example, a thumb drive is a basic mass storage application, but the ...
9. USB红外触摸屏的HID描述符定义了它的数据格式和通信协议。 The HID descriptor of the USB infrared touch screen defines its data format and communication protocol. 10.它通过USB传输触摸坐标数据和手势信息,实现与设备的交互。 It transmits touch coordinate data and gesture information through USB, realiz...
枚举HID设备时,找到了指定的HID设备(也即通过CreateFile()获得了句柄hDeviceHandle),即可通过上一篇博客中所述的三种方法之一进行通信。 我使用YIE002设计的HID设备中,三种通信方式都允许进行16字节的交换。也即设计的输入报告、输出报告和功能报告,其数据正文都是16字节的。