![]() |
Demo HCI Implementation for WiMOD-LR Devices
V1.3.1
|
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... | |
| ~WiMOD_SAP_LoRaWAN (void) | |
| Destructor. | |
| TWiMDLRResultCodes | ActivateDevice (TWiMODLORAWAN_ActivateDeviceData &activationData, UINT8 *statusRsp) |
| Activates the device via the APB procedure. More... | |
| TWiMDLRResultCodes | ReactivateDevice (UINT32 *devAdr, UINT8 *statusRsp) |
| Re-Activates the device via the APB procedure. More... | |
| TWiMDLRResultCodes | SetJoinParameter (TWiMODLORAWAN_JoinParams &joinParams, UINT8 *statusRsp) |
| Sets the parameters used for the OTAA activation procedure. More... | |
| TWiMDLRResultCodes | JoinNetwork (UINT8 *statusRsp) |
| Start joining the network via the OTAA procedure. Asynchronous process. More... | |
| 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... | |
| 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... | |
| TWiMDLRResultCodes | SendUData (const TWiMODLORAWAN_TX_Data *data, UINT8 *statusRsp) |
| Tries to send transmit U-Data to network server via RF link. More... | |
| TWiMDLRResultCodes | SendCData (const TWiMODLORAWAN_TX_Data *data, UINT8 *statusRsp) |
| Tries to send transmit C-Data to network server via RF link. More... | |
| TWiMDLRResultCodes | SetRadioStackConfig (const TWiMODLORAWAN_RadioStackConfig *data, UINT8 *statusRsp) |
| Sets a new radio config parameter set of the WiMOD. More... | |
| TWiMDLRResultCodes | GetRadioStackConfig (TWiMODLORAWAN_RadioStackConfig *data, UINT8 *statusRsp) |
| Gets the current radio config parameter set of the WiMOD. More... | |
| TWiMDLRResultCodes | DeactivateDevice (UINT8 *statusRsp) |
| Deactivate the device (logical disconnect from lora network) More... | |
| TWiMDLRResultCodes | FactoryReset (UINT8 *statusRsp) |
| Reset all internal settings to default values (incl. DevEUI) More... | |
| TWiMDLRResultCodes | SetDeviceEUI (const UINT8 *deviceEUI, UINT8 *statusRsp) |
| Sets a new DeviceEUI (aka. IEEE-Address) to the WiMOD. More... | |
| TWiMDLRResultCodes | GetDeviceEUI (UINT8 *deviceEUI, UINT8 *statusRsp) |
| Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD. More... | |
| TWiMDLRResultCodes | GetNwkStatus (TWiMODLORAWAN_NwkStatus_Data *nwkStatus, UINT8 *statusRsp) |
| Gets the current status of the network "connection". More... | |
| TWiMDLRResultCodes | SendMacCmd (const TWiMODLORAWAN_MacCmd *cmd, UINT8 *statusRsp) |
| Send a MAC command to the server; expert level only. More... | |
| TWiMDLRResultCodes | SetCustomConfig (const INT8 txPwrOffset, UINT8 *statusRsp) |
| Setup a custom config for tx power settings; expert level only. More... | |
| TWiMDLRResultCodes | GetCustomConfig (INT8 *txPwrOffset, UINT8 *statusRsp) |
| Get the current offet for tx power level; expert level only. More... | |
| 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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::ActivateDevice | ( | TWiMODLORAWAN_ActivateDeviceData & | activationData, |
| UINT8 * | statusRsp | ||
| ) |
Activates the device via the APB 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_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_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 |
| 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_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_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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::DeactivateDevice | ( | UINT8 * | statusRsp | ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::FactoryReset | ( | UINT8 * | statusRsp | ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::GetCustomConfig | ( | INT8 * | txPwrOffset, |
| UINT8 * | statusRsp | ||
| ) |
Get the current offet for tx power level; expert level only.
| txPwrOffset | pointer to store the offset 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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::GetDeviceEUI | ( | UINT8 * | deviceEUI, |
| UINT8 * | statusRsp | ||
| ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::GetNwkStatus | ( | TWiMODLORAWAN_NwkStatus_Data * | nwkStatus, |
| UINT8 * | statusRsp | ||
| ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::GetRadioStackConfig | ( | TWiMODLORAWAN_RadioStackConfig * | data, |
| UINT8 * | statusRsp | ||
| ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::JoinNetwork | ( | UINT8 * | statusRsp | ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::ReactivateDevice | ( | UINT32 * | devAdr, |
| UINT8 * | statusRsp | ||
| ) |
Re-Activates the device via the APB 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 |
| 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. |
| void WiMOD_SAP_LoRaWAN::RegisterJoinTxIndicationClient | ( | TJoinTxIndicationCallback | 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. |
| 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. |
| 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. |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::SendCData | ( | const TWiMODLORAWAN_TX_Data * | data, |
| UINT8 * | statusRsp | ||
| ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::SendMacCmd | ( | const TWiMODLORAWAN_MacCmd * | cmd, |
| UINT8 * | statusRsp | ||
| ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::SendUData | ( | const TWiMODLORAWAN_TX_Data * | data, |
| UINT8 * | statusRsp | ||
| ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::SetCustomConfig | ( | const INT8 | txPwrOffset, |
| UINT8 * | statusRsp | ||
| ) |
Setup a custom config for tx power settings; expert level only.
| txPwrOffset | new offset 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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::SetDeviceEUI | ( | const UINT8 * | deviceEUI, |
| UINT8 * | statusRsp | ||
| ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::SetJoinParameter | ( | TWiMODLORAWAN_JoinParams & | joinParams, |
| UINT8 * | statusRsp | ||
| ) |
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 |
| TWiMDLRResultCodes WiMOD_SAP_LoRaWAN::SetRadioStackConfig | ( | const TWiMODLORAWAN_RadioStackConfig * | data, |
| UINT8 * | statusRsp | ||
| ) |
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 |