fix(hid): show the 0x0005 device name when the receiver stores no codename - #286
fix(hid): show the 0x0005 device name when the receiver stores no codename#286samsontands wants to merge 2 commits into
Conversation
Greptile SummaryThis PR fixes devices connected via a Unifying receiver (and some Bolt pairings) showing as "Unknown device" by reading the device's own marketing name from HID++ feature
Confidence Score: 5/5Safe to merge — the change is purely additive, touching only the codename fallback on the Bolt/Unifying paths, with no risk of overriding an existing stored codename. The Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| crates/openlogi-hid/src/inventory/features.rs | Adds name: Option<String> to ProbedFeatures and reads it conditionally (want_name flag) from 0x0005 with proper trim/empty guard. Well-structured and correct. |
| crates/openlogi-hid/src/inventory/probe.rs | Both Bolt and Unifying slot probes now fall back to probe.name when the receiver-stored codename is None; the direct path correctly passes want_name = false. Logic is clean and correctly scoped. |
| crates/openlogi-hid/src/inventory/cache.rs | Adds want_name parameter to probe_or_reuse and threads it through to probe_features. Minimal, correct change; the cached ProbedFeatures now carries the name and it persists across cache hits normally. |
| README.md | Adds a Tested devices table documenting the MX Master on a Unifying receiver. |
Reviews (3): Last reviewed commit: "perf(hid): skip the 0x0005 name read on ..." | Re-trigger Greptile
…ename Unifying receivers (and some Bolt pairings) don't store a per-slot codename, so a fully-recognised device showed up as "Unknown device" in `openlogi list` and the GUI. The slot probe already reads HID++ 0x0005 for the device kind; this also reads its marketing name via `get_whole_device_name()` and uses it as the codename fallback when the receiver register has none. Behavior is unchanged whenever a stored codename exists. Verified on an original MX Master (reports "Wireless Mouse MX Master", wpid 4060) over a Unifying receiver on macOS 26: `openlogi list` now shows the model name instead of "Unknown device". Adds a Tested devices section to the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`probe_features` is shared by the Bolt, Unifying, and direct paths. The direct (BT/USB) path already uses the HID node name as the codename, so the marketing-name read (`get_whole_device_name`, several HID++ round-trips for long names) was fetched and then discarded there on every cache-miss probe. Thread a `want_name` flag so only the Bolt/Unifying paths — which can lack a stored codename — pay for it. The direct path passes `false`. Addresses review feedback on AprilNEA#286. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
079d82f to
7d4b9ec
Compare
Problem
On a Unifying receiver, a fully-recognised device shows up as "Unknown device" in
openlogi list(and the GUI device list). The display name (codename) is read only from the receiver's stored codename register (read_codename), which a Unifying receiver doesn't populate per slot — so it is alwaysNonethere, and some Bolt pairings lack it too.Fix
The slot probe already creates the HID++
0x0005(DeviceTypeAndName) feature to read the device kind. This change also reads the device's marketing name viaget_whole_device_name()and uses it as thecodenamefallback only when the receiver register returns none. When a stored codename exists, behavior is unchanged.Touched:
crates/openlogi-hid/src/inventory.rs—ProbedFeaturesgains anamefield, populated inprobe_features;probe_unifying_slotandprobe_bolt_slotusecodename.or_else(|| probe.name.clone()).Verification
Original MX Master (reports
Wireless Mouse MX Master,wpid 4060) over a Unifying receiver, macOS 26:Before:
After:
cargo fmt -p openlogi-hid -- --check,cargo clippy -p openlogi-hid --all-targets -- -D warnings, andcargo test -p openlogi-hid(61 passed) are all clean.Notes
0x2201, SmartShift0x2110, and Back/Forward/mode-shift remapping) already works — this PR is purely about the display name.🤖 Generated with Claude Code