| SX126x-Arduino 2.0.1

Region.h
Go to the documentation of this file.
1
52 #ifndef __REGION_H__
53 #define __REGION_H__
54
55 extern "C"
56 {
57
58 #include "mac/Commissioning.h"
59
60 #define channel_mask_size 12
61
65 #define LC(channelIndex) (uint16_t)(1 << (channelIndex - 1))
66
84 #define DR_0 0
85
103 #define DR_1 1
104
122 #define DR_2 2
123
141 #define DR_3 3
142
160 #define DR_4 4
161
179 #define DR_5 5
180
198 #define DR_6 6
199
217 #define DR_7 7
218
236 #define DR_8 8
237
255 #define DR_9 9
256
274 #define DR_10 10
275
293 #define DR_11 11
294
312 #define DR_12 12
313
331 #define DR_13 13
332
350 #define DR_14 14
351
369 #define DR_15 15
370
388 #define TX_POWER_0 0
389
407 #define TX_POWER_1 1
408
426 #define TX_POWER_2 2
427
445 #define TX_POWER_3 3
446
464 #define TX_POWER_4 4
465
483 #define TX_POWER_5 5
484
502 #define TX_POWER_6 6
503
521 #define TX_POWER_7 7
522
540 #define TX_POWER_8 8
541
559 #define TX_POWER_9 9
560
578 #define TX_POWER_10 10
579
583 #define TX_POWER_11 11
584
588 #define TX_POWER_12 12
589
593 #define TX_POWER_13 13
594
598 #define TX_POWER_14 14
599
603 #define TX_POWER_15 15
604
608 typedef enum ePhyAttribute
609 {
613 PHY_MIN_RX_DR,
617 PHY_MIN_TX_DR,
621 PHY_MAX_RX_DR,
625 PHY_MAX_TX_DR,
629 PHY_TX_DR,
633 PHY_DEF_TX_DR,
637 PHY_RX_DR,
641 PHY_TX_POWER,
645 PHY_DEF_TX_POWER,
649 PHY_MAX_PAYLOAD,
653 PHY_MAX_PAYLOAD_REPEATER,
657 PHY_DUTY_CYCLE,
661 PHY_MAX_RX_WINDOW,
665 PHY_RECEIVE_DELAY1,
669 PHY_RECEIVE_DELAY2,
673 PHY_JOIN_ACCEPT_DELAY1,
677 PHY_JOIN_ACCEPT_DELAY2,
681 PHY_MAX_FCNT_GAP,
685 PHY_ACK_TIMEOUT,
689 PHY_DEF_DR1_OFFSET,
693 PHY_DEF_RX2_FREQUENCY,
697 PHY_DEF_RX2_DR,
701 PHY_CHANNELS_MASK,
705 PHY_CHANNELS_DEFAULT_MASK,
709 PHY_MAX_NB_CHANNELS,
713 PHY_CHANNELS,
717 PHY_DEF_UPLINK_DWELL_TIME,
721 PHY_DEF_DOWNLINK_DWELL_TIME,
725 PHY_DEF_MAX_EIRP,
729 PHY_DEF_ANTENNA_GAIN,
733 PHY_NB_JOIN_TRIALS,
737 PHY_DEF_NB_JOIN_TRIALS,
741 PHY_NEXT_LOWER_TX_DR
742 } PhyAttribute_t;
743
747 typedef enum eInitType
748 {
753 INIT_TYPE_INIT,
757 INIT_TYPE_RESTORE,
762 INIT_TYPE_APP_DEFAULTS
763 } InitType_t;
764
765 typedef enum eChannelsMask
766 {
770 CHANNELS_MASK,
774 CHANNELS_DEFAULT_MASK
775 } ChannelsMask_t;
776
780 typedef union uPhyParam {
784 uint32_t Value;
788 float fValue;
792 uint16_t *ChannelsMask;
796 ChannelParams_t *Channels;
797 } PhyParam_t;
798
802 typedef struct sGetPhyParams
803 {
807 PhyAttribute_t Attribute;
813 int8_t Datarate;
819 uint8_t UplinkDwellTime;
825 uint8_t DownlinkDwellTime;
826 } GetPhyParams_t;
827
831 typedef struct sSetBandTxDoneParams
832 {
836 uint8_t Channel;
840 bool Joined;
844 TimerTime_t LastTxDoneTime;
845 } SetBandTxDoneParams_t;
846
850 typedef union uVerifyParams {
854 int8_t TxPower;
858 bool DutyCycle;
862 uint8_t NbJoinTrials;
866 struct sDatarateParams
867 {
871 int8_t Datarate;
875 uint8_t DownlinkDwellTime;
879 uint8_t UplinkDwellTime;
880 } DatarateParams;
881 } VerifyParams_t;
882
886 typedef struct sApplyCFListParams
887 {
891 uint8_t *Payload;
895 uint8_t Size;
896 } ApplyCFListParams_t;
897
901 typedef struct sChanMaskSetParams
902 {
906 uint16_t *ChannelsMaskIn;
910 ChannelsMask_t ChannelsMaskType;
911 } ChanMaskSetParams_t;
912
916 typedef struct sAdrNextParams
917 {
921 bool UpdateChanMask;
925 bool AdrEnabled;
929 uint32_t AdrAckCounter;
933 int8_t Datarate;
937 int8_t TxPower;
941 uint8_t UplinkDwellTime;
942 } AdrNextParams_t;
943
947 typedef struct sRxConfigParams
948 {
952 uint8_t Channel;
956 int8_t Datarate;
960 uint8_t Bandwidth;
964 int8_t DrOffset;
968 uint32_t Frequency;
972 uint32_t WindowTimeout;
976 int32_t WindowOffset;
980 uint8_t DownlinkDwellTime;
984 bool RepeaterSupport;
988 bool RxContinuous;
992 bool Window;
993 } RxConfigParams_t;
994
998 typedef struct sTxConfigParams
999 {
1003 uint8_t Channel;
1007 int8_t Datarate;
1011 int8_t TxPower;
1015 float MaxEirp;
1019 float AntennaGain;
1023 uint16_t PktLen;
1024 } TxConfigParams_t;
1025
1029 typedef struct sLinkAdrReqParams
1030 {
1034 uint8_t *Payload;
1038 uint8_t PayloadSize;
1042 uint8_t UplinkDwellTime;
1046 bool AdrEnabled;
1050 int8_t CurrentDatarate;
1054 int8_t CurrentTxPower;
1058 uint8_t CurrentNbRep;
1059 } LinkAdrReqParams_t;
1060
1064 typedef struct sRxParamSetupReqParams
1065 {
1069 int8_t Datarate;
1073 int8_t DrOffset;
1077 uint32_t Frequency;
1078 } RxParamSetupReqParams_t;
1079
1083 typedef struct sNewChannelReqParams
1084 {
1088 ChannelParams_t *NewChannel;
1092 int8_t ChannelId;
1093 } NewChannelReqParams_t;
1094
1098 typedef struct sTxParamSetupReqParams
1099 {
1103 uint8_t UplinkDwellTime;
1107 uint8_t DownlinkDwellTime;
1111 uint8_t MaxEirp;
1112 } TxParamSetupReqParams_t;
1113
1117 typedef struct sDlChannelReqParams
1118 {
1122 uint8_t ChannelId;
1126 uint32_t Rx1Frequency;
1127 } DlChannelReqParams_t;
1128
1132 typedef struct sAlternateDrParams
1133 {
1137 uint16_t NbTrials;
1138 } AlternateDrParams_t;
1139
1143 typedef struct sCalcBackOffParams
1144 {
1148 bool Joined;
1152 bool LastTxIsJoinRequest;
1156 bool DutyCycleEnabled;
1160 uint8_t Channel;
1164 TimerTime_t ElapsedTime;
1168 TimerTime_t TxTimeOnAir;
1169 } CalcBackOffParams_t;
1170
1174 typedef struct sNextChanParams
1175 {
1179 TimerTime_t AggrTimeOff;
1183 TimerTime_t LastAggrTx;
1187 int8_t Datarate;
1191 bool Joined;
1195 bool DutyCycleEnabled;
1196 } NextChanParams_t;
1197
1201 typedef struct sChannelAddParams
1202 {
1206 ChannelParams_t *NewChannel;
1210 uint8_t ChannelId;
1211 } ChannelAddParams_t;
1212
1216 typedef struct sChannelRemoveParams
1217 {
1221 uint8_t ChannelId;
1222 } ChannelRemoveParams_t;
1223
1227 typedef struct sContinuousWaveParams
1228 {
1232 uint8_t Channel;
1236 int8_t Datarate;
1240 int8_t TxPower;
1244 float MaxEirp;
1248 float AntennaGain;
1252 uint16_t Timeout;
1253 } ContinuousWaveParams_t;
1254
1263 bool RegionIsActive(LoRaMacRegion_t region);
1264
1274 PhyParam_t RegionGetPhyParam(LoRaMacRegion_t region, GetPhyParams_t *getPhy);
1275
1283 void RegionSetBandTxDone(LoRaMacRegion_t region, SetBandTxDoneParams_t *txDone);
1284
1292 void RegionInitDefaults(LoRaMacRegion_t region, InitType_t type);
1293
1305 bool RegionVerify(LoRaMacRegion_t region, VerifyParams_t *verify, PhyAttribute_t phyAttribute);
1306
1315 void RegionApplyCFList(LoRaMacRegion_t region, ApplyCFListParams_t *applyCFList);
1316
1326 bool RegionChanMaskSet(LoRaMacRegion_t region, ChanMaskSetParams_t *chanMaskSet);
1327
1343 bool RegionAdrNext(LoRaMacRegion_t region, AdrNextParams_t *adrNext, int8_t *drOut, int8_t *txPowOut, uint32_t *adrAckCounter);
1344
1356 bool RegionRxConfig(LoRaMacRegion_t region, RxConfigParams_t *rxConfig, int8_t *datarate);
1357
1358 /*
1359 * Rx window precise timing
1360 *
1361 * For more details please consult the following document, chapter 3.1.2.
1362 * http://www.semtech.com/images/datasheet/SX1272_settings_for_LoRaWAN_v2.0.pdf
1363 * or
1364 * http://www.semtech.com/images/datasheet/SX1276_settings_for_LoRaWAN_v2.0.pdf
1365 *
1366 * Downlink start: T = Tx + 1s (+/- 20 us)
1367 * |
1368 * TRxEarly | TRxLate
1369 * | | |
1370 * | | +---+---+---+---+---+---+---+---+
1371 * | | | Latest Rx window |
1372 * | | +---+---+---+---+---+---+---+---+
1373 * | | |
1374 * +---+---+---+---+---+---+---+---+
1375 * | Earliest Rx window |
1376 * +---+---+---+---+---+---+---+---+
1377 * |
1378 * +---+---+---+---+---+---+---+---+
1379 *Downlink preamble 8 symbols | | | | | | | | |
1380 * +---+---+---+---+---+---+---+---+
1381 *
1382 * Worst case Rx window timings
1383 *
1384 * TRxLate = DEFAULT_MIN_RX_SYMBOLS * tSymbol - RADIO_WAKEUP_TIME
1385 * TRxEarly = 8 - DEFAULT_MIN_RX_SYMBOLS * tSymbol - RxWindowTimeout - RADIO_WAKEUP_TIME
1386 *
1387 * TRxLate - TRxEarly = 2 * DEFAULT_SYSTEM_MAX_RX_ERROR
1388 *
1389 * RxOffset = ( TRxLate + TRxEarly ) / 2
1390 *
1391 * RxWindowTimeout = ( 2 * DEFAULT_MIN_RX_SYMBOLS - 8 ) * tSymbol + 2 * DEFAULT_SYSTEM_MAX_RX_ERROR
1392 * RxOffset = 4 * tSymbol - RxWindowTimeout / 2 - RADIO_WAKE_UP_TIME
1393 *
1394 * Minimal value of RxWindowTimeout must be 5 symbols which implies that the system always tolerates at least an error of 1.5 * tSymbol
1395 */
1411 void RegionComputeRxWindowParameters(LoRaMacRegion_t region, int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams);
1412
1426 bool RegionTxConfig(LoRaMacRegion_t region, TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir);
1427
1445 uint8_t RegionLinkAdrReq(LoRaMacRegion_t region, LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed);
1446
1456 uint8_t RegionRxParamSetupReq(LoRaMacRegion_t region, RxParamSetupReqParams_t *rxParamSetupReq);
1457
1467 uint8_t RegionNewChannelReq(LoRaMacRegion_t region, NewChannelReqParams_t *newChannelReq);
1468
1480 int8_t RegionTxParamSetupReq(LoRaMacRegion_t region, TxParamSetupReqParams_t *txParamSetupReq);
1481
1491 uint8_t RegionDlChannelReq(LoRaMacRegion_t region, DlChannelReqParams_t *dlChannelReq);
1492
1502 int8_t RegionAlternateDr(LoRaMacRegion_t region, AlternateDrParams_t *alternateDr);
1503
1511 void RegionCalcBackOff(LoRaMacRegion_t region, CalcBackOffParams_t *calcBackOff);
1512
1529 bool RegionNextChannel(LoRaMacRegion_t region, NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff);
1530
1540 LoRaMacStatus_t RegionChannelAdd(LoRaMacRegion_t region, ChannelAddParams_t *channelAdd);
1541
1551 bool RegionChannelsRemove(LoRaMacRegion_t region, ChannelRemoveParams_t *channelRemove);
1552
1560 void RegionSetContinuousWave(LoRaMacRegion_t region, ContinuousWaveParams_t *continuousWave);
1561
1575 uint8_t RegionApplyDrOffset(LoRaMacRegion_t region, uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset);
1576
1578 };
1579 #endif // __REGION_H__
sGetPhyParams::DownlinkDwellTime
uint8_t DownlinkDwellTime
Definition: Region.h:825
sAdrNextParams::AdrAckCounter
uint32_t AdrAckCounter
Definition: Region.h:929
eChannelsMask
eChannelsMask
Definition: Region.h:766
AdrNextParams_t
struct sAdrNextParams AdrNextParams_t
sChannelRemoveParams
Definition: Region.h:1217
sContinuousWaveParams::Datarate
int8_t Datarate
Definition: Region.h:1236
sTxParamSetupReqParams::MaxEirp
uint8_t MaxEirp
Definition: Region.h:1111
PHY_MAX_NB_CHANNELS
@ PHY_MAX_NB_CHANNELS
Definition: Region.h:709
sAdrNextParams::Datarate
int8_t Datarate
Definition: Region.h:933
CHANNELS_DEFAULT_MASK
@ CHANNELS_DEFAULT_MASK
Definition: Region.h:774
sChannelAddParams::ChannelId
uint8_t ChannelId
Definition: Region.h:1210
LoRaMacStatus_t
enum eLoRaMacStatus LoRaMacStatus_t
GetPhyParams_t
struct sGetPhyParams GetPhyParams_t
sTxConfigParams
Definition: Region.h:999
sContinuousWaveParams::AntennaGain
float AntennaGain
Definition: Region.h:1248
InitType_t
enum eInitType InitType_t
sSetBandTxDoneParams
Definition: Region.h:832
uVerifyParams::NbJoinTrials
uint8_t NbJoinTrials
Definition: Region.h:862
RegionApplyDrOffset
uint8_t RegionApplyDrOffset(LoRaMacRegion_t region, uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset)
Computes new datarate according to the given offset.
Definition: Region.cpp:1842
sCalcBackOffParams::LastTxIsJoinRequest
bool LastTxIsJoinRequest
Definition: Region.h:1152
sRxParamSetupReqParams
Definition: Region.h:1065
sTxParamSetupReqParams::UplinkDwellTime
uint8_t UplinkDwellTime
Definition: Region.h:1103
INIT_TYPE_INIT
@ INIT_TYPE_INIT
Definition: Region.h:753
RegionTxConfig
bool RegionTxConfig(LoRaMacRegion_t region, TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir)
TX configuration.
Definition: Region.cpp:1554
sRxConfigParams::Frequency
uint32_t Frequency
Definition: Region.h:968
PHY_DEF_DR1_OFFSET
@ PHY_DEF_DR1_OFFSET
Definition: Region.h:689
uVerifyParams
Definition: Region.h:850
sRxConfigParams::Window
bool Window
Definition: Region.h:992
PHY_MAX_PAYLOAD_REPEATER
@ PHY_MAX_PAYLOAD_REPEATER
Definition: Region.h:653
sRxConfigParams
Definition: Region.h:948
PHY_RECEIVE_DELAY2
@ PHY_RECEIVE_DELAY2
Definition: Region.h:669
PHY_MAX_PAYLOAD
@ PHY_MAX_PAYLOAD
Definition: Region.h:649
sAdrNextParams::UpdateChanMask
bool UpdateChanMask
Definition: Region.h:921
sRxConfigParams::RepeaterSupport
bool RepeaterSupport
Definition: Region.h:984
RegionTxParamSetupReq
int8_t RegionTxParamSetupReq(LoRaMacRegion_t region, TxParamSetupReqParams_t *txParamSetupReq)
The function processes a TX ParamSetup Request.
Definition: Region.cpp:1650
sTxConfigParams::MaxEirp
float MaxEirp
Definition: Region.h:1015
sAlternateDrParams
Definition: Region.h:1133
sNewChannelReqParams
Definition: Region.h:1084
NextChanParams_t
struct sNextChanParams NextChanParams_t
sTxParamSetupReqParams::DownlinkDwellTime
uint8_t DownlinkDwellTime
Definition: Region.h:1107
sChannelParams
Definition: LoRaMac.h:171
PHY_CHANNELS
@ PHY_CHANNELS
Definition: Region.h:713
LinkAdrReqParams_t
struct sLinkAdrReqParams LinkAdrReqParams_t
uVerifyParams::DatarateParams
struct uVerifyParams::sDatarateParams DatarateParams
PHY_JOIN_ACCEPT_DELAY2
@ PHY_JOIN_ACCEPT_DELAY2
Definition: Region.h:677
Commissioning.h
sGetPhyParams::UplinkDwellTime
uint8_t UplinkDwellTime
Definition: Region.h:819
sContinuousWaveParams
Definition: Region.h:1228
PHY_MAX_RX_DR
@ PHY_MAX_RX_DR
Definition: Region.h:621
RegionAdrNext
bool RegionAdrNext(LoRaMacRegion_t region, AdrNextParams_t *adrNext, int8_t *drOut, int8_t *txPowOut, uint32_t *adrAckCounter)
Calculates the next datarate to set, when ADR is on or off.
Definition: Region.cpp:1482
sRxConfigParams::DrOffset
int8_t DrOffset
Definition: Region.h:964
sAdrNextParams
Definition: Region.h:917
RegionGetPhyParam
PhyParam_t RegionGetPhyParam(LoRaMacRegion_t region, GetPhyParams_t *getPhy)
The function gets a value of a specific phy attribute.
Definition: Region.cpp:1337
sCalcBackOffParams::DutyCycleEnabled
bool DutyCycleEnabled
Definition: Region.h:1156
sAdrNextParams::UplinkDwellTime
uint8_t UplinkDwellTime
Definition: Region.h:941
PHY_MAX_TX_DR
@ PHY_MAX_TX_DR
Definition: Region.h:625
sRxConfigParams::WindowTimeout
uint32_t WindowTimeout
Definition: Region.h:972
sNextChanParams::LastAggrTx
TimerTime_t LastAggrTx
Definition: Region.h:1183
CalcBackOffParams_t
struct sCalcBackOffParams CalcBackOffParams_t
sTxConfigParams::Datarate
int8_t Datarate
Definition: Region.h:1007
sRxConfigParams::DownlinkDwellTime
uint8_t DownlinkDwellTime
Definition: Region.h:980
sContinuousWaveParams::TxPower
int8_t TxPower
Definition: Region.h:1240
RegionChannelsRemove
bool RegionChannelsRemove(LoRaMacRegion_t region, ChannelRemoveParams_t *channelRemove)
Removes a channel.
Definition: Region.cpp:1794
sSetBandTxDoneParams::Joined
bool Joined
Definition: Region.h:840
PhyParam_t
union uPhyParam PhyParam_t
sNextChanParams::DutyCycleEnabled
bool DutyCycleEnabled
Definition: Region.h:1195
sCalcBackOffParams
Definition: Region.h:1144
uPhyParam::Channels
ChannelParams_t * Channels
Definition: Region.h:796
RegionChannelAdd
LoRaMacStatus_t RegionChannelAdd(LoRaMacRegion_t region, ChannelAddParams_t *channelAdd)
Adds a channel.
Definition: Region.cpp:1770
PHY_ACK_TIMEOUT
@ PHY_ACK_TIMEOUT
Definition: Region.h:685
sLinkAdrReqParams::CurrentNbRep
uint8_t CurrentNbRep
Definition: Region.h:1058
PHY_MAX_RX_WINDOW
@ PHY_MAX_RX_WINDOW
Definition: Region.h:661
sDlChannelReqParams::ChannelId
uint8_t ChannelId
Definition: Region.h:1122
RegionInitDefaults
void RegionInitDefaults(LoRaMacRegion_t region, InitType_t type)
Initializes the channels masks and the channels.
Definition: Region.cpp:1386
sApplyCFListParams
Definition: Region.h:887
PHY_TX_POWER
@ PHY_TX_POWER
Definition: Region.h:641
sTxParamSetupReqParams
Definition: Region.h:1099
sContinuousWaveParams::Timeout
uint16_t Timeout
Definition: Region.h:1252
PHY_MIN_RX_DR
@ PHY_MIN_RX_DR
Definition: Region.h:613
RegionCalcBackOff
void RegionCalcBackOff(LoRaMacRegion_t region, CalcBackOffParams_t *calcBackOff)
Calculates the back-off time.
Definition: Region.cpp:1722
sApplyCFListParams::Payload
uint8_t * Payload
Definition: Region.h:891
uVerifyParams::DutyCycle
bool DutyCycle
Definition: Region.h:858
PHY_RX_DR
@ PHY_RX_DR
Definition: Region.h:637
RegionAlternateDr
int8_t RegionAlternateDr(LoRaMacRegion_t region, AlternateDrParams_t *alternateDr)
Alternates the datarate of the channel for the join request.
Definition: Region.cpp:1698
RegionComputeRxWindowParameters
void RegionComputeRxWindowParameters(LoRaMacRegion_t region, int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams)
Definition: Region.cpp:1506
ePhyAttribute
ePhyAttribute
Definition: Region.h:609
uPhyParam::ChannelsMask
uint16_t * ChannelsMask
Definition: Region.h:792
sNextChanParams::Joined
bool Joined
Definition: Region.h:1191
sChanMaskSetParams
Definition: Region.h:902
sGetPhyParams::Attribute
PhyAttribute_t Attribute
Definition: Region.h:807
PHY_DUTY_CYCLE
@ PHY_DUTY_CYCLE
Definition: Region.h:657
sRxConfigParams::WindowOffset
int32_t WindowOffset
Definition: Region.h:976
sAdrNextParams::AdrEnabled
bool AdrEnabled
Definition: Region.h:925
RegionDlChannelReq
uint8_t RegionDlChannelReq(LoRaMacRegion_t region, DlChannelReqParams_t *dlChannelReq)
The function processes a DlChannel Request.
Definition: Region.cpp:1674
sLinkAdrReqParams
Definition: Region.h:1030
sLinkAdrReqParams::UplinkDwellTime
uint8_t UplinkDwellTime
Definition: Region.h:1042
DlChannelReqParams_t
struct sDlChannelReqParams DlChannelReqParams_t
RegionVerify
bool RegionVerify(LoRaMacRegion_t region, VerifyParams_t *verify, PhyAttribute_t phyAttribute)
Verifies a parameter.
Definition: Region.cpp:1410
sTxConfigParams::AntennaGain
float AntennaGain
Definition: Region.h:1019
RxParamSetupReqParams_t
struct sRxParamSetupReqParams RxParamSetupReqParams_t
sTxConfigParams::PktLen
uint16_t PktLen
Definition: Region.h:1023
PHY_DEF_DOWNLINK_DWELL_TIME
@ PHY_DEF_DOWNLINK_DWELL_TIME
Definition: Region.h:721
sLinkAdrReqParams::CurrentDatarate
int8_t CurrentDatarate
Definition: Region.h:1050
sDlChannelReqParams::Rx1Frequency
uint32_t Rx1Frequency
Definition: Region.h:1126
PHY_MAX_FCNT_GAP
@ PHY_MAX_FCNT_GAP
Definition: Region.h:681
sNextChanParams::AggrTimeOff
TimerTime_t AggrTimeOff
Definition: Region.h:1179
CHANNELS_MASK
@ CHANNELS_MASK
Definition: Region.h:770
PHY_RECEIVE_DELAY1
@ PHY_RECEIVE_DELAY1
Definition: Region.h:665
RegionRxConfig
bool RegionRxConfig(LoRaMacRegion_t region, RxConfigParams_t *rxConfig, int8_t *datarate)
Configuration of the RX windows.
Definition: Region.cpp:1530
ChannelAddParams_t
struct sChannelAddParams ChannelAddParams_t
ChannelRemoveParams_t
struct sChannelRemoveParams ChannelRemoveParams_t
sLinkAdrReqParams::CurrentTxPower
int8_t CurrentTxPower
Definition: Region.h:1054
TxParamSetupReqParams_t
struct sTxParamSetupReqParams TxParamSetupReqParams_t
ChanMaskSetParams_t
struct sChanMaskSetParams ChanMaskSetParams_t
RegionChanMaskSet
bool RegionChanMaskSet(LoRaMacRegion_t region, ChanMaskSetParams_t *chanMaskSet)
Sets a channels mask.
Definition: Region.cpp:1458
PHY_DEF_UPLINK_DWELL_TIME
@ PHY_DEF_UPLINK_DWELL_TIME
Definition: Region.h:717
PHY_DEF_RX2_FREQUENCY
@ PHY_DEF_RX2_FREQUENCY
Definition: Region.h:693
region
LoRaMacRegion_t region
Definition: LoRaMacHelper.cpp:37
PHY_CHANNELS_MASK
@ PHY_CHANNELS_MASK
Definition: Region.h:701
PHY_DEF_NB_JOIN_TRIALS
@ PHY_DEF_NB_JOIN_TRIALS
Definition: Region.h:737
sRxConfigParams::Bandwidth
uint8_t Bandwidth
Definition: Region.h:960
ApplyCFListParams_t
struct sApplyCFListParams ApplyCFListParams_t
PHY_DEF_TX_DR
@ PHY_DEF_TX_DR
Definition: Region.h:633
PHY_TX_DR
@ PHY_TX_DR
Definition: Region.h:629
sChannelRemoveParams::ChannelId
uint8_t ChannelId
Definition: Region.h:1221
uVerifyParams::sDatarateParams::DownlinkDwellTime
uint8_t DownlinkDwellTime
Definition: Region.h:875
RegionLinkAdrReq
uint8_t RegionLinkAdrReq(LoRaMacRegion_t region, LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed)
The function processes a Link ADR Request.
Definition: Region.cpp:1578
PHY_DEF_MAX_EIRP
@ PHY_DEF_MAX_EIRP
Definition: Region.h:725
VerifyParams_t
union uVerifyParams VerifyParams_t
sNextChanParams
Definition: Region.h:1175
SetBandTxDoneParams_t
struct sSetBandTxDoneParams SetBandTxDoneParams_t
sSetBandTxDoneParams::LastTxDoneTime
TimerTime_t LastTxDoneTime
Definition: Region.h:844
uPhyParam
Definition: Region.h:780
uVerifyParams::TxPower
int8_t TxPower
Definition: Region.h:854
RegionSetBandTxDone
void RegionSetBandTxDone(LoRaMacRegion_t region, SetBandTxDoneParams_t *txDone)
Updates the last TX done parameters of the current channel.
Definition: Region.cpp:1362
RegionIsActive
bool RegionIsActive(LoRaMacRegion_t region)
The function verifies if a region is active or not. If a region is not active, it cannot be used.
Definition: Region.cpp:1313
sRxParamSetupReqParams::Frequency
uint32_t Frequency
Definition: Region.h:1077
sChanMaskSetParams::ChannelsMaskType
ChannelsMask_t ChannelsMaskType
Definition: Region.h:910
sTxConfigParams::TxPower
int8_t TxPower
Definition: Region.h:1011
PHY_NEXT_LOWER_TX_DR
@ PHY_NEXT_LOWER_TX_DR
Definition: Region.h:741
uVerifyParams::sDatarateParams::Datarate
int8_t Datarate
Definition: Region.h:871
AlternateDrParams_t
struct sAlternateDrParams AlternateDrParams_t
ChannelsMask_t
enum eChannelsMask ChannelsMask_t
uVerifyParams::sDatarateParams::UplinkDwellTime
uint8_t UplinkDwellTime
Definition: Region.h:879
RegionSetContinuousWave
void RegionSetContinuousWave(LoRaMacRegion_t region, ContinuousWaveParams_t *continuousWave)
Sets the radio into continuous wave mode.
Definition: Region.cpp:1818
INIT_TYPE_RESTORE
@ INIT_TYPE_RESTORE
Definition: Region.h:757
PHY_NB_JOIN_TRIALS
@ PHY_NB_JOIN_TRIALS
Definition: Region.h:733
sChannelAddParams
Definition: Region.h:1202
sRxConfigParams::Datarate
int8_t Datarate
Definition: Region.h:956
RxConfigParams_t
struct sRxConfigParams RxConfigParams_t
sContinuousWaveParams::Channel
uint8_t Channel
Definition: Region.h:1232
RegionNextChannel
bool RegionNextChannel(LoRaMacRegion_t region, NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff)
Searches and set the next random available channel.
Definition: Region.cpp:1746
NewChannelReqParams_t
struct sNewChannelReqParams NewChannelReqParams_t
sNewChannelReqParams::ChannelId
int8_t ChannelId
Definition: Region.h:1092
ContinuousWaveParams_t
struct sContinuousWaveParams ContinuousWaveParams_t
uPhyParam::Value
uint32_t Value
Definition: Region.h:784
sLinkAdrReqParams::PayloadSize
uint8_t PayloadSize
Definition: Region.h:1038
sTxConfigParams::Channel
uint8_t Channel
Definition: Region.h:1003
sRxConfigParams::RxContinuous
bool RxContinuous
Definition: Region.h:988
uVerifyParams::sDatarateParams
Definition: Region.h:867
sCalcBackOffParams::ElapsedTime
TimerTime_t ElapsedTime
Definition: Region.h:1164
sDlChannelReqParams
Definition: Region.h:1118
sGetPhyParams
Definition: Region.h:803
INIT_TYPE_APP_DEFAULTS
@ INIT_TYPE_APP_DEFAULTS
Definition: Region.h:762
PHY_DEF_RX2_DR
@ PHY_DEF_RX2_DR
Definition: Region.h:697
sCalcBackOffParams::Joined
bool Joined
Definition: Region.h:1148
PHY_JOIN_ACCEPT_DELAY1
@ PHY_JOIN_ACCEPT_DELAY1
Definition: Region.h:673
sSetBandTxDoneParams::Channel
uint8_t Channel
Definition: Region.h:836
uPhyParam::fValue
float fValue
Definition: Region.h:788
sGetPhyParams::Datarate
int8_t Datarate
Definition: Region.h:813
sLinkAdrReqParams::AdrEnabled
bool AdrEnabled
Definition: Region.h:1046
sNewChannelReqParams::NewChannel
ChannelParams_t * NewChannel
Definition: Region.h:1088
PHY_DEF_ANTENNA_GAIN
@ PHY_DEF_ANTENNA_GAIN
Definition: Region.h:729
sRxParamSetupReqParams::Datarate
int8_t Datarate
Definition: Region.h:1069
sNextChanParams::Datarate
int8_t Datarate
Definition: Region.h:1187
TxConfigParams_t
struct sTxConfigParams TxConfigParams_t
sRxParamSetupReqParams::DrOffset
int8_t DrOffset
Definition: Region.h:1073
sLinkAdrReqParams::Payload
uint8_t * Payload
Definition: Region.h:1034
sContinuousWaveParams::MaxEirp
float MaxEirp
Definition: Region.h:1244
sApplyCFListParams::Size
uint8_t Size
Definition: Region.h:895
sRxConfigParams::Channel
uint8_t Channel
Definition: Region.h:952
RegionNewChannelReq
uint8_t RegionNewChannelReq(LoRaMacRegion_t region, NewChannelReqParams_t *newChannelReq)
The function processes a New Channel Request.
Definition: Region.cpp:1626
sCalcBackOffParams::TxTimeOnAir
TimerTime_t TxTimeOnAir
Definition: Region.h:1168
sCalcBackOffParams::Channel
uint8_t Channel
Definition: Region.h:1160
PHY_CHANNELS_DEFAULT_MASK
@ PHY_CHANNELS_DEFAULT_MASK
Definition: Region.h:705
sAlternateDrParams::NbTrials
uint16_t NbTrials
Definition: Region.h:1137
PhyAttribute_t
enum ePhyAttribute PhyAttribute_t
sChanMaskSetParams::ChannelsMaskIn
uint16_t * ChannelsMaskIn
Definition: Region.h:906
RegionRxParamSetupReq
uint8_t RegionRxParamSetupReq(LoRaMacRegion_t region, RxParamSetupReqParams_t *rxParamSetupReq)
The function processes a RX Parameter Setup Request.
Definition: Region.cpp:1602
TimerTime_t
uint32_t TimerTime_t
Timer time variable definition.
Definition: timer.h:69
LoRaMacRegion_t
enum eLoRaMacRegion_t LoRaMacRegion_t
PHY_DEF_TX_POWER
@ PHY_DEF_TX_POWER
Definition: Region.h:645
sAdrNextParams::TxPower
int8_t TxPower
Definition: Region.h:937
PHY_MIN_TX_DR
@ PHY_MIN_TX_DR
Definition: Region.h:617
RegionApplyCFList
void RegionApplyCFList(LoRaMacRegion_t region, ApplyCFListParams_t *applyCFList)
The function parses the input buffer and sets up the channels of the CF list.
Definition: Region.cpp:1434
sChannelAddParams::NewChannel
ChannelParams_t * NewChannel
Definition: Region.h:1206
eInitType
eInitType
Definition: Region.h:748