hidi2c: fix command protocol - #955
Merged
williampMSFT merged 4 commits intoSep 4, 2026
Merged
Conversation
This change fixes two bugs in the HID-I2C command protocol: 1. In the GET_REPORT path, we weren't listening for a read request before responding with the report payload. On some HALs, this causes the bytes you write to be dropped and never get transmitted over the bus. 2. In the SET_REPORT path, when not using implicit report IDs, the host actually writes the report ID twice; once in the command register and again in the data register. We were not accounting for the second write as the first byte in the data register.
williampMSFT
marked this pull request as ready for review
September 4, 2026 20:19
williampMSFT
requested review from
RobertZ2011,
felipebalbi,
kurtjd and
tullom
and
a lite review from Copilot
September 4, 2026 20:19
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new GET_REPORT pre-listen does not validate that the next bus event is actually a read request, which can lead to incorrect behavior/timeouts on unexpected request types.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes HID-I2C command protocol handling in the target service to better match host/HAL transaction ordering and report payload formatting requirements.
Changes:
- GET_REPORT: wait for a controller read request before attempting to respond with the report payload.
- SET_REPORT: when report IDs are not implicit, skip the duplicated report ID byte present in the data-register payload.
File summaries
| File | Description |
|---|---|
| hidi2c-target-service/src/service.rs | Adjusts GET_REPORT response sequencing and SET_REPORT payload parsing to match HID-I2C command protocol expectations. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kurtjd
previously approved these changes
Sep 4, 2026
kurtjd
approved these changes
Sep 4, 2026
RobertZ2011
approved these changes
Sep 4, 2026
williampMSFT
merged commit Sep 4, 2026
95f81fb
into
OpenDevicePartnership:main
15 of 16 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change fixes two bugs in the HID-I2C command protocol: