mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Bridge: enhance CLI configuration options
This commit is contained in:
parent
aa946bbe36
commit
8edcb46a28
11 changed files with 162 additions and 118 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "helpers/AbstractBridge.h"
|
||||
#include "helpers/CommonCLI.h"
|
||||
#include "helpers/SimpleMeshTables.h"
|
||||
|
||||
#include <RTClib.h>
|
||||
|
|
@ -48,34 +49,31 @@ public:
|
|||
static constexpr uint16_t BRIDGE_LENGTH_SIZE = sizeof(uint16_t);
|
||||
static constexpr uint16_t BRIDGE_CHECKSUM_SIZE = sizeof(uint16_t);
|
||||
|
||||
/**
|
||||
* @brief Default delay in milliseconds for scheduling inbound packet processing
|
||||
*
|
||||
* It provides a buffer to prevent immediate processing conflicts in the mesh network.
|
||||
* Used in handleReceivedPacket() as: millis() + BRIDGE_DELAY
|
||||
*/
|
||||
static constexpr uint16_t BRIDGE_DELAY = 500; // TODO: maybe too high ?
|
||||
|
||||
protected:
|
||||
/** Tracks bridge state */
|
||||
bool _initialized = false;
|
||||
|
||||
|
||||
/** Packet manager for allocating and queuing mesh packets */
|
||||
mesh::PacketManager *_mgr;
|
||||
|
||||
/** RTC clock for timestamping debug messages */
|
||||
mesh::RTCClock *_rtc;
|
||||
|
||||
/** Node preferences for configuration settings */
|
||||
NodePrefs *_prefs;
|
||||
|
||||
/** Tracks seen packets to prevent loops in broadcast communications */
|
||||
SimpleMeshTables _seen_packets;
|
||||
|
||||
/**
|
||||
* @brief Constructs a BridgeBase instance
|
||||
*
|
||||
* @param prefs Node preferences for configuration settings
|
||||
* @param mgr PacketManager for allocating and queuing packets
|
||||
* @param rtc RTCClock for timestamping debug messages
|
||||
*/
|
||||
BridgeBase(mesh::PacketManager *mgr, mesh::RTCClock *rtc) : _mgr(mgr), _rtc(rtc) {}
|
||||
BridgeBase(NodePrefs *prefs, mesh::PacketManager *mgr, mesh::RTCClock *rtc)
|
||||
: _prefs(prefs), _mgr(mgr), _rtc(rtc) {}
|
||||
|
||||
/**
|
||||
* @brief Gets formatted date/time string for logging
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue