34 #ifndef ARDUINO_WIMODLORAWAN_H_ 35 #define ARDUINO_WIMODLORAWAN_H_ 57 #include "utils/ComSLIP.h" 64 #define WIMOD_LORAWAN_SERIAL_BAUDRATE 115200 66 #define WiMOD_LORAWAN_TX_BUFFER_SIZE 256 192 UINT8 txBuffer[WiMOD_LORAWAN_TX_BUFFER_SIZE];
194 UINT8 localStatusRsp;
bool Ping(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Ping Cmd - Checks the serial connection to the WiMOD module.
Definition: WiMODLoRaWAN.cpp:181
bool SetOperationMode(const TWiMOD_OperationMode opMode, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current operation mode of the WiMOD module.
Definition: WiMODLoRaWAN.cpp:498
Structure containing data of the joined network indication.
Definition: WiMOD_SAP_LORAWAN_IDs.h:592
Basic information about system status of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:208
Activation data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:481
void(* TRxCDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:133
Implementation for the ServiceAccessPoint LoRaWAN (End Node Modem firmware only)
Definition: WiMOD_SAP_LORAWAN.h:153
bool SetRtc(const UINT32 rtcTime, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current RTC values to WiMOD module.
Definition: WiMODLoRaWAN.cpp:412
Structure containing a received MAC command.
Definition: WiMOD_SAP_LORAWAN_IDs.h:575
void(* TTxCDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:124
void(* TRxMacCmdIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:136
TWiMDLRResultCodes GetLastHciResult(void)
Gets the last HCI result code from the last executed command.
Definition: WiMODLoRaWAN.cpp:2027
bool GetSystemStatus(TWiMODLR_DevMgmt_SystemStatus *info, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
GetSystemStatus Cmd - Gets the basic information about the system status of the WiMOD.
Definition: WiMODLoRaWAN.cpp:326
void(* TJoinTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:115
void RegisterRxAckIndicationClient(TRxAckIndicationCallback cb)
Register a callback function for the event "RX ACK (data) Indication".
Definition: WiMODLoRaWAN.cpp:1505
TWiMDLRResultCodes
Result codes for the local serial communication itself.
Definition: WiMODLRHCI.h:149
void RegisterRxUDataIndicationClient(TRxUDataIndicationCallback cb)
Register a callback function for the event "RX U-Data Indication".
Definition: WiMODLoRaWAN.cpp:1421
bool JoinNetwork(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Start joining the network via the OTAA procedure. Asynchronous process.
Definition: WiMODLoRaWAN.cpp:949
void begin(void)
This function must be called once before any other service can be used.
Definition: WiMODLoRaWAN.cpp:105
void(* TDevMgmtRtcAlarmCallback)(void)
Definition: WiMOD_SAP_DEVMGMT.h:96
bool FactoryReset(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Reset all internal settings to default values (incl. DevEUI !!!)
Definition: WiMODLoRaWAN.cpp:1761
void RegisterRxMacCmdIndicationClient(TRxMacCmdIndicationCallback cb)
Register a callback function for the event "RX MAC Cmd Indication".
Definition: WiMODLoRaWAN.cpp:1463
bool ClearRtcAlarm(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Clears pending RTC Alarms of the WiMOD.
Definition: WiMODLoRaWAN.cpp:624
void RegisterJoinedNwkIndicationClient(TJoinedNwkIndicationCallback cb)
Register a callback function for the event "Joined Nwk Indication".
Definition: WiMODLoRaWAN.cpp:1484
bool GetDeviceInfo(TWiMODLR_DevMgmt_DevInfo *info, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
GetDeviceInfo Cmd - Gets the basic device information of the WiMOD.
Definition: WiMODLoRaWAN.cpp:241
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
bool SendMacCmd(const TWiMODLORAWAN_MacCmd *cmd, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Send a MAC command to the server; expert level only.
Definition: WiMODLoRaWAN.cpp:1929
void(* TRxAckIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:139
bool SetRadioStackConfig(const TWiMODLORAWAN_RadioStackConfig *data, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets a new radio config parameter set of the WiMOD.
Definition: WiMODLoRaWAN.cpp:1657
bool GetRtcAlarm(TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets information about the RTC alarm feature of the WiMOD.
Definition: WiMODLoRaWAN.cpp:595
bool GetDeviceEUI(UINT8 *deviceEUI, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD.
Definition: WiMODLoRaWAN.cpp:1841
void RegisterPowerUpIndicationClient(TDevMgmtPowerUpCallback cb)
Register a callback function for the PowerUp Indication - optional -.
Definition: WiMODLoRaWAN.cpp:662
Declarations for the DeviceManagement SericeAccessPoint.
Internal helper class for processing SLIP frames.
Definition: WiMODLRHCI.h:229
void(* TJoinedNwkIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:118
Common low level HCI message processing base.
bool GetOperationMode(TWiMOD_OperationMode *opMode, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current operation mode of the WiMOD module.
Definition: WiMODLoRaWAN.cpp:458
bool GetRadioStackConfig(TWiMODLORAWAN_RadioStackConfig *data, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current radio config parameter set of the WiMOD.
Definition: WiMODLoRaWAN.cpp:1696
void RegisterTxCDataIndicationClient(TTxCDataIndicationCallback cb)
Register a callback function for the event "TX C-Data Indication".
Definition: WiMODLoRaWAN.cpp:1352
Main class representing the interface to the WiMOD running the firmware LoRaWAN EndNode Modem...
Definition: WiMODLoRaWAN.h:86
TWiMOD_OperationMode
This enum describes the possible operation modes of the WiMOD (only for LR-BASE). ...
Definition: WiMOD_SAP_DEVMGMT_IDs.h:410
Implementation for the ServiceAccessPoint DeviceManagement.
Definition: WiMOD_SAP_DEVMGMT.h:109
void RegisterNoDataIndicationClient(TNoDataIndicationCallback cb)
Register a callback function for the event "TX Join Indication".
Definition: WiMODLoRaWAN.cpp:1305
void(* TRxUDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:130
bool SendUData(const TWiMODLORAWAN_TX_Data *data, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to send transmit U-Data to network server via RF link.
Definition: WiMODLoRaWAN.cpp:1552
bool DeactivateDevice(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Deactivate the device (logical disconnect from lora network)
Definition: WiMODLoRaWAN.cpp:1728
WiMODLoRaWAN(Stream &s)
Constructor.
Definition: WiMODLoRaWAN.cpp:68
UINT8 GetLastResponseStatus(void)
Gets the last response code of the WiMOD of the last executed command.
Definition: WiMODLoRaWAN.cpp:2073
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:1038
bool SetDeviceEUI(const UINT8 *deviceEUI, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets a new DeviceEUI (aka. IEEE-Address) to the WiMOD.
Definition: WiMODLoRaWAN.cpp:1804
JOIN data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:492
Structure containing the RTC Alarm config parameters of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:452
Basic information about the current firmware of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:194
bool SetCustomConfig(const INT8 txPwrOffset, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Setup a custom config for tx power settings; expert level only.
Definition: WiMODLoRaWAN.cpp:1952
WiMOD_SAP_DevMgmt SapDevMgmt
Definition: WiMODLoRaWAN.h:182
void RegisterRtcAlarmIndicationClient(TDevMgmtRtcAlarmCallback cb)
Register a callback function for the RTC Alarm Indication - optional -.
Definition: WiMODLoRaWAN.cpp:700
bool GetRtc(UINT32 *rtcTime, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current RTC data info from WiMOD module.
Definition: WiMODLoRaWAN.cpp:373
bool ActivateDevice(TWiMODLORAWAN_ActivateDeviceData &activationData, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Activates the device via the APB procedure.
Definition: WiMODLoRaWAN.cpp:767
Data structure for received Acknowledgment data.
Definition: WiMOD_SAP_LORAWAN_IDs.h:634
bool SetRtcAlarm(const TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets and enables the RTC alarm feature of the WiMOD.
Definition: WiMODLoRaWAN.cpp:552
void RegisterRxCDataIndicationClient(TRxCDataIndicationCallback cb)
Register a callback function for the event "RX C-Data Indication".
Definition: WiMODLoRaWAN.cpp:1442
bool Reset(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Reset Cmd - Reboots the WiMOD module.
Definition: WiMODLoRaWAN.cpp:204
Declarations for the LoRaWAN SericeAccessPoint.
void end(void)
Shut shut down function.
Definition: WiMODLoRaWAN.cpp:115
bool GetNwkStatus(TWiMODLORAWAN_NwkStatus_Data *nwkStatus, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current status of the network "connection".
Definition: WiMODLoRaWAN.cpp:1888
void RegisterTxUDataIndicationClient(TTxUDataIndicationCallback cb)
Register a callback function for the event "TX U Data Indication".
Definition: WiMODLoRaWAN.cpp:1400
Activation data structure for LoRa network activation.
Definition: WiMOD_SAP_LORAWAN_IDs.h:514
LoRaWAN MAC command structure.
Definition: WiMOD_SAP_LORAWAN_IDs.h:622
void(* TNoDataIndicationCallback)(void)
Definition: WiMOD_SAP_LORAWAN.h:121
bool ReactivateDevice(UINT32 *devAdr, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Re-Activates the device via the APB procedure.
Definition: WiMODLoRaWAN.cpp:834
Structure containing basic information about the WiMOD device.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:156
bool SendCData(const TWiMODLORAWAN_TX_Data *data, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to send transmit C-Data to network server via RF link.
Definition: WiMODLoRaWAN.cpp:1610
Radio stack configuration related to to LoRaWAN specific options.
Definition: WiMOD_SAP_LORAWAN_IDs.h:609
void(* TTxUDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_LORAWAN.h:127
void RegisterJoinTxIndicationClient(TJoinTxIndicationCallback cb)
Register a callback function for the event "TX Join Indication".
Definition: WiMODLoRaWAN.cpp:985
bool GetFirmwareInfo(TWiMODLR_DevMgmt_FwInfo *info, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
GetFirmwareInfo Cmd - Gets the basic information about the firmware of the WiMOD. ...
Definition: WiMODLoRaWAN.cpp:283
WiMOD_SAP_LoRaWAN SapLoRaWan
Definition: WiMODLoRaWAN.h:183
void(* TDevMgmtPowerUpCallback)(void)
Definition: WiMOD_SAP_DEVMGMT.h:93
Structure containing all data about LoRaWAN network status.
Definition: WiMOD_SAP_LORAWAN_IDs.h:651
Structure containing all data necessary to transmitting a data message.
Definition: WiMOD_SAP_LORAWAN_IDs.h:544
bool SetJoinParameter(TWiMODLORAWAN_JoinParams &joinParams, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the parameters used for the OTAA activation procedure.
Definition: WiMODLoRaWAN.cpp:880
bool GetCustomConfig(INT8 *txPwrOffset, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Get the current offet for tx power level; expert level only.
Definition: WiMODLoRaWAN.cpp:1975
~WiMODLoRaWAN(void)
Desctructor.
Definition: WiMODLoRaWAN.cpp:85
Structure containing RX (user) payload data.
Definition: WiMOD_SAP_LORAWAN_IDs.h:555