Skip to content

glorious: fix classic-line connection and write failures on a real Model O 2 Wired - #102

Closed
onyxhq-dev wants to merge 2 commits into
OpenMouse-Project:mainfrom
onyxhq-dev:fix/glorious-classic-report-id
Closed

onyxhq-dev wants to merge 2 commits into
OpenMouse-Project:mainfrom
onyxhq-dev:fix/glorious-classic-report-id

Conversation

@onyxhq-dev

Copy link
Copy Markdown
Contributor

Fixes a real 0x320f:0x823a ("Model O 2 Wired Mouse") unit that could not connect at all, then could not write any setting once it could.

Two bugs found in sequence, both from user-submitted diagnostics rather than physical hardware:

  1. Connection failure. The driver assumed the config channel is always the unnumbered feature report (id 0), but this unit carries it as numbered report 7. isSupported()/the constructor now discover the real report id from the device's own collections at connect time instead of assuming.

  2. Every write then failed with "Failed to write the feature report." The driver builds every payload at a fixed 64 bytes (true for every previously-confirmed classic-line device), but this unit's report 7 declares a 263-byte length in its own descriptor. WebHID rejects a feature-report write whose length doesn't match the device's declared length. Payloads are now resized (truncated or zero-padded) to the discovered length before sending.

Both fixes read the real values from the device's descriptor rather than hardcoding a second assumption, so any other classic-line unit with its own report id/length combination should be covered by the same code path.

Confirmed working against the real hardware after these two fixes.

…ng 0

A real 0x320f:0x823a (Model O V2 Wired) carried its config channel as
numbered report 7, not the unnumbered report every other classic-family
device uses - isSupported() rejected it outright since the check was
hardcoded to report id 0.

Now discovered per device at connect time and used for every send/
receive call. WebHID takes the report id separately from the payload
bytes, so existing devices (report id 0) are unaffected.
Connecting to the real 0x320f:0x823a unit worked after the report-id fix,
but every write then failed with "Failed to write the feature report.":
its numbered report 7 declares a shorter byte length than the 64-byte
buffer every payload builder in glorious-classic/index.ts assumes, and
WebHID rejects a feature report whose length does not match the device's
own descriptor.

Same fix shape as the report-id discovery: read the declared length off
the same collection at connect time and resize (truncate or zero-pad)
every payload to fit before sending. The actual command bytes are always
well under the shortest length seen in practice, so truncating never
touches meaningful data.
@onyxhq-dev

Copy link
Copy Markdown
Contributor Author

Closing - the report-id/length fix connects the device and stops the write from erroring, but a diagnostic just confirmed the mouse doesn't actually apply any of it (DPI/polling rate unchanged). The 263-byte report needs its real byte layout captured before this is actually correct; reopening once that's sorted.

@onyxhq-dev onyxhq-dev closed this Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant