Conversation
|
…ransports A multi-transport device (e.g. G915 X LS: USB + eQuad + BTLE all supported) always got labeled "Bluetooth (direct)" on a Direct route, even when plugged in over USB, because the label was picked from the device's static, unordered transport capability flags with Bluetooth/BTLE checked first regardless of which transport was actually live this session. A Direct route already carries the vendor/product id of the HID node this session enumerated. Add DeviceModelInfo::transport_for_product_id to match that pid against the packed per-transport model_ids slots, and use it in the GUI's diagnostics connection label and gallery-card connection glyph before falling back to the old capability-flag guess. Fixes AprilNEA#1218
4ni1ak
force-pushed
the
fix/g915-connection-label
branch
from
September 15, 2026 09:02
5c08d9e to
7766a2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Directroute.Root cause
For a
Directroute, the connection label (openlogi-desktop's diagnostics report and gallery-card glyph) was picked from the device's staticDeviceTransportscapability flags — the transports the firmware merely claims to support — checking Bluetooth/BTLE before USB. A device that supports both (e.g. G915 X LS: USB + eQuad + BTLE alltrue) therefore always showed "Bluetooth (direct)", even when it was actually plugged in over USB.A
Directroute already carries the vendor/product id of the HID node this session actually enumerated. For a multi-transport device, the firmware packs a distinct PID per transport intoDeviceModelInfo::model_ids(ascending bit order: Bluetooth, BTLE, eQuad, USB), so that pid tells us exactly which transport is live right now — it just wasn't being consulted.Changes
crates/openlogi-core/src/device.rs: addDeviceModelInfo::transport_for_product_id, matching a product id against the packedmodel_idsslots, plus theModelTransportenum it returns.crates/openlogi-desktop/src/services/diagnostics.rs:connection_fornow resolves theDirect-route label viatransport_for_product_idfirst, falling back to the old capability-flag guess only when the product id matches no known slot.crates/openlogi-desktop/src/app/home.rs:connection_icon_path(gallery-card glyph) gets the same fix, for the same reason.crates/openlogi-desktop/src/app/tests.rs,crates/openlogi-core/src/device.rs(tests module),crates/openlogi-desktop/src/services/diagnostics.rs(tests module): regression tests reproducing the exact G915 X LS report from [Bug]: G915 X Lightspeed listed as bluetooth connection when connected over USB #1218 (model_ids = [0xb38a, 0x40b5, 0xc356], transports usb+equad+btle) — same model, two different live routes (USB-direct and BTLE-direct), asserting the label/icon differs correctly between them, plus fallback-path coverage for an unrecognized product id and missing model info.Testing
cargo test -p openlogi-core— 273 passedcargo test -p openlogi-desktop— 210 passedcargo fmt --all -- --check— cleancargo clippy -p openlogi-core -p openlogi-desktop --all-targets -- -D warnings— cleanFixes #1218