mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-07 20:56:11 +00:00
fix(repeater): close radio-profile bypass paths, dedupe preset/BW logic
CMD_SET_RADIO_PARAMS and the on-device Settings radio editors (Freq/SF/BW/CR/Preset) called radio_driver.setParams() directly instead of applyRepeaterRadio(), so editing the companion's own radio params while relaying on a dedicated profile silently retuned the live radio off that profile. Both now route through applyRepeaterRadio(), the single decision point already used at boot and by the on-device repeater toggle. Also: overhear-suppression matched queued packets by payload hash alone, so it could cancel a queued direct-route retransmit that happened to share a hash with an overheard flood packet — now scoped to flood-queued entries only. repeaterProfileValid()'s frequency floor (100 MHz) is raised to 150 MHz to match the radio's actual validated range. RepeaterScreen's preset-name lookup now uses the same epsilon-tolerant float comparison as Settings instead of exact ==, avoiding inconsistent "Custom" labeling between the two screens. Dedupe: the BW-options table, the value-column x-offset math, and the default-profile-seeding block had each drifted into two or three independent copies (RepeaterScreen vs Settings, MyMesh constructor vs DataStore.cpp upgrade path); factored into shared helpers in RadioPresets.h / NodePrefs.h. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
afe7b8a0ca
commit
4999620fba
@@ -224,10 +224,7 @@ public:
|
||||
|
||||
// True when the optional repeater radio profile is a valid LoRa config.
|
||||
bool repeaterProfileValid() const {
|
||||
return _prefs.repeater_freq >= 100.0f && _prefs.repeater_freq <= 960.0f
|
||||
&& _prefs.repeater_sf >= 5 && _prefs.repeater_sf <= 12
|
||||
&& _prefs.repeater_cr >= 5 && _prefs.repeater_cr <= 8
|
||||
&& _prefs.repeater_bw >= 7.0f && _prefs.repeater_bw <= 510.0f;
|
||||
return isValidRepeaterProfile(_prefs.repeater_freq, _prefs.repeater_bw, _prefs.repeater_sf, _prefs.repeater_cr);
|
||||
}
|
||||
// Load the radio with the correct params for the current mode: the repeater
|
||||
// profile when relaying with a valid dedicated profile, otherwise the
|
||||
|
||||
Reference in New Issue
Block a user