Place USB Bluetooth dongle in its physical Overview slot - #60
Merged
Conversation
The Overview slot table only matched serial ttys, so a USB Bluetooth dongle left its declared slot rendering empty while showing as a separate peripheral row keyed by its hci name. Expose the USB port path on each radio and have the Overview promote a slotted peripheral into the declared slot it occupies, keeping USB rows in fixed hardware order. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Unit-test hardware_rows/2 promotion and ordering directly (the host test env has no declared slots, so a live mount can't reach that path), add a defensive catch-all to the row dispatcher, clarify the promotion guard, and return a named map from classify_bus/3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
A USB Bluetooth dongle physically occupies one of the Pi's declared USB-A slots (e.g.
1-1.1.2), but the Overview hardware table only matched serial ttys into slots. So the dongle's slot rendered empty while the dongle itself showed up as a separate, placeless peripheral row keyed by itshciname (hci1). On the rpi3 you'd see an emptyUSB 1 / 1-1.1.2row and a disconnected-lookinghci1row.Fix
radios.ex—Radios.enumerate/0now exposes a structuredportfield (the USB receptacle path like"1-1.1.2", ornil) on each radio, parsed from the same sysfs path the display string already used.overview_live.ex— newhardware_rows/2builds a single ordered, tagged row list and promotes a peripheral whoseslot_submatches an empty declared slot into that slot's position, inheriting itsUSB Nlabel. USB rows stay in fixed declared-hardware order regardless of which device fills them; the phantom empty row is gone. Audio cards and unmatched dongles trail at the end. A smallhardware_row/1dispatcher renders each tagged row.Result on the Overview:
USB 1 / 1-1.1.2→ the Bluetooth dongle (links to the Bluetooth tab), followed by the remaining empty slots in order.Testing
hardware_rows/2unit-tested directly (promotion, declared ordering, connected-port protection, audio/unmatched-dongle trailing).credo --strict,mix format, anddialyzerall clean.USB 1 / 1-1.1.2in declared order with no strayhci1row.🤖 Generated with Claude Code