mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-03 10:46:12 +00:00
fix(ble): show pairing PIN on dual (BLE+USB) builds
The Bluetooth-page PIN prompt was gated on hasConnection(), which is fed by the serial interface's isConnected(). DualSerialInterface::isConnected() always returns true (USB always "connected"), so waiting_for_pair was always false and the PIN was never drawn — on every dual build, i.e. the published OLED + e-ink firmware. Pure-BLE builds were unaffected (there isConnected() reflects bond state). Gate the PIN on actual BLE-bonded state instead: add AbstractUITask::isBLEConnected() (forwards to BaseSerialInterface:: isBLEConnected(), which DualSerialInterface overrides with the real BLE state and pure-BLE inherits as its bond-aware isConnected()). The PIN now shows on the Bluetooth page while BLE is on and not yet bonded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,10 @@ protected:
|
||||
public:
|
||||
void setHasConnection(bool connected) { _connected = connected; }
|
||||
bool hasConnection() const { return _connected; }
|
||||
// True only when a BLE central is actually bonded/connected. On a dual
|
||||
// (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(); }
|
||||
uint16_t getBattMilliVolts() const { return _board->getBattMilliVolts(); }
|
||||
bool isSerialEnabled() const { return _serial->isEnabled(); }
|
||||
void enableSerial() { _serial->enable(); }
|
||||
|
||||
Reference in New Issue
Block a user