1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-05 15:34:57 -04:00

Meshtastic modulator: added Region, Preset and Channel combo boxes. Do not set bandwidth from MESH: message

This commit is contained in:
f4exb
2026-03-23 20:43:19 +01:00
parent 86088fdede
commit 05a96c2170
7 changed files with 559 additions and 41 deletions
@@ -205,25 +205,6 @@ void MeshtasticMod::setCenterFrequency(qint64 frequency)
}
}
int MeshtasticMod::findBandwidthIndex(int bandwidthHz) const
{
int bestIndex = -1;
int bestDelta = 1 << 30;
for (int i = 0; i < MeshtasticModSettings::nbBandwidths; i++)
{
const int delta = std::abs(MeshtasticModSettings::bandwidths[i] - bandwidthHz);
if (delta < bestDelta)
{
bestDelta = delta;
bestIndex = i;
}
}
return bestIndex;
}
bool MeshtasticMod::applyMeshtasticRadioSettingsIfPresent(MeshtasticModSettings& settings) const
{
if (settings.m_codingScheme != MeshtasticModSettings::CodingLoRa) {
@@ -243,12 +224,6 @@ bool MeshtasticMod::applyMeshtasticRadioSettingsIfPresent(MeshtasticModSettings&
}
bool changed = false;
const int bwIndex = findBandwidthIndex(meshRadio.bandwidthHz);
if ((bwIndex >= 0) && (bwIndex != settings.m_bandwidthIndex)) {
settings.m_bandwidthIndex = bwIndex;
changed = true;
}
if ((meshRadio.spreadFactor > 0) && (meshRadio.spreadFactor != settings.m_spreadFactor)) {
settings.m_spreadFactor = meshRadio.spreadFactor;