|
LoRaMAC
4.4.5
Documentation of the API
|
Go to the documentation of this file.
121 #ifndef __LORAMAC_H__
122 #define __LORAMAC_H__
131 #include "utilities.h"
140 #define MAX_ACK_RETRIES 8
155 #define LORA_MAC_MLME_CONFIRM_QUEUE_LEN 5
160 #define LORAMAC_CRYPTO_MULTICAST_KEYS 127
165 typedef enum eActivationType
184 typedef union uDrRange
217 typedef struct sChannelParams
240 typedef struct sRxChannelParams
259 typedef enum eLoRaMacRxSlot
294 typedef struct sLoRaMacCtxs
357 typedef struct sLoRaMacParams
437 typedef union uPingSlotInfo
465 typedef struct sBeaconInfo
508 typedef enum eLoRaMacEventInfoStatus
586 typedef union eLoRaMacFlags_t
670 typedef struct sRequestReturnParam
683 typedef struct sMcpsReqUnconfirmed
709 typedef struct sMcpsReqConfirmed
756 typedef struct sMcpsReqProprietary
775 typedef struct sMcpsReq
810 typedef struct sMcpsConfirm
853 typedef struct sMcpsIndication
1045 typedef struct sMlmeReqJoin
1056 typedef struct sMlmeReqTxCw
1075 typedef struct sMlmeReqPingSlotInfo
1083 typedef struct sMlmeReqDeriveMcKEKey
1102 typedef struct sMlmeReqDeriveMcSessionKeyPair
1113 typedef struct sMlmeReq
1156 typedef struct sMlmeConfirm
1197 typedef struct sMlmeIndication
1700 typedef union uMibParam
2025 Version_t AbpLrWanVersion;
2034 Version_t LoRaWanRegion;
2121 typedef struct eMibRequestConfirm
2137 typedef struct sLoRaMacTxInfo
2153 typedef enum eLoRaMacStatus
2218 LORAMAC_STATUS_NO_CHANNEL_FOUND,
2222 LORAMAC_STATUS_NO_FREE_CHANNEL_FOUND,
2268 typedef enum eLoRaMacRegion_t
2315 typedef enum LoRaMacNvmCtxModule_e
2352 typedef struct sLoRaMacPrimitives
2383 typedef struct sLoRaMacCallback
2393 uint8_t ( *GetBatteryLevel )( void );
2399 float ( *GetTemperatureLevel )( void );
2412 void ( *MacProcessNotify )( void );
2419 static const uint8_t LoRaMacMaxEirpTable[] = { 8, 10, 12, 13, 14, 16, 18, 20, 21, 24, 26, 27, 29, 30, 33, 36 };
2742 #endif // __LORAMAC_H__
Definition: LoRaMac.h:1694
Definition: LoRaMac.h:1632
uint8_t * McAppSKey0
Definition: LoRaMac.h:1815
uint8_t * DevEui
Definition: LoRaMac.h:1719
LoRaMacStatus_t LoRaMacStop(void)
Stops LoRaMAC layer.
int8_t ChannelsDatarate
Definition: LoRaMac.h:366
Definition: LoRaMac.h:1357
Definition: LoRaMac.h:1423
Definition: LoRaMac.h:2305
Mcps_t Type
Definition: LoRaMac.h:780
Definition: LoRaMac.h:2328
uint8_t McpsInd
Definition: LoRaMac.h:604
LoRaMacStatus_t LoRaMacDeInitialization(void)
LoRaMAC deinitialization.
uint8_t * FNwkSIntKey
Definition: LoRaMac.h:1779
Definition: LoRaMac.h:446
Definition: LoRaMac.h:2190
Definition: LoRaMac.h:1567
int8_t ChannelsDefaultDatarate
Definition: LoRaMac.h:1965
Definition: LoRaMac.h:1644
Definition: LoRaMac.h:1303
Definition: LoRaMac.h:2297
McpsReqConfirmed_t Confirmed
Definition: LoRaMac.h:794
Definition: LoRaMac.h:2170
Definition: LoRaMac.h:1677
Definition: LoRaMac.h:1628
Definition: LoRaMac.h:2320
uint8_t MlmeInd
Definition: LoRaMac.h:612
LoRaMacStatus_t LoRaMacMcpsRequest(McpsReq_t *mcpsRequest)
LoRaMAC MCPS-Request.
LoRaMacStatus_t
Definition: LoRaMac.h:2153
Definition: LoRaMac.h:1321
Definition: LoRaMac.h:2195
Definition: LoRaMac.h:280
uint32_t ReceiveDelay2
Definition: LoRaMac.h:389
Definition: LoRaMac.h:2200
bool EnablePublicNetwork
Definition: LoRaMac.h:1881
Definition: LoRaMac.h:2186
Definition: LoRaMac.h:652
Definition: LoRaMac.h:1487
Definition: LoRaMac.h:1375
Definition: LoRaMac.h:660
Definition: LoRaMac.h:1624
Mlme_t MlmeRequest
Definition: LoRaMac.h:1161
Definition: LoRaMac.h:580
Definition: LoRaMac.h:968
Definition: LoRaMac.h:1441
Definition: LoRaMac.h:1652
float AntennaGain
Definition: LoRaMac.h:429
uint8_t * McAppSKey2
Definition: LoRaMac.h:1851
Definition: LoRaMac.h:2254
Definition: LoRaMac.h:240
Definition: LoRaMac.h:2352
int8_t ChannelsTxPower
Definition: LoRaMac.h:362
uint8_t * McKey1
Definition: LoRaMac.h:1827
DeviceClass_t
Definition: LoRaMacTypes.h:68
void * RegionNvmCtx
Pointer to region context.
Definition: LoRaMac.h:307
Definition: LoRaMac.h:184
Definition: LoRaMac.h:980
uint8_t Datarate
Definition: LoRaMac.h:253
Definition: LoRaMac.h:586
Mib_t
Definition: LoRaMac.h:1296
RxChannelParams_t Rx2Channel
Definition: LoRaMac.h:409
Definition: LoRaMac.h:178
Definition: LoRaMac.h:217
Definition: LoRaMac.h:272
Definition: LoRaMac.h:294
BeaconInfo_t BeaconInfo
Definition: LoRaMac.h:1211
uint32_t PingSlotSymbolToExpansionMax
Definition: LoRaMac.h:2089
Definition: LoRaMac.h:1345
LoRa MAC layer internal types definition. Please do not include in application sources.
Definition: LoRaMac.h:1197
Definition: LoRaMac.h:1031
Definition: LoRaMac.h:1417
Definition: LoRaMac.h:1333
uint16_t * ChannelsMask
Definition: LoRaMac.h:1917
void * CryptoNvmCtx
Pointer to crypto module context.
Definition: LoRaMac.h:315
uint32_t BeaconGuard
Definition: LoRaMac.h:2053
Definition: LoRaMac.h:995
uint8_t LoRaMacMcChannelGetGroupId(uint32_t mcAddress)
LoRaMAC multicast channel get groupId from MC address.
Definition: LoRaMac.h:2178
Definition: LoRaMac.h:1351
TimerTime_t BeaconTimingDelay
Definition: LoRaMac.h:1187
Definition: LoRaMac.h:170
Definition: LoRaMac.h:1405
uint32_t Channel
Definition: LoRaMac.h:847
int8_t Min
Definition: LoRaMac.h:202
uint8_t * SePin
Definition: LoRaMac.h:1731
Definition: LoRaMac.h:1045
Definition: LoRaMac.h:1547
Definition: LoRaMac.h:560
Definition: LoRaMac.h:1315
LoRaMacStatus_t LoRaMacMcChannelSetup(McChannelParams_t *channel)
LoRaMAC multicast channel setup service.
uint8_t * McNwkSKey0
Definition: LoRaMac.h:1821
uint8_t * Buffer
Definition: LoRaMac.h:882
uint8_t * AppSKey
Definition: LoRaMac.h:1797
DeviceClass_t Class
Definition: LoRaMac.h:1707
uint8_t * McKey3
Definition: LoRaMac.h:1863
Definition: LoRaMac.h:465
Mib_t Type
Definition: LoRaMac.h:2126
uint8_t * McAppSKey3
Definition: LoRaMac.h:1869
Definition: LoRaMac.h:525
MibParam_t Param
Definition: LoRaMac.h:2131
Definition: LoRaMac.h:2162
uint8_t InfoDesc
Definition: LoRaMac.h:497
Definition: LoRaMac.h:1648
ActivationType_t NetworkActivation
Definition: LoRaMac.h:1713
Definition: LoRaMac.h:2273
Definition: LoRaMac.h:1113
uint8_t * JoinEui
Definition: LoRaMac.h:1725
uint32_t Rx1Frequency
Definition: LoRaMac.h:226
bool DeviceTimeAnsReceived
Definition: LoRaMac.h:918
LoRaMacRegion_t
Definition: LoRaMac.h:2268
RxChannelParams_t Rx2DefaultChannel
Definition: LoRaMac.h:1899
MlmeReqJoin_t Join
Definition: LoRaMac.h:1128
uint32_t BeaconSymbolToDefault
Definition: LoRaMac.h:2077
uint32_t BeaconInterval
Definition: LoRaMac.h:2041
Definition: LoRaMac.h:1309
bool LoRaMacIsBusy(void)
Returns a value indicating if the MAC layer is busy or not.
size_t ConfirmQueueNvmCtxSize
Size of MLME Confirm queue module context.
Definition: LoRaMac.h:351
uint8_t MinRxSymbols
Definition: LoRaMac.h:377
LoRaMacStatus_t LoRaMacChannelRemove(uint8_t id)
LoRaMAC channel remove service.
int8_t TxPower
Definition: LoRaMac.h:827
uint8_t * NwkSEncKey
Definition: LoRaMac.h:1791
Definition: LoRaMac.h:1591
uint8_t * SNwkSIntKey
Definition: LoRaMac.h:1785
Definition: LoRaMac.h:1583
Mlme_t Type
Definition: LoRaMac.h:1118
McpsReqProprietary_t Proprietary
Definition: LoRaMac.h:798
int8_t Datarate
Definition: LoRaMac.h:703
uint8_t * McNwkSKey3
Definition: LoRaMac.h:1875
Definition: LoRaMac.h:1102
Definition: LoRaMac.h:2238
SysTime_t Time
Definition: LoRaMac.h:471
Definition: LoRaMac.h:1083
uint32_t DevAddress
Definition: LoRaMac.h:914
uint32_t UpLinkCounter
Definition: LoRaMac.h:843
Definition: LoRaMac.h:2293
Definition: LoRaMac.h:1602
Definition: LoRaMac.h:1447
Definition: LoRaMac.h:2182
Definition: LoRaMac.h:564
Definition: LoRaMac.h:1517
Definition: LoRaMac.h:962
void LoRaMacProcess(void)
Definition: LoRaMac.h:533
Definition: LoRaMac.h:2332
Mcps_t McpsRequest
Definition: LoRaMac.h:815
Definition: LoRaMac.h:513
Definition: LoRaMac.h:2301
Definition: LoRaMac.h:264
MlmeReqDeriveMcKEKey_t DeriveMcKEKey
Definition: LoRaMac.h:1140
void * ClassBNvmCtx
Pointer to Class B module context.
Definition: LoRaMac.h:339
Definition: LoRaMac.h:2121
uint32_t MaxRxWindow
Definition: LoRaMac.h:381
Definition: LoRaMacTypes.h:299
Definition: LoRaMac.h:1668
Definition: LoRaMac.h:1393
LoRaMacEventInfoStatus_t Status
Definition: LoRaMac.h:819
Definition: LoRaMac.h:1025
Definition: LoRaMac.h:2230
Definition: LoRaMac.h:956
Mcps_t McpsIndication
Definition: LoRaMac.h:858
uint8_t UplinkDwellTime
Definition: LoRaMac.h:417
Definition: LoRaMac.h:1453
Definition: LoRaMac.h:2344
Definition: LoRaMac.h:556
uint16_t * ChannelsDefaultMask
Definition: LoRaMac.h:1923
Definition: LoRaMac.h:1660
float MaxEirp
Definition: LoRaMac.h:425
Definition: LoRaMac.h:288
MlmeReqDeriveMcSessionKeyPair_t DeriveMcSessionKeyPair
Definition: LoRaMac.h:1144
void * SecureElementNvmCtx
Pointer to secure element driver context.
Definition: LoRaMac.h:323
Definition: LoRaMac.h:552
Definition: LoRaMac.h:268
Definition: LoRaMac.h:1682
uint8_t FramePending
Definition: LoRaMac.h:878
ActivationType_t
Definition: LoRaMac.h:165
bool AckReceived
Definition: LoRaMac.h:831
RxChannelParams_t RxCDefaultChannel
Definition: LoRaMac.h:1911
Definition: LoRaMac.h:1479
LoRaMacStatus_t LoRaMacMcChannelDelete(AddressIdentifier_t groupID)
LoRaMAC multicast channel removal service.
void * fBuffer
Definition: LoRaMac.h:695
McChannelParams_t MulticastChannel
Definition: LoRaMac.h:1989
Definition: LoRaMac.h:2340
uint8_t MacDone
Definition: LoRaMac.h:620
Definition: LoRaMac.h:756
size_t SecureElementNvmCtxSize
Size of secure element driver context.
Definition: LoRaMac.h:327
uint16_t Timeout
Definition: LoRaMac.h:1061
Definition: LoRaMac.h:1664
Definition: LoRaMac.h:2277
uint8_t * McNwkSKey1
Definition: LoRaMac.h:1839
Definition: LoRaMac.h:537
Definition: LoRaMac.h:999
uint8_t * McKEKey
Definition: LoRaMac.h:1803
uint32_t DownLinkCounter
Definition: LoRaMac.h:910
Definition: LoRaMac.h:1156
uint8_t Band
Definition: LoRaMac.h:234
uint8_t RFU
Definition: LoRaMac.h:456
Definition: LoRaMac.h:2258
Definition: LoRaMac.h:1636
uint8_t NbTrials
Definition: LoRaMac.h:750
uint16_t Nonce
Definition: LoRaMac.h:1092
Definition: LoRaMac.h:568
Definition: LoRaMac.h:174
Definition: LoRaMac.h:276
uint8_t * JSEncKey
Definition: LoRaMac.h:1773
Definition: LoRaMac.h:1686
Definition: LoRaMac.h:2383
uint8_t Rx1DrOffset
Definition: LoRaMac.h:405
uint8_t fPort
Definition: LoRaMac.h:691
Definition: LoRaMac.h:2285
Definition: LoRaMac.h:529
Definition: LoRaMac.h:1523
Definition: LoRaMac.h:2174
uint32_t DevAddr
Definition: LoRaMac.h:1749
Definition: LoRaMac.h:1499
int16_t Rssi
Definition: LoRaMac.h:483
Definition: LoRaMac.h:1559
KeyIdentifier_t KeyID
Definition: LoRaMac.h:1088
Definition: LoRaMac.h:1597
uint8_t Value
Definition: LoRaMac.h:442
AddressIdentifier_t
Definition: LoRaMacTypes.h:272
Definition: LoRaMac.h:2242
Definition: LoRaMac.h:547
Definition: LoRaMac.h:1505
Definition: LoRaMac.h:517
Definition: LoRaMac.h:950
Definition: LoRaMac.h:664
Definition: LoRaMac.h:1535
Definition: LoRaMac.h:1369
uint8_t BufferSize
Definition: LoRaMac.h:886
Definition: LoRaMac.h:1511
uint8_t * McKey0
Definition: LoRaMac.h:1809
Definition: LoRaMac.h:1465
Definition: LoRaMac.h:1429
float DefaultAntennaGain
Definition: LoRaMac.h:2013
Definition: LoRaMac.h:974
uint32_t PingSlotSymbolToExpansionFactor
Definition: LoRaMac.h:2103
Definition: LoRaMac.h:1541
size_t MacNvmCtxSize
Size of Mac context.
Definition: LoRaMac.h:303
Definition: LoRaMac.h:656
size_t CryptoNvmCtxSize
Size of crypto module context.
Definition: LoRaMac.h:319
uint8_t ChannelsNbTrans
Definition: LoRaMac.h:401
int8_t Snr
Definition: LoRaMac.h:487
Definition: LoRaMac.h:2234
uint8_t NbRetries
Definition: LoRaMac.h:835
Definition: LoRaMac.h:1005
Definition: LoRaMac.h:2250
Definition: LoRaMac.h:709
uint8_t MlmeSchedUplinkInd
Definition: LoRaMac.h:616
Definition: LoRaMac.h:1381
uint32_t BeaconSymbolToExpansionFactor
Definition: LoRaMac.h:2096
LoRaMacStatus_t LoRaMacChannelAdd(uint8_t id, ChannelParams_t params)
LoRaMAC channel add service.
Definition: LoRaMac.h:785
Definition: LoRaMac.h:1075
uint8_t * McAppSKey1
Definition: LoRaMac.h:1833
AddressIdentifier_t GroupID
Definition: LoRaMac.h:1107
Definition: LoRaMac.h:1493
Definition: LoRaMac.h:1399
Definition: LoRaMac.h:193
uint32_t PingSlotWindow
Definition: LoRaMac.h:2071
LoRaMacCtxs_t * Contexts
Definition: LoRaMac.h:2019
Definition: LoRaMac.h:1435
Definition: LoRaMac.h:1019
DrRange_t DrRange
Definition: LoRaMac.h:230
uint32_t Frequency
Definition: LoRaMac.h:222
uint8_t Periodicity
Definition: LoRaMac.h:452
bool RxData
Definition: LoRaMac.h:890
ChannelParams_t * ChannelList
Definition: LoRaMac.h:1887
bool AdrEnable
Definition: LoRaMac.h:1737
Definition: LoRaMac.h:1123
Definition: LoRaMac.h:2309
RxChannelParams_t RxCChannel
Definition: LoRaMac.h:413
uint8_t DownlinkDwellTime
Definition: LoRaMac.h:421
Definition: LoRaMac.h:810
Mlme_t
LoRaMAC management services.
Definition: LoRaMac.h:945
LoRaMacStatus_t LoRaMacQueryTxPossible(uint8_t size, LoRaMacTxInfo_t *txInfo)
Queries the LoRaMAC if it is possible to send the next frame with a given application data payload si...
int8_t ChannelsDefaultTxPower
Definition: LoRaMac.h:1977
size_t ClassBNvmCtxSize
Size of MAC Class B module context.
Definition: LoRaMac.h:343
uint16_t fBufferSize
Definition: LoRaMac.h:699
Definition: LoRaMac.h:1411
uint8_t * DevEUI
Definition: LoRaMac.h:1096
uint8_t * JSIntKey
Definition: LoRaMac.h:1767
uint8_t Multicast
Definition: LoRaMac.h:866
RequestReturnParam_t ReqReturn
Definition: LoRaMac.h:804
Definition: LoRaMac.h:1012
KeyIdentifier_t
Definition: LoRaMacTypes.h:169
Definition: LoRaMac.h:2214
Definition: LoRaMac.h:541
Definition: LoRaMac.h:284
LoRaMacStatus_t LoRaMacMlmeRequest(MlmeReq_t *mlmeRequest)
LoRaMAC MLME-Request.
void * CommandsNvmCtx
Pointer to MAC commands module context.
Definition: LoRaMac.h:331
Definition: LoRaMac.h:437
void * MacNvmCtx
Pointer to Mac context.
Definition: LoRaMac.h:299
MlmeReqPingSlotInfo_t PingSlotInfo
Definition: LoRaMac.h:1136
uint8_t * AppKey
Definition: LoRaMac.h:1755
int8_t Power
Definition: LoRaMac.h:1069
uint32_t BeaconWindowSlots
Definition: LoRaMac.h:2065
Definition: LoRaMac.h:1700
Definition: LoRaMac.h:1471
uint8_t MlmeReq
Definition: LoRaMac.h:608
size_t CommandsNvmCtxSize
Size of MAC commands module context.
Definition: LoRaMac.h:335
Definition: LoRaMac.h:492
Definition: LoRaMac.h:2166
Definition: LoRaMac.h:2158
uint32_t BeaconReserved
Definition: LoRaMac.h:2047
Mcps_t
LoRaMAC data services.
Definition: LoRaMac.h:647
Definition: LoRaMac.h:1672
uint32_t NetID
Definition: LoRaMac.h:1743
Definition: LoRaMac.h:2289
Definition: LoRaMac.h:2226
uint8_t RxDatarate
Definition: LoRaMac.h:874
MlmeReqTxCw_t TxCw
Definition: LoRaMac.h:1132
int8_t Max
Definition: LoRaMac.h:210
Definition: LoRaMac.h:1325
Definition: LoRaMac.h:2246
Definition: LoRaMac.h:1363
Definition: LoRaMac.h:1339
TimerTime_t DutyCycleWaitTime
Definition: LoRaMac.h:677
Definition: LoRaMac.h:1529
uint8_t McpsReq
Definition: LoRaMac.h:600
Definition: LoRaMac.h:1640
uint8_t * McKey2
Definition: LoRaMac.h:1845
TimerTime_t TxTimeOnAir
Definition: LoRaMac.h:839
size_t RegionNvmCtxSize
Size of region context.
Definition: LoRaMac.h:311
LoRaMacStatus_t LoRaMacMibGetRequestConfirm(MibRequestConfirm_t *mibGet)
LoRaMAC MIB-Get.
uint32_t ReceiveDelay1
Definition: LoRaMac.h:385
Definition: LoRaMac.h:357
Definition: LoRaMac.h:1575
McpsReqUnconfirmed_t Unconfirmed
Definition: LoRaMac.h:790
LoRaMacRxSlot_t
Definition: LoRaMac.h:259
uint32_t JoinAcceptDelay2
Definition: LoRaMac.h:397
Definition: LoRaMac.h:775
Definition: LoRaMac.h:2031
Definition: LoRaMac.h:1039
Definition: LoRaMac.h:1387
int8_t Value
Definition: LoRaMac.h:189
Definition: LoRaMac.h:1056
Definition: LoRaMac.h:2262
LoRaMacEventInfoStatus_t
Definition: LoRaMac.h:508
Definition: LoRaMac.h:991
uint8_t * NwkKey
Definition: LoRaMac.h:1761
LoRaMacNvmCtxModule_t
Definition: LoRaMac.h:2315
Definition: LoRaMac.h:521
void * ConfirmQueueNvmCtx
Pointer to MLME Confirm queue module context.
Definition: LoRaMac.h:347
uint8_t * McNwkSKey2
Definition: LoRaMac.h:1857
Definition: LoRaMac.h:683
uint8_t DemodMargin
Definition: LoRaMac.h:1174
uint32_t BeaconWindow
Definition: LoRaMac.h:2059
uint8_t Port
Definition: LoRaMac.h:870
uint8_t BeaconTimingChannel
Definition: LoRaMac.h:1191
Definition: LoRaMac.h:1656
Definition: LoRaMac.h:1459
uint8_t MaxPossibleApplicationDataSize
Definition: LoRaMac.h:2142
Definition: LoRaMac.h:2137
Definition: LoRaMac.h:853
uint8_t CurrentPossiblePayloadSize
Definition: LoRaMac.h:2147
int8_t PingSlotDatarate
Definition: LoRaMac.h:2115
uint32_t BeaconSymbolToExpansionMax
Definition: LoRaMac.h:2083
Definition: LoRaMacTypes.h:333
uint32_t MaxBeaconLessPeriod
Definition: LoRaMac.h:2109
LoRaMacStatus_t LoRaMacStart(void)
Starts LoRaMAC layer.
LoRaMacStatus_t LoRaMacMcChannelSetupRxParams(AddressIdentifier_t groupID, McRxParams_t *rxParams, uint8_t *status)
LoRaMAC multicast channel Rx parameters setup service.
Definition: LoRaMac.h:670
uint8_t NbGateways
Definition: LoRaMac.h:1178
Definition: LoRaMac.h:1613
Definition: LoRaMac.h:2281
LoRaMacStatus_t LoRaMacInitialization(LoRaMacPrimitives_t *primitives, LoRaMacCallback_t *callbacks, LoRaMacRegion_t region)
LoRaMAC layer initialization.
Definition: LoRaMac.h:576
Definition: LoRaMac.h:1553
Mlme_t MlmeIndication
Definition: LoRaMac.h:1202
Definition: LoRaMac.h:2336
Definition: LoRaMac.h:2324
LoRaMacStatus_t LoRaMacMibSetRequestConfirm(MibRequestConfirm_t *mibSet)
LoRaMAC MIB-Set.
uint32_t JoinAcceptDelay1
Definition: LoRaMac.h:393
Definition: LoRaMac.h:986
Definition: LoRaMac.h:595
LoRaMacRxSlot_t RxSlot
Definition: LoRaMac.h:902
Definition: LoRaMac.h:572
uint32_t SystemMaxRxError
Definition: LoRaMac.h:372