Fix firmware budget regressions and flood alias delimiters

Share nRF52 checked-record reads and command-family lookups without changing
storage formats, error protection, fleet authorization, or delegated scopes.
Use the existing bounded Merkle proof workspace for qualified ESP32 repeaters
while retaining source capacity, wire format, and every enabled feature.
Restore advert tab/CRLF delimiters and expose nested qualification build logs.

Validation: all 1932 native CI test cases; exact canonical RAK4631 Full,
Wio-E5 Mini, Station G3 Full MQTT, and Wireless Tracker Full wrappers;
linked RAK crypto/workspace checks and retained Reader code equivalence;
focused persistence, authorization, source-proof, and RAM policy regressions.
This commit is contained in:
mikecarper committed 2026-10-21 03:02:46 -07:00
1 parent 99724cd1d3
commit db1c4704e0
15 files changed
+370 -130

No files matched your search

+15 -4
View File
@@ -2,6 +2,10 @@
#include "OtaSpeedConfig.h"
#include <helpers/CLICommandUtils.h>
#include <helpers/PersistentStoreFormat.h>
#if defined(NRF52_PLATFORM)
#include <helpers/CheckedSettingsFile.h>
#include <helpers/FilePresence.h>
#endif
#include <stdio.h>
#include <string.h>
#if defined(ESP32_PLATFORM)
@@ -26,7 +30,9 @@ enum class ImageReadResult : uint8_t { Missing, Valid, Invalid, Unreadable };
// A failed open is not enough to prove a path is absent: some filesystems
// report an I/O error as a failed exists() call. Keep those images protected.
bool pathPresence(const char* path, bool& present) {
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
#if defined(NRF52_PLATFORM)
return filePresence(settings_fs, path, present);
#elif defined(STM32_PLATFORM)
struct lfs_info info;
settings_fs->_lockFS();
const int result = lfs_stat(settings_fs->_getFS(), path, &info);
@@ -61,9 +67,13 @@ ImageReadResult readImage(const char* path, uint8_t* image) {
if (!settings_fs || !pathPresence(path, present)) return ImageReadResult::Unreadable;
if (!present) return ImageReadResult::Missing;
#if defined(NRF52_PLATFORM)
File file(*settings_fs);
if (!file.open(path, FILE_O_READ)) return ImageReadResult::Unreadable;
#elif defined(STM32_PLATFORM)
const storage::FixedSettingsRead read = storage::readFixedSettingsFileResult(
settings_fs, path, image, ImageSize);
if (read != storage::FixedSettingsRead::Complete)
return read == storage::FixedSettingsRead::WrongSize
? ImageReadResult::Invalid : ImageReadResult::Unreadable;
#else
#if defined(STM32_PLATFORM)
File file = settings_fs->open(path, FILE_O_READ);
#else
File file = settings_fs->open(path, "r");
@@ -74,6 +84,7 @@ ImageReadResult readImage(const char* path, uint8_t* image) {
file.close();
if (!right_size) return ImageReadResult::Invalid;
if (!complete) return ImageReadResult::Unreadable;
#endif
float value;
memcpy(&value, image + 4, sizeof(value));
return !memcmp(image, "OS\1\0", 4) && validSpeed(value)