mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-02 18:26:11 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user