Demo HCI Implementation for WiMOD-LR Devices  V2.0.3
WiMOD_SAP_LoRaWAN_ProLink Class Reference

Implementation for the ServiceAccessPoint LoRaWAN (End Node Modem firmware only) More...

#include <SAP/WiMOD_SAP_LORAWAN_ProLink.h>

Inheritance diagram for WiMOD_SAP_LoRaWAN_ProLink:
Collaboration diagram for WiMOD_SAP_LoRaWAN_ProLink:

Public Member Functions

 WiMOD_SAP_LoRaWAN_ProLink (TWiMODLRHCI *hci, UINT8 *buffer, UINT16 bufferSize)
 Constructor. More...
 
virtual ~WiMOD_SAP_LoRaWAN_ProLink (void)
 Destructor.
 
virtual void setRegion (TProLinkLoRaWANregion regionalSetting)
 Setup regional settings for the LoRaWAN Firmware of the WiMOD module. More...
 
TWiMODLRResultCodes SetDeviceNonce (const UINT16 devNonce, UINT8 *statusRsp)
 SetDeviceNonce Cmd - Sets the device NONCE of WiMOD. More...
 
TWiMODLRResultCodes GetDeviceNonce (UINT16 *devNonce, UINT8 *statusRsp)
 Gets the current device NONCE value of the WiMOD. More...
 
TWiMODLRResultCodes SetJoinNonce (const UINT16 joinNonce, UINT8 *statusRsp)
 SetJoinNonce Cmd - Sets the Join NONCE value of WiMOD. More...
 
TWiMODLRResultCodes GetJoinNonce (UINT16 *joinNonce, UINT8 *statusRsp)
 Gets the current Join NONCE value of the WiMOD. More...
 
TWiMODLRResultCodes SendNwkTimeRequest (TWiMODLORAWAN_DevTimeReqInfo *devTimeInfo, UINT8 *statusRsp)
 SendNwkTimeRequest Cmd - Sends a network device time request to WiMOD. More...
 
TWiMODLRResultCodes SendUData (TWiMODProLinkLORAWAN_TX_Data *data, UINT8 *statusRsp)
 Tries to send transmit U-Data to network server via RF link. More...
 
TWiMODLRResultCodes SendCData (TWiMODProLinkLORAWAN_TX_Data *data, UINT8 *statusRsp)
 Tries to send transmit C-Data to network server via RF link. More...
 
void RegisterResetDevNonceIndicationClient (TResetDevNonceIndicationCallback cb)
 Register a callback function for the event "Reset DeviceNonce Indication". More...
 
void RegisterLinkDisconnectIndicationClient (TLinkDisconnectIndicationCallback cb)
 Register a callback function for the event "Link Disconnect Indication". More...
 
void RegisterDeviceTimeAnsIndicationClient (TNwkDeviceTimeAnsIndicationCallback cb)
 Register a callback function for the event "Nwk DeviceTime Answer Indication". More...
 
void RegisterMulticastDataIndicationClient (TMCastDataIndicationCallback cb)
 Register a callback function for the event "RX Multicast Data Indication". More...
 
void RegisterMulticastInvalidDataIndicationClient (TMCastInvalidDataIndicationCallback cb)
 Register a callback function for the event "RX Invalid Multicast Data". More...
 
TWiMODLRResultCodes SetMulticastConfig (TWiMODLORAWAN_McastConfig &mcastCfg, UINT8 *statusRsp)
 
TWiMODLRResultCodes GetMulticastConfig (TWiMODLORAWAN_McastConfig *mcastCfg, UINT8 *statusRsp)
 
TWiMODLRResultCodes RemoveMulticastConfig (const UINT8 mcastIndex, UINT8 *statusRsp)
 
virtual TWiMODLRResultCodes SetRadioStackConfig (TWiMODProLinkLORAWAN_RadioStackConfig *data, UINT8 *statusRsp)
 Sets a new radio config parameter set of the WiMOD. More...
 
virtual TWiMODLRResultCodes GetRadioStackConfig (TWiMODProLinkLORAWAN_RadioStackConfig *data, UINT8 *statusRsp)
 Gets the current radio config parameter set of the WiMOD. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_DevTimeAnsInfo *info)
 Convert a received low level HCI-Msg to a high-level DevicetimeAnswser structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_McastData *mcastData)
 Convert a received low level HCI-Msg to a high-level (RX) Multicast Data structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_McastNoData *mcastErrData)
 Convert a received low level HCI-Msg to a high-level Invalid/No Multicast Data structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_RX_Data *loraWanRxData)
 
