LoRaMAC  4.6.0
Documentation of the API
RegionCommon.h File Reference

Region independent implementations which are common to all regions. More...

#include "LoRaMacTypes.h"
#include "LoRaMacHeaderTypes.h"
#include "region/Region.h"

Go to the source code of this file.

Data Structures

struct  RegionCommonRxBeaconSetupParams_t
 
struct  RegionCommonCountNbOfEnabledChannelsParams_t
 
struct  RegionCommonIdentifyChannelsParam_t
 
struct  RegionCommonSetDutyCycleParams_t
 
struct  RegionCommonGetNextLowerTxDrParams_t
 

Macros

#define REGION_COMMON_DEFAULT_RECEIVE_DELAY1   1000
 
#define REGION_COMMON_DEFAULT_RECEIVE_DELAY2   ( REGION_COMMON_DEFAULT_RECEIVE_DELAY1 + 1000 )
 
#define REGION_COMMON_DEFAULT_JOIN_ACCEPT_DELAY1   5000
 
#define REGION_COMMON_DEFAULT_JOIN_ACCEPT_DELAY2   ( REGION_COMMON_DEFAULT_JOIN_ACCEPT_DELAY1 + 1000 )
 
#define REGION_COMMON_DEFAULT_ADR_ACK_LIMIT   64
 
#define REGION_COMMON_DEFAULT_ADR_ACK_DELAY   32
 
#define REGION_COMMON_DEFAULT_RETRANSMIT_TIMEOUT   2000
 
#define REGION_COMMON_DEFAULT_RETRANSMIT_TIMEOUT_RND   1000
 
#define REGION_COMMON_DEFAULT_RX1_DR_OFFSET   0
 
#define REGION_COMMON_DEFAULT_DOWNLINK_DWELL_TIME   0
 
#define REGION_COMMON_DEFAULT_PING_SLOT_PERIODICITY   7
 
#define REGION_COMMON_CLASS_B_C_RESP_TIMEOUT   8000
 

Functions

uint8_t RegionCommonValueInRange (int8_t value, int8_t min, int8_t max)
 Verifies, if a value is in a given range. This is a generic function and valid for all regions. More...
 
bool RegionCommonChanVerifyDr (uint8_t nbChannels, uint16_t *channelsMask, int8_t dr, int8_t minDr, int8_t maxDr, ChannelParams_t *channels)
 Verifies, if a datarate is available on an active channel. This is a generic function and valid for all regions. More...
 
bool RegionCommonChanDisable (uint16_t *channelsMask, uint8_t id, uint8_t maxChannels)
 Disables a channel in a given channels mask. This is a generic function and valid for all regions. More...
 
uint8_t RegionCommonCountChannels (uint16_t *channelsMask, uint8_t startIdx, uint8_t stopIdx)
 Counts the number of active channels in a given channels mask. This is a generic function and valid for all regions. More...
 
void RegionCommonChanMaskCopy (uint16_t *channelsMaskDest, uint16_t *channelsMaskSrc, uint8_t len)
 Copy a channels mask. This is a generic function and valid for all regions. More...
 
void RegionCommonSetBandTxDone (Band_t *band, TimerTime_t lastTxAirTime, bool joined, SysTime_t elapsedTimeSinceStartup)
 Sets the last tx done property. This is a generic function and valid for all regions. More...
 
TimerTime_t RegionCommonUpdateBandTimeOff (bool joined, Band_t *bands, uint8_t nbBands, bool dutyCycleEnabled, bool lastTxIsJoinRequest, SysTime_t elapsedTimeSinceStartup, TimerTime_t expectedTimeOnAir)
 Updates the time-offs of the bands. This is a generic function and valid for all regions. More...
 
uint8_t RegionCommonParseLinkAdrReq (uint8_t *payload, RegionCommonLinkAdrParams_t *parseLinkAdr)
 Parses the parameter of an LinkAdrRequest. This is a generic function and valid for all regions. More...
 
uint8_t RegionCommonLinkAdrReqVerifyParams (RegionCommonLinkAdrReqVerifyParams_t *verifyParams, int8_t *dr, int8_t *txPow, uint8_t *nbRep)
 Verifies and updates the datarate, the TX power and the number of repetitions of a LinkAdrRequest. This depends on the configuration of ADR also. More...
 
uint32_t RegionCommonComputeSymbolTimeLoRa (uint8_t phyDr, uint32_t bandwidthInHz)
 Computes the symbol time for LoRa modulation. More...
 
uint32_t RegionCommonComputeSymbolTimeFsk (uint8_t phyDrInKbps)
 Computes the symbol time for FSK modulation. More...
 
void RegionCommonComputeRxWindowParameters (uint32_t tSymbolInUs, uint8_t minRxSymbols, uint32_t rxErrorInMs, uint32_t wakeUpTimeInMs, uint32_t *windowTimeoutInSymbols, int32_t *windowOffsetInMs)
 Computes the RX window timeout and the RX window offset. More...
 
int8_t RegionCommonComputeTxPower (int8_t txPowerIndex, float maxEirp, float antennaGain)
 Computes the txPower, based on the max EIRP and the antenna gain. More...
 
void RegionCommonRxBeaconSetup (RegionCommonRxBeaconSetupParams_t *rxBeaconSetupParams)
 Sets up the radio into RX beacon mode. More...
 
void RegionCommonCountNbOfEnabledChannels (RegionCommonCountNbOfEnabledChannelsParams_t *countNbOfEnabledChannelsParams, uint8_t *enabledChannels, uint8_t *nbEnabledChannels, uint8_t *nbRestrictedChannels)
 Counts the number of enabled channels. More...
 
LoRaMacStatus_t RegionCommonIdentifyChannels (RegionCommonIdentifyChannelsParam_t *identifyChannelsParam, TimerTime_t *aggregatedTimeOff, uint8_t *enabledChannels, uint8_t *nbEnabledChannels, uint8_t *nbRestrictedChannels, TimerTime_t *nextTxDelay)
 Identifies all channels which are available currently. More...
 
int8_t RegionCommonGetNextLowerTxDr (RegionCommonGetNextLowerTxDrParams_t *params)
 Selects the next lower datarate. More...
 
int8_t RegionCommonLimitTxPower (int8_t txPower, int8_t maxBandTxPower)
 Limits the TX power. More...
 
uint32_t RegionCommonGetBandwidth (uint32_t drIndex, const uint32_t *bandwidths)
 Gets the bandwidth. More...
 

Detailed Description

Region independent implementations which are common to all regions.

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