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
+4 -1
View File
@@ -1372,6 +1372,9 @@ MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMe
_prefs.clearFields();
memset(_prefs.ch_scope_idx, NodePrefs::CH_SCOPE_DEFAULT, sizeof(_prefs.ch_scope_idx));
_prefs.airtime_factor = 1.0;
#ifdef ENABLE_WIFI_INTERFACE
_prefs.wifi_enabled = 1; // on, so a WiFi-only build works; it doesn't start without an SSID
#endif
_prefs.tx_delay_factor = 0.5f;
_prefs.direct_tx_delay_factor = 0.2f;
strcpy(_prefs.node_name, "NONAME");
@@ -1570,7 +1573,7 @@ bool MyMesh::isValidClientRepeatFreq(uint32_t f) const {
void MyMesh::startInterface(BaseSerialInterface &serial) {
_serial = &serial;
if (!_prefs.ble_off) serial.enable();
serial.enable(); // main.cpp then turns Bluetooth off if the user left it off (ble_off)
}
static bool isAllZero(const uint8_t* buf, size_t n) {