Skip to content

Place USB Bluetooth dongle in its physical Overview slot - #60

Merged
bbangert merged 2 commits into
mainfrom
fix/overview-bt-slot-placement
Jun 14, 2026
Merged

Place USB Bluetooth dongle in its physical Overview slot#60
bbangert merged 2 commits into
mainfrom
fix/overview-bt-slot-placement

Conversation

@bbangert

Copy link
Copy Markdown
Owner

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 its hci name (hci1). On the rpi3 you'd see an empty USB 1 / 1-1.1.2 row and a disconnected-looking hci1 row.

Fix

  • radios.exRadios.enumerate/0 now exposes a structured port field (the USB receptacle path like "1-1.1.2", or nil) on each radio, parsed from the same sysfs path the display string already used.
  • overview_live.ex — new hardware_rows/2 builds a single ordered, tagged row list and promotes a peripheral whose slot_sub matches an empty declared slot into that slot's position, inheriting its USB N label. 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 small hardware_row/1 dispatcher 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/2 unit-tested directly (promotion, declared ordering, connected-port protection, audio/unmatched-dongle trailing).
  • Full suite: 490 tests + 5 doctests, 0 failures. credo --strict, mix format, and dialyzer all clean.
  • Validated on hardware (rpi3 at the bench): built, flashed, and confirmed via the live-rendered page that the dongle appears in USB 1 / 1-1.1.2 in declared order with no stray hci1 row.

🤖 Generated with Claude Code

bbangert and others added 2 commits June 14, 2026 00:58
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>
@bbangert
bbangert merged commit 8779473 into main Jun 14, 2026
6 checks passed
@bbangert
bbangert deleted the fix/overview-bt-slot-placement branch June 14, 2026 01:14
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