SX1262: Remove warnings on unavailable parameter fetch
This commit is contained in:
parent
4625f56c6e
commit
058cad7ca0
@ -94,6 +94,8 @@ Sx1262::ParameterStatus Sx1262::setLrFhssParameter(const Parameter parameter, co
|
|||||||
using enum Parameter;
|
using enum Parameter;
|
||||||
|
|
||||||
switch (parameter) {
|
switch (parameter) {
|
||||||
|
case Power:
|
||||||
|
return checkLimitsAndApply(power, value, -9.0, 22.0);
|
||||||
case Bandwidth:
|
case Bandwidth:
|
||||||
return checkValuesAndApply(bandwidth, value, {
|
return checkValuesAndApply(bandwidth, value, {
|
||||||
39.06, 85.94, 136.72, 183.59, 335.94, 386.72, 722.66, 773.44, 1523.4, 1574.2
|
39.06, 85.94, 136.72, 183.59, 335.94, 386.72, 722.66, 773.44, 1523.4, 1574.2
|
||||||
@ -163,7 +165,6 @@ Sx1262::ParameterStatus Sx1262::getLoraParameter(const Parameter parameter, floa
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_W(TAG, "Tried to get unsupported LoRa parameter \"%s\"", toString(parameter));
|
|
||||||
return Sx1262::ParameterStatus::Unavailable;
|
return Sx1262::ParameterStatus::Unavailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +191,6 @@ Sx1262::ParameterStatus Sx1262::getFskParameter(const Parameter parameter, float
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_W(TAG, "Tried to get unsupported FSK parameter \"%s\"", toString(parameter));
|
|
||||||
return Sx1262::ParameterStatus::Unavailable;
|
return Sx1262::ParameterStatus::Unavailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +214,6 @@ Sx1262::ParameterStatus Sx1262::getLrFhssParameter(const Parameter parameter, fl
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_W(TAG, "Tried to get unsupported LR-FHSS parameter \"%s\"", toString(parameter));
|
|
||||||
return Sx1262::ParameterStatus::Unavailable;
|
return Sx1262::ParameterStatus::Unavailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,6 +221,7 @@ Sx1262::ParameterStatus Sx1262::getLrFhssParameter(const Parameter parameter, fl
|
|||||||
Sx1262::ParameterStatus Sx1262::getParameter(const Parameter parameter, float &value) const {
|
Sx1262::ParameterStatus Sx1262::getParameter(const Parameter parameter, float &value) const {
|
||||||
const auto currentModulation = getModulation();
|
const auto currentModulation = getModulation();
|
||||||
|
|
||||||
|
// No warnings are emitted to be able to discover parameters by return status
|
||||||
switch (currentModulation) {
|
switch (currentModulation) {
|
||||||
case Modulation::LoRa:
|
case Modulation::LoRa:
|
||||||
return getLoraParameter(parameter, value);
|
return getLoraParameter(parameter, value);
|
||||||
|
|||||||
@ -41,8 +41,9 @@ private:
|
|||||||
SX1262 radio;
|
SX1262 radio;
|
||||||
TxItem currentTx;
|
TxItem currentTx;
|
||||||
|
|
||||||
int8_t power = 0;
|
// Shared parameters which have a common lowest value are set here
|
||||||
float frequency = 0.0;
|
int8_t power = -9.0;
|
||||||
|
float frequency = 150;
|
||||||
float bandwidth = 0.0;
|
float bandwidth = 0.0;
|
||||||
uint8_t spreadFactor = 0.0;
|
uint8_t spreadFactor = 0.0;
|
||||||
uint8_t codingRate = 0;
|
uint8_t codingRate = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user