refactor(companion): the app's links through upstream's MultiSerialInterface

- Bluetooth + USB (+ WiFi/Ethernet/UART per build) in one interface_manager,
  as upstream; frames go to every enabled link, USB is read while BT is
  connected. DUAL_SERIAL now means ENABLE_USB_INTERFACE.
- WiFi interface with upstream's wifi_* prefs and set/get wifi.* CLI.
- isClientConnected moved into ArduinoSerialInterface (DTR on nRF52 and
  ESP32 native CDC).
- UI uses isBluetoothEnabled/enableBluetooth/disableBluetooth; turning BT
  off leaves USB and the other links on.
- DualSerialInterface removed.
- Sim build gains DynamicConfigSerializer.cpp (broken since bd64c203).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-10-15 14:04:58 +02:00
co-authored by Claude Opus 5.5
parent bd64c203c7
commit f6c0a2f021
21 changed files with 345 additions and 309 deletions
+3 -3
View File
@@ -328,7 +328,7 @@ class HomeScreen : public UIScreen {
add("All messages", Q_MORE, QA_MORE, 0);
n += recentChats(rows + n, quickFit() - 1);
} else if (page == BLUETOOTH) {
const bool on = _task->isSerialEnabled();
const bool on = _task->isBluetoothEnabled();
add("Bluetooth", Q_SWITCH, QA_BT, on ? 1 : 0);
add("Phone", Q_VALUE, QA_NONE, 0);
char* v = rows[n - 1].value;
@@ -440,7 +440,7 @@ class HomeScreen : public UIScreen {
case QA_BRIGHTNESS:
case QA_AUTO_ADVERT: _quick_edit = true; break; // Left/Right change it, Enter / Back keep it
case QA_BT:
if (_task->isSerialEnabled()) _task->disableSerial(); else _task->enableSerial();
if (_task->isBluetoothEnabled()) _task->disableBluetooth(); else _task->enableBluetooth();
break;
case QA_ADVERT:
_task->notify(UIEventType::ack);
@@ -609,7 +609,7 @@ class HomeScreen : public UIScreen {
struct Sicon { bool active; const MiniIcon* icon; };
const Sicon icons[] = {
{ board.isExternalPowered(), &ICON_CHARGE }, // USB power: next to the battery
{ _task->isSerialEnabled() && _task->isBLEConnected(), &ICON_BLUETOOTH },
{ _task->isBluetoothEnabled() && _task->isBLEConnected(), &ICON_BLUETOOTH },
{ gps_on, gps_fix ? &ICON_GPS : &ICON_GPS_SEARCH },
{ _node_prefs && _node_prefs->alarm_on, &ICON_ALARM },
{ mute_on, &ICON_MUTE },
+2 -2
View File
@@ -4,7 +4,7 @@
#include <helpers/ui/DisplayDriver.h>
#include <helpers/ui/UIScreen.h>
#include <helpers/SensorManager.h>
#include <helpers/BaseSerialInterface.h>
#include <helpers/MultiSerialInterface.h>
#include <helpers/ContactInfo.h>
#include <Arduino.h>
#include <helpers/sensors/LPPDataHelpers.h>
@@ -284,7 +284,7 @@ public:
void setNodeLockPassword(const char* plain);
bool passwordLockEnabled() const;
UITask(mesh::MainBoard* board, BaseSerialInterface* serial) : UITaskBase(board, serial), _display(NULL), _sensors(NULL), _node_prefs(NULL) {
UITask(mesh::MainBoard* board, MultiSerialInterface* serial) : UITaskBase(board, serial), _display(NULL), _sensors(NULL), _node_prefs(NULL) {
next_batt_chck = _next_refresh = 0;
ui_started_at = 0;
_batt_mv = 0;