bool convert (TWiMODLR_HCIMessage &rxMsg, TWiMODLORAWAN_TxIndData *sendIndData)
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_RX_MacCmdData *loraWanMacCmdData)
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_RX_JoinedNwkData *joinedNwkData)
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_RX_ACK_Data *ackData)
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_NoData_Data *info)
 
void DispatchProLinkLoRaWANMessage (TWiMODLR_HCIMessage &rxMsg)
 
- Public Member Functions inherited from WiMOD_SAP_LoRaWAN
 WiMOD_SAP_LoRaWAN (TWiMODLRHCI *hci, UINT8 *buffer, UINT16 bufferSize)
 Constructor. More...
 
virtual ~WiMOD_SAP_LoRaWAN (void)
 Destructor.
 
virtual void setRegion (TLoRaWANregion regionalSetting)
 Setup regional settings for the LoRaWAN Firmware of the WiMOD module. More...
 
virtual TWiMODLRResultCodes ActivateDevice (TWiMODLORAWAN_ActivateDeviceData &activationData, UINT8 *statusRsp)
 Activates the device via the ABP procedure. More...
 
virtual TWiMODLRResultCodes ReactivateDevice (UINT32 *devAdr, UINT8 *statusRsp)
 Re-Activates the device via the ABP procedure. More...
 
virtual TWiMODLRResultCodes SetJoinParameter (TWiMODLORAWAN_JoinParams &joinParams, UINT8 *statusRsp)
 Sets the parameters used for the OTAA activation procedure. More...
 
virtual TWiMODLRResultCodes JoinNetwork (UINT8 *statusRsp)
 Start joining the network via the OTAA procedure. Asynchronous process. More...
 
virtual void RegisterJoinTxIndicationClient (TJoinTxIndicationCallback cb)
 Register a callback function for the event "TX Join Indication". More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_RX_Data *loraWanRxData)
 Convert a received low level HCI-Msg to a high-level Rx Data structure. More...
 
bool convert (TWiMODLR_HCIMessage &rxMsg, TWiMODLORAWAN_TxIndData *sendIndData)
 Convert a received low level HCI-Msg to a high-level tx ind structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_RX_MacCmdData *loraWanMacCmdData)
 Convert a received low level HCI-Msg to a high-level MAC-Cmd structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_RX_JoinedNwkData *joinedNwkData)
 Convert a received low level HCI-Msg to a high-level NwkJoined structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_RX_ACK_Data *ackData)
 Convert a received low level HCI-Msg to a high-level AckData structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLORAWAN_NoData_Data *info)
 Convert a received low level HCI-Msg to a high-level NoDataIndication structure. More...
 
void RegisterNoDataIndicationClient (TNoDataIndicationCallback cb)
 Register a callback function for the event "TX Join Indication". More...
 
void RegisterTxCDataIndicationClient (TTxCDataIndicationCallback cb)
 Register a callback function for the event "TX C-Data Indication". More...
 
void RegisterTxUDataIndicationClient (TTxUDataIndicationCallback cb)
 Register a callback function for the event "TX U Data Indication". More...
 
void RegisterRxUDataIndicationClient (TRxUDataIndicationCallback cb)
 Register a callback function for the event "RX U-Data Indication". More...
 
void RegisterRxCDataIndicationClient (TRxCDataIndicationCallback cb)
 Register a callback function for the event "RX C-Data Indication". More...
 
void RegisterRxMacCmdIndicationClient (TRxMacCmdIndicationCallback cb)
 Register a callback function for the event "RX MAC Cmd Indication". More...
 
void RegisterJoinedNwkIndicationClient (TJoinedNwkIndicationCallback cb)
 Register a callback function for the event "Joined Nwk Indication". More...
 
void RegisterRxAckIndicationClient (TRxAckIndicationCallback cb)
 Register a callback function for the event "RX ACK (data) Indication". More...
 
virtual TWiMODLRResultCodes SendUData (const TWiMODLORAWAN_TX_Data *data, UINT8 *statusRsp)
 Tries to send transmit U-Data to network server via RF link. More...
 
