LoRaMAC  4.5.1
Documentation of the API
LoRaMacAdr.h File Reference

LoRa MAC ADR implementation. More...

Go to the source code of this file.

Data Structures

struct  CalcNextAdrParams_t
 

Functions

bool LoRaMacAdrCalcNext (CalcNextAdrParams_t *adrNext, int8_t *drOut, int8_t *txPowOut, uint8_t *nbTransOut, uint32_t *adrAckCounter)
 Calculates the next datarate to set, when ADR is on or off. More...
 

Detailed Description

LoRa MAC ADR implementation.

______ _
/ _____) _ | |
( (____ _____ ____ _| |_ _____ ____| |__
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
(C)2013-2017 Semtech
___ _____ _ ___ _ _____ ___ ___ ___ ___
/ __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __|
\__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _|
|___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
embedded.connectivity.solutions===============
Author
Miguel Luis ( Semtech )
Gregory Cristian ( Semtech )
Daniel Jaeckle ( STACKFORCE )
Johannes Bruder ( STACKFORCE )

Data Structure Documentation

◆ CalcNextAdrParams_t

struct CalcNextAdrParams_t
Data Fields
bool UpdateChanMask

Set to true, if the function should update the channels mask.

bool AdrEnabled

Set to true, if ADR is enabled.

uint32_t AdrAckCounter

ADR ack counter.

uint16_t AdrAckLimit

ADR Ack limit

uint16_t AdrAckDelay

ADR Ack delay

int8_t Datarate

Datarate used currently.

int8_t TxPower

TX power used currently.

uint8_t NbTrans

NbTrans counter used currently.

uint8_t UplinkDwellTime

UplinkDwellTime

LoRaMacRegion_t Region

Region

Function Documentation

◆ LoRaMacAdrCalcNext()

bool LoRaMacAdrCalcNext ( CalcNextAdrParams_t adrNext,
int8_t *  drOut,
int8_t *  txPowOut,
uint8_t *  nbTransOut,
uint32_t *  adrAckCounter 
)

Calculates the next datarate to set, when ADR is on or off.

Here is a summary of the actions:

ADR_ACK_CNT Action
0... 63 Do nothing
64...95 Set ADR ack bit
96...127 Set TX power to default (if already default, do nothing)
128...159 Set data rate to default (if already default, do nothing)
>=160 Set NbTrans to 1, re-enable default channels
Parameters
[IN]adrNext Pointer to the function parameters.
[OUT]drOut The calculated datarate for the next TX.
[OUT]txPowOut The TX power for the next TX.
[OUT]nbTransOut The NbTrans counter.
[OUT]adrAckCounter The calculated ADR acknowledgement counter.
Return values
Returnstrue, if an ADR request should be performed.