Skip to content

Commit

Permalink
Issue Lora-net#723 - Move Tx power control after `if( adrNext->AdrAck…
Browse files Browse the repository at this point in the history
…Counter >= ( adrNext->AdrAckLimit + adrNext->AdrAckDelay ) )`

The Tx power control is not specified into LoRaWAN specifications 1.0.3 and below.
Although its control is advisable in order to avoid loosing connection in some conditions.
This addition shouldn't have any impact on ADR algorithms nor on the certification process.
  • Loading branch information
mluis1 committed Jun 17, 2019
1 parent 003b162 commit 4051c9f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/mac/LoRaMacAdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,18 @@ static bool CalcNextV10X( CalcNextAdrParams_t* adrNext, int8_t* drOut, int8_t* t
if( adrNext->AdrAckCounter >= adrNext->AdrAckLimit )
{
adrAckReq = true;
// Set TX Power to maximum
getPhy.Attribute = PHY_MAX_TX_POWER;
phyParam = RegionGetPhyParam( adrNext->Region, &getPhy );
txPower = phyParam.Value;
}
else
{
adrAckReq = false;
}
if( adrNext->AdrAckCounter >= ( adrNext->AdrAckLimit + adrNext->AdrAckDelay ) )
{
// Set TX Power to maximum
getPhy.Attribute = PHY_MAX_TX_POWER;
phyParam = RegionGetPhyParam( adrNext->Region, &getPhy );
txPower = phyParam.Value;

if( ( adrNext->AdrAckCounter % adrNext->AdrAckDelay ) == 1 )
{
// Decrease the datarate
Expand Down

0 comments on commit 4051c9f

Please sign in to comment.