Skip to content

feat: support the Logitech G502 X PLUS - #29

Merged
PyFlat-JR merged 3 commits into
mainfrom
feature/logitech-g502-x-plus
Oct 16, 2026
Merged

PyFlat-JR merged 3 commits into
mainfrom
feature/logitech-g502-x-plus

Conversation

@PyFlat-JR

Copy link
Copy Markdown
Member

What does this PR do?

Adds the Logitech G502 X PLUS (receiver C547, cable C095) to the existing HID++ mouse protocol, and makes HID probing robust against a second receiver with the same product id. Part of #25.

  • Model: one line in LogitechProtocol.Devices. The mouse answers HID++ 0x1004 (unified battery) at device index 1 over the receiver and over the cable, exactly like the G Pro X Superlight 2.
  • Shared receiver fix: C547 is not unique to this mouse; other Logitech devices ship with the same receiver. When no candidate answered the short probe, HidFamily fell back to the first candidate, which could be another device's receiver. Every read then failed with "The device does not have that battery feature." Now a candidate that answered as a different device (NotSupportedException) is never the fallback. A candidate that only timed out still is. A new HidFamilyTests case covers it and fails without the fix.
  • Hardware tests:
    • New Lists_the_hidpp_features_of_every_logitech_device prints each Logitech HID++ device's name and feature table at device index 1 and 0xFF.
    • Reads_every_supported_hid_device_through_the_plugin now prints a probe line for each candidate it skipped, with the reason.
  • Linux: udev lines for c547 and c095, plus their copy in docs/linux-setup.md.
  • Docs: a README supported-devices row, and the fallback rule in AGENTS.md.

Checklist

  • I have read AGENTS.md and CONTRIBUTING.md.
  • dotnet build and dotnet test pass locally (0 warnings, 317 tests).
  • I updated README.md / AGENTS.md if this changes what they describe.
  • If this touches a device backend: I tested it against the real hardware (see below).

Device/hardware tested against (if applicable)

The mouse's owner (@ReqwiemG) tested it in #25 on Windows, with G HUB running:

  • Cable only: 91% Charging, matching G HUB.
  • Receiver: 91% Discharging, matching G HUB.
  • Receiver, with a second C547 receiver for another device plugged in, after the fallback fix: 91% Discharging, matching G HUB. The other receiver timed out in the probe, and the mouse's receiver answered.
  • Before the fix, that two-receiver setup failed with "The device does not have that battery feature."

@PyFlat-JR
PyFlat-JR force-pushed the feature/logitech-g502-x-plus branch from 1b37e9b to b0be9e3 Compare October 16, 2026 15:56
@PyFlat-JR
PyFlat-JR merged commit 175981f into main Oct 16, 2026
3 checks passed
@PyFlat-JR
PyFlat-JR deleted the feature/logitech-g502-x-plus branch October 16, 2026 15:59
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