Keep bridged OTA retries resumable across profile handoffs

Let the mesh timed OTA retry guard own byte-identical requests instead of the permanent bridge FIFO. Bind bridge ingress to its primary profile generation and preserve UART reflection/liveness protections. Verified a LoRa to ESP-NOW to LoRa update with outage recovery and install.
This commit is contained in:
mikecarper committed 2026-10-15 21:05:23 -07:00
1 parent bc1b414af0
commit 690ffe5601
11 files changed
+228 -24

No files matched your search

@@ -4,6 +4,7 @@
#include <vector>
#define MAX_TRANS_UNIT 255
#define PAYLOAD_TYPE_OTA 0x0c
#define BRIDGE_DEBUG_PRINTLN(...) ((void)0)
struct NodePrefs { uint32_t bridge_baud = 115200; };
@@ -11,6 +12,7 @@ namespace mesh {
struct Packet {
std::vector<uint8_t> payload{1, 2, 3};
bool allowed = true;
uint8_t getPayloadType() const { return payload.empty() ? 0 : (payload[0] >> 2) & 0x0f; }
int getRawLength() const { return static_cast<int>(payload.size()); }
uint16_t writeTo(uint8_t* out) const {
for (size_t i = 0; i < payload.size(); ++i) out[i] = payload[i];
+4 -1
View File
@@ -9,6 +9,7 @@
#include <helpers/bridges/ESPNowBridgeFormat.h>
#include <helpers/bridges/RS232PowerSettings.h>
struct FakeRng { void random(uint8_t* out, size_t size) { memset(out, 0x42, size); } };
struct FakeRadio { const void* profiles() const { return nullptr; } };
#define BRIDGE_MAX_BAUD 115200
#define PUB_KEY_SIZE 32
#define MESH_DEBUG_PRINTLN(...) ((void)0)
@@ -64,6 +65,7 @@ public:
void setPacketFilter(bool (*check)(void*, const mesh::Packet*), void* context) {
filter = check; filter_context = context; ++filters;
}
void setIngressProfiles(const void*) {}
};
class RS232Bridge : public AbstractBridge {
NodePrefs* prefs;
@@ -217,7 +219,8 @@ public:
FakeCLI _cli;
FakeAlerter _alerter;
mesh::LocalIdentity self_id;
void* _mgr = nullptr; void* _radio = nullptr; void* _ms = nullptr;
FakeRadio radio; FakeRadio* _radio = &radio;
void* _mgr = nullptr; void* _ms = nullptr;
void* getRTCClock() { return nullptr; }
FakeRng rng;
FakeRng* getRNG() { return &rng; }