virtual TWiMODLRResultCodes SendCData (const TWiMODLORAWAN_TX_Data *data, UINT8 *statusRsp)
 Tries to send transmit C-Data to network server via RF link. More...
 
virtual TWiMODLRResultCodes SetRadioStackConfig (TWiMODLORAWAN_RadioStackConfig *data, UINT8 *statusRsp)
 Sets a new radio config parameter set of the WiMOD. More...
 
virtual TWiMODLRResultCodes GetRadioStackConfig (TWiMODLORAWAN_RadioStackConfig *data, UINT8 *statusRsp)
 Gets the current radio config parameter set of the WiMOD. More...
 
virtual TWiMODLRResultCodes DeactivateDevice (UINT8 *statusRsp)
 Deactivate the device (logical disconnect from lora network) More...
 
virtual TWiMODLRResultCodes FactoryReset (UINT8 *statusRsp)
 Reset all internal settings to default values (incl. DevEUI) More...
 
virtual TWiMODLRResultCodes SetDeviceEUI (const UINT8 *deviceEUI, UINT8 *statusRsp)
 Sets a new DeviceEUI (aka. IEEE-Address) to the WiMOD. More...
 
virtual TWiMODLRResultCodes GetDeviceEUI (UINT8 *deviceEUI, UINT8 *statusRsp)
 Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD. More...
 
virtual TWiMODLRResultCodes GetNwkStatus (TWiMODLORAWAN_NwkStatus_Data *nwkStatus, UINT8 *statusRsp)
 Gets the current status of the network "connection". More...
 
virtual TWiMODLRResultCodes SendMacCmd (const TWiMODLORAWAN_MacCmd *cmd, UINT8 *statusRsp)
 Send a MAC command to the server; expert level only. More...
 
virtual TWiMODLRResultCodes SetCustomConfig (const INT8 rfGain, UINT8 *statusRsp)
 Setup a custom config for tx power settings; expert level only. More...
 
virtual TWiMODLRResultCodes GetCustomConfig (INT8 *rfGain, UINT8 *statusRsp)
 Get the current offet for tx power level; expert level only. More...
 
virtual TWiMODLRResultCodes GetSupportedBands (TWiMODLORAWAN_SupportedBands *supportedBands, UINT8 *statusRsp)
 Get the supported bands of this firmware. More...
 
virtual TWiMODLRResultCodes GetTxPowerLimitConfig (TWiMODLORAWAN_TxPwrLimitConfig *txPwrLimitCfg, UINT8 *statusRsp)
 Get the configured TxPowerLimit settings. More...
 
virtual TWiMODLRResultCodes SetTxPowerLimitConfig (TWiMODLORAWAN_TxPwrLimitConfig &txPwrLimitCfg, UINT8 *statusRsp)
 Set a SINGLE TxPowerLimit entry. More...
 
virtual TWiMODLRResultCodes SetBatteryLevelStatus (UINT8 battStatus, UINT8 *statusRsp)
 Set Battery Level Status. More...
 
virtual void DispatchLoRaWANMessage (TWiMODLR_HCIMessage &rxMsg)
 

Detailed Description

Implementation for the ServiceAccessPoint LoRaWAN (End Node Modem firmware only)

Constructor & Destructor Documentation

◆ WiMOD_SAP_LoRaWAN_ProLink()

WiMOD_SAP_LoRaWAN_ProLink::WiMOD_SAP_LoRaWAN_ProLink ( TWiMODLRHCI hci,
UINT8 *  buffer,
UINT16  bufferSize 
)

Constructor.

Parameters
hciPointer to HCI processor object
bufferpointer to storage area for building tx frames; MUST BE VALID
bufferSizesize of the buffer

Member Function Documentation

◆ convert() [1/3]

bool WiMOD_SAP_LoRaWAN_ProLink::convert ( TWiMODLR_HCIMessage RxMsg,
TWiMODLORAWAN_DevTimeAnsInfo info 
)

Convert a received low level HCI-Msg to a high-level DevicetimeAnswser structure.

This function should be used by the DeviceTimeAnswer MAC command response Indication Callback function prior processing the received data message.

Parameters
RxMsgReference to low-level HCI message.
Warning
DO NOT MANIPULATE THESE VALUES !!!
Parameters
loraWanMacCmdDataPointer to the buffer where to store the received data
Return values
trueif the conversion was successful

