Demo HCI Implementation for WiMOD-LR Devices  V2.0.3
WiMODLoRaWAN.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
31 //------------------------------------------------------------------------------
32 
33 
34 #ifndef ARDUINO_WIMODLORAWAN_H_
35 #define ARDUINO_WIMODLORAWAN_H_
36 
37 
38 
45 //------------------------------------------------------------------------------
46 //
47 // Section Includes Files
48 //
49 //------------------------------------------------------------------------------
50 
51 #include "Arduino.h"
52 /************
53  * BUG in ardunino.h ?
54  * -> https://stackoverflow.com/questions/41093090/esp8266-error-macro-min-passed-3-arguments-but-takes-just-2
55  */
56 #include <string.h>
57 
58 #include "SAP/WiMOD_SAP_LORAWAN.h"
60 #include "SAP/WiMOD_SAP_Generic.h"
61 #include "utils/ComSLIP.h"
62 #include "HCI/WiMODLRHCI.h"
63 
64 //-----------------------------------------------------------------------------
65 // common defines
66 //-----------------------------------------------------------------------------
68 #define WIMOD_LORAWAN_SERIAL_BAUDRATE 115200
69 
70 #define WiMOD_LORAWAN_TX_BUFFER_SIZE 256
71 //-----------------------------------------------------------------------------
73 // types for callback functions
74 //-----------------------------------------------------------------------------
75 
76 
77 
78 //-----------------------------------------------------------------------------
79 // API class declaration for the WiMOD LoRaWAN Stack
80 //
81 // note: this is NOT compliant with the LR-BASE stack
82 //-----------------------------------------------------------------------------
90 class WiMODLoRaWAN : public TWiMODLRHCI {
91 public:
92  /*explicit*/ WiMODLoRaWAN(Stream& s);
93  ~WiMODLoRaWAN(void);
94 
96  void end(void);
97 
99  void beginAndAutoSetup(void);
100  void autoSetupSupportedRegion(void);
102 
103  /*
104  * DevMgmt SAP
105  */
106  bool Ping(TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
107  bool Reset(TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
108  bool GetDeviceInfo(TWiMODLR_DevMgmt_DevInfoLoRaWan* info, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
109  bool GetFirmwareInfo(TWiMODLR_DevMgmt_FwInfo* info, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
110  bool GetSystemStatus(TWiMODLR_DevMgmt_SystemStatusLorawan* info, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
111  bool GetRtc(UINT32* rtcTime,TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
112  bool SetRtc(const UINT32 rtcTime, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
113 
114  bool GetOperationMode(TWiMOD_OperationMode* opMode, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
115  bool SetOperationMode(const TWiMOD_OperationMode opMode, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
116 
117  bool SetRtcAlarm(const TWiMODLR_DevMgmt_RtcAlarm* rtcAlarm, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
118  bool GetRtcAlarm(TWiMODLR_DevMgmt_RtcAlarm* rtcAlarm, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
119  bool ClearRtcAlarm(TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
120 
123 
124  bool GetHciConfig(TWiMODLR_DevMgmt_HciConfig* hciConfig, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
125  bool SetHciConfig(TWiMODLR_DevMgmt_HciConfig& hciConfig, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
126 
127 
128  /*
129  * LoRaWAN SAP
130  */
131  bool ActivateDevice(TWiMODLORAWAN_ActivateDeviceData& activationData,TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
132  bool ReactivateDevice(UINT32* devAdr, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
133  bool SetJoinParameter(TWiMODLORAWAN_JoinParams& joinParams, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
134  bool JoinNetwork(TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
135 
137 
138  bool
139  convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLORAWAN_RX_Data* loraWanRxData);
140  bool
142 
143  bool
144  convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLORAWAN_RX_MacCmdData* loraWanMacCmdData);
145 
146  bool
148 
149  bool
151 
152  bool
154 
155  void
157 
158  void
160 
161  void
163 
164  void
166 
167  void
169 
170  void
172 
173  void
175 
176  void
178 
179  bool SendUData(const TWiMODLORAWAN_TX_Data* data, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
180  bool SendCData(const TWiMODLORAWAN_TX_Data* data,TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
181  bool SetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig* data,TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
182  bool GetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig* data, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
183  bool DeactivateDevice(TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
184  bool FactoryReset(TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
185  bool SetDeviceEUI(const UINT8* deviceEUI, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
186  bool GetDeviceEUI(UINT8* deviceEUI, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
187 // bool GetNwkStatus(UINT8* nwkStatus, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL); // implementation for spec up to V1.13
188  bool GetNwkStatus(TWiMODLORAWAN_NwkStatus_Data* nwkStatus, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL); // new implementation for spec. V1.14
189  bool SendMacCmd(const TWiMODLORAWAN_MacCmd* cmd, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
190  bool SetCustomConfig(const INT8 rfGain, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
191  bool GetCustomConfig(INT8* rfGain, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
192  bool GetSupportedBands(TWiMODLORAWAN_SupportedBands* supportedBands, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
193  bool GetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig* txPwrLimitCfg, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
194  bool SetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig& txPwrLimitCfg, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
195 // bool GetLinkAdrReqConfig(TWiMODLORAWAN_LinkAdrReqConfig* linkAdrReqCfg, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
196 // bool SetLinkAdrReqConfig(TWiMODLORAWAN_LinkAdrReqConfig& linkAdrReqCfg, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
197  bool SetBatteryLevelStatus(UINT8 battStatus, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
198 
199  /*
200  * Generic Cmd
201  */
202  bool ExecuteGenericCmd(TWiMODLR_Generic_CmdInfo* info, TWiMODLRResultCodes* hciResult = NULL, UINT8* rspStatus = NULL);
203 
204  /*
205  * Info & QuickStart Cmds
206  */
207  void PrintBasicDeviceInfo(Stream& s);
208  void ConnectViaOTAA(const uint8_t* appEUI = NULL, const uint8_t* appKey = NULL);
209  void ConvertAppEuiStrToArray(char* appEuiStr, uint8_t* appEuiArray);
210  void ConvertAppKeyStrToArray(char* appKeyStr, uint8_t* appKeyArray);
211 
212  void ConvertNwkSKeyStrToArray(char* nwkSKeyStr, uint8_t* nwkSKeyArray);
213  void ConvertAppSKeyStrToArray(char* appSKeyStr, uint8_t* appSKeyArray);
214 
216  UINT8 GetLastResponseStatus(void);
217 
218 protected:
224  virtual void ProcessUnexpectedRxMessage(TWiMODLR_HCIMessage& rxMsg);
225 
226 
227  bool copyLoRaWanResultInfos(TWiMODLRResultCodes* hciResult, UINT8* rspStatus);
228  bool copyDevMgmtResultInfos(TWiMODLRResultCodes* hciResult, UINT8* rspStatus);
229 private:
231  UINT8 txBuffer[WiMOD_LORAWAN_TX_BUFFER_SIZE];
232 
233  UINT8 localStatusRsp;
234  bool cmdResult;
235  TWiMODLRResultCodes localHciRes;
236 
237  TWiMODLRResultCodes lastHciRes;
238  UINT8 lastStatusRsp;
240 };
241 
242 
243 #endif /* ARDUINO_WIMODLORAWAN_H_ */
WiMOD_SAP_Generic
Implementation for the ServiceAccessPoint DeviceManagement.
Definition: WiMOD_SAP_Generic.h:78
TJoinedNwkIndicationCallback
void(* TJoinedNwkIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:154
WiMODLoRaWAN::Reset
bool Reset(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Reset Cmd - Reboots the WiMOD module.
Definition: WiMODLoRaWAN.cpp:465
WiMODLoRaWAN::GetDeviceEUI
bool GetDeviceEUI(UINT8 *deviceEUI, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD.
Definition: WiMODLoRaWAN.cpp:2227
WiMODLoRaWAN::~WiMODLoRaWAN
~WiMODLoRaWAN(void)
Desctructor.
Definition: WiMODLoRaWAN.cpp:88
WiMODLoRaWAN::ConvertAppSKeyStrToArray
void ConvertAppSKeyStrToArray(char *appSKeyStr, uint8_t *appSKeyArray)
Converts a string containing an AppSKey string into a given byte array.
Definition: WiMODLoRaWAN.cpp:375
WiMODLoRaWAN::RegisterTxUDataIndicationClient
void RegisterTxUDataIndicationClient(TTxUDataIndicationCallback cb)
Register a callback function for the event "TX U Data Indication".
Definition: WiMODLoRaWAN.cpp:1786
WiMODLoRaWAN::RegisterRxMacCmdIndicationClient
void RegisterRxMacCmdIndicationClient(TRxMacCmdIndicationCallback cb)
Register a callback function for the event "RX MAC Cmd Indication".
Definition: WiMODLoRaWAN.cpp:1849
WiMOD_SAP_DEVMGMT_Lorawan.h
WiMODLoRaWAN::GetFirmwareInfo
bool GetFirmwareInfo(TWiMODLR_DevMgmt_FwInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
GetFirmwareInfo Cmd - Gets the basic information about the firmware of the WiMOD.
Definition: WiMODLoRaWAN.cpp:544
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
WiMODLoRaWAN::RegisterNoDataIndicationClient
void RegisterNoDataIndicationClient(TNoDataIndicationCallback cb)
Register a callback function for the event "TX Join Indication".
Definition: WiMODLoRaWAN.cpp:1691
WiMODLoRaWAN::GetCustomConfig
bool GetCustomConfig(INT8 *rfGain, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Get the current offet for tx power level; expert level only.
Definition: WiMODLoRaWAN.cpp:2361
WiMODLoRaWAN::DeactivateDevice
bool DeactivateDevice(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Deactivate the device (logical disconnect from lora network)
Definition: WiMODLoRaWAN.cpp:2114
WiMODLoRaWAN::GetLastHciResult
TWiMODLRResultCodes GetLastHciResult(void)
Gets the last HCI result code from the last executed command.
Definition: WiMODLoRaWAN.cpp:2621
WiMODLoRaWAN::ClearRtcAlarm
bool ClearRtcAlarm(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Clears pending RTC Alarms of the WiMOD.
Definition: WiMODLoRaWAN.cpp:885
WiMODLoRaWAN::ConvertAppKeyStrToArray
void ConvertAppKeyStrToArray(char *appKeyStr, uint8_t *appKeyArray)
Converts a string containing an App Key string into a given byte array.
Definition: WiMODLoRaWAN.cpp:336
TWiMODLORAWAN_NoData_Data
Structure containing infos of a NoData Indication message.
Definition: WiMOD_SAP_LORAWAN_IDs.h:648
WiMODLoRaWAN::SetJoinParameter
bool SetJoinParameter(TWiMODLORAWAN_JoinParams &joinParams, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the parameters used for the OTAA activation procedure.
Definition: WiMODLoRaWAN.cpp:1225
WiMODLoRaWAN::SetRadioStackConfig
bool SetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig *data, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets a new radio config parameter set of the WiMOD.
Definition: WiMODLoRaWAN.cpp:2043
TWiMODLORAWAN_TxIndData
Activation data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:472
WiMODLoRaWAN::FactoryReset
bool FactoryReset(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Reset all internal settings to default values (incl. DevEUI !!!)
Definition: WiMODLoRaWAN.cpp:2147
WiMODLoRaWAN::ConvertAppEuiStrToArray
void ConvertAppEuiStrToArray(char *appEuiStr, uint8_t *appEuiArray)
Converts a string containing an App EUI string into a given byte array.
Definition: WiMODLoRaWAN.cpp:317
WiMODLoRaWAN::SetDeviceEUI
bool SetDeviceEUI(const UINT8 *deviceEUI, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets a new DeviceEUI (aka. IEEE-Address) to the WiMOD.
Definition: WiMODLoRaWAN.cpp:2190
WiMODLoRaWAN::SapLoRaWan
WiMOD_SAP_LoRaWAN SapLoRaWan
Definition: WiMODLoRaWAN.h:223
WiMODLoRaWAN::GetTxPowerLimitConfig
bool GetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig *txPwrLimitCfg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Get the configured TX limits for all sub-bands.
Definition: WiMODLoRaWAN.cpp:2409
TWiMODLRHCI
Internal helper class for processing SLIP frames.
Definition: WiMODLRHCI.h:235
WiMODLoRaWAN::GetSupportedBands
bool GetSupportedBands(TWiMODLORAWAN_SupportedBands *supportedBands, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Get the supported bands of this firmware.
Definition: WiMODLoRaWAN.cpp:2386
WiMODLoRaWAN::SetRtcAlarm
bool SetRtcAlarm(const TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets and enables the RTC alarm feature of the WiMOD.
Definition: WiMODLoRaWAN.cpp:813
WiMODLoRaWAN::ActivateDevice
bool ActivateDevice(TWiMODLORAWAN_ActivateDeviceData &activationData, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Activates the device via the ABP procedure.
Definition: WiMODLoRaWAN.cpp:1112
TWiMODLORAWAN_NwkStatus_Data
Structure containing all data about LoRaWAN network status.
Definition: WiMOD_SAP_LORAWAN_IDs.h:619
WiMODLoRaWAN::RegisterTxCDataIndicationClient
void RegisterTxCDataIndicationClient(TTxCDataIndicationCallback cb)
Register a callback function for the event "TX C-Data Indication".
Definition: WiMODLoRaWAN.cpp:1738
TWiMODLR_DevMgmt_FwInfo
Basic information about the current firmware of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:220
WiMODLoRaWAN::GetSystemStatus
bool GetSystemStatus(TWiMODLR_DevMgmt_SystemStatusLorawan *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
GetSystemStatus Cmd - Gets the basic information about the system status of the WiMOD.
Definition: WiMODLoRaWAN.cpp:587
WiMODLoRaWAN
Main class representing the interface to the WiMOD running the firmware LoRaWAN EndNode Modem.
Definition: WiMODLoRaWAN.h:90
WiMODLoRaWAN::ConvertNwkSKeyStrToArray
void ConvertNwkSKeyStrToArray(char *nwkSKeyStr, uint8_t *nwkSKeyArray)
Converts a string containing an NwkSKey string into a given byte array.
Definition: WiMODLoRaWAN.cpp:355
TWiMODLR_DevMgmt_DevInfoLoRaWan
Structure containing basic information about the WiMOD device.
Definition: WiMOD_SAP_DEVMGMT_Lorawan_IDs.h:64
TWiMODLR_HCIMessage
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
TWiMODLR_DevMgmt_RtcAlarm
Structure containing the RTC Alarm config parameters of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:484
TWiMODLORAWAN_SupportedBands
data structure for supported bands
Definition: WiMOD_SAP_LORAWAN_IDs.h:663
WiMODLoRaWAN::ConnectViaOTAA
void ConnectViaOTAA(const uint8_t *appEUI=NULL, const uint8_t *appKey=NULL)
do a jump start and use OTAA to connect to a Nwk server
Definition: WiMODLoRaWAN.cpp:260
WiMODLoRaWAN::SendMacCmd
bool SendMacCmd(const TWiMODLORAWAN_MacCmd *cmd, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Send a MAC command to the server; expert level only.
Definition: WiMODLoRaWAN.cpp:2315
WiMODLRHCI.h
TWiMOD_OperationMode
TWiMOD_OperationMode
This enum describes the possible operation modes of the WiMOD (only for LR-BASE).
Definition: WiMOD_SAP_DEVMGMT_IDs.h:440
TWiMODLORAWAN_JoinParams
JOIN data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:450
WiMODLoRaWAN::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: WiMODLoRaWAN.cpp:1383
WiMODLoRaWAN::GetDeviceInfo
bool GetDeviceInfo(TWiMODLR_DevMgmt_DevInfoLoRaWan *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
GetDeviceInfo Cmd - Gets the basic device information of the WiMOD.
Definition: WiMODLoRaWAN.cpp:502
WiMOD_SAP_LORAWAN.h
WiMODLoRaWAN::RegisterRtcAlarmIndicationClient
void RegisterRtcAlarmIndicationClient(TDevMgmtRtcAlarmCallback cb)
Register a callback function for the RTC Alarm Indication - optional -.
Definition: WiMODLoRaWAN.cpp:961
WiMODLoRaWAN::SetOperationMode
bool SetOperationMode(const TWiMOD_OperationMode opMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current operation mode of the WiMOD module.
Definition: WiMODLoRaWAN.cpp:759
TWiMODLORAWAN_RadioStackConfig
Radio stack configuration related to to LoRaWAN specific options.
Definition: WiMOD_SAP_LORAWAN_IDs.h:568
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
WiMODLoRaWAN::RegisterRxCDataIndicationClient
void RegisterRxCDataIndicationClient(TRxCDataIndicationCallback cb)
Register a callback function for the event "RX C-Data Indication".
Definition: WiMODLoRaWAN.cpp:1828
WiMODLoRaWAN::ReactivateDevice
bool ReactivateDevice(UINT32 *devAdr, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Re-Activates the device via the ABP procedure.
Definition: WiMODLoRaWAN.cpp:1179
WiMODLoRaWAN::SetRtc
bool SetRtc(const UINT32 rtcTime, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current RTC values to WiMOD module.
Definition: WiMODLoRaWAN.cpp:673
WiMODLoRaWAN::GetHciConfig
bool GetHciConfig(TWiMODLR_DevMgmt_HciConfig *hciConfig, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current HCI configuration of the WiMOD.
Definition: WiMODLoRaWAN.cpp:1000
TRxAckIndicationCallback
void(* TRxAckIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:175
WiMODLoRaWAN::JoinNetwork
bool JoinNetwork(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Start joining the network via the OTAA procedure. Asynchronous process.
Definition: WiMODLoRaWAN.cpp:1294
TWiMODLORAWAN_RX_ACK_Data
Data structure for received Acknowledgment data.
Definition: WiMOD_SAP_LORAWAN_IDs.h:602
WiMODLoRaWAN::SetHciConfig
bool SetHciConfig(TWiMODLR_DevMgmt_HciConfig &hciConfig, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets a new HCI configuration of the WiMOD.
Definition: WiMODLoRaWAN.cpp:1042
ComSLIP.h
TRxMacCmdIndicationCallback
void(* TRxMacCmdIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:172
WiMODLoRaWAN::SetCustomConfig
bool SetCustomConfig(const INT8 rfGain, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Setup a custom config for tx power settings; expert level only.
Definition: WiMODLoRaWAN.cpp:2338
WiMODLoRaWAN::end
void end(void)
Shut shut down function.
Definition: WiMODLoRaWAN.cpp:127
WiMODLoRaWAN::GetOperationMode
bool GetOperationMode(TWiMOD_OperationMode *opMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current operation mode of the WiMOD module.
Definition: WiMODLoRaWAN.cpp:719
WiMODLoRaWAN::RegisterRxAckIndicationClient
void RegisterRxAckIndicationClient(TRxAckIndicationCallback cb)
Register a callback function for the event "RX ACK (data) Indication".
Definition: WiMODLoRaWAN.cpp:1891
WiMODLoRaWAN::GetRadioStackConfig
bool GetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig *data, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current radio config parameter set of the WiMOD.
Definition: WiMODLoRaWAN.cpp:2082
TTxCDataIndicationCallback
void(* TTxCDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:160
WiMODLoRaWAN::ExecuteGenericCmd
bool ExecuteGenericCmd(TWiMODLR_Generic_CmdInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Generic Execution Function for HCI commands that are currently not implemented.
Definition: WiMODLoRaWAN.cpp:2569
WiMODLoRaWAN::GetRtcAlarm
bool GetRtcAlarm(TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets information about the RTC alarm feature of the WiMOD.
Definition: WiMODLoRaWAN.cpp:856
WiMODLoRaWAN::Ping
bool Ping(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Ping Cmd - Checks the serial connection to the WiMOD module.
Definition: WiMODLoRaWAN.cpp:442
TWiMODLORAWAN_MacCmd
LoRaWAN MAC command structure.
Definition: WiMOD_SAP_LORAWAN_IDs.h:590
WiMODLoRaWAN::SapGeneric
WiMOD_SAP_Generic SapGeneric
Definition: WiMODLoRaWAN.h:224
WiMODLoRaWAN::RegisterJoinTxIndicationClient
void RegisterJoinTxIndicationClient(TJoinTxIndicationCallback cb)
Register a callback function for the event "TX Join Indication".
Definition: WiMODLoRaWAN.cpp:1330
WiMODLoRaWAN::RegisterJoinedNwkIndicationClient
void RegisterJoinedNwkIndicationClient(TJoinedNwkIndicationCallback cb)
Register a callback function for the event "Joined Nwk Indication".
Definition: WiMODLoRaWAN.cpp:1870
TJoinTxIndicationCallback
void(* TJoinTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:151
TNoDataIndicationCallback
void(* TNoDataIndicationCallback)(void)
Definition: WiMOD_SAP_LORAWAN.h:157
WiMODLoRaWAN::WiMODLoRaWAN
WiMODLoRaWAN(Stream &s)
Constructor.
Definition: WiMODLoRaWAN.cpp:69
TRxCDataIndicationCallback
void(* TRxCDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:169
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
WiMOD_SAP_Generic.h
TWiMODLORAWAN_ActivateDeviceData
Activation data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:439
WiMODLoRaWAN::SetTxPowerLimitConfig
bool SetTxPowerLimitConfig(TWiMODLORAWAN_TxPwrLimitConfig &txPwrLimitCfg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Set a single TX limit for a single sub-band.
Definition: WiMODLoRaWAN.cpp:2432
WiMODLoRaWAN::SendCData
bool SendCData(const TWiMODLORAWAN_TX_Data *data, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to send transmit C-Data to network server via RF link.
Definition: WiMODLoRaWAN.cpp:1996
TWiMODLR_DevMgmt_HciConfig
HCI Configuration Parameters.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:519
TWiMODLRHCI::begin
virtual void begin(void)
Init function of the generic HCI message handler.
Definition: WiMODLRHCI.cpp:92
WiMOD_SAP_LoRaWAN
Implementation for the ServiceAccessPoint LoRaWAN (End Node Modem firmware only)
Definition: WiMOD_SAP_LORAWAN.h:189
TDevMgmtRtcAlarmCallback
void(* TDevMgmtRtcAlarmCallback)(void)
Definition: WiMOD_SAP_DEVMGMT.h:96
TDevMgmtPowerUpCallback
void(* TDevMgmtPowerUpCallback)(void)
Definition: WiMOD_SAP_DEVMGMT.h:93
TWiMODLR_DevMgmt_SystemStatusLorawan
Basic information about system status of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_Lorawan_IDs.h:77
WiMODLoRaWAN::SetBatteryLevelStatus
bool SetBatteryLevelStatus(UINT8 battStatus, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Set the Battery Level Status.
Definition: WiMODLoRaWAN.cpp:2505
WiMODLoRaWAN::SapDevMgmt
WiMOD_SAP_DevMgmt_Lorawan SapDevMgmt
Definition: WiMODLoRaWAN.h:222
WiMODLoRaWAN::GetRtc
bool GetRtc(UINT32 *rtcTime, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current RTC data info from WiMOD module.
Definition: WiMODLoRaWAN.cpp:634
TWiMODLORAWAN_TX_Data
Structure containing all data necessary to transmitting a data message.
Definition: WiMOD_SAP_LORAWAN_IDs.h:502
WiMOD_SAP_DevMgmt_Lorawan
Implementation for the ServiceAccessPoint DeviceManagement.
Definition: WiMOD_SAP_DEVMGMT_Lorawan.h:63
WiMODLoRaWAN::GetLastResponseStatus
UINT8 GetLastResponseStatus(void)
Gets the last response code of the WiMOD of the last executed command.
Definition: WiMODLoRaWAN.cpp:2667
WiMODLoRaWAN::SendUData
bool SendUData(const TWiMODLORAWAN_TX_Data *data, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to send transmit U-Data to network server via RF link.
Definition: WiMODLoRaWAN.cpp:1938
WiMODLoRaWAN::RegisterPowerUpIndicationClient
void RegisterPowerUpIndicationClient(TDevMgmtPowerUpCallback cb)
Register a callback function for the PowerUp Indication - optional -.
Definition: WiMODLoRaWAN.cpp:923
WiMODLoRaWAN::RegisterRxUDataIndicationClient
void RegisterRxUDataIndicationClient(TRxUDataIndicationCallback cb)
Register a callback function for the event "RX U-Data Indication".
Definition: WiMODLoRaWAN.cpp:1807
WiMODLoRaWAN::GetNwkStatus
bool GetNwkStatus(TWiMODLORAWAN_NwkStatus_Data *nwkStatus, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current status of the network "connection".
Definition: WiMODLoRaWAN.cpp:2274