Merge pull request #831 from Meshcore-Portugal/jbrazio/2025_87fe0ad8

Add bridge management CLI
This commit is contained in:
fdlamotte 2025-10-06 14:23:35 +02:00 committed by GitHub
commit 5f31979e1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 508 additions and 248 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
@ -182,4 +182,24 @@ public:
void clearStats() override;
void handleCommand(uint32_t sender_timestamp, char* command, char* reply);
void loop();
#if defined(WITH_BRIDGE)
void setBridgeState(bool enable) override {
if (enable == bridge.isRunning()) return;
if (enable)
{
bridge.begin();
}
else
{
bridge.end();
}
}
void restartBridge() override {
if (!bridge.isRunning()) return;
bridge.end();
bridge.begin();
}
#endif
};