Reject AGC intervals that would wrap or silently disable resets

This commit is contained in:
mikecarper committed 2026-10-16 01:19:09 -07:00
1 parent 9cf2417d29
commit 862260de17
3 files changed
+48 -6

No files matched your search

+8 -3
View File
@@ -4265,9 +4265,14 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
strcpy(reply, "OK");
}
} else if (memcmp(config, "agc.reset.interval ", 19) == 0) {
_prefs->agc_reset_interval = atoi(&config[19]) / 4;
savePrefs();
sprintf(reply, "OK - interval rounded to %d", ((uint32_t) _prefs->agc_reset_interval) * 4);
uint32_t seconds;
if (!mesh::cli::parseUnsignedIntegerStrict(&config[19], seconds) || seconds > 1020) {
strcpy(reply, "Error: AGC interval must be 0-1020 seconds");
} else {
_prefs->agc_reset_interval = seconds / 4;
savePrefs();
sprintf(reply, "OK - interval rounded to %d", ((uint32_t) _prefs->agc_reset_interval) * 4);
}
} else if (memcmp(config, "multi.acks ", 11) == 0) {
_prefs->multi_acks = atoi(&config[11]);
savePrefs();