fix(unifying): enable wireless notifications so paired devices enumerate#309
Conversation
58d6a8e to
f68b17d
Compare
f68b17d to
9aff9b7
Compare
|
Addressed both review notes: the deduped connection list is now sorted by slot so device order is stable across probe cycles, and added a note on |
AprilNEA
left a comment
There was a problem hiding this comment.
This looks like the right direction overall — enabling the Unifying notification stream before trigger_device_arrival, correcting the 0x40 name base, and deduping repeated arrivals are all well-scoped, and CI is green.
One edge I’d tighten: set_wireless_notifications(true) currently writes the whole notifications register as [0, 1, 0]. That sets the wireless bit, but it also clears any other notification flags already enabled on register 0x00. In this repo, the pairing flow writes [0x00, 0x09, 0x00] (WIRELESS | SOFTWARE_PRESENT) before streaming pairing events, so an inventory poll during/near pairing could accidentally drop the software-present bit or any future notification flag.
Could we make this read-modify-write, or at least use the same named notification flag constants as pairing.rs so the intended bitmask is explicit? The rest of the PR looks good to me.
9aff9b7 to
f2b7ef5
Compare
|
Good catch — switched |
|
Can confirm this fix works. Setup: MX Master 3 (wpid On stock v0.6.19 the receiver enumerates ( Note the branch no longer applies cleanly onto v0.6.19 ( (Unrelated: occasional |
|
Confirmed that this fix works on my setup, GPT-5.6 SOL make it work:
With the stock v0.6.19 agent, every inventory cycle reported: receiver reports pairing count pairing_count=Some(1) The receiver knew that one device was paired, but trigger_device_arrival() produced no 0x41 events because wireless notifications had not been I ported this PR to the split inventory layout in the v0.6.19 tag. After enabling the WIRELESS bit in notification register 0x00 before triggering drained device-arrival events events=1 The corrected Unifying codename register (0x40 + slot - 1) also returns MX Master 3 correctly. Control capture, gesture buttons, DPI buttons, The agent is running continuously through launchd, and the mouse no longer disappears from the GUI. The OpenLogi HID and HID++ test suites also This confirms that the missing wireless-notification initialization is the root cause for this MX Master 3 / Unifying receiver combination. |
Port of AprilNEA#309 onto master (0.6.19 probe.rs layout). A device on a Unifying receiver would flap offline seconds after connecting: the receiver only re-broadcasts 0x41 arrival events while wireless notifications (register 0x00) are enabled, which was never done, so trigger_device_arrival was ACK'd but emitted nothing for already-connected devices. - hidpp: add Register::Notifications + set_wireless_notifications (RMW of the WIRELESS bit, preserving SOFTWARE_PRESENT). - probe.rs: enable wireless notifications before draining arrivals; dedup and sort arrivals per slot; derive online from the feature walk succeeding (event.online reads the wrong byte and is always set); read Unifying codenames at base 0x40 (not Bolt's 0x60) with a clamped length. - Inline unit tests for the Unifying codename parser. Verified on MX Master 3 over a Unifying receiver: surfaces online with correct codename and stays online while in use. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Port of AprilNEA#309 onto master (0.6.19 probe.rs layout). A device on a Unifying receiver would flap offline seconds after connecting: the receiver only re-broadcasts 0x41 arrival events while wireless notifications (register 0x00) are enabled, which was never done, so trigger_device_arrival was ACK'd but emitted nothing for already-connected devices. - hidpp: add Register::Notifications + set_wireless_notifications (RMW of the WIRELESS bit, preserving SOFTWARE_PRESENT). - probe.rs: enable wireless notifications before draining arrivals; dedup and sort arrivals per slot; derive online from the feature walk succeeding (event.online reads the wrong byte and is always set); read Unifying codenames at base 0x40 (not Bolt's 0x60) with a clamped length. - Inline unit tests for the Unifying codename parser. Verified on MX Master 3 over a Unifying receiver: surfaces online with correct codename and stays online while in use.
The receiver only re-broadcasts 0x41 device-arrival events while wireless notifications are on; with them off, trigger_device_arrival is ACK'd but emits nothing, so a paired online device never surfaces. Enable them (read-modify- write of just the WIRELESS bit so the pairing flow's SOFTWARE_PRESENT isn't clobbered) before draining, matching Solaar. Also on the Unifying path: - dedup the arrival burst per slot and sort by slot so a device isn't listed twice and the order stays stable across cycles; - read names from the Unifying base 0x40+(n-1) via read_codename_unifying (0x60 is Bolt-only), which works even while the device is offline; - treat a successful feature walk — not the unreliable event.online byte — as the liveness signal, always probing and reporting online = walk succeeded.
f2b7ef5 to
c882724
Compare
Summary
A device on a Unifying receiver wouldn't show up even while connected. The
receiver only re-broadcasts arrival events while wireless notifications
(register 0x00) are on, and we never enabled it — so the trigger got ACK'd
but emitted nothing. Solaar does this before listing.
Changes
"offline" here).
clamp the reported length.
Testing
Tested on an MX Master 2S over a Unifying receiver. Added unit tests for the
name parser (normal, over-long length, short response).