| Demo HCI Implementation for WiMOD-LR Devices V2.0.3

WiMOD_SAP_LORAWAN.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
31 //------------------------------------------------------------------------------
32
33
34 #ifndef ARDUINO_WIMOD_SAP_LORAWAN_H_
35 #define ARDUINO_WIMOD_SAP_LORAWAN_H_
36
37 /*
38 * THIS IS AN EXAMPLE IMPLEMENTATION ACCORDING THE THE HCI SPEC: V2.1
39 * FOR FIRMWARE: LoRaWAN_EndNode_Modem
40 *
41 * SEE FILE: WiMOD_LoRaWAN_EndNode_Modem_HCI_Spec_V2_1.pdf
42 * for detailed information
43 *
44 */
45
46
47 //------------------------------------------------------------------------------
48 //
49 // Section Includes Files
50 //
51 //------------------------------------------------------------------------------
52
53 #include "WiMOD_SAP_LORAWAN_IDs.h"
54 #include "../HCI/WiMODLRHCI.h"
55
56 /*
57 * C++11 supports a better way for function pointers / function objects
58 * But C++11 mode is not supported by all platforms.
59 */
60 #ifdef WIMOD_USE_CPP11
61 #include <functional>
62 #endif
63 //------------------------------------------------------------------------------
64 //
65 // Section defines
66 //
67 //------------------------------------------------------------------------------
68
70 #define WiMOD_LORAWAN_TX_PAYLOAD_SIZE (WiMODLORAWAN_APP_PAYLOAD_LEN + 5)
71
75
79 typedef enum TLoRaWANregion
80 {
81 LoRaWAN_Region_EU868,
82 LoRaWAN_Region_US915,
83 LoRaWAN_Region_IN865,
84 LoRaWAN_Region_AS923,
85 LoRaWAN_Region_IL915,
86 LoRaWAN_Region_RU868,
87 LoRaWAN_Region_proprietary_WW2G4,
88 } TLoRaWANregion;
89
90
91
92 //-----------------------------------------------------------------------------
93 //
94 // types for callback functions
95 //
96 //-----------------------------------------------------------------------------
97
98 // C++11 check
99 #ifdef WIMOD_USE_CPP11
100 /* C++11 function callback definitions */
101
103 typedef std::function<void (void)> TResetDevNonceIndicationCallback;
104
106 typedef std::function<void (void)> TLinkDisconnectIndicationCallback;
107
109 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TNwkDeviceTimeAnsIndicationCallback;
110
112 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TJoinTxIndicationCallback;
113
115 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TJoinedNwkIndicationCallback;
116
118 typedef std::function<void (void)> TNoDataIndicationCallback;
119
121 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TTxCDataIndicationCallback;
122
124 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TTxUDataIndicationCallback;
125
127 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TRxUDataIndicationCallback;
128
130 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TRxCDataIndicationCallback;
131
133 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TRxMacCmdIndicationCallback;
134
136 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TRxAckIndicationCallback;
137
138 #else
139 /* pre C++11 function callback definitions */
140
142 typedef void (*TResetDevNonceIndicationCallback)(void);
143
145 typedef void (*TLinkDisconnectIndicationCallback)(void);
146
148 typedef void (*TNwkDeviceTimeAnsIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
149
151 typedef void (*TJoinTxIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
152
154 typedef void (*TJoinedNwkIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
155
157 typedef void (*TNoDataIndicationCallback)(void);
158
160 typedef void (*TTxCDataIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
161
163 typedef void (*TTxUDataIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
164
166 typedef void (*TRxUDataIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
167
169 typedef void (*TRxCDataIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
170
172 typedef void (*TRxMacCmdIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
173
175 typedef void (*TRxAckIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
176
177 #endif
178
179
180 //------------------------------------------------------------------------------
181 //
182 // Section class
183 //
184 //------------------------------------------------------------------------------
185
189 class WiMOD_SAP_LoRaWAN {
190 public:
191
192 WiMOD_SAP_LoRaWAN(TWiMODLRHCI* hci, UINT8* buffer, UINT16 bufferSize);
193 virtual ~WiMOD_SAP_LoRaWAN(void);
194
195
196 virtual void setRegion(TLoRaWANregion regionalSetting);
197
198 virtual TWiMODLRResultCodes ActivateDevice(TWiMODLORAWAN_ActivateDeviceData& activationData, UINT8* statusRsp);
199 virtual TWiMODLRResultCodes ReactivateDevice(UINT32* devAdr, UINT8* statusRsp);
200 virtual TWiMODLRResultCodes SetJoinParameter(TWiMODLORAWAN_JoinParams& joinParams, UINT8* statusRsp);
201 virtual TWiMODLRResultCodes JoinNetwork(UINT8* statusRsp);
202
203 virtual void RegisterResetDevNonceIndicationClient(TResetDevNonceIndicationCallback cb);
204 virtual void RegisterLinkDisconnectIndicationClient(TLinkDisconnectIndicationCallback cb);
205 virtual void RegisterDeviceTimeAnsIndicationClient(TNwkDeviceTimeAnsIndicationCallback cb);
206 virtual void RegisterJoinTxIndicationClient(TJoinTxIndicationCallback cb);
207
208 // bool convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLORAWAN_JoinNwkTxIndData* indicationData);
209 bool convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLORAWAN_RX_Data* loraWanRxData);
210 // bool convert(TWiMODLR_HCIMessage& rxMsg, TWiMODLORAWAN_SendDataTxInd_Data* sendIndData);
211 bool convert(TWiMODLR_HCIMessage& rxMsg, TWiMODLORAWAN_TxIndData* sendIndData);
212 bool convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLORAWAN_RX_MacCmdData* loraWanMacCmdData);
213 bool convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLORAWAN_RX_JoinedNwkData* joinedNwkData);
214 bool convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLORAWAN_RX_ACK_Data* ackData);
215 bool convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLORAWAN_NoData_Data* info);
216
217 void RegisterNoDataIndicationClient(TNoDataIndicationCallback cb);
218 void RegisterTxCDataIndicationClient(TTxCDataIndicationCallback cb);
219 void RegisterTxUDataIndicationClient(TTxUDataIndicationCallback cb);
220 void RegisterRxUDataIndicationClient(TRxUDataIndicationCallback cb);
221 void RegisterRxCDataIndicationClient(TRxCDataIndicationCallback cb);
222 void RegisterRxMacCmdIndicationClient(TRxMacCmdIndicationCallback cb);
223 void RegisterJoinedNwkIndicationClient(TJoinedNwkIndicationCallback cb);
224 void RegisterRxAckIndicationClient(TRxAckIndicationCallback cb);
225
226
227 virtual TWiMODLRResultCodes SendUData(const TWiMODLORAWAN_TX_Data* data, UINT8* statusRsp);
228 virtual TWiMODLRResultCodes SendCData(const TWiMODLORAWAN_TX_Data* data, UINT8* statusRsp);
229 virtual TWiMODLRResultCodes SetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig* data, UINT8* statusRsp);
230 virtual TWiMODLRResultCodes GetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig* data, UINT8* statusRsp);
231 virtual TWiMODLRResultCodes DeactivateDevice(UINT8* statusRsp);
232 virtual TWiMODLRResultCodes FactoryReset(UINT8* statusRsp);
233 virtual TWiMODLRResultCodes SetDeviceEUI(const UINT8* deviceEUI, UINT8* statusRsp);
234 virtual TWiMODLRResultCodes GetDeviceEUI(UINT8* deviceEUI, UINT8* statusRsp);
235 virtual TWiMODLRResultCodes GetNwkStatus(TWiMODLORAWAN_NwkStatus_Data* nwkStatus, UINT8* statusRsp);
236
237 virtual TWiMODLRResultCodes SendMacCmd(const TWiMODLORAWAN_MacCmd* cmd, UINT8* statusRsp);
238 virtual TWiMODLRResultCodes SetCustomConfig(const INT8 rfGain, UINT8* statusRsp);
239 virtual TWiMODLRResultCodes GetCustomConfig(INT8* rfGain, UINT8* statusRsp);
240 virtual TWiMODLRResultCodes GetSupportedBands(TWiMODLORAWAN_SupportedBands* supportedBands, UINT8* statusRsp);
241 virtual TWiMODLRResultCodes GetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig* txPwrLimitCfg, UINT8* statusRsp);
242 virtual TWiMODLRResultCodes SetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig& txPwrLimitCfg, UINT8* statusRsp);
243
244 // TWiMODLRResultCodes GetLinkAdrReqConfig(TWiMODLORAWAN_LinkAdrReqConfig* linkAdrReqCfg, UINT8* statusRsp);
245 // TWiMODLRResultCodes SetLinkAdrReqConfig(TWiMODLORAWAN_LinkAdrReqConfig& linkAdrReqCfg, UINT8* statusRsp);
246
247 virtual TWiMODLRResultCodes SetBatteryLevelStatus(UINT8 battStatus, UINT8* statusRsp);
248
249 virtual void DispatchLoRaWANMessage(TWiMODLR_HCIMessage& rxMsg);
250 protected:
252 TResetDevNonceIndicationCallback ResetDevNonceCallback;
253 TLinkDisconnectIndicationCallback LinkDisconnectCallback;
254 TNwkDeviceTimeAnsIndicationCallback DeviceTimeAnsCallback;
255 TJoinTxIndicationCallback JoinTxIndCallback;
256 TNoDataIndicationCallback NoDataIndCallback;
257 TTxCDataIndicationCallback TxCDataIndCallback;
258 TTxUDataIndicationCallback TxUDataIndCallback;
259 TRxUDataIndicationCallback RxUDataIndCallback;
260 TRxCDataIndicationCallback RxCDataIndCallback;
261 TRxMacCmdIndicationCallback RxMacCmdIndCallback;
262 TJoinedNwkIndicationCallback JoinedNwkIndCallback;
263 TRxAckIndicationCallback RxAckIndCallback;
264
265 UINT8* txPayload;
266 UINT16 txPayloadSize;
267 TWiMODLRHCI* HciParser;
268 TLoRaWANregion region;
270 private:
272
274
275 };
276
277
278 #endif /* ARDUINO_WIMOD_SAP_LORAWAN_H_ */
WiMOD_SAP_LoRaWAN::SetDeviceEUI
virtual TWiMODLRResultCodes SetDeviceEUI(const UINT8 *deviceEUI, UINT8 *statusRsp)
Sets a new DeviceEUI (aka. IEEE-Address) to the WiMOD.
Definition: WiMOD_SAP_LORAWAN.cpp:1057
TJoinedNwkIndicationCallback
void(* TJoinedNwkIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:154
TWiMODLORAWAN_RX_JoinedNwkData::StatusFormat
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:553
TWiMODLORAWAN_RadioStackConfig::HeaderMacCmdCapacity
UINT8 HeaderMacCmdCapacity
Definition: WiMOD_SAP_LORAWAN_IDs.h:576
WiMOD_SAP_LoRaWAN::RegisterRxUDataIndicationClient
void RegisterRxUDataIndicationClient(TRxUDataIndicationCallback cb)
Register a callback function for the event "RX U-Data Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:808
TWiMODLORAWAN_RadioStackConfig::DataRateIndex
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:570
WiMOD_SAP_LoRaWAN::RegisterNoDataIndicationClient
void RegisterNoDataIndicationClient(TNoDataIndicationCallback cb)
Register a callback function for the event "TX Join Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:763
TWiMODLORAWAN_TxIndData::PowerLevel
UINT8 PowerLevel
Definition: WiMOD_SAP_LORAWAN_IDs.h:484
TWiMODLORAWAN_RX_JoinedNwkData
Structure containing data of the joined network indication.
Definition: WiMOD_SAP_LORAWAN_IDs.h:551
TRxUDataIndicationCallback
void(* TRxUDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:166
TWiMODLORAWAN_RX_Data
Structure containing RX (user) payload data.
Definition: WiMOD_SAP_LORAWAN_IDs.h:514
TLoRaWANregion
TLoRaWANregion
LoRaWAN Region support.
Definition: WiMOD_SAP_LORAWAN.h:79
TWiMODLORAWAN_SupportedBands::BandIndex
UINT8 BandIndex[(WiMODLORAWAN_APP_PAYLOAD_LEN/2)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:666
TWiMODLORAWAN_SupportedBands::NumOfEntries
UINT8 NumOfEntries
Definition: WiMOD_SAP_LORAWAN_IDs.h:665
WiMOD_SAP_LoRaWAN::FactoryReset
virtual TWiMODLRResultCodes FactoryReset(UINT8 *statusRsp)
Reset all internal settings to default values (incl. DevEUI)
Definition: WiMOD_SAP_LORAWAN.cpp:1024
WiMOD_SAP_LoRaWAN::RegisterDeviceTimeAnsIndicationClient
virtual void RegisterDeviceTimeAnsIndicationClient(TNwkDeviceTimeAnsIndicationCallback cb)
Register a callback function for the event "Nwk DeviceTime Answer Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:393
TWiMODLORAWAN_TxPwrLimitConfig::WrongParamErrCode
UINT8 WrongParamErrCode
Definition: WiMOD_SAP_LORAWAN_IDs.h:682
WiMOD_SAP_LoRaWAN::JoinNetwork
virtual TWiMODLRResultCodes JoinNetwork(UINT8 *statusRsp)
Start joining the network via the OTAA procedure. Asynchronous process.
Definition: WiMOD_SAP_LORAWAN.cpp:246
TWiMODLORAWAN_ActivateDeviceData::AppSKey
UINT8 AppSKey[WiMODLORAWAN_APP_SESSION_KEY_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:443
TWiMODLORAWAN_NoData_Data
Structure containing infos of a NoData Indication message.
Definition: WiMOD_SAP_LORAWAN_IDs.h:648
TWiMODLORAWAN_RX_ACK_Data::StatusFormat
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:604
TWiMODLORAWAN_RX_Data::RxSlot
UINT8 RxSlot
Definition: WiMOD_SAP_LORAWAN_IDs.h:526
TWiMODLORAWAN_MacCmd::Length
UINT8 Length
Definition: WiMOD_SAP_LORAWAN_IDs.h:595
TWiMODLORAWAN_RX_Data::Length
UINT8 Length
Definition: WiMOD_SAP_LORAWAN_IDs.h:518
WiMOD_SAP_LoRaWAN::RegisterLinkDisconnectIndicationClient
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
@ LORAWAN_OPT_TX_IND_INFOS_EXCL_PKT_CNT
Definition: WiMOD_SAP_LORAWAN_IDs.h:463
TWiMODLORAWAN_TxIndData
Activation data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:472
TWiMODLORAWAN_RX_MacCmdData::DataRateIndex
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:541
TWiMODLRHCI
Internal helper class for processing SLIP frames.
Definition: WiMODLRHCI.h:235
LORAWAN_OPT_TX_IND_INFOS_INCL_PKT_CNT
@ LORAWAN_OPT_TX_IND_INFOS_INCL_PKT_CNT
Definition: WiMOD_SAP_LORAWAN_IDs.h:464
WiMOD_SAP_LoRaWAN::ReactivateDevice
virtual TWiMODLRResultCodes ReactivateDevice(UINT32 *devAdr, UINT8 *statusRsp)
Re-Activates the device via the ABP procedure.
Definition: WiMOD_SAP_LORAWAN.cpp:167
TWiMODLORAWAN_RX_ACK_Data::OptionalInfoAvaiable
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:612
TWiMODLORAWAN_TxPwrLimitConfig::TxPwrLimitFlag
UINT8 TxPwrLimitFlag[(WiMODLORAWAN_APP_PAYLOAD_LEN/3)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:678
TWiMODLORAWAN_TxPwrLimitConfig::TxPwrLimitValue
UINT8 TxPwrLimitValue[(WiMODLORAWAN_APP_PAYLOAD_LEN/3)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:679
WiMOD_SAP_LoRaWAN::SetRadioStackConfig
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
@ WiMODLR_RESULT_TRANMIT_ERROR
Definition: WiMODLRHCI.h:154
TWiMODLORAWAN_NwkStatus_Data::NetworkStatus
UINT8 NetworkStatus
Definition: WiMOD_SAP_LORAWAN_IDs.h:621
TWiMODLORAWAN_NwkStatus_Data::NumMacTransmissions
UINT8 NumMacTransmissions
Definition: WiMOD_SAP_LORAWAN_IDs.h:626
TWiMODLORAWAN_RX_Data::StatusFormat
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:516
TWiMODLORAWAN_NwkStatus_Data
Structure containing all data about LoRaWAN network status.
Definition: WiMOD_SAP_LORAWAN_IDs.h:619
TWiMODLORAWAN_RX_ACK_Data::RSSI
INT8 RSSI
Definition: WiMOD_SAP_LORAWAN_IDs.h:609
WiMOD_SAP_LoRaWAN::RegisterRxAckIndicationClient
void RegisterRxAckIndicationClient(TRxAckIndicationCallback cb)
Register a callback function for the event "RX ACK (data) Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:868
TWiMODLORAWAN_TxPwrLimitConfig::SubBandIndex
UINT8 SubBandIndex[(WiMODLORAWAN_APP_PAYLOAD_LEN/3)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:677
WiMOD_SAP_LoRaWAN::SendUData
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
TWiMODLORAWAN_TxPwrLimitConfig::NumOfEntries
UINT8 NumOfEntries
Definition: WiMOD_SAP_LORAWAN_IDs.h:676
WiMOD_SAP_LoRaWAN::RegisterJoinTxIndicationClient
virtual void RegisterJoinTxIndicationClient(TJoinTxIndicationCallback cb)
Register a callback function for the event "TX Join Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:406
WiMOD_SAP_LoRaWAN::RegisterResetDevNonceIndicationClient
virtual void RegisterResetDevNonceIndicationClient(TResetDevNonceIndicationCallback cb)
Register a callback function for the event "Reset DeviceNonce Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:362
TWiMODLORAWAN_RX_MacCmdData::Length
UINT8 Length
Definition: WiMOD_SAP_LORAWAN_IDs.h:536
TWiMODLR_HCIMessage
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
TWiMODLORAWAN_JoinParams::AppKey
UINT8 AppKey[WiMODLORAWAN_APP_KEY_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:453
WiMOD_SAP_LORAWAN_IDs.h
TWiMODLORAWAN_RX_ACK_Data::DataRateIndex
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:608
WiMODLR_RESULT_OK
@ WiMODLR_RESULT_OK
Definition: WiMODLRHCI.h:151
TWiMODLORAWAN_TxIndData::NumTxPackets
UINT8 NumTxPackets
Definition: WiMOD_SAP_LORAWAN_IDs.h:482
LoRaWAN_Region_US915
@ LoRaWAN_Region_US915
Definition: WiMOD_SAP_LORAWAN.h:82
TWiMODLORAWAN_RadioStackConfig::PowerSavingMode
UINT8 PowerSavingMode
Definition: WiMOD_SAP_LORAWAN_IDs.h:573
TWiMODLORAWAN_SupportedBands
data structure for supported bands
Definition: WiMOD_SAP_LORAWAN_IDs.h:663
TWiMODLORAWAN_SupportedBands::MaxEIRP
UINT8 MaxEIRP[(WiMODLORAWAN_APP_PAYLOAD_LEN/2)]
Definition: WiMOD_SAP_LORAWAN_IDs.h:667
TWiMODLORAWAN_JoinParams
JOIN data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:450
LoRaWAN_Region_IL915
@ LoRaWAN_Region_IL915
Definition: WiMOD_SAP_LORAWAN.h:85
TWiMODLORAWAN_RadioStackConfig::TXPowerLevel
UINT8 TXPowerLevel
Definition: WiMOD_SAP_LORAWAN_IDs.h:571
WiMOD_SAP_LORAWAN.h
WiMOD_SAP_LoRaWAN::SetJoinParameter
virtual TWiMODLRResultCodes SetJoinParameter(TWiMODLORAWAN_JoinParams &joinParams, UINT8 *statusRsp)
Sets the parameters used for the OTAA activation procedure.
Definition: WiMOD_SAP_LORAWAN.cpp:208
TWiMODLORAWAN_RX_MacCmdData::SNR
INT8 SNR
Definition: WiMOD_SAP_LORAWAN_IDs.h:543
TWiMODLORAWAN_MacCmd::MacCmdID
UINT8 MacCmdID
Definition: WiMOD_SAP_LORAWAN_IDs.h:593
WiMOD_SAP_LoRaWAN::RegisterJoinedNwkIndicationClient
void RegisterJoinedNwkIndicationClient(TJoinedNwkIndicationCallback cb)
Register a callback function for the event "Joined Nwk Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:853
TWiMODLORAWAN_RX_MacCmdData::RSSI
INT8 RSSI
Definition: WiMOD_SAP_LORAWAN_IDs.h:542
WiMOD_SAP_LoRaWAN::GetRadioStackConfig
virtual TWiMODLRResultCodes GetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig *data, UINT8 *statusRsp)
Gets the current radio config parameter set of the WiMOD.
Definition: WiMOD_SAP_LORAWAN.cpp:946
TWiMODLORAWAN_RadioStackConfig
Radio stack configuration related to to LoRaWAN specific options.
Definition: WiMOD_SAP_LORAWAN_IDs.h:568
TWiMODLR_HCIMessage::Length
UINT16 Length
Definition: WiMODLRHCI.h:123
TWiMODLORAWAN_RX_Data::RSSI
INT8 RSSI
Definition: WiMOD_SAP_LORAWAN_IDs.h:524
TWiMODLR_HCIMessage::MsgID
UINT8 MsgID
Definition: WiMODLRHCI.h:129
TWiMODLORAWAN_RX_JoinedNwkData::OptionalInfoAvaiable
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:562
TWiMODLORAWAN_MacCmd::DataServiceType
UINT8 DataServiceType
Definition: WiMOD_SAP_LORAWAN_IDs.h:592
WiMOD_SAP_LoRaWAN::RegisterTxCDataIndicationClient
void RegisterTxCDataIndicationClient(TTxCDataIndicationCallback cb)
Register a callback function for the event "TX C-Data Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:778
TWiMODLORAWAN_RX_ACK_Data::RxSlot
UINT8 RxSlot
Definition: WiMOD_SAP_LORAWAN_IDs.h:611
TTxUDataIndicationCallback
void(* TTxUDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:163
TWiMODLORAWAN_TxPwrLimitConfig
data structure for TX Power Limits
Definition: WiMOD_SAP_LORAWAN_IDs.h:674
TWiMODLORAWAN_JoinParams::JoinEUI
UINT8 JoinEUI[WiMODLORAWAN_JOIN_EUI_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:452
TRxAckIndicationCallback
void(* TRxAckIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:175
WiMOD_SAP_LoRaWAN::GetDeviceEUI
virtual TWiMODLRResultCodes GetDeviceEUI(UINT8 *deviceEUI, UINT8 *statusRsp)
Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD.
Definition: WiMOD_SAP_LORAWAN.cpp:1094
TWiMODLORAWAN_RX_ACK_Data
Data structure for received Acknowledgment data.
Definition: WiMOD_SAP_LORAWAN_IDs.h:602
TWiMODLR_HCIMessage::Payload
UINT8 Payload[WIMODLR_HCI_MSG_PAYLOAD_SIZE]
Definition: WiMODLRHCI.h:132
WiMOD_SAP_LoRaWAN::GetCustomConfig
virtual TWiMODLRResultCodes GetCustomConfig(INT8 *rfGain, UINT8 *statusRsp)
Get the current offet for tx power level; expert level only.
Definition: WiMOD_SAP_LORAWAN.cpp:1302
TWiMODLORAWAN_RX_JoinedNwkData::RxSlot
UINT8 RxSlot
Definition: WiMOD_SAP_LORAWAN_IDs.h:561
TWiMODLORAWAN_RX_MacCmdData::RxSlot
UINT8 RxSlot
Definition: WiMOD_SAP_LORAWAN_IDs.h:544
WiMOD_SAP_LoRaWAN::RegisterRxMacCmdIndicationClient
void RegisterRxMacCmdIndicationClient(TRxMacCmdIndicationCallback cb)
Register a callback function for the event "RX MAC Cmd Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:838
WiMOD_SAP_LoRaWAN::GetNwkStatus
virtual TWiMODLRResultCodes GetNwkStatus(TWiMODLORAWAN_NwkStatus_Data *nwkStatus, UINT8 *statusRsp)
Gets the current status of the network "connection".
Definition: WiMOD_SAP_LORAWAN.cpp:1168
TWiMODLORAWAN_NoData_Data::StatusFormat
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:650
TWiMODLORAWAN_TxIndData::DataRateIndex
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:480
TRxMacCmdIndicationCallback
void(* TRxMacCmdIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:172
WiMOD_SAP_LoRaWAN::RegisterRxCDataIndicationClient
void RegisterRxCDataIndicationClient(TRxCDataIndicationCallback cb)
Register a callback function for the event "RX C-Data Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:823
TWiMODLORAWAN_RX_ACK_Data::SNR
INT8 SNR
Definition: WiMOD_SAP_LORAWAN_IDs.h:610
TWiMODLORAWAN_RadioStackConfig::BandIndex
UINT8 BandIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:575
TWiMODLORAWAN_RX_JoinedNwkData::SNR
INT8 SNR
Definition: WiMOD_SAP_LORAWAN_IDs.h:560
TWiMODLORAWAN_TxIndData::RfMsgAirtime
UINT32 RfMsgAirtime
Definition: WiMOD_SAP_LORAWAN_IDs.h:486
TNwkDeviceTimeAnsIndicationCallback
void(* TNwkDeviceTimeAnsIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:148
TTxCDataIndicationCallback
void(* TTxCDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:160
TWiMODLORAWAN_TxIndData::StatusFormat
UINT8 StatusFormat
Definition: WiMOD_SAP_LORAWAN_IDs.h:476
WiMOD_SAP_LoRaWAN::SetTxPowerLimitConfig
virtual TWiMODLRResultCodes SetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig &txPwrLimitCfg, UINT8 *statusRsp)
Set a SINGLE TxPowerLimit entry.
Definition: WiMOD_SAP_LORAWAN.cpp:1431
WiMOD_SAP_LoRaWAN::WiMOD_SAP_LoRaWAN
WiMOD_SAP_LoRaWAN(TWiMODLRHCI *hci, UINT8 *buffer, UINT16 bufferSize)
Constructor.
Definition: WiMOD_SAP_LORAWAN.cpp:68
TWiMODLORAWAN_RadioStackConfig::WrongParamErrCode
UINT8 WrongParamErrCode
Definition: WiMOD_SAP_LORAWAN_IDs.h:583
TWiMODLORAWAN_RX_JoinedNwkData::DataRateIndex
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:558
WiMODLR_RESULT_PAYLOAD_PTR_ERROR
@ WiMODLR_RESULT_PAYLOAD_PTR_ERROR
Definition: WiMODLRHCI.h:153
TWiMODLORAWAN_NoData_Data::OptionalInfoAvaiable
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:655
TWiMODLORAWAN_MacCmd
LoRaWAN MAC command structure.
Definition: WiMOD_SAP_LORAWAN_IDs.h:590
TWiMODLORAWAN_RX_MacCmdData::ChannelIndex
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:540
TWiMODLORAWAN_RX_Data::Port
UINT8 Port
Definition: WiMOD_SAP_LORAWAN_IDs.h:517
TJoinTxIndicationCallback
void(* TJoinTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:151
TNoDataIndicationCallback
void(* TNoDataIndicationCallback)(void)
Definition: WiMOD_SAP_LORAWAN.h:157
WiMOD_SAP_LoRaWAN::GetTxPowerLimitConfig
virtual TWiMODLRResultCodes GetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig *txPwrLimitCfg, UINT8 *statusRsp)
Get the configured TxPowerLimit settings.
Definition: WiMOD_SAP_LORAWAN.cpp:1382
WiMOD_SAP_LoRaWAN::SetBatteryLevelStatus
virtual TWiMODLRResultCodes SetBatteryLevelStatus(UINT8 battStatus, UINT8 *statusRsp)
Set Battery Level Status.
Definition: WiMOD_SAP_LORAWAN.cpp:1569
TWiMODLORAWAN_TxIndData::FieldAvailability
TWiMODLORAWAN_OptIndInfos FieldAvailability
Definition: WiMOD_SAP_LORAWAN_IDs.h:474
TWiMODLORAWAN_RX_Data::OptionalInfoAvaiable
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:527
WiMOD_SAP_LoRaWAN::~WiMOD_SAP_LoRaWAN
virtual ~WiMOD_SAP_LoRaWAN(void)
Destructor.
Definition: WiMOD_SAP_LORAWAN.cpp:95
TWiMODLORAWAN_RX_ACK_Data::ChannelIndex
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:607
TWiMODLORAWAN_RX_Data::SNR
INT8 SNR
Definition: WiMOD_SAP_LORAWAN_IDs.h:525
WiMOD_SAP_LoRaWAN::SetCustomConfig
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
TWiMODLORAWAN_RX_MacCmdData::OptionalInfoAvaiable
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_LORAWAN_IDs.h:545
TRxCDataIndicationCallback
void(* TRxCDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:169
TWiMODLORAWAN_RX_Data::Payload
UINT8 Payload[WiMODLORAWAN_APP_PAYLOAD_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:519
TResetDevNonceIndicationCallback
void(* TResetDevNonceIndicationCallback)(void)
Definition: WiMOD_SAP_LORAWAN.h:142
TWiMODLORAWAN_RadioStackConfig::SubBandMask1
UINT8 SubBandMask1
Definition: WiMOD_SAP_LORAWAN_IDs.h:579
TWiMODLORAWAN_RX_MacCmdData
Structure containing a received MAC command.
Definition: WiMOD_SAP_LORAWAN_IDs.h:534
TWiMODLRResultCodes
TWiMODLRResultCodes
Result codes for the local serial communication itself.
Definition: WiMODLRHCI.h:149
LoRaWAN_Region_EU868
@ LoRaWAN_Region_EU868
Definition: WiMOD_SAP_LORAWAN.h:81
TWiMODLORAWAN_RadioStackConfig::Options
UINT8 Options
Definition: WiMOD_SAP_LORAWAN_IDs.h:572
LoRaWAN_Region_IN865
@ LoRaWAN_Region_IN865
Definition: WiMOD_SAP_LORAWAN.h:83
WiMOD_SAP_LoRaWAN::setRegion
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
@ WiMODLR_RESULT_NO_RESPONSE
Definition: WiMODLRHCI.h:156
WiMOD_SAP_LoRaWAN::SendCData
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
TWiMODLORAWAN_ActivateDeviceData
Activation data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:439
TWiMODLORAWAN_NwkStatus_Data::DataRateIndex
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:623
WiMOD_SAP_LoRaWAN::DeactivateDevice
virtual TWiMODLRResultCodes DeactivateDevice(UINT8 *statusRsp)
Deactivate the device (logical disconnect from lora network)
Definition: WiMOD_SAP_LORAWAN.cpp:996
TWiMODLORAWAN_NwkStatus_Data::DeviceAddress
UINT32 DeviceAddress
Definition: WiMOD_SAP_LORAWAN_IDs.h:622
TWiMODLORAWAN_RX_Data::DataRateIndex
UINT8 DataRateIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:523
TWiMODLORAWAN_NwkStatus_Data::PowerLevel
UINT8 PowerLevel
Definition: WiMOD_SAP_LORAWAN_IDs.h:624
TWiMODLORAWAN_NoData_Data::ErrorCode
UINT8 ErrorCode
Definition: WiMOD_SAP_LORAWAN_IDs.h:653
WiMOD_SAP_LoRaWAN
Implementation for the ServiceAccessPoint LoRaWAN (End Node Modem firmware only)
Definition: WiMOD_SAP_LORAWAN.h:189
TWiMODLORAWAN_RX_Data::ChannelIndex
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:522
WiMOD_SAP_LoRaWAN::GetSupportedBands
virtual TWiMODLRResultCodes GetSupportedBands(TWiMODLORAWAN_SupportedBands *supportedBands, UINT8 *statusRsp)
Get the supported bands of this firmware.
Definition: WiMOD_SAP_LORAWAN.cpp:1338
TWiMODLORAWAN_RX_JoinedNwkData::RSSI
INT8 RSSI
Definition: WiMOD_SAP_LORAWAN_IDs.h:559
WiMOD_SAP_LoRaWAN::ActivateDevice
virtual TWiMODLRResultCodes ActivateDevice(TWiMODLORAWAN_ActivateDeviceData &activationData, UINT8 *statusRsp)
Activates the device via the ABP procedure.
Definition: WiMOD_SAP_LORAWAN.cpp:126
WiMOD_SAP_LoRaWAN::RegisterTxUDataIndicationClient
void RegisterTxUDataIndicationClient(TTxUDataIndicationCallback cb)
Register a callback function for the event "TX U Data Indication".
Definition: WiMOD_SAP_LORAWAN.cpp:793
TWiMODLORAWAN_ActivateDeviceData::DeviceAddress
UINT32 DeviceAddress
Definition: WiMOD_SAP_LORAWAN_IDs.h:441
WiMOD_SAP_LoRaWAN::convert
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
TWiMODLORAWAN_RadioStackConfig::Retransmissions
UINT8 Retransmissions
Definition: WiMOD_SAP_LORAWAN_IDs.h:574
LoRaWAN_Region_RU868
@ LoRaWAN_Region_RU868
Definition: WiMOD_SAP_LORAWAN.h:86
TWiMODLORAWAN_TX_Data
Structure containing all data necessary to transmitting a data message.
Definition: WiMOD_SAP_LORAWAN_IDs.h:502
WiMOD_SAP_LoRaWAN::SendMacCmd
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
TWiMODLORAWAN_ActivateDeviceData::NwkSKey
UINT8 NwkSKey[WiMODLORAWAN_NWK_SESSION_KEY_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:442
TWiMODLORAWAN_RX_JoinedNwkData::ChannelIndex
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:557
TWiMODLORAWAN_TX_Data::Length
UINT8 Length
Definition: WiMOD_SAP_LORAWAN_IDs.h:505
TWiMODLORAWAN_TX_Data::Port
UINT8 Port
Definition: WiMOD_SAP_LORAWAN_IDs.h:504
LORAWAN_OPT_TX_IND_INFOS_NOT_AVAILABLE
@ LORAWAN_OPT_TX_IND_INFOS_NOT_AVAILABLE
Definition: WiMOD_SAP_LORAWAN_IDs.h:462
TWiMODLORAWAN_RX_MacCmdData::MacCmdData
UINT8 MacCmdData[WiMODLORAWAN_APP_PAYLOAD_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:537
TWiMODLORAWAN_TxIndData::ChannelIndex
UINT8 ChannelIndex
Definition: WiMOD_SAP_LORAWAN_IDs.h:478
TWiMODLORAWAN_TX_Data::Payload
UINT8 Payload[WiMODLORAWAN_APP_PAYLOAD_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:506
TLinkDisconnectIndicationCallback
void(* TLinkDisconnectIndicationCallback)(void)
Definition: WiMOD_SAP_LORAWAN.h:145
TWiMODLORAWAN_RadioStackConfig::SubBandMask2
UINT8 SubBandMask2
Definition: WiMOD_SAP_LORAWAN_IDs.h:580
LoRaWAN_Region_AS923
@ LoRaWAN_Region_AS923
Definition: WiMOD_SAP_LORAWAN.h:84
TWiMODLORAWAN_NwkStatus_Data::MaxPayloadSize
UINT8 MaxPayloadSize
Definition: WiMOD_SAP_LORAWAN_IDs.h:625
TWiMODLORAWAN_MacCmd::Payload
UINT8 Payload[WiMODLORAWAN_MAC_CMD_PAYLOAD_LENGTH]
Definition: WiMOD_SAP_LORAWAN_IDs.h:594
TWiMODLORAWAN_RX_JoinedNwkData::DeviceAddress
UINT32 DeviceAddress
Definition: WiMOD_SAP_LORAWAN_IDs.h:554
WiMODLR_RESULT_PAYLOAD_LENGTH_ERROR
@ WiMODLR_RESULT_PAYLOAD_LENGTH_ERROR
Definition: WiMODLRHCI.h:152