Add bridge management CLI

This commit is contained in:
João Brázio
2025-09-24 16:30:00 +01:00
parent ea13fa899e
commit 1d45c7ec66
11 changed files with 340 additions and 137 deletions

View File

@@ -2,7 +2,8 @@
#include <Arduino.h>
#include <Mesh.h>
#include <helpers/CommonCLI.h>
#include <RTClib.h>
#include <target.h>
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
#include <InternalFileSystem.h>
@@ -12,16 +13,6 @@
#include <SPIFFS.h>
#endif
#include <helpers/ArduinoHelpers.h>
#include <helpers/StaticPoolPacketManager.h>
#include <helpers/SimpleMeshTables.h>
#include <helpers/IdentityStore.h>
#include <helpers/AdvertDataHelpers.h>
#include <helpers/TxtDataHelpers.h>
#include <helpers/ClientACL.h>
#include <RTClib.h>
#include <target.h>
#ifdef WITH_RS232_BRIDGE
#include "helpers/bridges/RS232Bridge.h"
#define WITH_BRIDGE
@@ -32,6 +23,15 @@
#define WITH_BRIDGE
#endif
#include <helpers/AdvertDataHelpers.h>
#include <helpers/ArduinoHelpers.h>
#include <helpers/ClientACL.h>
#include <helpers/CommonCLI.h>
#include <helpers/IdentityStore.h>
#include <helpers/SimpleMeshTables.h>
#include <helpers/StaticPoolPacketManager.h>
#include <helpers/TxtDataHelpers.h>
#ifdef WITH_BRIDGE
extern AbstractBridge* bridge;
#endif
@@ -165,6 +165,21 @@ public:
void updateAdvertTimer() override;
void updateFloodAdvertTimer() override;
#if defined(WITH_ESPNOW_BRIDGE)
void setBridgeState(bool enable) {
if (enable == bridge.getState()) return;
enable ? bridge.begin() : bridge.end();
}
void updateBridgeChannel(int ch) override {
bridge.setChannel(ch);
if (bridge.getState()) {
bridge.end();
bridge.begin();
}
}
#endif
void setLoggingOn(bool enable) override { _logging = enable; }
void eraseLogFile() override {