fix: read a DualSense over Bluetooth whatever its report padding - #132
Merged
Merged
Conversation
The DualSense's basic Bluetooth report has the same ID (0x01) as the USB report but a different layout; the reader told them apart by the size of the bytes read (>= 64 = USB). When Windows hands the report back padded to the declared Bluetooth size (78), the basic report was parsed with the USB offsets and every button read as released. Decide by the size the HID descriptor declares instead, and log the first report of each pad (ID, size, declared size) and any unknown report ID, so a pad that reads wrong can be diagnosed from consolemode.log. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes The PR updates Sony HID report parsing and documents Bluetooth/USB verification for DualSense controllers.
- Report layout selection: Uses the declared HID input report size to distinguish padded basic Bluetooth reports from the DualSense USB layout, and adds report diagnostics.
- Coverage and manual checks: Adds parser tests plus Portuguese/English changelog entries and DualSense Bluetooth/USB checks in
docs/TESTING.md.
GPT Luna | 𝕏
lippdev
approved these changes
Oct 1, 2026
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.

Summary
A DualSense over Bluetooth could read as "no buttons pressed" in the places that depend on
SonyHidReader(the session menu over a game, the shortcuts).The reader told the DualSense's two report layouts apart by the size of the bytes read: report ID
0x01with at least 64 bytes was parsed as the USB layout (buttons at offset 8). But the DualSense's basic Bluetooth report has the same ID (0x01, buttons at offset 5), and ReadFile may hand every report back padded to the size the HID descriptor declares (78 over Bluetooth, report0x31). Padded, the basic report was parsed with the USB offsets and every button read as released. Over Bluetooth the pad stays in this basic mode unless something else switches it, so the reader never saw it.ControllerMapping.SonyButtonstakes the declared input report length (HIDP_CAPS.InputReportByteLength, new optional parameter, default 0 = old behaviour) and treats ID0x01as USB only when that length is 64 (or unknown) and the data is ≥ 64 bytes. The padding no longer matters; the DS4 and USB layouts are unchanged.SonyHidReaderpasses the declared length and now logs, once per pad, the first report (ID, size, declared size) and any unknown report ID, so a pad that reads wrong can be diagnosed fromconsolemode.logalone.docs/TESTING.md: DualSense over Bluetooth/USB checks and the new log line.Validation
ControllerMappingTests: the basic Bluetooth report as 10 bytes and padded to 78, the USB report with a declared size of 64, and the known report IDs; the existing layout tests still pass.dotnet testare left to CI.🤖 Generated with Claude Code