[LoRaWAN] Fixed output power configuration (#814)
This commit is contained in:
parent
b2b176f1c3
commit
73382c2933
1 changed files with 8 additions and 2 deletions
|
@ -807,7 +807,13 @@ int16_t LoRaWANNode::setPhyProperties() {
|
||||||
}
|
}
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
state = this->phyLayer->setOutputPower(this->band->powerMax);
|
// set the maximum power supported by both the module and the band
|
||||||
|
int8_t pwr = this->band->powerMax;
|
||||||
|
state = RADIOLIB_ERR_INVALID_OUTPUT_POWER;
|
||||||
|
while(state == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
|
||||||
|
// go from the highest power in band and lower it until we hit one supported by the module
|
||||||
|
state = this->phyLayer->setOutputPower(pwr--);
|
||||||
|
}
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
uint8_t syncWord[3] = { 0 };
|
uint8_t syncWord[3] = { 0 };
|
||||||
|
|
Loading…
Add table
Reference in a new issue