fix(endgame): support OP1w 4K v2 and fix WE/OP1 PID collision - #32
Merged
Conversation
Fixes #107. - Add EGG_DEVICE_PROFILES entries for PID 0x1984 (mouse) and 0x1970 (wireless dongle) — the OP1w 4K v2 was undetected because it had no device profile at all. - Disambiguate the 0x1970 collision by HID descriptor instead of PID: EggWeHidClient now excludes any device exposing the OP1-8K command feature report (0xa1), since that PID is reused by both the legacy OP1we dongle and the new OP1w 4K v2 dongle. Also closes a related gap where 0x1980 (XM2 8K v2) wasn't excluded from the WE driver. - Broaden eggNormalizeFeatureReport's wire-header detection to accept all four documented status bytes (0x01/0x03/0x07/0x08), not just OK/busy — rejected and RF-sleep replies were falling through to the byte-shifting path and corrupting the payload length calculation, which explains the reported firmware misdetection and write failures. - Add maxPollingHz to the device profile (4000 for wireless, 8000 for wired) and cap supportedPollingRates/setPollingRate accordingly. - Add regression tests for the new profiles and the descriptor-based collision fix.
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.
Fixes OpenMouse-Project/openmouse#107.
What
EGG_DEVICE_PROFILESentries for the OP1w 4K v2 (PID0x1984mouse /0x1970wireless dongle) — previously undetected entirely.0x1970PID collision: that PID is reused by both the legacy OP1we dongle (handled byEggWeHidClient) and the new OP1w 4K v2 dongle (OP1-8K v2 protocol).EggWeHidClient.isSupported()now excludes any device exposing the OP1-8K command feature report (0xa1) via descriptor check, rather than relying on PID alone. Also closes a related gap where0x1980(XM2 8K v2) wasn't excluded from the WE driver's PID set.eggNormalizeFeatureReport's wire-header detection to accept all four status bytes the reporter documented (0x01OK /0x03busy /0x07rejected /0x08RF sleep), not just OK/busy — replies with the other two statuses were falling through to the byte-shifting path, corrupting the payload length and explaining the reported firmware misdetection (V1.00 vs V1.01) and write failures.maxPollingHzto the device profile (4000 Hz wireless / 8000 Hz wired) and capssupportedPollingRates/setPollingRateby it.Not addressed
The
0x07config-store-rejection root cause and the battery data format are hardware-observation claims from the issue reporter that I couldn't independently verify without their raw HID captures — flagging here in case hardware testing still turns up write failures after this fix.Testing
npx tsx --test src/drivers/endgame/egg-op1-protocol.test.ts src/drivers/endgame/egg-we-protocol.test.ts— 19/19 passing (17 pre-existing + 2 new regression tests).🤖 Generated with Claude Code