mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-03 02:36:11 +00:00
fix(ui): keep hasConnection() BLE-specific; use isClientConnected() only for mute/wake
Self-review caught a regression I'd just introduced: feeding hasConnection() from isClientConnected() (BLE *or* USB) broke the GPX-export collision warning in TrailScreen, which relies on hasConnection() meaning "BLE app connected" (BLE → USB dump is safe; otherwise the app may be on USB → warn). Correct split: - hasConnection() ← isBLEConnected() — BLE-specific consumers: BT status indicator, pairing PIN, GPX-export warning. - isClientConnected() (BLE bonded OR open USB-CDC port) used directly only by the Auto buzzer mute and message-wake, which should react to either transport. Builds clean on dual (OLED + e-ink) and pure-BLE. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,9 @@ public:
|
||||
// (BLE+USB) interface hasConnection() is always true (USB counts), so use
|
||||
// this for BLE-specific UI like the pairing-PIN prompt.
|
||||
bool isBLEConnected() const { return _serial->isBLEConnected(); }
|
||||
// True when a companion app is connected over any transport (BLE bonded or an
|
||||
// open USB-CDC port). For app-connected behaviour like Auto buzzer mute.
|
||||
bool isClientConnected() const { return _serial->isClientConnected(); }
|
||||
uint16_t getBattMilliVolts() const { return _board->getBattMilliVolts(); }
|
||||
bool isSerialEnabled() const { return _serial->isEnabled(); }
|
||||
void enableSerial() { _serial->enable(); }
|
||||
|
||||
Reference in New Issue
Block a user