![]()  | 
  
    LoRaMAC
    4.6.0
    
   Documentation of the API 
   | 
 
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... | |
LoRa MAC ADR implementation.
| 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  | 
| 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 | 
| [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. | 
| Returns | true, if an ADR request should be performed. |