Skip to content

feat(corsair): add SCIMITAR RGB ELITE to the Bragi driver - #231

Open
Oricul wants to merge 1 commit into
OpenMouse-Project:mainfrom
Oricul:add-corsair-scimitar-rgb-elite
Open

Oricul wants to merge 1 commit into
OpenMouse-Project:mainfrom
Oricul:add-corsair-scimitar-rgb-elite

Conversation

@Oricul

@Oricul Oricul commented Oct 15, 2026 •

Copy link
Copy Markdown

What this adds

The wired Corsair SCIMITAR RGB ELITE (USB 0x1b1c:0x1be3) speaks the Bragi protocol
the repo already has for the IRONCLAW RGB WIRELESS, so this adds it to that codec and
driver rather than introducing a new one. Read-only, like the existing Bragi driver.

  • Table entry: name, DPI 100–18,000, 128-byte reports (the IRONCLAW's are 64), command
    collection usage 0x01. CorsairBragiMouse gains an optional packetSize (default 64,
    so existing entries are unchanged); corsairBragiPacket's signature is unchanged
    (corsairBragiPacketOfSize is new) and the get/setDpi encoders take an optional size
    that defaults to 64. No existing export changes meaning, and nothing in openmouse
    uses the types touched.
  • New properties: 0x02 brightness, 0x07 angle snapping, 0x4f active DPI stage.
  • Encoders for polling rate, brightness, angle snapping (tested against the capture; the
    driver does not send them). Decoders for brightness percent and angle snapping.
  • Driver reads firmware, mode, DPI X/Y, polling rate, angle snapping, brightness and the
    active stage. The three extra reads are opt-in per mouse (extraProperties), so the
    IRONCLAW's request sequence is unchanged.
  • The picker filter for this PID also pins usage: 1, so the input-only 0xFF42:2
    interface is not offered.

Evidence

  • captures/corsair-scimitar-rgb-elite/: properties.hex (219 request/reply pairs from
    iCUE, the handshake and DPI, polling, brightness and angle-snapping changes),
    usb-descriptors.txt, README. No serial numbers; other devices on the bus, the lighting
    stream and the on-board profile transfer are left out.
  • Capture method: iCUE on Windows 11 in a VM with the mouse passed through; usbmon on the
    host. iCUE's version was not recorded.

Tested on hardware

One unit, wired, firmware 1.2.21 (as iCUE reports it), mouse in hardware mode:

  • Direct HID reads and writes with iCUE closed (Linux hidraw), not through the app:
    • all GETs in the fixture answer; live DPI SET reads back and is lost on replug
    • polling rate, brightness and angle snapping are stored across a replug
    • DPI range 100–18,000 (the mouse answers status 1 outside it)
    • GET 4f follows the DPI button
  • In OpenMouse (Chrome 152, Linux, this branch's build via the local package): the mouse
    is found in the picker, connects, shows name, Wired, DPI 800, 1,000 Hz; DPI follows the
    physical DPI button on the 30 s refresh. The driver sent only GETs.
  • Rebased onto current main (54c68c6). npm run check in mouse-protocol (2,659 tests) and in openmouse with the local package (400 tests) pass on the rebased branch.

OpenMouse

No matching openmouse PR is needed: CorsairBragiHidClient is already registered and in
NEEDS_OPEN, and the picker filter comes from the table. openmouse builds and its tests
pass with this branch installed as the local package. For information: the landing-page
list shows "Scimitar RGB Elite" as "Driver Needed"; I haven't touched it.

Not verified / assumptions

  • Only this PID and firmware; the wireless SCIMITAR models and receivers are not covered.
  • Property 03 is read as 1 = hardware / 2 = software per the existing table; iCUE writes
    2, 1, 2 at connect and why is unknown.
  • 0x14, 0x50, 0x51 read back values whose meaning is unknown; they are not named.
  • 08 01 6e (what iCUE sends when a Device Memory Mode slot is selected) is acked with
    status 5 and GET 6e is also 5, so it is not shown to switch slots; left out.
  • Lighting and the on-board profile storage were observed but are not implemented here.
  • The product artwork is a separate request (artwork discussion), not part of this PR.

Notes

  • This change was written with AI assistance (Claude Code); the hardware tests above were
    run on the contributor's own mouse.

Summary by CodeRabbit

  • New Features

    • Added support for the wired Corsair SCIMITAR RGB ELITE, including detection and display of available DPI stage, brightness, and angle-snapping status.
    • Added control encoding for polling rate, brightness, and angle snapping, with validation for supported values.
  • Documentation

    • Added device setup observations and USB capture details, including supported ranges and known limitations.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: OpenMouse-Project/mouse-protocol/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0304e788-78c0-496b-b77e-185090acab84
📥 Commits

Reviewing files that changed from the base of the PR and between e53af6d and 7542fa0.

📒 Files selected for processing: 8
  • captures/corsair-scimitar-rgb-elite/README.md
  • captures/corsair-scimitar-rgb-elite/properties.hex
  • captures/corsair-scimitar-rgb-elite/usb-descriptors.txt
  • src/corsair/bragi-scimitar.test.ts
  • src/corsair/bragi.ts
  • src/drivers/corsair/bragi-hid.test.ts
  • src/drivers/corsair/bragi-hid.ts
  • src/drivers/vendors.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Adds capture-backed Bragi protocol support for the wired SCIMITAR RGB ELITE. The driver uses its 128-byte report size, reads listed extra properties, and includes available values in status output.

Changes: SCIMITAR RGB ELITE support

Layer / File(s) Summary
Capture-backed device contract
captures/corsair-scimitar-rgb-elite/*, src/corsair/bragi.ts
Adds USB descriptor and property-traffic captures, documents observed behavior and capture limits, and adds the mouse’s report size, command usage, and extra properties to the Bragi table.
Sized packets and property conversions
src/corsair/bragi.ts, src/corsair/bragi-scimitar.test.ts
Adds size-parameterized packet construction, encoders and decoders for the supported properties, and tests against captured request and reply frames.
HID discovery and status reads
src/drivers/corsair/bragi-hid.ts, src/drivers/corsair/bragi-hid.test.ts, src/drivers/vendors.ts
Uses product command usage in HID filtering and per-device report size in requests. Reads listed extra properties and tests status output, optional responses, and IRONCLAW behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CORSAIR_BRAGI_HID_FILTERS
  participant CORSAIR_BRAGI_MICE
  participant BragiHID
  participant SCIMITAR_RGB_ELITE
  CORSAIR_BRAGI_HID_FILTERS->>CORSAIR_BRAGI_MICE: Read product commandUsage
  BragiHID->>CORSAIR_BRAGI_MICE: Read packetSize and extraProperties
  BragiHID->>SCIMITAR_RGB_ELITE: Send 128-byte GET requests for listed properties
  SCIMITAR_RGB_ELITE-->>BragiHID: Return property values
  BragiHID-->>BragiHID: Add available values to status
Loading

Suggested reviewers: ydw1904

Merge Risk: ⚪ Minimal · up to 7542f

The wired SCIMITAR support appears ready to merge after normal checks; no actionable issue remains identified.

Security architecture risk: 🔵 Low · up to 7542f

The change expands which USB mouse can supply status data while keeping support read-only. No introduced security vulnerability was established. Residual uncertainty concerns delayed responses, reconnect handling and untested firmware variants.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — On the inspected production path, externally supplied bytes enter through a HIDDevice handle and become mouse status. The new product identity broadens compatible-device reachability, but does not add a configuration-write operation or privilege grant. A malicious or competing report producer can affect status correctness; no downstream security-sensitive decision was established.

Trust Boundaries and Controls

  • observed — The picker pins the SCIMITAR to Corsair VID, its PID, page 0xff42 and usage 1. Runtime support separately requires a known product and an output-capable collection on that page, rather than checking command usage itself. Replies require minimum length, matching slot and command, and successful status; these checks are protocol validation, not device authentication.

Resilience and Maintainability Implications

  • inferred — The existing protocol cannot distinguish a late response to a timed-out GET from a subsequent GET using the same slot and command. Close also removes the listener without joining the read queue. Base-to-head comparison leaves both mechanisms unchanged. The additional reads extend the active window, but no materially worsened security outcome was established; external close/read sequencing remains unproven.
Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. (3 skipped: 3 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding the wired Corsair SCIMITAR RGB ELITE to the Bragi driver.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. (3 skipped: 3 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added type: enhancement PR title category: enhancement area: protocol Protocol codecs and shared types area: drivers Device drivers and transport integration area: tests Protocol and driver tests area: captures Protocol captures and device evidence area: documentation Documentation labels Oct 15, 2026
@Oricul
Oricul marked this pull request as ready for review October 15, 2026 19:02
The wired SCIMITAR RGB ELITE (USB 0x1b1c:0x1be3) speaks the Bragi protocol
the IRONCLAW RGB WIRELESS already uses, so it joins that codec and driver
instead of getting a new one. The driver stays read-only.

- Table entry with the mouse's 128-byte reports (the IRONCLAW's are 64), DPI
  range 100-18,000 and command usage 0x01. CorsairBragiMouse gains an optional
  packetSize that defaults to 64, so existing entries are unchanged.
  corsairBragiPacket keeps its signature and corsairBragiPacketOfSize is new.
- New properties: 0x02 brightness, 0x07 angle snapping, 0x4f active DPI stage.
  Encoders for polling rate, brightness and angle snapping are tested against
  the capture but not sent by the driver.
- The driver reads firmware, mode, DPI X/Y, polling rate, angle snapping,
  brightness and the active stage. The extra reads are opt-in per mouse, so
  the IRONCLAW's request sequence is unchanged.
- The picker filter for this PID pins usage 1, which excludes the input-only
  0xFF42:2 interface.

Evidence: captures/corsair-scimitar-rgb-elite/ (iCUE property traffic, USB
descriptors, README). Checked on one unit, firmware 1.2.21: direct HID reads
and writes with iCUE closed, and the driver in OpenMouse on Chrome/Linux.
Live DPI writes are volatile; polling rate, brightness and angle snapping are
stored. See the README for what is not verified.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Oricul
Oricul force-pushed the add-corsair-scimitar-rgb-elite branch from 7542fa0 to 67014aa Compare October 19, 2026 14:00
@Oricul

Oricul commented Oct 19, 2026

Copy link
Copy Markdown
Author

Rebased onto current main (54c68c6); the patch is unchanged. Full check passes on the rebased branch (2,659 tests), as does openmouse against the local package (400 tests).

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

Labels

area: captures Protocol captures and device evidence area: documentation Documentation area: drivers Device drivers and transport integration area: protocol Protocol codecs and shared types area: tests Protocol and driver tests type: enhancement PR title category: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant