|
LoRaMAC
4.4.5
Documentation of the API
|
Go to the documentation of this file.
37 #ifndef __REGIONCOMMON_H__
38 #define __REGIONCOMMON_H__
54 #define REGION_COMMON_DEFAULT_RECEIVE_DELAY1 1000
59 #define REGION_COMMON_DEFAULT_RECEIVE_DELAY2 ( REGION_COMMON_DEFAULT_RECEIVE_DELAY1 + 1000 )
64 #define REGION_COMMON_DEFAULT_JOIN_ACCEPT_DELAY1 5000
69 #define REGION_COMMON_DEFAULT_JOIN_ACCEPT_DELAY2 ( REGION_COMMON_DEFAULT_JOIN_ACCEPT_DELAY1 + 1000 )
74 #define REGION_COMMON_DEFAULT_ADR_ACK_LIMIT 64
79 #define REGION_COMMON_DEFAULT_ADR_ACK_DELAY 32
84 #define REGION_COMMON_DEFAULT_MAX_FCNT_GAP 16384
89 #define REGION_COMMON_DEFAULT_ACK_TIMEOUT 2000
95 #define REGION_COMMON_DEFAULT_ACK_TIMEOUT_RND 1000
100 #define REGION_COMMON_DEFAULT_RX1_DR_OFFSET 0
105 #define REGION_COMMON_DEFAULT_DOWNLINK_DWELL_TIME 0
113 #define REGION_COMMON_DEFAULT_PING_SLOT_PERIODICITY 7
115 typedef struct sRegionCommonLinkAdrParams
139 typedef struct sRegionCommonLinkAdrReqVerifyParams
207 typedef struct sRegionCommonRxBeaconSetupParams
239 typedef struct sRegionCommonCountNbOfEnabledChannelsParams
273 typedef struct sRegionCommonIdentifyChannelsParam
309 typedef struct sRegionCommonSetDutyCycleParams
435 uint8_t nbBands,
bool dutyCycleEnabled,
436 bool lastTxIsJoinRequest, SysTime_t elapsedTimeSinceStartup,
437 TimerTime_t expectedTimeOnAir );
505 void RegionCommonComputeRxWindowParameters( uint32_t tSymbolInUs, uint8_t minRxSymbols, uint32_t rxErrorInMs, uint32_t wakeUpTimeInMs, uint32_t* windowTimeoutInSymbols, int32_t* windowOffsetInMs );
545 uint8_t* enabledChannels, uint8_t* nbEnabledChannels, uint8_t* nbRestrictedChannels );
569 TimerTime_t* aggregatedTimeOff, uint8_t* enabledChannels,
570 uint8_t* nbEnabledChannels, uint8_t* nbRestrictedChannels,
571 TimerTime_t* nextTxDelay );
612 #endif // __REGIONCOMMON_H__
uint16_t * ChannelsMask
Definition: RegionCommon.h:184
bool DutyCycleEnabled
Definition: RegionCommon.h:286
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 f...
int8_t TxPower
Definition: RegionCommon.h:128
int8_t MaxDatarate
Definition: RegionCommon.h:192
int8_t CurrentNbRep
Definition: RegionCommon.h:176
int8_t RegionCommonComputeTxPower(int8_t txPowerIndex, float maxEirp, float antennaGain)
Computes the txPower, based on the max EIRP and the antenna gain.
bool LastTxIsJoinRequest
Definition: RegionCommon.h:298
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.
LoRaMacStatus_t
Definition: LoRaMac.h:2153
int8_t CurrentDatarate
Definition: RegionCommon.h:168
uint8_t BeaconSize
Definition: RegionCommon.h:220
uint8_t Status
Definition: RegionCommon.h:148
int8_t RegionCommonLimitTxPower(int8_t txPower, int8_t maxBandTxPower)
Limits the TX power.
uint8_t ChMaskCtrl
Definition: RegionCommon.h:132
Definition: LoRaMac.h:217
int8_t Datarate
Definition: RegionCommon.h:124
LoRa MAC layer internal types definition. Please do not include in application sources.
uint8_t MaxBands
Definition: RegionCommon.h:290
Definition: RegionCommon.h:139
void RegionCommonRxBeaconSetup(RegionCommonRxBeaconSetupParams_t *rxBeaconSetupParams)
Sets up the radio into RX beacon mode.
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.
uint8_t NbRep
Definition: RegionCommon.h:120
void RegionCommonCountNbOfEnabledChannels(RegionCommonCountNbOfEnabledChannelsParams_t *countNbOfEnabledChannelsParams, uint8_t *enabledChannels, uint8_t *nbEnabledChannels, uint8_t *nbRestrictedChannels)
Counts the number of enabled channels.
int8_t MaxTxPower
Definition: RegionCommon.h:204
Definition: LoRaMacTypes.h:590
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.
uint16_t ChMask
Definition: RegionCommon.h:136
RegionCommonCountNbOfEnabledChannelsParams_t * CountNbOfEnabledChannelsParam
Definition: RegionCommon.h:306
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.
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.
uint32_t RegionCommonComputeSymbolTimeFsk(uint8_t phyDrInKbps)
Computes the symbol time for FSK modulation.
Version_t Version
Definition: RegionCommon.h:144
uint16_t SymbolTimeout
Definition: RegionCommon.h:236
uint32_t RxTime
Definition: RegionCommon.h:232
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.
bool AdrEnabled
Definition: RegionCommon.h:152
Band_t * Bands
Definition: RegionCommon.h:260
uint8_t BeaconChannelBW
Definition: RegionCommon.h:228
Definition: RegionCommon.h:239
ChannelParams_t * Channels
Definition: RegionCommon.h:196
uint16_t * JoinChannels
Definition: RegionCommon.h:270
TimerTime_t LastAggrTx
Definition: RegionCommon.h:282
uint8_t NbChannels
Definition: RegionCommon.h:180
const uint8_t * Datarates
Definition: RegionCommon.h:212
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.
int8_t MinDatarate
Definition: RegionCommon.h:188
TimerTime_t DutyCycleTimePeriod
Definition: RegionCommon.h:314
uint32_t RegionCommonComputeSymbolTimeLoRa(uint8_t phyDr, uint32_t bandwidthInHz)
Computes the symbol time for LoRa modulation.
uint32_t Frequency
Definition: RegionCommon.h:216
Definition: RegionCommon.h:115
bool Joined
Definition: RegionCommon.h:244
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....
uint8_t BeaconDatarate
Definition: RegionCommon.h:224
TimerTime_t ExpectedTimeOnAir
Definition: RegionCommon.h:302
uint32_t RegionCommonGetBandwidth(uint32_t drIndex, const uint32_t *bandwidths)
Gets the bandwidth.
SysTime_t ElapsedTimeSinceStartUp
Definition: RegionCommon.h:294
Definition: RegionCommon.h:207
int8_t RegionCommonGetNextLowerTxDr(int8_t dr, int8_t minDr)
Selects the next lower datarate.
uint8_t Datarate
Definition: RegionCommon.h:248
uint16_t MaxNbChannels
Definition: RegionCommon.h:264
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 a...
int8_t CurrentTxPower
Definition: RegionCommon.h:172
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.
TimerTime_t AggrTimeOff
Definition: RegionCommon.h:278
Definition: RegionCommon.h:273
int8_t MinTxPower
Definition: RegionCommon.h:200
Definition: RegionCommon.h:309