Apply infrastructure radio changes after a two-second reply handoff

Persist set freq and set radio atomically, then apply through the existing safe radio scheduler without rebooting. Retain the old tuple until the delay and reply handoff finish, including queued room/sensor replies and TX-complete callbacks. End temporary sessions when accepting a permanent change.

Display applied RF settings even when radio2 is off. Share radio validation across immediate and scheduled setters to preserve STM32 Mini flash capacity. Update command documentation, regression coverage, and CI.

Validated production timing, persistence, display, CLI, fleet/reply, RX, sleep and Morse regressions. W12 repeater, room-server and sensor builds pass. Canonical STM32 Mini Repeater passes flash and RAM admission with 448 bytes of flash remaining. Physical W12 RF testing was not performed.
This commit is contained in:
mikecarper committed 2026-10-26 00:38:13 -07:00
1 parent c98684021a
commit 4f76345b67
22 files changed
+414 -67

No files matched your search

+6
View File
@@ -55,6 +55,7 @@ struct Prefs {
uint8_t sf=7, cr=5, interference_threshold=0, agc_reset_interval=0;
uint8_t path_hash_mode=0, multi_acks=0, rx_ps_level=0, rx_ps_preamble=0;
int8_t tx_power_dbm=10;
uint16_t primary_radio_preamble=0;
uint32_t rx_ps_rx_us=1000, rx_ps_sleep_us=1000;
bool cad_enabled=false, rx_boosted_gain=false, rx_powersaving_enabled=false;
uint8_t extra_sf[4]={};
@@ -111,6 +112,11 @@ public:
uint8_t _rx_settings_pending=0;
uint32_t _rx_settings_retry_at=0;
void savePrefs() { callbacks.savePrefs(); }
bool applyAndSavePrimaryRadioParams(float f,float bw,uint8_t sf,uint8_t cr,uint16_t preamble,char* reply) {
if (!savePrimaryRadioParams(f,bw,sf,cr,preamble)) return false;
strcpy(reply,"OK - applying in 2s"); return true;
}
@PRIMARY_VALIDATE@
bool trySavePrefs() { savePrefs(); return true; }
void applyAndSaveTxPower(int8_t power, char* reply);
void servicePendingTxPower();