◆ convert() [2/3]

bool WiMOD_SAP_LoRaWAN_ProLink::convert ( TWiMODLR_HCIMessage RxMsg,
TWiMODLORAWAN_McastData mcastData 
)

Convert a received low level HCI-Msg to a high-level (RX) Multicast Data structure.

This function should be used by the Rx MultiCast Data Indication Callback function prior processing the received data message.

Parameters
RxMsgReference to low-level HCI message.
Warning
DO NOT MANIPULATE THESE VALUES !!!
Parameters
loraWanMacCmdDataPointer to the buffer where to store the received data
Return values
trueif the conversion was successful

◆ convert() [3/3]

bool WiMOD_SAP_LoRaWAN_ProLink::convert ( TWiMODLR_HCIMessage RxMsg,
TWiMODLORAWAN_McastNoData mcastErrData 
)

Convert a received low level HCI-Msg to a high-level Invalid/No Multicast Data structure.

This function should be used by the Rx Invalid MultiCast Data Indication Callback function prior processing the received data message.

Parameters
RxMsgReference to low-level HCI message.
Warning
DO NOT MANIPULATE THESE VALUES !!!
Parameters
loraWanMacCmdDataPointer to the buffer where to store the received data
Return values
trueif the conversion was successful

◆ GetDeviceNonce()

TWiMODLRResultCodes WiMOD_SAP_LoRaWAN_ProLink::GetDeviceNonce ( UINT16 *  devNonce,
UINT8 *  statusRsp 
)

Gets the current device NONCE value of the WiMOD.

Parameters
devNoncepointer to data value for storing the requested information
statusRspStatus byte contained in the local response of the module
Return values
WiMODLR_RESULT_OKif command transmit to WiMOD was ok

◆ GetJoinNonce()

TWiMODLRResultCodes WiMOD_SAP_LoRaWAN_ProLink::GetJoinNonce ( UINT16 *  joinNonce,
UINT8 *  statusRsp 
)

Gets the current Join NONCE value of the WiMOD.

Parameters
joinNoncepointer to data value for storing the requested information
statusRspStatus byte contained in the local response of the module
Return values
WiMODLR_RESULT_OKif command transmit to WiMOD was ok

◆ GetRadioStackConfig()

TWiMODLRResultCodes WiMOD_SAP_LoRaWAN_ProLink::GetRadioStackConfig ( TWiMODProLinkLORAWAN_RadioStackConfig data,
UINT8 *  statusRsp 
)
virtual

Gets the current radio config parameter set of the WiMOD.

Parameters
datapointer to data structure for storing the requested information
See also
TWiMODLORAWAN_TX_Data for details
Parameters
statusRspStatus byte contained in the local response of the module
Return values
WiMODLR_RESULT_OKif command transmit to WiMOD was ok

◆ RegisterDeviceTimeAnsIndicationClient()

void WiMOD_SAP_LoRaWAN_ProLink::RegisterDeviceTimeAnsIndicationClient ( TNwkDeviceTimeAnsIndicationCallback  cb)
virtual

Register a callback function for the event "Nwk DeviceTime Answer Indication".

This registered callback is called when the specified event is called by the WiMOD stack.

Parameters
cbpointer to a callback function that should be called if the event occurs.

Reimplemented from WiMOD_SAP_LoRaWAN.

◆ RegisterLinkDisconnectIndicationClient()

void WiMOD_SAP_LoRaWAN_ProLink::RegisterLinkDisconnectIndicationClient ( TLinkDisconnectIndicationCallback  cb)
virtual

Register a callback function for the event "Link Disconnect Indication".

This registered callback is called when the specified event is called by the WiMOD stack.

Parameters
cbpointer to a callback function that should be called if the event occurs.

Reimplemented from WiMOD_SAP_LoRaWAN.

◆ RegisterMulticastDataIndicationClient()

void WiMOD_SAP_LoRaWAN_ProLink::RegisterMulticastDataIndicationClient ( TMCastDataIndicationCallback  cb)

Register a callback function for the event "RX Multicast Data Indication".

This registered callback is called when the specified event is called by the WiMOD stack.

Parameters
cbpointer to a callback function that should be called if the event occurs.

◆ RegisterMulticastInvalidDataIndicationClient()

void WiMOD_SAP_LoRaWAN_ProLink::RegisterMulticastInvalidDataIndicationClient ( TMCastInvalidDataIndicationCallback  cb)

