Skip to content

feat(coolermaster): add MM711 driver and protocol codec - #153

Merged
snekxs merged 5 commits into
OpenMouse-Project:mainfrom
Xander-Coetzee:feat/coolermaster-mm711
Oct 3, 2026
Merged

snekxs merged 5 commits into
OpenMouse-Project:mainfrom
Xander-Coetzee:feat/coolermaster-mm711

Conversation

@Xander-Coetzee

@Xander-Coetzee Xander-Coetzee commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Device

Model Cooler Master MM711
USB IDs 0x2516:0x0101 (wired USB)
Connection USB Wired
Config collection usagePage 0xFF00, usage 0x0001 (Interface MI_01)
Request Report ID 0x00, 64 bytes data payload (sendReport(0, ...))
Answer Interrupt IN report (0x00 + 64 bytes) delivered to oninputreport event

What this adds

  • src/coolermaster/index.ts - pure codec: wire layouts, constants, handshake encoder, active DPI stage decoder, performance block encoder/decoder (7 DPI presets, LOD, angle snapping, angle tuning), polling rate encoder/decoder, button debounce encoder/decoder, and dual-zone RGB lighting encoders/decoders (effect mode, general effect parameters, and per-zone custom RGB).
  • src/drivers/coolermaster/hid.ts - CoolerMasterHidClient: implements SupportedClient with discovery of the 0xFF00:0x0001 control collection, timeout-protected command/response matching, a serialized async queue, performance settings round-trips, and full readLighting() / setLighting() support for two addressable zones ("Scroll wheel" and "Logo").
  • Registry and discovery: registered in src/drivers/vendors.ts and src/drivers/registry.ts, exported as ./coolermaster subpath in package.json and tsconfig.json.
  • 23 unit and driver tests in src/coolermaster/index.test.ts and src/drivers/coolermaster/hid.test.ts: verified against captured hardware fixtures, mock report dispatch, parameter boundary assertions, lighting mode / custom color assertions, and driver registry resolution.
  • Hardware captures and protocol documentation in captures/coolermaster-mm711/README.md.

Features supported

  • DPI: 7 customizable stages (100–16,000 DPI in 100 DPI steps), active stage selection, editable stage count.
  • Polling Rate: 125, 250, 500, 1000 Hz.
  • Debounce Time: 4–32 ms.
  • Sensor Controls: Lift-off distance (Low/High), angle snapping (toggle), and angle tuning (-30° to +30°).
  • RGB Lighting:
    • 2 independently addressable zones: Scroll wheel (LED 0) and Logo (LED 1).
    • 5 lighting modes:
      • Static: Independent per-zone custom RGB color picker (0x51 0xA8 + mode 0xB0).
      • Breathing single: Pulsing single color with 5-level speed control (60, 55, 49, 44, 38) and brightness.
      • Breathing random: Multi-color cycle breathing with 5-level speed control.
      • Cycling: Rainbow spectrum cycle with 5-level speed control (50, 45, 40, 35, 30) and brightness.
      • Off: Shuts off LEDs (mode 0xFE).

Evidence & Protocol Discovery

  • Sanitized USB captures recorded on 2026-10-02 (captures/coolermaster-mm711/) using Wireshark + USBPcap while changing settings in Cooler Master MasterPlus (v1.9.4).
  • Reverse-engineered lighting subcommands from MasterPlus+ DLLs/PDBs (CMUOT.dll, ParseSdk.dll):
    • 0x28: Active effect mode query & write
    • 0x2B: General effect parameters (speed, brightness, random flag, color)
    • 0xA8: Custom per-zone RGB colors
  • Confirmed live on hardware via raw HID read/write probes against 0x2516:0x0101.

Verified on hardware

readStatus() and settings round-trips verified on physical Cooler Master MM711:

Polling rate 1000 Hz (also verified 125, 250, 500 Hz)
DPI 7 stages: 400 / 800 / 1200 / 1600 / 3200 / 6400 / 16000 (Active: stage 2, 800 DPI)
Lift-off distance Low (~2mm) and High (~3mm)
Debounce 5 ms (verified 4 – 32 ms range)
Angle snapping Off (verified toggle on/off)
Angle tuning 0° (verified -30° to +30°)
Lighting Dual-zone RGB verified (Static per-zone, Breathing, Cycling, Off)
Write verification Mouse firmware immediately echoes 0x51 writes back via interrupt-IN

Safety

  • All write functions (setDpi, setPollingRate, setDebounceTime, setLiftOffDistance, setLighting, etc.) validate parameter bounds before building packets.
  • Commands are strictly serialized via Promise queue to avoid interleaving packets on the control channel.
  • Writes preserve firmware block layout using read-modify-write on cached performance payloads.

Companion PR

OpenMouse-Project/openmouse#481

- Protocol codec for Cooler Master MM711 (handshake, DPI, polling, LOD, debounce, angle snapping, angle tuning)
- Hardware captures and fixture test cases
- CoolerMasterHidClient implementing WebHID driver interface
- Driver registry and vendor filter registrations
- Comprehensive unit and mock integration test suites
Reverse-engineered lighting protocol from Cooler Master MasterPlus+ DLLs/PDBs (CMUOT, ParseSdk):

- Add subcommands: effect mode (0x28), general effect (0x2B), custom zone effect (0xA8)
- Support 2 lighting zones: 'Scroll wheel' (LED 0) and 'Logo' (LED 1)
- Support 5 lighting modes: Static (per-zone custom RGB), Breathing single, Breathing random, Cycling, and Off
- Add 5-level discrete speed tables for Breathing and Color Cycling
- Implement readLighting() and setLighting() in CoolerMasterHidClient
- Add unit tests for lighting codec functions and driver setLighting/readStatus
@snekxs
snekxs force-pushed the feat/coolermaster-mm711 branch from 9195594 to 4285e5c Compare October 3, 2026 07:22
@snekxs
snekxs merged commit 879f30a into OpenMouse-Project:main Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants