mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
fix: code review corrections in DualSerialInterface and NearbyScreen
- DualSerialInterface: guard writeFrame/isWriteBusy/isBLEConnected with _ble_enabled to avoid BLE-after-disable race - NearbyScreen: initialize all fields in constructor; promote D_* layout constants to class scope; clamp _dscroll on result count change; replace hardcoded 2 with D_VISIBLE in scroll logic; allow re-scan from detail view via KEY_CONTEXT_MENU/KEY_ENTER - variant.cpp: fix inconsistent indentation in initVariant() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,14 +32,14 @@ public:
|
||||
// Always true — USB is always available as fallback, so the mesh can send.
|
||||
bool isConnected() const override { return true; }
|
||||
// True only when a BLE companion app is paired and connected.
|
||||
bool isBLEConnected() const override { return _ble.isConnected(); }
|
||||
bool isBLEConnected() const override { return _ble_enabled && _ble.isConnected(); }
|
||||
|
||||
bool isWriteBusy() const override {
|
||||
return _ble.isConnected() ? _ble.isWriteBusy() : _usb.isWriteBusy();
|
||||
return (_ble_enabled && _ble.isConnected()) ? _ble.isWriteBusy() : _usb.isWriteBusy();
|
||||
}
|
||||
|
||||
size_t writeFrame(const uint8_t src[], size_t len) override {
|
||||
return _ble.isConnected() ? _ble.writeFrame(src, len) : _usb.writeFrame(src, len);
|
||||
return (_ble_enabled && _ble.isConnected()) ? _ble.writeFrame(src, len) : _usb.writeFrame(src, len);
|
||||
}
|
||||
|
||||
size_t checkRecvFrame(uint8_t dest[]) override {
|
||||
|
||||
Reference in New Issue
Block a user