RT-Thread / RT-Thread/rt-thread
usb device bInterfaceProtocol 字段配置错误
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
usb device 中 HID 设备配置 bInterfaceProtocol 字段时错误(hid.c 文件第 314 行)
所有判断条件取或,导致只使能键盘设备或只使能鼠标设备时设备端 bInterfaceProtocol 描述符字段始终为 0,hid host设备无法判断 hid 设备类型,是否应该更改为判断条件取与。
主机端和设备端 USB 配置情况如下:
另外,是否计划添加对主机端自定义 hid 设备的支持(设备端现在存在自定义 hid,主机端好像不支持)。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading hid.c around line 314 and compare the bInterfaceProtocol conditions for keyboard-only and mouse-only device configurations. Confirm whether the current logic produces zero and determine the intended condition from the HID descriptor behavior. Done means the descriptor reports the correct protocol for each configuration; the separate custom HID host-support question remains outside this fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100