feat(companion): delete saved presets, align app-driven repeat with on-device toggle

- Radio Preset popup: "+ Save current..." moved to the top of the list; add
  "- Delete preset..." (shown only when a saved preset exists) which opens a
  sub-list of just the saved presets and clears the picked slot.
- CMD_SET_RADIO_PARAMS no longer requires repeat=1 to land on one of the
  three dedicated repeat_freq_ranges bands — none of the 16 built-in presets
  matched those exactly, so app-driven repeat would either get rejected or
  silently retune away from the user's chosen frequency. Commented out
  (not deleted) so the old behaviour can be restored if needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-18 17:42:41 +02:00
co-authored by Claude Sonnet 4.6
parent 056a786fc8
commit 46263fe247
2 changed files with 62 additions and 25 deletions
+9 -3
View File
@@ -1818,9 +1818,15 @@ void MyMesh::handleCmdFrame(size_t len) {
repeat = cmd_frame[i++]; // FIRMWARE_VER_CODE 9+
}
if (repeat && !isValidClientRepeatFreq(freq)) {
writeErrFrame(ERR_CODE_ILLEGAL_ARG);
} else if (freq >= 150000 && freq <= 2500000 && sf >= 5 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7000 &&
// Dedicated-band requirement for app-driven repeat disabled, to match the
// on-device Repeater toggle (Settings > Radio), which repeats on whatever
// frequency is already set with no band restriction. Uncomment to restore
// the old behaviour (repeat=1 only accepted on repeat_freq_ranges, i.e.
// 433.000/869.495/918.000 MHz exactly, by default).
// if (repeat && !isValidClientRepeatFreq(freq)) {
// writeErrFrame(ERR_CODE_ILLEGAL_ARG);
// } else
if (freq >= 150000 && freq <= 2500000 && sf >= 5 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7000 &&
bw <= 500000) {
_prefs.sf = sf;
_prefs.cr = cr;