[LoRaWAN] Fix ADR bug if not enabled
This commit is contained in:
parent
00264f48a9
commit
f7730463bd
1 changed files with 40 additions and 38 deletions
|
@ -912,10 +912,11 @@ int16_t LoRaWANNode::uplink(uint8_t* data, size_t len, uint8_t port, bool isConf
|
|||
// increase frame counter by one
|
||||
this->fcntUp += 1;
|
||||
|
||||
bool adrAckReq = false;
|
||||
if(this->adrEnabled) {
|
||||
// check if we need to do ADR stuff
|
||||
uint32_t adrLimit = 0x01 << this->adrLimitExp;
|
||||
uint32_t adrDelay = 0x01 << this->adrDelayExp;
|
||||
bool adrAckReq = false;
|
||||
if((this->fcntUp - this->adrFcnt) >= adrLimit) {
|
||||
adrAckReq = true;
|
||||
}
|
||||
|
@ -959,6 +960,7 @@ int16_t LoRaWANNode::uplink(uint8_t* data, size_t len, uint8_t port, bool isConf
|
|||
// we tried something to improve the range, so increase the ADR frame counter by 'ADR delay'
|
||||
this->adrFcnt += adrDelay;
|
||||
}
|
||||
}
|
||||
|
||||
// configure for uplink
|
||||
this->selectChannels();
|
||||
|
|
Loading…
Add table
Reference in a new issue