![]() |
Demo HCI Implementation for WiMOD-LR Devices
V2.0.3
|
Implementation for the ServiceAccessPoint LoRaWAN (End Node Modem firmware only) More...
#include <SAP/WiMOD_SAP_LORAWAN.h>

Public Member Functions | |
| 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 | RegisterResetDevNonceIndicationClient (TResetDevNonceIndicationCallback cb) |
| Register a callback function for the event "Reset DeviceNonce Indication". More... | |
| virtual void | RegisterLinkDisconnectIndicationClient (TLinkDisconnectIndicationCallback cb) |
| Register a callback function for the event "Link Disconnect Indication". More... | |
| virtual void | RegisterDeviceTimeAnsIndicationClient (TNwkDeviceTimeAnsIndicationCallback cb) |
| Register a callback function for the event "Nwk DeviceTime Answer Indication". 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) |
Implementation for the ServiceAccessPoint LoRaWAN (End Node Modem firmware only)
| WiMOD_SAP_LoRaWAN::WiMOD_SAP_LoRaWAN | ( | TWiMODLRHCI * | hci, |
| UINT8 * | buffer, | ||
| UINT16 | bufferSize | ||
| ) |
Constructor.
| hci | Pointer to HCI processor object |
| buffer | pointer to storage area for building tx frames; MUST BE VALID |
| bufferSize | size of the buffer |
|
virtual |
Activates the device via the ABP procedure.
| activationData | structure holding the necessary parameters |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
| bool WiMOD_SAP_LoRaWAN::convert | ( | TWiMODLR_HCIMessage & | RxMsg, |
| TWiMODLORAWAN_NoData_Data * | info | ||
| ) |
Convert a received low level HCI-Msg to a high-level NoDataIndication structure.
This function should be used by the NoData Indication Callback function prior processing the received data message.
| RxMsg | Reference to low-level HCI message. |
| info | Pointer to the buffer where to store the received data |
| true | if the conversion was successful |
| bool WiMOD_SAP_LoRaWAN::convert | ( | TWiMODLR_HCIMessage & | RxMsg, |
| TWiMODLORAWAN_RX_ACK_Data * | ackData | ||
| ) |
Convert a received low level HCI-Msg to a high-level AckData structure.
This function should be used by the Rx Ack Indication Callback function prior processing the received data message.
| RxMsg | Reference to low-level HCI message. |
| ackData | Pointer to the buffer where to store the received data |
| true | if the conversion was successful |
| bool WiMOD_SAP_LoRaWAN::convert | ( | TWiMODLR_HCIMessage & | RxMsg, |
| TWiMODLORAWAN_RX_Data * | loraWanRxData | ||
| ) |
Convert a received low level HCI-Msg to a high-level Rx Data structure.
This function should be used by the Rx Data Indication Callback functions prior processing the received data message.
| RxMsg | Reference to low-level HCI message. |
| loraWanRxData | Pointer to the buffer where to store the received data |
| true | if the conversion was successful |
| bool WiMOD_SAP_LoRaWAN::convert | ( | TWiMODLR_HCIMessage & | RxMsg, |
| TWiMODLORAWAN_RX_JoinedNwkData * | joinedNwkData | ||
| ) |
Convert a received low level HCI-Msg to a high-level NwkJoined structure.
This function should be used by the JoinedNwk Indication Callback function prior processing the received data message.
| RxMsg | Reference to low-level HCI message. |
| joinedNwkData | Pointer to the buffer where to store the received data |
| true | if the conversion was successful |
| bool WiMOD_SAP_LoRaWAN::convert | ( | TWiMODLR_HCIMessage & | RxMsg, |
| TWiMODLORAWAN_RX_MacCmdData * | loraWanMacCmdData | ||
| ) |
Convert a received low level HCI-Msg to a high-level MAC-Cmd structure.
This function should be used by the Rx Mac Cmd Indication Callback function prior processing the received data message.
| RxMsg | Reference to low-level HCI message. |
| loraWanMacCmdData | Pointer to the buffer where to store the received data |
| true | if the conversion was successful |
| bool WiMOD_SAP_LoRaWAN::convert | ( | TWiMODLR_HCIMessage & | RxMsg, |
| TWiMODLORAWAN_TxIndData * | sendIndData | ||
| ) |
Convert a received low level HCI-Msg to a high-level tx ind structure.
This function should be used by the Tx Data Indication Callback functions prior processing the received data message.
| RxMsg | Reference to low-level HCI message. |
| sendIndData | Pointer to the buffer where to store the received data |
| true | if the conversion was successful |
|
virtual |
Deactivate the device (logical disconnect from lora network)
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Reset all internal settings to default values (incl. DevEUI)
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Get the current offet for tx power level; expert level only.
| rfGain | pointer to store the rfGain info for tx power settings |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD.
| deviceEUI | pointer for storing the received 64bit address |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Gets the current status of the network "connection".
| nwkStatus | pointer for storing the requested information |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Gets the current radio config parameter set of the WiMOD.
| data | pointer to data structure for storing the requested information |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Get the supported bands of this firmware.
| supportedBands | pointer to store area for result |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Get the configured TxPowerLimit settings.
| txPwrLimitCfg | pointer to store area for result |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Start joining the network via the OTAA procedure. Asynchronous process.
This functions starts an asynchronous process of joining to a network. It will take a time until a (final) result is ready. Therefore the callback interface (e.g. RegisterJoinedNwkIndicationClient) should be used.
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Re-Activates the device via the ABP procedure.
| devAdr | pointer where to store the "received" device address |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
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.
| cb | pointer to a callback function that should be called if the event occurs. |
Reimplemented in WiMOD_SAP_LoRaWAN_ProLink.
| void WiMOD_SAP_LoRaWAN::RegisterJoinedNwkIndicationClient | ( | TJoinedNwkIndicationCallback | cb | ) |
Register a callback function for the event "Joined Nwk Indication".
This registered callback is called when the specified event is called by the WiMOD stack.
| cb | pointer to a callback function that should be called if the event occurs. |
|
virtual |
Register a callback function for the event "TX Join Indication".
This registered callback is called when the specified event is called by the WiMOD stack.
| cb | pointer to a callback function that should be called if the event occurs. |
|
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.
| cb | pointer to a callback function that should be called if the event occurs. |
Reimplemented in WiMOD_SAP_LoRaWAN_ProLink.
| void WiMOD_SAP_LoRaWAN::RegisterNoDataIndicationClient | ( | TNoDataIndicationCallback | cb | ) |
Register a callback function for the event "TX Join Indication".
This registered callback is called when the specified event is called by the WiMOD stack.
| cb | pointer to a callback function that should be called if the event occurs. |
|
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.
| cb | pointer to a callback function that should be called if the event occurs. |
Reimplemented in WiMOD_SAP_LoRaWAN_ProLink.
| void WiMOD_SAP_LoRaWAN::RegisterRxAckIndicationClient | ( | TRxAckIndicationCallback | cb | ) |
Register a callback function for the event "RX ACK (data) Indication".
This registered callback is called when the specified event is called by the WiMOD stack.
| cb | pointer to a callback function that should be called if the event occurs. |
| void WiMOD_SAP_LoRaWAN::RegisterRxCDataIndicationClient | ( | TRxCDataIndicationCallback | cb | ) |
Register a callback function for the event "RX C-Data Indication".
This registered callback is called when the specified event is called by the WiMOD stack.
| cb | pointer to a callback function that should be called if the event occurs. |
| void WiMOD_SAP_LoRaWAN::RegisterRxMacCmdIndicationClient | ( | TRxMacCmdIndicationCallback | cb | ) |
Register a callback function for the event "RX MAC Cmd Indication".
This registered callback is called when the specified event is called by the WiMOD stack.
| cb | pointer to a callback function that should be called if the event occurs. |
| void WiMOD_SAP_LoRaWAN::RegisterRxUDataIndicationClient | ( | TRxUDataIndicationCallback | cb | ) |
Register a callback function for the event "RX U-Data Indication".
This registered callback is called when the specified event is called by the WiMOD stack.
| cb | pointer to a callback function that should be called if the event occurs. |
| void WiMOD_SAP_LoRaWAN::RegisterTxCDataIndicationClient | ( | TTxCDataIndicationCallback | cb | ) |
Register a callback function for the event "TX C-Data Indication".
This registered callback is called when the specified event is called by the WiMOD stack.
| cb | pointer to a callback function that should be called if the event occurs. |
| void WiMOD_SAP_LoRaWAN::RegisterTxUDataIndicationClient | ( | TTxUDataIndicationCallback | cb | ) |
Register a callback function for the event "TX U Data Indication".
This registered callback is called when the specified event is called by the WiMOD stack.
| cb | pointer to a callback function that should be called if the event occurs. |
|
virtual |
Tries to send transmit C-Data to network server via RF link.
| data | pointer to data structure containing the TX-data and options. |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Send a MAC command to the server; expert level only.
| cmd | pointer containing the MAC command and parameters |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Tries to send transmit U-Data to network server via RF link.
| data | pointer to data structure containing the TX-data and options. |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Set Battery Level Status.
**
**
| battStatus | status value; see documentation for details. |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Setup a custom config for tx power settings; expert level only.
| rfGain | new rfGain value for tx power settings |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Sets a new DeviceEUI (aka. IEEE-Address) to the WiMOD.
Note: Setting a new DeviceEUI is requires to switch to customer operation mode. In "normal" application mode, this command is locked.
| deviceEUI | pointer to data structure containing the new parameters (Must be an pointer of a 64bit address) |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Sets the parameters used for the OTAA activation procedure.
| joinParams | structure holding the necessary parameters |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Sets a new radio config parameter set of the WiMOD.
| data | pointer to data structure containing the new parameters |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |
|
virtual |
Setup regional settings for the LoRaWAN Firmware of the WiMOD module.
| regionalSetting | region code for the firmware |
|
virtual |
Set a SINGLE TxPowerLimit entry.
| txPwrLimitCfg | reference that holds the data to write |
| statusRsp | Status byte contained in the local response of the module |
| WiMODLR_RESULT_OK | if command transmit to WiMOD was ok |