mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
fix(ui): hasConnection() should track BLE bond, not isConnected()
PR #14 (advert sound) changed setHasConnection() from isBLEConnected() to isConnected() to also mute on USB — but DualSerialInterface::isConnected() is hardcoded true (USB is always a send fallback) and ArduinoSerialInterface's is too ("no way of knowing"), so USB-client presence is undetectable. The result on every dual build: hasConnection() always true, which broke everything that means "a companion app is connected": - Auto buzzer mute → permanently muted (Auto behaved like Off) - BT status indicator → always shown connected - message-wake → display never woke for new messages Revert to isBLEConnected() (the only detectable client signal). Mute-on-USB isn't achievable; Buzzer = Off covers that case manually. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2497,7 +2497,12 @@ void MyMesh::loop() {
|
||||
}
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
if (_ui) _ui->setHasConnection(_serial->isConnected());
|
||||
// Use BLE-bonded state, not isConnected(): on a dual (BLE+USB) interface
|
||||
// isConnected() is hardcoded true (USB is always a send fallback), and USB
|
||||
// client presence isn't detectable anyway. hasConnection() drives the BT
|
||||
// status indicator, message-wake and the Auto buzzer mute — all of which
|
||||
// mean "a companion app is connected", i.e. BLE bonded.
|
||||
if (_ui) _ui->setHasConnection(_serial->isBLEConnected());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user