Skip to content

feat(attackshark): implement 0x25a7 GearHub protocol for X8 SE - #30

Merged
jazzstack merged 1 commit into
OpenMouse-Project:mainfrom
jazzstack:main
Aug 17, 2026
Merged

feat(attackshark): implement 0x25a7 GearHub protocol for X8 SE#30
jazzstack merged 1 commit into
OpenMouse-Project:mainfrom
jazzstack:main

Conversation

@jazzstack

Copy link
Copy Markdown
Contributor

Summary

Reverse-engineered the Attack Shark 0x25a7 protocol from the qmk.top GearHub web driver JS bundle and implemented it in the Attack Shark HID client.

Changes

  • checksum25a7() and encodeReport25a7() — GearHub command encoding with one's-complement checksum
  • POLLING_CODES_25A7 — maps 125/250/500/1k/2k/4k/8k Hz to protocol byte codes
  • getFirmware25a7() — reads firmware version via command 0x80
  • getDpi25a7() — reads DPI slots via command 0xD4 (profile param)
  • write25a7PollingRate() — sets polling rate via command 0x04
  • read25a7Status() — full device initialization (firmware + DPI + polling)
  • 4 new unit tests for checksum computation and polling code mapping

Protocol Details

  • HID feature reports on report ID 0x00, 64 bytes
  • Commands padded to 9 bytes, checksum at byte[7] = 255 - (sum(bytes[0..6]) & 255)
  • Command IDs: 0x80 (get firmware), 0xD4 (get DPI), 0x54 (set DPI), 0x04 (set polling), 0x05 (set profile)

Testing

All 7 Attack Shark tests pass. Full test suite: 410/415 pass (5 pre-existing Logitech module resolution failures unrelated to this change).

Reverse-engineered from the qmk.top GearHub web driver bundle.
Adds HID feature report communication (report ID 0x00, 64 bytes) with
GearHub checksum, DPI get/set, polling rate set, and firmware version.

Key additions:
- checksum25a7() and encodeReport25a7() helpers
- POLLING_CODES_25A7 map (125/250/500/1k/2k/4k/8k Hz)
- getFirmware25a7(), getDpi25a7(), write25a7PollingRate()
- read25a7Status() for full device initialization
- 4 new unit tests for checksum and polling code mapping

Protocol: 9-byte padded commands with one's-complement checksum at
byte 7, sent as 64-byte HID feature reports on report ID 0x00.
@jazzstack
jazzstack merged commit 7a08313 into OpenMouse-Project:main Aug 17, 2026
1 check passed
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