|
LoRaMAC
4.5.2
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_RETRANSMIT_TIMEOUT 2000
90 #define REGION_COMMON_DEFAULT_RETRANSMIT_TIMEOUT_RND 1000
95 #define REGION_COMMON_DEFAULT_RX1_DR_OFFSET 0
100 #define REGION_COMMON_DEFAULT_DOWNLINK_DWELL_TIME 0
108 #define REGION_COMMON_DEFAULT_PING_SLOT_PERIODICITY 7
117 #define REGION_COMMON_CLASS_B_C_RESP_TIMEOUT 8000
120 typedef struct sRegionCommonLinkAdrParams
144 typedef struct sRegionCommonLinkAdrReqVerifyParams
212 typedef struct sRegionCommonRxBeaconSetupParams
244 typedef struct sRegionCommonCountNbOfEnabledChannelsParams
278 typedef struct sRegionCommonIdentifyChannelsParam
314 typedef struct sRegionCommonSetDutyCycleParams
330 typedef struct sRegionCommonGetNextLowerTxDrParams
336 uint16_t* ChannelsMask;
450 uint8_t nbBands,
bool dutyCycleEnabled,
451 bool lastTxIsJoinRequest, SysTime_t elapsedTimeSinceStartup,
452 TimerTime_t expectedTimeOnAir );
520 void RegionCommonComputeRxWindowParameters( uint32_t tSymbolInUs, uint8_t minRxSymbols, uint32_t rxErrorInMs, uint32_t wakeUpTimeInMs, uint32_t* windowTimeoutInSymbols, int32_t* windowOffsetInMs );
560 uint8_t* enabledChannels, uint8_t* nbEnabledChannels, uint8_t* nbRestrictedChannels );
584 TimerTime_t* aggregatedTimeOff, uint8_t* enabledChannels,
585 uint8_t* nbEnabledChannels, uint8_t* nbRestrictedChannels,
586 TimerTime_t* nextTxDelay );
625 #endif // __REGIONCOMMON_H__
uint16_t * ChannelsMask
Definition: RegionCommon.h:189
bool DutyCycleEnabled
Definition: RegionCommon.h:291
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:133
int8_t MaxDatarate
Definition: RegionCommon.h:197
int8_t CurrentNbRep
Definition: RegionCommon.h:181
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:303
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:2269
int8_t CurrentDatarate
Definition: RegionCommon.h:173
uint8_t BeaconSize
Definition: RegionCommon.h:225
uint8_t Status
Definition: RegionCommon.h:153
int8_t RegionCommonLimitTxPower(int8_t txPower, int8_t maxBandTxPower)
Limits the TX power.
uint8_t ChMaskCtrl
Definition: RegionCommon.h:137
int8_t Datarate
Definition: RegionCommon.h:129
LoRa MAC layer internal types definition. Please do not include in application sources.
uint8_t MaxBands
Definition: RegionCommon.h:295
Definition: RegionCommon.h:144
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:125
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:209
Definition: LoRaMacTypes.h:1097
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:141
RegionCommonCountNbOfEnabledChannelsParams_t * CountNbOfEnabledChannelsParam
Definition: RegionCommon.h:311
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:149
uint16_t SymbolTimeout
Definition: RegionCommon.h:241
uint32_t RxTime
Definition: RegionCommon.h:237
Definition: LoRaMacTypes.h:1169
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:157
Band_t * Bands
Definition: RegionCommon.h:265
uint8_t BeaconChannelBW
Definition: RegionCommon.h:233
Definition: RegionCommon.h:244
ChannelParams_t * Channels
Definition: RegionCommon.h:201
uint16_t * JoinChannels
Definition: RegionCommon.h:275
TimerTime_t LastAggrTx
Definition: RegionCommon.h:287
uint8_t NbChannels
Definition: RegionCommon.h:185
const uint8_t * Datarates
Definition: RegionCommon.h:217
Definition: RegionCommon.h:330
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:193
TimerTime_t DutyCycleTimePeriod
Definition: RegionCommon.h:319
uint32_t RegionCommonComputeSymbolTimeLoRa(uint8_t phyDr, uint32_t bandwidthInHz)
Computes the symbol time for LoRa modulation.
uint32_t Frequency
Definition: RegionCommon.h:221
Definition: RegionCommon.h:120
bool Joined
Definition: RegionCommon.h:249
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:229
TimerTime_t ExpectedTimeOnAir
Definition: RegionCommon.h:307
uint32_t RegionCommonGetBandwidth(uint32_t drIndex, const uint32_t *bandwidths)
Gets the bandwidth.
SysTime_t ElapsedTimeSinceStartUp
Definition: RegionCommon.h:299
Definition: RegionCommon.h:212
uint8_t Datarate
Definition: RegionCommon.h:253
int8_t RegionCommonGetNextLowerTxDr(RegionCommonGetNextLowerTxDrParams_t *params)
Selects the next lower datarate.
uint16_t MaxNbChannels
Definition: RegionCommon.h:269
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:177
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:283
Definition: RegionCommon.h:278
int8_t MinTxPower
Definition: RegionCommon.h:205
Definition: RegionCommon.h:314