feat(ui): detect USB-CDC connection for Auto mute (BLE or USB)

USB client presence IS detectable on nRF52 after all: (bool)Serial ==
tud_cdc_n_connected() (DTR — a host has the CDC port open). Add
isClientConnected() = BLE-bonded OR USB-CDC-open; DualSerialInterface
overrides it, base defaults to isConnected() (single-transport unchanged).

Wire it so each consumer gets the right signal:
- hasConnection() ← isClientConnected(): Auto buzzer mute + message-wake now
  trigger on BLE or an open USB port (PR #14's intent, done correctly), but
  not on charging-only (no host → DTR low).
- BT status indicator + pairing PIN stay on isBLEConnected() (BLE-specific).

Caveat: a plain serial monitor also asserts DTR, so it counts as connected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-05 12:36:49 +02:00
co-authored by Claude Opus 4.8
parent 4ea67ee950
commit 3b795f7abc
4 changed files with 16 additions and 7 deletions
+1 -1
View File
@@ -456,7 +456,7 @@ class HomeScreen : public UIScreen {
int leftmostX = battLeftX;
if (_task->isSerialEnabled()) {
int btX = battLeftX - ind - ind_gap;
if (_task->hasConnection()) {
if (_task->isBLEConnected()) { // BT icon reflects BLE link, not USB
display.setColor(DisplayDriver::LIGHT);
display.fillRect(btX, 0, ind, ind_h);
display.setColor(DisplayDriver::DARK);