 |
Demo HCI Implementation for WiMOD-LR Devices
V2.0.3
|
Go to the documentation of this file.
34 #ifndef ARDUINO_WIMOD_SAP_LORAWAN_H_
35 #define ARDUINO_WIMOD_SAP_LORAWAN_H_
54 #include "../HCI/WiMODLRHCI.h"
60 #ifdef WIMOD_USE_CPP11
70 #define WiMOD_LORAWAN_TX_PAYLOAD_SIZE (WiMODLORAWAN_APP_PAYLOAD_LEN + 5)
87 LoRaWAN_Region_proprietary_WW2G4,
99 #ifdef WIMOD_USE_CPP11
266 UINT16 txPayloadSize;
virtual TWiMODLRResultCodes SetDeviceEUI(const UINT8 *deviceEUI, UINT8 *statusRsp)
Sets a new DeviceEUI (aka. IEEE-Address) to the WiMOD.
Definition: WiMOD_SAP_LORAWAN.cpp:1057
void(* TJoinedNwkIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:154
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:553
UINT8 HeaderMacCmdCapacity
Definition: WiMOD_SAP_LORAWAN_IDs.h:576
void RegisterRxUDataIndicationClient(TRxUDataIndicationCallback cb)
Register a callback function for the event "RX U-Data Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:808
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:570
void RegisterNoDataIndicationClient(TNoDataIndicationCallback cb)
Register a callback function for the event "TX Join Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:763
UINT8 PowerLevel
Definition: WiMOD_SAP_LORAWAN_IDs.h:484
Structure containing data of the joined network indication.
Definition: WiMOD_SAP_LORAWAN_IDs.h:551
void(* TRxUDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:166
Structure containing RX (user) payload data.
Definition: WiMOD_SAP_LORAWAN_IDs.h:514
TLoRaWANregion
LoRaWAN Region support.
Definition: WiMOD_SAP_LORAWAN.h:79
UINT8 BandIndex[(WiMODLORAWAN_APP_PAYLOAD_LEN/2)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:666
UINT8 NumOfEntries
Definition: WiMOD_SAP_LORAWAN_IDs.h:665
virtual TWiMODLRResultCodes FactoryReset(UINT8 *statusRsp)
Reset all internal settings to default values (incl. DevEUI)
Definition: WiMOD_SAP_LORAWAN.cpp:1024
virtual void RegisterDeviceTimeAnsIndicationClient(TNwkDeviceTimeAnsIndicationCallback cb)
Register a callback function for the event "Nwk DeviceTime Answer Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:393
UINT8 WrongParamErrCode
Definition: WiMOD_SAP_LORAWAN_IDs.h:682
virtual TWiMODLRResultCodes JoinNetwork(UINT8 *statusRsp)
Start joining the network via the OTAA procedure. Asynchronous process.
Definition: WiMOD_SAP_LORAWAN.cpp:246
UINT8 AppSKey[WiMODLORAWAN_APP_SESSION_KEY_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:443
Structure containing infos of a NoData Indication message.
Definition: WiMOD_SAP_LORAWAN_IDs.h:648
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:604
UINT8 RxSlot
Definition: WiMOD_SAP_LORAWAN_IDs.h:526
UINT8 Length
Definition: WiMOD_SAP_LORAWAN_IDs.h:595
UINT8 Length
Definition: WiMOD_SAP_LORAWAN_IDs.h:518
virtual void RegisterLinkDisconnectIndicationClient(TLinkDisconnectIndicationCallback cb)
Register a callback function for the event "Link Disconnect Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:378
@ LORAWAN_OPT_TX_IND_INFOS_EXCL_PKT_CNT
Definition: WiMOD_SAP_LORAWAN_IDs.h:463
Activation data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:472
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:541
Internal helper class for processing SLIP frames.
Definition: WiMODLRHCI.h:235
@ LORAWAN_OPT_TX_IND_INFOS_INCL_PKT_CNT
Definition: WiMOD_SAP_LORAWAN_IDs.h:464
virtual TWiMODLRResultCodes ReactivateDevice(UINT32 *devAdr, UINT8 *statusRsp)
Re-Activates the device via the ABP procedure.
Definition: WiMOD_SAP_LORAWAN.cpp:167
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:612
UINT8 TxPwrLimitFlag[(WiMODLORAWAN_APP_PAYLOAD_LEN/3)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:678
UINT8 TxPwrLimitValue[(WiMODLORAWAN_APP_PAYLOAD_LEN/3)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:679
virtual TWiMODLRResultCodes SetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig *data, UINT8 *statusRsp)
Sets a new radio config parameter set of the WiMOD.
Definition: WiMOD_SAP_LORAWAN.cpp:886
@ WiMODLR_RESULT_TRANMIT_ERROR
Definition: WiMODLRHCI.h:154
UINT8 NetworkStatus
Definition: WiMOD_SAP_LORAWAN_IDs.h:621
UINT8 NumMacTransmissions
Definition: WiMOD_SAP_LORAWAN_IDs.h:626
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:516
Structure containing all data about LoRaWAN network status.
Definition: WiMOD_SAP_LORAWAN_IDs.h:619
INT8 RSSI
Definition: WiMOD_SAP_LORAWAN_IDs.h:609
void RegisterRxAckIndicationClient(TRxAckIndicationCallback cb)
Register a callback function for the event "RX ACK (data) Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:868
UINT8 SubBandIndex[(WiMODLORAWAN_APP_PAYLOAD_LEN/3)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:677
virtual TWiMODLRResultCodes SendUData(const TWiMODLORAWAN_TX_Data *data, UINT8 *statusRsp)
Tries to send transmit U-Data to network server via RF link.
Definition: WiMOD_SAP_LORAWAN.cpp:278
UINT8 NumOfEntries
Definition: WiMOD_SAP_LORAWAN_IDs.h:676
virtual void RegisterJoinTxIndicationClient(TJoinTxIndicationCallback cb)
Register a callback function for the event "TX Join Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:406
virtual void RegisterResetDevNonceIndicationClient(TResetDevNonceIndicationCallback cb)
Register a callback function for the event "Reset DeviceNonce Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:362
UINT8 Length
Definition: WiMOD_SAP_LORAWAN_IDs.h:536
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
UINT8 AppKey[WiMODLORAWAN_APP_KEY_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:453
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:608
@ WiMODLR_RESULT_OK
Definition: WiMODLRHCI.h:151
UINT8 NumTxPackets
Definition: WiMOD_SAP_LORAWAN_IDs.h:482
@ LoRaWAN_Region_US915
Definition: WiMOD_SAP_LORAWAN.h:82
UINT8 PowerSavingMode
Definition: WiMOD_SAP_LORAWAN_IDs.h:573
data structure for supported bands
Definition: WiMOD_SAP_LORAWAN_IDs.h:663
UINT8 MaxEIRP[(WiMODLORAWAN_APP_PAYLOAD_LEN/2)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:667
JOIN data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:450
@ LoRaWAN_Region_IL915
Definition: WiMOD_SAP_LORAWAN.h:85
UINT8 TXPowerLevel
Definition: WiMOD_SAP_LORAWAN_IDs.h:571
virtual TWiMODLRResultCodes SetJoinParameter(TWiMODLORAWAN_JoinParams &joinParams, UINT8 *statusRsp)
Sets the parameters used for the OTAA activation procedure.
Definition: WiMOD_SAP_LORAWAN.cpp:208
INT8 SNR
Definition: WiMOD_SAP_LORAWAN_IDs.h:543
UINT8 MacCmdID
Definition: WiMOD_SAP_LORAWAN_IDs.h:593
void RegisterJoinedNwkIndicationClient(TJoinedNwkIndicationCallback cb)
Register a callback function for the event "Joined Nwk Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:853
INT8 RSSI
Definition: WiMOD_SAP_LORAWAN_IDs.h:542
virtual TWiMODLRResultCodes GetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig *data, UINT8 *statusRsp)
Gets the current radio config parameter set of the WiMOD.
Definition: WiMOD_SAP_LORAWAN.cpp:946
Radio stack configuration related to to LoRaWAN specific options.
Definition: WiMOD_SAP_LORAWAN_IDs.h:568
UINT16 Length
Definition: WiMODLRHCI.h:123
INT8 RSSI
Definition: WiMOD_SAP_LORAWAN_IDs.h:524
UINT8 MsgID
Definition: WiMODLRHCI.h:129
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:562
UINT8 DataServiceType
Definition: WiMOD_SAP_LORAWAN_IDs.h:592
void RegisterTxCDataIndicationClient(TTxCDataIndicationCallback cb)
Register a callback function for the event "TX C-Data Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:778
UINT8 RxSlot
Definition: WiMOD_SAP_LORAWAN_IDs.h:611
void(* TTxUDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:163
data structure for TX Power Limits
Definition: WiMOD_SAP_LORAWAN_IDs.h:674
UINT8 JoinEUI[WiMODLORAWAN_JOIN_EUI_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:452
void(* TRxAckIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:175
virtual TWiMODLRResultCodes GetDeviceEUI(UINT8 *deviceEUI, UINT8 *statusRsp)
Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD.
Definition: WiMOD_SAP_LORAWAN.cpp:1094
Data structure for received Acknowledgment data.
Definition: WiMOD_SAP_LORAWAN_IDs.h:602
UINT8 Payload[WIMODLR_HCI_MSG_PAYLOAD_SIZE]
Definition: WiMODLRHCI.h:132
virtual TWiMODLRResultCodes GetCustomConfig(INT8 *rfGain, UINT8 *statusRsp)
Get the current offet for tx power level; expert level only.
Definition: WiMOD_SAP_LORAWAN.cpp:1302
UINT8 RxSlot
Definition: WiMOD_SAP_LORAWAN_IDs.h:561
UINT8 RxSlot
Definition: WiMOD_SAP_LORAWAN_IDs.h:544
void RegisterRxMacCmdIndicationClient(TRxMacCmdIndicationCallback cb)
Register a callback function for the event "RX MAC Cmd Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:838
virtual TWiMODLRResultCodes GetNwkStatus(TWiMODLORAWAN_NwkStatus_Data *nwkStatus, UINT8 *statusRsp)
Gets the current status of the network "connection".
Definition: WiMOD_SAP_LORAWAN.cpp:1168
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:650
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:480
void(* TRxMacCmdIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:172
void RegisterRxCDataIndicationClient(TRxCDataIndicationCallback cb)
Register a callback function for the event "RX C-Data Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:823
INT8 SNR
Definition: WiMOD_SAP_LORAWAN_IDs.h:610
UINT8 BandIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:575
INT8 SNR
Definition: WiMOD_SAP_LORAWAN_IDs.h:560
UINT32 RfMsgAirtime
Definition: WiMOD_SAP_LORAWAN_IDs.h:486
void(* TNwkDeviceTimeAnsIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:148
void(* TTxCDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:160
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:476
virtual TWiMODLRResultCodes SetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig &txPwrLimitCfg, UINT8 *statusRsp)
Set a SINGLE TxPowerLimit entry.
Definition: WiMOD_SAP_LORAWAN.cpp:1431
WiMOD_SAP_LoRaWAN(TWiMODLRHCI *hci, UINT8 *buffer, UINT16 bufferSize)
Constructor.
Definition: WiMOD_SAP_LORAWAN.cpp:68
UINT8 WrongParamErrCode
Definition: WiMOD_SAP_LORAWAN_IDs.h:583
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:558
@ WiMODLR_RESULT_PAYLOAD_PTR_ERROR
Definition: WiMODLRHCI.h:153
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:655
LoRaWAN MAC command structure.
Definition: WiMOD_SAP_LORAWAN_IDs.h:590
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:540
UINT8 Port
Definition: WiMOD_SAP_LORAWAN_IDs.h:517
void(* TJoinTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:151
void(* TNoDataIndicationCallback)(void)
Definition: WiMOD_SAP_LORAWAN.h:157
virtual TWiMODLRResultCodes GetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig *txPwrLimitCfg, UINT8 *statusRsp)
Get the configured TxPowerLimit settings.
Definition: WiMOD_SAP_LORAWAN.cpp:1382
virtual TWiMODLRResultCodes SetBatteryLevelStatus(UINT8 battStatus, UINT8 *statusRsp)
Set Battery Level Status.
Definition: WiMOD_SAP_LORAWAN.cpp:1569
TWiMODLORAWAN_OptIndInfos FieldAvailability
Definition: WiMOD_SAP_LORAWAN_IDs.h:474
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:527
virtual ~WiMOD_SAP_LoRaWAN(void)
Destructor.
Definition: WiMOD_SAP_LORAWAN.cpp:95
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:607
INT8 SNR
Definition: WiMOD_SAP_LORAWAN_IDs.h:525
virtual TWiMODLRResultCodes SetCustomConfig(const INT8 rfGain, UINT8 *statusRsp)
Setup a custom config for tx power settings; expert level only.
Definition: WiMOD_SAP_LORAWAN.cpp:1268
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:545
void(* TRxCDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:169
UINT8 Payload[WiMODLORAWAN_APP_PAYLOAD_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:519
void(* TResetDevNonceIndicationCallback)(void)
Definition: WiMOD_SAP_LORAWAN.h:142
UINT8 SubBandMask1
Definition: WiMOD_SAP_LORAWAN_IDs.h:579
Structure containing a received MAC command.
Definition: WiMOD_SAP_LORAWAN_IDs.h:534
TWiMODLRResultCodes
Result codes for the local serial communication itself.
Definition: WiMODLRHCI.h:149
@ LoRaWAN_Region_EU868
Definition: WiMOD_SAP_LORAWAN.h:81
UINT8 Options
Definition: WiMOD_SAP_LORAWAN_IDs.h:572
@ LoRaWAN_Region_IN865
Definition: WiMOD_SAP_LORAWAN.h:83
virtual void setRegion(TLoRaWANregion regionalSetting)
Setup regional settings for the LoRaWAN Firmware of the WiMOD module.
Definition: WiMOD_SAP_LORAWAN.cpp:108
@ WiMODLR_RESULT_NO_RESPONSE
Definition: WiMODLRHCI.h:156
virtual TWiMODLRResultCodes SendCData(const TWiMODLORAWAN_TX_Data *data, UINT8 *statusRsp)
Tries to send transmit C-Data to network server via RF link.
Definition: WiMOD_SAP_LORAWAN.cpp:325
Activation data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:439
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:623
virtual TWiMODLRResultCodes DeactivateDevice(UINT8 *statusRsp)
Deactivate the device (logical disconnect from lora network)
Definition: WiMOD_SAP_LORAWAN.cpp:996
UINT32 DeviceAddress
Definition: WiMOD_SAP_LORAWAN_IDs.h:622
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:523
UINT8 PowerLevel
Definition: WiMOD_SAP_LORAWAN_IDs.h:624
UINT8 ErrorCode
Definition: WiMOD_SAP_LORAWAN_IDs.h:653
Implementation for the ServiceAccessPoint LoRaWAN (End Node Modem firmware only)
Definition: WiMOD_SAP_LORAWAN.h:189
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:522
virtual TWiMODLRResultCodes GetSupportedBands(TWiMODLORAWAN_SupportedBands *supportedBands, UINT8 *statusRsp)
Get the supported bands of this firmware.
Definition: WiMOD_SAP_LORAWAN.cpp:1338
INT8 RSSI
Definition: WiMOD_SAP_LORAWAN_IDs.h:559
virtual TWiMODLRResultCodes ActivateDevice(TWiMODLORAWAN_ActivateDeviceData &activationData, UINT8 *statusRsp)
Activates the device via the ABP procedure.
Definition: WiMOD_SAP_LORAWAN.cpp:126
void RegisterTxUDataIndicationClient(TTxUDataIndicationCallback cb)
Register a callback function for the event "TX U Data Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:793
UINT32 DeviceAddress
Definition: WiMOD_SAP_LORAWAN_IDs.h:441
bool convert(TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_RX_Data *loraWanRxData)
Convert a received low level HCI-Msg to a high-level Rx Data structure.
Definition: WiMOD_SAP_LORAWAN.cpp:489
UINT8 Retransmissions
Definition: WiMOD_SAP_LORAWAN_IDs.h:574
@ LoRaWAN_Region_RU868
Definition: WiMOD_SAP_LORAWAN.h:86
Structure containing all data necessary to transmitting a data message.
Definition: WiMOD_SAP_LORAWAN_IDs.h:502
virtual TWiMODLRResultCodes SendMacCmd(const TWiMODLORAWAN_MacCmd *cmd, UINT8 *statusRsp)
Send a MAC command to the server; expert level only.
Definition: WiMOD_SAP_LORAWAN.cpp:1221
UINT8 NwkSKey[WiMODLORAWAN_NWK_SESSION_KEY_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:442
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:557
UINT8 Length
Definition: WiMOD_SAP_LORAWAN_IDs.h:505
UINT8 Port
Definition: WiMOD_SAP_LORAWAN_IDs.h:504
@ LORAWAN_OPT_TX_IND_INFOS_NOT_AVAILABLE
Definition: WiMOD_SAP_LORAWAN_IDs.h:462
UINT8 MacCmdData[WiMODLORAWAN_APP_PAYLOAD_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:537
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:478
UINT8 Payload[WiMODLORAWAN_APP_PAYLOAD_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:506
void(* TLinkDisconnectIndicationCallback)(void)
Definition: WiMOD_SAP_LORAWAN.h:145
UINT8 SubBandMask2
Definition: WiMOD_SAP_LORAWAN_IDs.h:580
@ LoRaWAN_Region_AS923
Definition: WiMOD_SAP_LORAWAN.h:84
UINT8 MaxPayloadSize
Definition: WiMOD_SAP_LORAWAN_IDs.h:625
UINT8 Payload[WiMODLORAWAN_MAC_CMD_PAYLOAD_LENGTH]
Definition: WiMOD_SAP_LORAWAN_IDs.h:594
UINT32 DeviceAddress
Definition: WiMOD_SAP_LORAWAN_IDs.h:554
@ WiMODLR_RESULT_PAYLOAD_LENGTH_ERROR
Definition: WiMODLRHCI.h:152