自定义HID Feature报告描述符通讯
2026-09-24
本文链接为:http://www.usbzh.com/article/detail-1808.html ,欢迎转载,转载请附上本文链接。
Windows提供了SetFeature和GetFeature通讯,其对应的API函数HidD_SetFeature HidD_GetFeature
这样在报告描述符中,只需要增加如下即可
0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00)
0x09, 0x01, // Usage (0x01)
0xA1, 0x01, // Collection (Application)
0x85, 0x07, // Report ID (7)
0x09, 0x01, // Usage (0x01)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x3f, // Report Count (64)
0xB1, 0x02, // Feature (Data,Var,Abs)
0xC0 // End Collection
当然,也可以支持多个ReportId
// ---- Feature Report ID 7:命令帧,8 字节 ----
0x85, 0x07, // Report ID (7)
0x09, 0x01, // Usage (0x01)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x40, // Report Count (8)
0xb1, 0x02, // Feature (Data,Var,Abs)
// ---- Feature Report ID 8:数据帧,64 字节 ----
0x85, 0x08, // Report ID (8)
0x09, 0x02, // Usage (0x02)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x40, // Report Count (64)
0xb1, 0x02, // Feature (Data,Var,Abs)
0xC0 // End Collection
本文链接为:http://www.usbzh.com/article/detail-1808.html ,欢迎转载,转载请附上本文链接。
HID人机交互QQ群:564808376
UAC音频QQ群:218581009
UVC相机QQ群:331552032
BOT&UASP大容量存储QQ群:258159197
STC-USB单片机QQ群:315457461
USB技术交流QQ群2:580684376
USB技术交流QQ群:952873936 USB技术交流3:1031974172
HID报表描述符大全及实例分析