Register a callback function for the event "RX Invalid Multicast Data".

This registered callback is called when the specified event is called by the WiMOD stack.

Parameters
cbpointer to a callback function that should be called if the event occurs.

◆ RegisterResetDevNonceIndicationClient()

void WiMOD_SAP_LoRaWAN_ProLink::RegisterResetDevNonceIndicationClient ( TResetDevNonceIndicationCallback  cb)
virtual

Register a callback function for the event "Reset DeviceNonce Indication".

This registered callback is called when the specified event is called by the WiMOD stack.

Parameters
cbpointer to a callback function that should be called if the event occurs.

Reimplemented from WiMOD_SAP_LoRaWAN.

◆ SendCData()

TWiMODLRResultCodes WiMOD_SAP_LoRaWAN_ProLink::SendCData ( TWiMODProLinkLORAWAN_TX_Data data,
UINT8 *  statusRsp 
)

Tries to send transmit C-Data to network server via RF link.

Parameters
datapointer to data structure containing the TX-data and options.
See also
TWiMODLORAWAN_TX_Data for details
Parameters
statusRspStatus byte contained in the local response of the module
Return values
WiMODLR_RESULT_OKif command transmit to WiMOD was ok

◆ SendNwkTimeRequest()

TWiMODLRResultCodes WiMOD_SAP_LoRaWAN_ProLink::SendNwkTimeRequest ( TWiMODLORAWAN_DevTimeReqInfo devTimeInfo,
UINT8 *  statusRsp 
)

SendNwkTimeRequest Cmd - Sends a network device time request to WiMOD.

Parameters
devTimeInfopointer to store additional response data
statusRsppointer to store status byte of response mesg from WiMOD
Return values
WiMODLR_RESULT_OKif command transmit to WiMOD was ok

◆ SendUData()

TWiMODLRResultCodes WiMOD_SAP_LoRaWAN_ProLink::SendUData ( TWiMODProLinkLORAWAN_TX_Data data,
UINT8 *  statusRsp 
)

Tries to send transmit U-Data to network server via RF link.

Parameters
datapointer to data structure containing the TX-data and options.
See also
TWiMODLORAWAN_TX_Data for details
Parameters
statusRspStatus byte contained in the local response of the module
Return values
WiMODLR_RESULT_OKif command transmit to WiMOD was ok

◆ SetDeviceNonce()

TWiMODLRResultCodes WiMOD_SAP_LoRaWAN_ProLink::SetDeviceNonce ( const UINT16  devNonce,
UINT8 *  statusRsp 
)

SetDeviceNonce Cmd - Sets the device NONCE of WiMOD.

Parameters
devNonce16bit NONCE value - see LoRaWAN spec for details
statusRsppointer to store status byte of response mesg from WiMOD
Return values
WiMODLR_RESULT_OKif command transmit to WiMOD was ok

◆ SetJoinNonce()

TWiMODLRResultCodes WiMOD_SAP_LoRaWAN_ProLink::SetJoinNonce ( const UINT16  joinNonce,
UINT8 *  statusRsp 
)

SetJoinNonce Cmd - Sets the Join NONCE value of WiMOD.

Parameters
joinNonce16bit nonce value - see LoRaWAN spec for details
statusRsppointer to store status byte of response mesg from WiMOD
Return values
WiMODLR_RESULT_OKif command transmit to WiMOD was ok

◆ SetRadioStackConfig()

TWiMODLRResultCodes WiMOD_SAP_LoRaWAN_ProLink::SetRadioStackConfig ( TWiMODProLinkLORAWAN_RadioStackConfig data,
UINT8 *  statusRsp 
)
virtual

Sets a new radio config parameter set of the WiMOD.

Parameters
datapointer to data structure containing the new parameters
See also
TWiMODLORAWAN_TX_Data for details
Parameters
statusRspStatus byte contained in the local response of the module
Return values
WiMODLR_RESULT_OKif command transmit to WiMOD was ok

◆ setRegion()

void WiMOD_SAP_LoRaWAN_ProLink::setRegion ( TProLinkLoRaWANregion  regionalSetting)
virtual

Setup regional settings for the LoRaWAN Firmware of the WiMOD module.

Parameters
regionalSettingregion code for the firmware

The documentation for this class was generated from the following files: