| Demo HCI Implementation for WiMOD-LR Devices V2.0.3

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WiMODLRBASE Class Reference

Main class representing the interface to the WiMOD running the firmware WiMODLR-BASE. More...

`#include <WiMODLR_BASE.h>`

Inheritance diagram for WiMODLRBASE:
[legend]
Collaboration diagram for WiMODLRBASE:
[legend]

## Public Member Functions
| WiMODLRBASE (Stream &s)
| Constructor. More...
| ~WiMODLRBASE (void)
| Destructor.
void | begin (void)
| Setup internal things. More...
void | end (void)
| De-Setup internal things. More...
bool | Ping (TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Ping Cmd - Checks serial connetion to WiMOD module. More...
bool | Reset (TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Reset Cmd - Do a local reboot of the WiMOD module. More...
bool | GetDeviceInfo (TWiMODLR_DevMgmt_DevInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the basic DeviceInfo from WiMOD module. More...
bool | GetFirmwareInfo (TWiMODLR_DevMgmt_FwInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the basic FirmwareInfo from WiMOD module. More...
bool | GetSystemStatus (TWiMODLR_DevMgmt_SystemStatus *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the bas SystemStatus info from WiMOD module. More...
bool | GetRtc (UINT32 *rtcTime, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the current RTC data info from WiMOD module. More...
bool | SetRtc (const UINT32 rtcTime, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets the current RTC values to WiMOD module. More...
bool | GetRadioConfig (TWiMODLR_DevMgmt_RadioConfig *radioCfg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the current configuration of the radio of the WiMOD module. More...
bool | SetRadioConfig (const TWiMODLR_DevMgmt_RadioConfig *radioCfg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets the current configuration for the radio of the WiMOD module. More...
bool | ResetRadioConfig (TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Resets the current configuration to defaults. More...
bool | GetOperationMode (TWiMOD_OperationMode *opMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the current operation mode of the WiMOD module. More...
bool | SetOperationMode (const TWiMOD_OperationMode opMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets the current operation mode of the WiMOD module. More...
bool | SetRadioMode (const TRadioCfg_RadioMode radioMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| SetRadioMode - Set the current radio mode of the WiMOD. More...
bool | SetAesKey (const UINT8 *key, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets the security 128bit AES key to use for RF communication. More...
bool | GetAesKey (UINT8 *key, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the used security 128bit AES key. More...
bool | SetRtcAlarm (const TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets and enables the RTC alarm feature of the WiMOD. More...
bool | GetRtcAlarm (TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets information about the RTC alarm feature of the WiMOD. More...
bool | ClearRtcAlarm (TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Clears pending RTC Alarms of the WiMOD. More...
void | RegisterPowerUpIndicationClient (TDevMgmtPowerUpCallback cb)
| Register a callback function for the PowerUp Indication - optional -. More...
void | RegisterRtcAlarmIndicationClient (TDevMgmtRtcAlarmCallback cb)
| Register a callback function for the RTC Alarm Indication - optional -. More...
bool | SendUData (const TWiMODLR_RadioLink_Msg *txMsg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Tries to send transmit U-Data to peer module via RF link. More...
bool | SendCData (const TWiMODLR_RadioLink_Msg *txMsg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Tries to send transmit C-Data to peer module via RF link. More...
bool | SetAckData (const TWiMODLR_RadioLink_Msg *txMsg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets additional user payload for the next ack frame to send. More...
bool | convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLR_RadioLink_Msg *radioLinkMsg)
| Convert a received low level HCI-Msg to a high-level RadioLink-Msg. More...
bool | convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLR_RadioLink_CdataInd *cDataTxInfo)
| Convert a received low level HCI-Msg to a high-level CDataTx Info. More...
bool | convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLR_RadioLink_UdataInd *cDataTxInfo)
| Convert a received low level HCI-Msg to a high-level UDataTx Info. More...
bool | convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLR_AckTxInd_Msg *txAckIndInfo)
| Convert a received low level HCI-Msg to a high-level AckTxInd Info. More...
bool | convert (TWiMODLR_HCIMessage &RxMsg, TWiMODLR_RadioLink_RawMsg *radioLinkRawMsg)
void | RegisterUDataRxClient (TRadioLinkUDataRxIndicationCallback cb)
| Register a callback function for the RX U-Data Indication - optional -. More...
void | RegisterUDataTxClient (TRadioLinkUDataTxIndicationCallback cb)
| Register a callback function for the TX U-Data Indication - optional -. More...
void | RegisterRawDataRxClient (TRadioLinkRawDataRxIndicationCallback cb)
void | RegisterCDataRxClient (TRadioLinkCDataRxIndicationCallback cb)
| Register a callback function for the RX C-Data Indication - optional -. More...
void | RegisterCDataTxClient (TRadioLinkCDataTxIndicationCallback cb)
| Register a callback function for the TX C-Data Indication - optional -. More...
void | RegisterAckRxClient (TRadioLinkAckRxIndicationCallback cb)
| Register a callback function for the RX Ack (+data) Indication - optional -. More...
void | RegisterAckRxTimeoutClient (TRadioLinkAckRxTimeoutIndicationCallback cb)
| Register a callback function for the Ack Timeout Indication - optional -. More...
void | RegisterAckTxCallback (TRadioLinkAckTxIndicationCallback cb)
| Register a callback function for the TX Ack Indication - optional -. More...
bool | ExecuteGenericCmd (TWiMODLR_Generic_CmdInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Generic Execution Function for HCI commands that are currently not implemented. More...
void | calcFreqToRegister (uint32_t freq, uint8_t *msb, uint8_t *mid, uint8_t *lsb)
| Convert a frequency in Hz to the corresponding low level register values. More...
uint32_t | calcRegisterToFreq (uint8_t msb, uint8_t mid, uint8_t lsb)
| Convert a frequency registers to frequency in Hz. More...
TWiMODLRResultCodes | GetLastHciResult (void)
| Gets the value of the last local HCI TX status. More...
UINT8 | GetLastResponseStatus (void)
| Gets the value of the last status response value of the WiMOD. More...
Public Member Functions inherited from TWiMODLRHCI
| TWiMODLRHCI (Stream &s)
| Constructor. More...
| ~TWiMODLRHCI (void)
| Destructor.
TWiMODLRResultCodes | SendHCIMessage (UINT8 dstSapID, UINT8 msgID, UINT8 rxMsgID, UINT8 *payload, UINT16 length)
| Generic function for transferring a HCI message to the WiMOD module. More...
TWiMODLRResultCodes | SendHCIMessageWithoutRx (UINT8 dstSapID, UINT8 msgID, UINT8 *payload, UINT16 length)
| Generic function for transferring a HCI message to the WiMOD module. More...
void | Process (void)
| Handle the receiver path; process all incomming bytes from the WiMOD. More...
void | SendWakeUpSequence (void)
| : Send a sequence of dummy chars to give the WiMOD some time to wake up
void | RegisterStackErrorClient (TWiMODStackErrorClient cb)
const TWiMODLR_HCIMessage & | GetRxMessage (void)
void | EnableWakeupSequence (bool flag)

## Protected Member Functions
bool | copyResultInfos (TWiMODLRResultCodes *hciResult, UINT8 *rspStatus, UINT8 successValue)
virtual void | ProcessUnexpectedRxMessage (TWiMODLR_HCIMessage &rxMsg)
Protected Member Functions inherited from TWiMODLRHCI
TWiMODLRResultCodes | PostMessage (UINT8 sapID, UINT8 msgID, UINT8 *payload, UINT16 length)
TWiMODLRResultCodes | SendPacket (UINT8 *txData, UINT16 length)
bool | WaitForResponse (UINT8 rxSapID, UINT8 rxMsgID)
UINT8 * | ProcessRxMessage (UINT8 *rxBuffer, UINT16 length)

## Protected Attributes
WiMOD_SAP_DevMgmt | SapDevMgmt
WiMOD_SAP_RadioLink | SapRadioLink
WiMOD_SAP_Generic | SapGeneric

## Detailed Description

Main class representing the interface to the WiMOD running the firmware WiMODLR-BASE.

This class is the only API class a user should use for interacting with a WiMOD module that runs the IMST WiMODLR-Base firmware.

## Constructor & Destructor Documentation

## ◆ WiMODLRBASE()

WiMODLRBASE::WiMODLRBASE | ( | Stream & | s | ) |

Constructor.

Parameters

  s | Reference to the serial interace to be used for communication. The serial interface must be initialized outside of this class prior calling the first command in runtime.

#include <WiMODLR_BASE.h>
WiMODLRBASE wimod(Serial3); // use the Arduino Serial3 as serial interface
void setup() {
// init stack
wimod.begin();
...
}

## Member Function Documentation

## ◆ begin()

void WiMODLRBASE::begin | ( | void |  | ) |
| virtual

Setup internal things.

This function must be executed at startup before any other service can be used.

#include <WiMODLR_BASE.h>
WiMODLRBASE wimod(Serial3); // use the Arduino Serial3 as serial interface
void setup() {
// init stack
wimod.begin();
...
}

Reimplemented from TWiMODLRHCI.

Here is the call graph for this function:

## ◆ calcFreqToRegister()

void WiMODLRBASE::calcFreqToRegister | ( | uint32_t | freq,
|  | uint8_t * | msb,
|  | uint8_t * | mid,
|  | uint8_t * | lsb
| ) |  |

Convert a frequency in Hz to the corresponding low level register values.

Parameters

  freq | Target frequencey in Hz
  msb | Pointer to register value for MSB-Part
  mid | Pointer to register value for MID-Part
  lsb | Pointer to register value for LSB-Part

Here is the call graph for this function:

## ◆ calcRegisterToFreq()

uint32_t WiMODLRBASE::calcRegisterToFreq | ( | uint8_t | msb,
|  | uint8_t | mid,
|  | uint8_t | lsb
| ) |  |

Convert a frequency registers to frequency in Hz.

Parameters

  msb | register value for MSB-Part
  mid | register value for MID-Part
  lsb | register value for LSB-Part

return Frequency in Hz

Here is the call graph for this function:

## ◆ ClearRtcAlarm()

bool WiMODLRBASE::ClearRtcAlarm | ( | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Clears pending RTC Alarms of the WiMOD.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// clear a pending RTC alarm of WiMOD
wimod.ClearRtcAlarm();
...
Here is the call graph for this function:

## ◆ convert() [1/4]

bool WiMODLRBASE::convert | ( | TWiMODLR_HCIMessage & | RxMsg,
|  | TWiMODLR_AckTxInd_Msg * | txAckIndInfo
| ) |  |

Convert a received low level HCI-Msg to a high-level AckTxInd Info.

This function should be used by the AckTx Indication Callback functions prior processing the received data message.

Parameters

  RxMsg | Reference to low-level HCI message.

Warning
  DO NOT MANIPULATE THESE VALUES !!!

Parameters

  txAckIndInfo | Pointer to the buffer where to store the received data

Return values

  true | if the conversion was successful

// global buffer
TWiMODLR_AckTxInd_Msg txAckData;
void myTxAckInd(TWiMODLR_HCIMessage& rxMsg) {
// convert/copy the raw message
if (wimod.convert(rxMsg, &txAckData)) {
// access the fields folding information about the ACK transmission
// txDataMsg.Status
...
}
}
...
void setup() {
...
// init the communication stack
wimod.begin();
// register callback
wimod.RegisterAckTxCallback(myTxAckInd);
...
}
Here is the call graph for this function:

## ◆ convert() [2/4]

bool WiMODLRBASE::convert | ( | TWiMODLR_HCIMessage & | RxMsg,
|  | TWiMODLR_RadioLink_CdataInd * | cDataTxInfo
| ) |  |

Convert a received low level HCI-Msg to a high-level CDataTx Info.

This function should be used by the Tx-C-Data Indication Callback functions prior processing the received data message.

Parameters

  RxMsg | Reference to low-level HCI message.

Warning
  DO NOT MANIPULATE THESE VALUES !!!

Parameters

  cDataTxInfo | Pointer to the buffer where to store the received data

Return values

  true | if the conversion was successful

// global buffer for indication that CData has been send
TWiMODLR_RadioLink_CdataInd txDataMsg;
void myTxCDataInd(TWiMODLR_HCIMessage& rxMsg) {
// convert/copy the raw message to RX radio buffer
if (wimod.convert(rxMsg, &txDataMsg)) {
// access the fields folding information about the transmission
// txDataMsg.TxEventCounter
...
}
}
...
void setup() {
...
// init the communication stack
wimod.begin();
// register callback
wimod.RegisterCDataTxClient(myTxCDataInd);
...
}
Here is the call graph for this function:

## ◆ convert() [3/4]

bool WiMODLRBASE::convert | ( | TWiMODLR_HCIMessage & | RxMsg,
|  | TWiMODLR_RadioLink_Msg * | radioLinkMsg
| ) |  |

Convert a received low level HCI-Msg to a high-level RadioLink-Msg.

This function should be used by the RxUData / RxCData callback functions prior processing the received data message.

Parameters

  RxMsg | Reference to low-level HCI message.

Warning
  DO NOT MANIPULATE THESE VALUES !!!

Parameters

  radioLinkMsg | Pointer to the buffer where to store the received data

Return values

  true | if the conversion was successful

// global buffer for incoming messages
TWiMODLR_RadioLink_Msg radioRxMsg;
void myRxDataInd(TWiMODLR_HCIMessage& rxMsg) {
// convert/copy the raw message to RX radio buffer
if (wimod.convert(rxMsg, &radioRxMsg)) {
// access the radioRxMsg fields
// radioRxMsg.Length
// radioRxMsg.Payload
...
}
}
...
void setup() {
...
// init the communication stack
wimod.begin();
// register callbacks for incoming RF messages
wimod.RegisterUDataRxClient(myRxDataInd);
wimod.RegisterCDataRxClient(myRxDataInd);
...
}
Here is the call graph for this function:

## ◆ convert() [4/4]

bool WiMODLRBASE::convert | ( | TWiMODLR_HCIMessage & | RxMsg,
|  | TWiMODLR_RadioLink_UdataInd * | uDataTxInfo
| ) |  |

Convert a received low level HCI-Msg to a high-level UDataTx Info.

This function should be used by the Tx-U-Data Indication Callback functions prior processing the received data message.

Parameters

  RxMsg | Reference to low-level HCI message.

Warning
  DO NOT MANIPULATE THESE VALUES !!!

Parameters

  uDataTxInfo | Pointer to the buffer where to store the received data

Return values

  true | if the conversion was successful

// global buffer for indication that UData has been send
TWiMODLR_RadioLink_UdataInd txDataMsg;
void myTxCDataInd(TWiMODLR_HCIMessage& rxMsg) {
// convert/copy the raw message to RX radio buffer
if (wimod.convert(rxMsg, &txDataMsg)) {
// access the fields folding information about the transmission
// txDataMsg.TxEventCounter
...
}
}
...
void setup() {
...
// init the communication stack
wimod.begin();
// register callback
wimod.RegisterCDataTxClient(myTxCDataInd);
...
}
Here is the call graph for this function:

## ◆ end()

void WiMODLRBASE::end | ( | void |  | ) |
| virtual

De-Setup internal things.

Reimplemented from TWiMODLRHCI.

Here is the call graph for this function:

## ◆ ExecuteGenericCmd()

bool WiMODLRBASE::ExecuteGenericCmd | ( | TWiMODLR_Generic_CmdInfo * | info,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Generic Execution Function for HCI commands that are currently not implemented.

This funtion enables the user to execute various HCI commands that are currently not implemented as commands within this API class.

The user has to know the HCI Command IDs and has to decode the response data on his own.

Parameters

  info | pointer to a structure containing the HCI commands to execute
  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

...
// prepare command to send to WiMOD
TWiMODLR_Generic_CmdInfo cmdInfo;
cmdInfo.SapID = 0x01; // DevMgmt
cmdInfo.MsgReqID = 0x01; // Ping Req
cmdInfo.MsgRspID = 0x02; // expected response
// prepare payload for tx command
cmdInfo.CmdPayloadLength = 0
cmdInfo.CmdPayload[0] = 0xab;
...
// execute command
if (wimod.ExecuteGenericCmd(&cmdInfo)) {
// extract cmd reponse data
if (cmdInfo.CmdPayloadLength > 0) {
// repsonse data available
rspData =cmdInfo.CmdPayload[0]
...
// process data
...
}
}
Here is the call graph for this function:

## ◆ GetAesKey()

bool WiMODLRBASE::GetAesKey | ( | UINT8 * | key,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the used security 128bit AES key.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  key | Pointer to the 128bit AES key that is used
  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

const uint8_t AesKey[16];
// read AES key from WiMOD (LR-Base mode ONLY!)
if (wimod.GetAesKey(AesKey)) {
//ok;
}
...
Here is the call graph for this function:

## ◆ GetDeviceInfo()

bool WiMODLRBASE::GetDeviceInfo | ( | TWiMODLR_DevMgmt_DevInfo * | info,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the basic DeviceInfo from WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  info | Pointer where to store the retrieved information

See also
  TWiMODLR_DevMgmt_DevInfo for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

//local variable
TWiMODLR_DevMgmt_DevInfo devInfo;
// get information of WiMOD
if (wimod.GetDeviceInfo(&devInfo)) {
// ok; process received information
...
}
...
Here is the call graph for this function:

## ◆ GetFirmwareInfo()

bool WiMODLRBASE::GetFirmwareInfo | ( | TWiMODLR_DevMgmt_FwInfo * | info,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the basic FirmwareInfo from WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  info | Pointer where to store the retrieved information

See also
  TWiMODLR_DevMgmt_FwInfo for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

//local variable
TWiMODLR_DevMgmt_FwInfo fwInfo;
// get information of WiMOD
if (wimod.GetFirmwareInfo(&fwInfo)) {
// ok; process received information
if (fwInfo.FirmwareMayorVersion = 0x01) {...}
}
...
Here is the call graph for this function:

## ◆ GetLastHciResult()

TWiMODLRResultCodes WiMODLRBASE::GetLastHciResult | ( | void |  | ) |

Gets the value of the last local HCI TX status.

If the optional parameters have been left out (for the normal commands), the user can get the last value back by using this function

Return values

  the | last value of the last command issued

...
if (wimod.Ping() == false) {
TWiMODLRResultCodes hciResult;
// get (local) result of HCI command transmission
hciResult = wimod.GetLastHciResult();
// check result code
switch (hciResult):
case WiMODLR_RESULT_OK: // OK, no error
case WiMODLR_RESULT_PAYLOAD_LENGTH_ERROR: // given payload is too big
case WiMODLR_RESULT_PAYLOAD_PTR_ERROR: // wrong pointer to payload (NULL?)
case WiMODLR_RESULT_TRANMIT_ERROR, // Error sending data to WiMOD via serial interface
case WiMODLR_RESULT_SLIP_ENCODER_ERROR, // Error during SLIP encoding
case WiMODLR_RESULT_NO_RESPONSE // The WiMOD did not respond to a request command
...
}
...

## ◆ GetLastResponseStatus()

UINT8 WiMODLRBASE::GetLastResponseStatus | ( | void |  | ) |

Gets the value of the last status response value of the WiMOD.

If the optional parameters have been left out (for the normal commands), the user can get the last value back by using this function

Return values

  the | last value of the last command issued

- ...
  if (wimod.Ping() == false) {
  uint8_t rsp;
  // get (remote) response code
  rsp = wimod.GetLastResponseStatus();
  // check result code
  switch (rsp):
  case LoRaWAN_Status_Ok: // OK; No error;
  // --> check "remote" ResponseStatus
  case LoRaWAN_Status_Error: // general (un-specific) error
  case LoRaWAN_Status_Cmd_Not_Supported: // Command is not supported (or unknown)
  case LoRaWAN_Status_Wrong_parameter: // Wrong parameter applied
  case LoRaWAN_Status_Wrong_DeviceMode: // Device is in wong device mode for specific command
  case LoRaWAN_Status_Device_Not_Activated: // Device has NOT been activated; command has not been executed
  case LoRaWAN_Status_Device_Busy: // There is another operation pending; and or duty cycle restriction is active
  case LoRaWAN_Status_Queue_Full: // internal command queue is full
  case LoRaWAN_Status_Length_Error: // some error related to the given length information
  case LoRaWAN_Status_No_Factory_Settings: // Factory settings are not available
  case LoRaWAN_Status_Channel_Blocked: // Selected channel is blocked (duty cycle?)
  case LoRaWAN_Status_Channel_Not_Available: // Selected channel is not available
  ...
  }
  ...

## ◆ GetOperationMode()

bool WiMODLRBASE::GetOperationMode | ( | TWiMOD_OperationMode * | opMode,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the current operation mode of the WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  opMode | Pointer where to store the information

See also
  TWiMOD_OperationMode for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// local variable
TWiMOD_OperationMode opMode;
// get information from WiMOD
if (wimod.GetOperationMode(&opMode)) {
//ok
if (opMode != OperationMode_Application) {
// normal operation is disabled; only test functionality is enabled
}
}
...
Here is the call graph for this function:

## ◆ GetRadioConfig()

bool WiMODLRBASE::GetRadioConfig | ( | TWiMODLR_DevMgmt_RadioConfig * | radioCfg,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the current configuration of the radio of the WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  radioCfg | Pointer where to store the information

See also
  TWiMODLR_DevMgmt_RadioConfig for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// create a local variable
TWiMODLR_DevMgmt_RadioConfig radioCfg;
// get information from WiMOD
if (wimod.GetRadioConfig(&radioCfg)) {
// access the fields
if (radioCfg.RadioMode != RadioMode_Standard) {
// error unsupported mode
}
if (radioCfg.Modulation == Modulation_LoRa) {...}
uint32_t freq = FreqCalc_calcRegisterToFreq(radioCfg.RfFreq_MSB,
radioCfg.RfFreq_MID,
radioCfg.RfFreq_LSB);
...
}
...
Here is the call graph for this function:

## ◆ GetRtc()

bool WiMODLRBASE::GetRtc | ( | UINT32 * | rtcTime,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the current RTC data info from WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  rtcTime | Pointer where to store the RTC information

See also
  WIMOD_RTC_GET_* Macros for conversation of this value

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// create a local variable
uint32_t timestamp;
// get information of WiMOD
wimod.GetRtc(&timestamp);
//access fields of structure
printf("Year : %d:", WIMOD_RTC_GET_YEARS(timestamp));
printf("Month: %d:", WIMOD_RTC_GET_MONTHS(timestamp));
printf("Day : %d:", WIMOD_RTC_GET_DAYS(timestamp));
printf("Hour : %d:", WIMOD_RTC_GET_HOURS(timestamp));
printf("Min : %d:", WIMOD_RTC_GET_MINUTES(timestamp));
printf("Sec : %d:", WIMOD_RTC_GET_SECONDS(timestamp));
...
Here is the call graph for this function:

## ◆ GetRtcAlarm()

bool WiMODLRBASE::GetRtcAlarm | ( | TWiMODLR_DevMgmt_RtcAlarm * | rtcAlarm,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets information about the RTC alarm feature of the WiMOD.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  rtcAlarm | Pointer to a structure where to store the RTC alarm related information
  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// create a local variable
TWiMODLR_DevMgmt_RtcAlarm rtcAlarm;
// get information of WiMOD
wimod.GetRtcAlarm(&rtcAlarm);
...
// access values
if (rtcAlarm.AlarmStatus == RTC_Alarm_Alarm_Set) {
printf("Alarm is active");
...
}
...
Here is the call graph for this function:

## ◆ GetSystemStatus()

bool WiMODLRBASE::GetSystemStatus | ( | TWiMODLR_DevMgmt_SystemStatus * | info,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the bas SystemStatus info from WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  info | Pointer where to store the retrieved information

See also
  TWiMODLR_DevMgmt_SystemStatus for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

//local variable
TWiMODLR_DevMgmt_SystemStatus sysStatus;
// get information of WiMOD
if (wimod.GetSystemStatus(&sysStatus)) {
// ok; process received information
if (sysStatus.BatteryStatus < 2500) { //low batt. voltage detected }
}
...
Here is the call graph for this function:

## ◆ Ping()

bool WiMODLRBASE::Ping | ( | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Ping Cmd - Checks serial connetion to WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

if (wimod.Ping()) {
// success ...
} else {
// error ...
}

OR:

TWiMODLRResultCodes hciResult;
if (!wimod.Ping(&hciResult)) {
// error: check HCI result codes
if (WiMODLR_RESULT_TRANMIT_ERROR == hciResult) {...}
if (WiMODLR_RESULT_NO_RESPONSE == hciResult) {...}
}

OR:

TWiMODLRResultCodes hciResult;
uint8 rspCode;
if (!wimod.Ping(&hciResult, &rspCode)) {
// error: check HCI result codes
if (WiMODLR_RESULT_OK == hciResult) {
if (rspCode == DEVMGMT_STATUS_ERROR) {
// operation failed
}
...
}
...
}
Here is the call graph for this function:

## ◆ RegisterAckRxClient()

void WiMODLRBASE::RegisterAckRxClient | ( | TRadioLinkAckRxIndicationCallback | cb | ) |

Register a callback function for the RX Ack (+data) Indication - optional -.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  cb | Pointer a callback function

See also
  TRadioLinkAckRxIndicationCallback for details

Note
  The callback function should call the corresponding convert in order to decode the message properly

// callback for U data Tx indication
void myAckRxInd(TWiMODLR_HCIMessage& rxMsg) {
// use the convert function before accesing the data
...
}
void setup() {
...
// setup the callback
wimod.RegisterAckRxClient(myAckRxInd);
...
}
...
Here is the call graph for this function:

## ◆ RegisterAckRxTimeoutClient()

void WiMODLRBASE::RegisterAckRxTimeoutClient | ( | TRadioLinkAckRxTimeoutIndicationCallback | cb | ) |

Register a callback function for the Ack Timeout Indication - optional -.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  cb | Pointer a callback function

See also
  TRadioLinkAckRxTimeoutIndicationCallback for details

// callback for a missing ACK packet
void myAckRxTimemoutInd() {
// this is called if an expected ACK has NOT been received
// within expected time; it it up to the application to
// react accordingly! (e.g. retransmission the data)
...
}
void setup() {
...
// setup the callback
wimod.RegisterAckRxTimeoutClient(myAckRxTimemoutInd);
...
}
...
Here is the call graph for this function:

## ◆ RegisterAckTxCallback()

void WiMODLRBASE::RegisterAckTxCallback | ( | TRadioLinkAckTxIndicationCallback | cb | ) |

Register a callback function for the TX Ack Indication - optional -.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  cb | Pointer a callback function

See also
  TRadioLinkAckTxIndicationCallback for details

// callback for C data Ack Tx indication
void myAckTxInd() {
// this is called if an ACK has been send
...
}
void setup() {
...
// setup the callback
wimod.RegisterAckTxCallback(myAckTxInd);
...
}
...
Here is the call graph for this function:

## ◆ RegisterCDataRxClient()

void WiMODLRBASE::RegisterCDataRxClient | ( | TRadioLinkCDataRxIndicationCallback | cb | ) |

Register a callback function for the RX C-Data Indication - optional -.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  cb | Pointer a callback function

See also
  TRadioLinkCDataRxIndicationCallback for details

Note
  The callback function should call the corresponding convert in order to decode the message properly

// callback for C data Rx indication
void myCDataRxInd(TWiMODLR_HCIMessage& rxMsg) {
// use the convert function before accessing the data
...
}
void setup() {
...
// setup the callback
wimod.RegisterCDataRxClient(myCDataRxInd);
...
}
...
Here is the call graph for this function:

## ◆ RegisterCDataTxClient()

void WiMODLRBASE::RegisterCDataTxClient | ( | TRadioLinkCDataTxIndicationCallback | cb | ) |

Register a callback function for the TX C-Data Indication - optional -.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  cb | Pointer a callback function

See also
  TRadioLinkCDataTxIndicationCallback for details

Note
  The callback function should call the corresponding convert in order to decode the message properly

// callback for U data Tx indication
void myCDataTxInd(TWiMODLR_HCIMessage& rxMsg) {
// use the convert function before accesing the data
...
}
void setup() {
...
// setup the callback
wimod.RegisterCDataTxClient(myCDataTxInd);
...
}
...
Here is the call graph for this function:

## ◆ RegisterPowerUpIndicationClient()

void WiMODLRBASE::RegisterPowerUpIndicationClient | ( | TDevMgmtPowerUpCallback | cb | ) |

Register a callback function for the PowerUp Indication - optional -.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  cb | Pointer a callback function

See also
  TDevMgmtPowerUpCallback for details

// user defined callback function
void myPowerUpCallback(void) {
// WiMOD just powered up
...
}
void setup() {
...
// "connect" the user defined to callback to the WiMOD callback feature
wimod.RegisterPowerUpIndicationClient(myPowerUpCallback);
...
}
Here is the call graph for this function:

## ◆ RegisterRtcAlarmIndicationClient()

void WiMODLRBASE::RegisterRtcAlarmIndicationClient | ( | TDevMgmtRtcAlarmCallback | cb | ) |

Register a callback function for the RTC Alarm Indication - optional -.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  cb | Pointer a callback function

See also
  TDevMgmtRtcAlarmCallback for details

// user defined callback function
void myRtcAlarmCallback(void) {
// RTC Alarm has just been triggered
...
}
void setup() {
...
// "connect" the user defined to callback to the WiMOD callback feature
wimod.RegisterRtcAlarmIndicationClient(myRtcAlarmCallback);
...
}
Here is the call graph for this function:

## ◆ RegisterUDataRxClient()

void WiMODLRBASE::RegisterUDataRxClient | ( | TRadioLinkUDataRxIndicationCallback | cb | ) |

Register a callback function for the RX U-Data Indication - optional -.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  cb | Pointer a callback function

See also
  TRadioLinkUDataRxIndicationCallback for details

Note
  The callback function should call the corresponding convert in order to decode the message properly

// callback for U data Rx indication
void myUDataRxInd(TWiMODLR_HCIMessage& rxMsg) {
// use the convert function before accessing the data
...
}
void setup() {
...
// setup the callback
wimod.RegisterUDataRxClient(myUDataRxInd);
...
}
...
Here is the call graph for this function:

## ◆ RegisterUDataTxClient()

void WiMODLRBASE::RegisterUDataTxClient | ( | TRadioLinkUDataTxIndicationCallback | cb | ) |

Register a callback function for the TX U-Data Indication - optional -.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  cb | Pointer a callback function

See also
  TRadioLinkUDataTxIndicationCallback for details

// callback for U data Tx indication
void myUDataTxInd() {
...
}
void setup() {
...
// setup the callback
wimod.RegisterUDataTxClient(myUDataTxInd);
...
}
...
Here is the call graph for this function:

## ◆ Reset()

bool WiMODLRBASE::Reset | ( | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Reset Cmd - Do a local reboot of the WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// do a software reboot of the WiMOD device
if (wimod.Reset() {
// ok; reset procedure has been started
// wait a while for the reboot to be finished
}
...
Here is the call graph for this function:

## ◆ ResetRadioConfig()

bool WiMODLRBASE::ResetRadioConfig | ( | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Resets the current configuration to defaults.

See also
  HCI Documentation for details of default settings
  TWiMODLRResultCodes for interpretation of the values

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

...
// reset radio config from WiMOD to defaults
if (wimod.ResetRadioConfig()) {
//ok config has been setup to defaults
}
...
Here is the call graph for this function:

## ◆ SendCData()

bool WiMODLRBASE::SendCData | ( | const TWiMODLR_RadioLink_Msg * | txMsg,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Tries to send transmit C-Data to peer module via RF link.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  txMsg | Data structure containing the TX-data and options.

See also
  TWiMODLR_RadioLink_Msg for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

...
// local variable
TWiMODLR_RadioLink_Msg txData;
// setup tx packet
txData.DestinationGroupAddress = 0x10;
txData.DestinationDeviceAddress = 0x1234;
txData.Length = strlen("Hello World!");
strncpy(txData.Payload, "Hello World!", WiMODLORAWAN_APP_PAYLOAD_LEN);
// send data
wimod.SendCData(&txData);
...
// if ACK callback has been registered: wait for callback
// to be called and check the received indication data
// in order to get the status of the transmission
...
Here is the call graph for this function:

## ◆ SendUData()

bool WiMODLRBASE::SendUData | ( | const TWiMODLR_RadioLink_Msg * | txMsg,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Tries to send transmit U-Data to peer module via RF link.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  txMsg | Data structure containing the TX-data and options.

See also
  TWiMODLR_RadioLink_Msg for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

...
// local variable
TWiMODLR_RadioLink_Msg txData;
// setup tx packet
txData.DestinationGroupAddress = 0x10;
txData.DestinationDeviceAddress = 0x1234;
txData.Length = strlen("Hello World!");
strncpy(txData.Payload, "Hello World!", WiMODLORAWAN_APP_PAYLOAD_LEN);
// send data
wimod.SendUData(&txData);
...
Here is the call graph for this function:

## ◆ SetAckData()

bool WiMODLRBASE::SetAckData | ( | const TWiMODLR_RadioLink_Msg * | txMsg,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Sets additional user payload for the next ack frame to send.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  txMsg | Pointer to data structure containing the payload data. note: Max ack payload size is 8 byte!

See also
  TWiMODLR_RadioLink_Msg for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// global buffer
TWiMODLR_RadioLink_Msg ackPayloadData;
...
// if you want that the next ack that will be send should contain
// additional payload: setup the data structure
ackPayloadData.DestinationGroupAddress = ...;
ackPayloadData.DestinationDeviceAddress = ...;
ackPayloadData.Length = ...;
ackPayloadData.Payload = ...;
// prepare the next ack packet
wimod.SetAckData(ackPayloadData);
...
Here is the call graph for this function:

## ◆ SetAesKey()

bool WiMODLRBASE::SetAesKey | ( | const UINT8 * | key,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Sets the security 128bit AES key to use for RF communication.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  key | Pointer to the 128bit AES key to by used
  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

const uint8_t AesKey[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0D, 0x0E, 0x0F};
// write new AES key to WiMOD (LR-Base mode ONLY!)
if (wimod.SetAesKey(AesKey)) {
//ok;
}
...
Here is the call graph for this function:

## ◆ SetOperationMode()

bool WiMODLRBASE::SetOperationMode | ( | const TWiMOD_OperationMode | opMode,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Sets the current operation mode of the WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  opMode | The new operation mode to set

See also
  TWiMOD_OperationMode for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// local variable
TWiMOD_OperationMode opMode;
// setup new opMode
opMode = OperationMode_Application;
// write information to WiMOD
if (wimod.SetOperationMode(opMode)) {
//ok; wait a little bit to setup everthing
}
...
Here is the call graph for this function:

## ◆ SetRadioConfig()

bool WiMODLRBASE::SetRadioConfig | ( | const TWiMODLR_DevMgmt_RadioConfig * | radioCfg,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Sets the current configuration for the radio of the WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  radioCfg | Pointer where to read the information

See also
  TWiMODLR_DevMgmt_RadioConfig for details

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// create a local variable
TWiMODLR_DevMgmt_RadioConfig radioCfg;
// setup new radio config
radioCfg.RadioMode = RadioMode_Standard;
radioCfg.StoreNwmFlag = 0x01; // store new config permanently
radioCfg.Modulation = Modulation_LoRa;
radioCfg.PowerLevel = TxPowerLevel_14_dBm;
...
FreqCalc_calcFreqToRegister(868300000,
&radioCfg.RfFreq_MSB,
&radioCfg.RfFreq_MID,
&radioCfg.RfFreq_LSB);
...
// set information from WiMOD
if (wimod.SetRadioConfig(&radioCfg)) {
//ok new config has been setup
}
...
Here is the call graph for this function:

## ◆ SetRadioMode()

bool WiMODLRBASE::SetRadioMode | ( | const TRadioCfg_RadioMode | radioMode,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

SetRadioMode - Set the current radio mode of the WiMOD.

Parameters

  radioMode | the new radio mode to set
  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Warning
  : This use this command with care!

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

Here is the call graph for this function:

## ◆ SetRtc()

bool WiMODLRBASE::SetRtc | ( | const UINT32 | rtcTime,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Sets the current RTC values to WiMOD module.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  rtcTime | RTC information to setup

See also
  WIMOD_RTC_MAKE_DATETIME_U32 Macro for conversation of this value

Parameters

  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// create a local variable
uint32_t timestamp;
// convert date/time to timestamp format ( 1st Oct 2016 16:12:55 )
timestamp = WIMOD_RTC_MAKE_DATETIME_U32(55, 12, 16, 1, 10, 2016);
// set information to WiMOD
wimod.SetRtc(timestamp);
...
Here is the call graph for this function:

## ◆ SetRtcAlarm()

bool WiMODLRBASE::SetRtcAlarm | ( | const TWiMODLR_DevMgmt_RtcAlarm * | rtcAlarm,
|  | TWiMODLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Sets and enables the RTC alarm feature of the WiMOD.

See also
  TWiMODLRResultCodes for interpretation of the values

Parameters

  rtcAlarm | Pointer to a structure containing the RTC alarm related information
  hciResult | Result of the local command transmission to module This is an optional parameter.
  rspStatus | Status byte contained in the local response of the module This is an optional parameter.

Return values

  true | if everything is ok
  false | if something went wrong; see hciResult & rspStatus for details

// create a local variable
TWiMODLR_DevMgmt_RtcAlarm rtcAlarm;
// setup RTC Alarm
rtcAlarm.Options = RTC_Alarm_Single; // single, non repeated alarm
rtcAlarm.Hour = 13; // alarm at 13:45:20
rtcAlarm.Minutes = 32;
rtcAlarm.Seconds = 20;
// set information of WiMOD
wimod.SetRtcAlarm(&rtcAlarm);
...
// wait for alarm to occur
Here is the call graph for this function:

## Member Data Documentation

## ◆ SapDevMgmt

WiMOD_SAP_DevMgmt WiMODLRBASE::SapDevMgmt
| protected

Service Access Point for 'DeviceManagement'

## ◆ SapGeneric

WiMOD_SAP_Generic WiMODLRBASE::SapGeneric
| protected

dumy SAP for generic HCI command

## ◆ SapRadioLink

WiMOD_SAP_RadioLink WiMODLRBASE::SapRadioLink
| protected

Service Access Point for 'RadioLink'

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

- WiMODLR_BASE.h
- LR-BASE/WiMODLR_BASE.cpp

WIMOD_RTC_GET_MONTHS
#define WIMOD_RTC_GET_MONTHS(t)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:547
TWiMODLR_DevMgmt_RadioConfig::PowerLevel
TRadioCfg_PowerLevel PowerLevel
Definition: WiMOD_SAP_DEVMGMT_IDs.h:426
TxPowerLevel_14_dBm
@ TxPowerLevel_14_dBm
Definition: WiMOD_SAP_DEVMGMT_IDs.h:328
WiMODLR_RESULT_SLIP_ENCODER_ERROR
@ WiMODLR_RESULT_SLIP_ENCODER_ERROR
Definition: WiMODLRHCI.h:155
LoRaWAN_Status_Length_Error
@ LoRaWAN_Status_Length_Error
Definition: WiMOD_SAP_LORAWAN_IDs.h:114
WIMOD_RTC_GET_MINUTES
#define WIMOD_RTC_GET_MINUTES(t)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:545
TWiMODLR_DevMgmt_RtcAlarm::AlarmStatus
TWiMOD_RtcAlarmStatus AlarmStatus
Definition: WiMOD_SAP_DEVMGMT_IDs.h:487
FreqCalc_calcRegisterToFreq
uint32_t FreqCalc_calcRegisterToFreq(uint8_t msb, uint8_t mid, uint8_t lsb)
Translates given register values to a carrier frequency.
Definition: FreqCalc_SX127x.c:68
TWiMODLR_RadioLink_Msg::Payload
UINT8 Payload[WIMOD_RADIOLINK_PAYLOAD_LEN]
Definition: WiMOD_SAP_RadioLink_IDs.h:175
TWiMODLR_RadioLink_Msg::DestinationDeviceAddress
UINT16 DestinationDeviceAddress
Definition: WiMOD_SAP_RadioLink_IDs.h:167
TWiMODLR_RadioLink_Msg
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RadioLink_IDs.h:160
WiMODLR_RESULT_TRANMIT_ERROR
@ WiMODLR_RESULT_TRANMIT_ERROR
Definition: WiMODLRHCI.h:154
TWiMODLR_DevMgmt_FwInfo
Basic information about the current firmware of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:220
TWiMODLR_AckTxInd_Msg
Structure containing information about an acknowledgment transmission.
Definition: WiMOD_SAP_RadioLink_IDs.h:243
TWiMODLR_HCIMessage
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
LoRaWAN_Status_Channel_Blocked
@ LoRaWAN_Status_Channel_Blocked
Definition: WiMOD_SAP_LORAWAN_IDs.h:116
LoRaWAN_Status_Error
@ LoRaWAN_Status_Error
Definition: WiMOD_SAP_LORAWAN_IDs.h:107
WiMODLR_RESULT_OK
@ WiMODLR_RESULT_OK
Definition: WiMODLRHCI.h:151
TWiMODLR_DevMgmt_RtcAlarm
Structure containing the RTC Alarm config parameters of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:484
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
RTC_Alarm_Single
@ RTC_Alarm_Single
Definition: WiMOD_SAP_DEVMGMT_IDs.h:477
WIMOD_RTC_GET_YEARS
#define WIMOD_RTC_GET_YEARS(t)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:553
TWiMODLR_DevMgmt_RtcAlarm::Hour
UINT8 Hour
Definition: WiMOD_SAP_DEVMGMT_IDs.h:490
WIMOD_RTC_MAKE_DATETIME_U32
#define WIMOD_RTC_MAKE_DATETIME_U32(s, m, h, dd, mm, yy)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:556
TWiMODLR_DevMgmt_RadioConfig::Modulation
TRadioCfg_Modulation Modulation
Definition: WiMOD_SAP_DEVMGMT_IDs.h:419
LoRaWAN_Status_Channel_Not_Available
@ LoRaWAN_Status_Channel_Not_Available
Definition: WiMOD_SAP_LORAWAN_IDs.h:117
WiMODLRBASE
Main class representing the interface to the WiMOD running the firmware WiMODLR-BASE.
Definition: WiMODLR_BASE.h:122
TWiMODLR_DevMgmt_RadioConfig::RfFreq_MSB
UINT8 RfFreq_MSB
Definition: WiMOD_SAP_DEVMGMT_IDs.h:422
Modulation_LoRa
@ Modulation_LoRa
Definition: WiMOD_SAP_DEVMGMT_IDs.h:268
TWiMODLR_RadioLink_Msg::DestinationGroupAddress
UINT8 DestinationGroupAddress
Definition: WiMOD_SAP_RadioLink_IDs.h:166
WIMOD_RTC_GET_SECONDS
#define WIMOD_RTC_GET_SECONDS(t)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:543
RadioMode_Standard
@ RadioMode_Standard
Definition: WiMOD_SAP_DEVMGMT_IDs.h:257
TWiMODLR_DevMgmt_RtcAlarm::Seconds
UINT8 Seconds
Definition: WiMOD_SAP_DEVMGMT_IDs.h:492
WIMOD_RTC_GET_HOURS
#define WIMOD_RTC_GET_HOURS(t)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:549
LoRaWAN_Status_Device_Not_Activated
@ LoRaWAN_Status_Device_Not_Activated
Definition: WiMOD_SAP_LORAWAN_IDs.h:111
TWiMODLR_DevMgmt_RadioConfig::RfFreq_LSB
UINT8 RfFreq_LSB
Definition: WiMOD_SAP_DEVMGMT_IDs.h:420
TWiMODLR_DevMgmt_RtcAlarm::Minutes
UINT8 Minutes
Definition: WiMOD_SAP_DEVMGMT_IDs.h:491
WIMOD_RTC_GET_DAYS
#define WIMOD_RTC_GET_DAYS(t)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:551
LoRaWAN_Status_Cmd_Not_Supported
@ LoRaWAN_Status_Cmd_Not_Supported
Definition: WiMOD_SAP_LORAWAN_IDs.h:108
TWiMODLR_DevMgmt_SystemStatus::BatteryStatus
UINT16 BatteryStatus
Definition: WiMOD_SAP_DEVMGMT_IDs.h:241
TWiMODLR_DevMgmt_DevInfo
Structure containing basic information about the WiMOD device.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:172
TWiMODLR_RadioLink_Msg::Length
UINT8 Length
Definition: WiMOD_SAP_RadioLink_IDs.h:174
WiMODLR_RESULT_PAYLOAD_PTR_ERROR
@ WiMODLR_RESULT_PAYLOAD_PTR_ERROR
Definition: WiMODLRHCI.h:153
LoRaWAN_Status_Ok
@ LoRaWAN_Status_Ok
Definition: WiMOD_SAP_LORAWAN_IDs.h:106
TWiMODLRResultCodes
TWiMODLRResultCodes
Result codes for the local serial communication itself.
Definition: WiMODLRHCI.h:149
TWiMODLR_DevMgmt_RadioConfig::RfFreq_MID
UINT8 RfFreq_MID
Definition: WiMOD_SAP_DEVMGMT_IDs.h:421
TWiMODLR_DevMgmt_FwInfo::FirmwareMayorVersion
UINT8 FirmwareMayorVersion
Definition: WiMOD_SAP_DEVMGMT_IDs.h:224
LoRaWAN_Status_Device_Busy
@ LoRaWAN_Status_Device_Busy
Definition: WiMOD_SAP_LORAWAN_IDs.h:112
WiMODLR_RESULT_NO_RESPONSE
@ WiMODLR_RESULT_NO_RESPONSE
Definition: WiMODLRHCI.h:156
TWiMODLR_DevMgmt_RadioConfig::StoreNwmFlag
UINT8 StoreNwmFlag
Definition: WiMOD_SAP_DEVMGMT_IDs.h:412
TWiMODLR_DevMgmt_RadioConfig::RadioMode
TRadioCfg_RadioMode RadioMode
Definition: WiMOD_SAP_DEVMGMT_IDs.h:414
LoRaWAN_Status_No_Factory_Settings
@ LoRaWAN_Status_No_Factory_Settings
Definition: WiMOD_SAP_LORAWAN_IDs.h:115
TWiMODLR_RadioLink_UdataInd
Structure containing information about a U-Data indication (TX only)
Definition: WiMOD_SAP_RadioLink_IDs.h:232
TWiMODLR_DevMgmt_RadioConfig
Structure containing the radio (stack) config parameters of the WiMOD (only for LR-BASE)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:406
LoRaWAN_Status_Wrong_parameter
@ LoRaWAN_Status_Wrong_parameter
Definition: WiMOD_SAP_LORAWAN_IDs.h:109
WiMODLR_BASE.h
LoRaWAN_Status_Wrong_DeviceMode
@ LoRaWAN_Status_Wrong_DeviceMode
Definition: WiMOD_SAP_LORAWAN_IDs.h:110
TWiMODLR_DevMgmt_SystemStatus
Basic information about system status of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:234
RTC_Alarm_Alarm_Set
@ RTC_Alarm_Alarm_Set
Definition: WiMOD_SAP_DEVMGMT_IDs.h:462
TWiMODLR_RadioLink_CdataInd
Structure containing information about a C-Data indication (TX only)
Definition: WiMOD_SAP_RadioLink_IDs.h:221
LoRaWAN_Status_Queue_Full
@ LoRaWAN_Status_Queue_Full
Definition: WiMOD_SAP_LORAWAN_IDs.h:113
OperationMode_Application
@ OperationMode_Application
Definition: WiMOD_SAP_DEVMGMT_IDs.h:442
TWiMODLR_DevMgmt_RtcAlarm::Options
TWiMOD_RtcAlarmType Options
Definition: WiMOD_SAP_DEVMGMT_IDs.h:489
WiMODLR_RESULT_PAYLOAD_LENGTH_ERROR
@ WiMODLR_RESULT_PAYLOAD_LENGTH_ERROR
Definition: WiMODLRHCI.h:152