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,6 +2,10 @@
#include <Arduino.h>
bool BridgeBase::getState() const {
return _initialized;
}
const char *BridgeBase::getLogDateTime() {
static char tmp[32];
uint32_t now = _rtc->getCurrentTime();
@@ -28,6 +32,13 @@ bool BridgeBase::validateChecksum(const uint8_t *data, size_t len, uint16_t rece
}
void BridgeBase::handleReceivedPacket(mesh::Packet *packet) {
// Guard against uninitialized state
if (_initialized == false) {
Serial.printf("%s: BRIDGE: RX packet received before initialization\n", getLogDateTime());
_mgr->free(packet);
return;
}
if (!_seen_packets.hasSeen(packet)) {
_mgr->queueInbound(packet, millis() + BRIDGE_DELAY);
} else {