| Demo HCI Implementation for WiMOD-LR Devices V1.3.1

- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

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

Main class representing the interface to the WiMOD running the firmware LoRaWAN EndNode Modem. More...

`#include <WiMODLoRaWAN.h>`

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

## Public Member Functions
| WiMODLoRaWAN (Stream &s)
| Constructor. More...
| ~WiMODLoRaWAN (void)
| Desctructor.
void | begin (void)
| This function must be called once before any other service can be used. More...
void | end (void)
| Shut shut down function.
bool | Ping (TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Ping Cmd - Checks the serial connection to the WiMOD module. More...
bool | Reset (TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Reset Cmd - Reboots the WiMOD module. More...
bool | GetDeviceInfo (TWiMODLR_DevMgmt_DevInfo *info, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| GetDeviceInfo Cmd - Gets the basic device information of the WiMOD. More...
bool | GetFirmwareInfo (TWiMODLR_DevMgmt_FwInfo *info, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| GetFirmwareInfo Cmd - Gets the basic information about the firmware of the WiMOD. More...
bool | GetSystemStatus (TWiMODLR_DevMgmt_SystemStatus *info, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| GetSystemStatus Cmd - Gets the basic information about the system status of the WiMOD. More...
bool | GetRtc (UINT32 *rtcTime, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the current RTC data info from WiMOD module. More...
bool | SetRtc (const UINT32 rtcTime, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets the current RTC values to WiMOD module. More...
bool | GetOperationMode (TWiMOD_OperationMode *opMode, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the current operation mode of the WiMOD module. More...
bool | SetOperationMode (const TWiMOD_OperationMode opMode, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets the current operation mode of the WiMOD module. More...
bool | SetRtcAlarm (const TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets and enables the RTC alarm feature of the WiMOD. More...
bool | GetRtcAlarm (TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets information about the RTC alarm feature of the WiMOD. More...
bool | ClearRtcAlarm (TWiMDLRResultCodes *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 | ActivateDevice (TWiMODLORAWAN_ActivateDeviceData &activationData, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Activates the device via the APB procedure. More...
bool | ReactivateDevice (UINT32 *devAdr, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Re-Activates the device via the APB procedure. More...
bool | SetJoinParameter (TWiMODLORAWAN_JoinParams &joinParams, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets the parameters used for the OTAA activation procedure. More...
bool | JoinNetwork (TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| 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...
bool | SendUData (const TWiMODLORAWAN_TX_Data *data, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Tries to send transmit U-Data to network server via RF link. More...
bool | SendCData (const TWiMODLORAWAN_TX_Data *data, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Tries to send transmit C-Data to network server via RF link. More...
bool | SetRadioStackConfig (const TWiMODLORAWAN_RadioStackConfig *data, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets a new radio config parameter set of the WiMOD. More...
bool | GetRadioStackConfig (TWiMODLORAWAN_RadioStackConfig *data, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the current radio config parameter set of the WiMOD. More...
bool | DeactivateDevice (TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Deactivate the device (logical disconnect from lora network) More...
bool | FactoryReset (TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Reset all internal settings to default values (incl. DevEUI !!!) More...
bool | SetDeviceEUI (const UINT8 *deviceEUI, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Sets a new DeviceEUI (aka. IEEE-Address) to the WiMOD. More...
bool | GetDeviceEUI (UINT8 *deviceEUI, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD. More...
bool | GetNwkStatus (TWiMODLORAWAN_NwkStatus_Data *nwkStatus, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Gets the current status of the network "connection". More...
bool | SendMacCmd (const TWiMODLORAWAN_MacCmd *cmd, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Send a MAC command to the server; expert level only. More...
bool | SetCustomConfig (const INT8 txPwrOffset, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Setup a custom config for tx power settings; expert level only. More...
bool | GetCustomConfig (INT8 *txPwrOffset, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
| Get the current offet for tx power level; expert level only. More...
TWiMDLRResultCodes | GetLastHciResult (void)
| Gets the last HCI result code from the last executed command. More...
UINT8 | GetLastResponseStatus (void)
| Gets the last response code of the WiMOD of the last executed command. More...
Public Member Functions inherited from TWiMODLRHCI
| TWiMODLRHCI (Stream &s)
| Constructor. More...
| ~TWiMODLRHCI (void)
| Destructor.
TWiMDLRResultCodes | SendHCIMessage (UINT8 dstSapID, UINT8 msgID, UINT8 rxMsgID, 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)
Public Member Functions inherited from TComSlipClient
virtual UINT8 * | ProcessRxMessage (UINT8 *, UINT16)

## Protected Member Functions
virtual void | ProcessUnexpectedRxMessage (TWiMODLR_HCIMessage &rxMsg)
bool | copyLoRaWanResultInfos (TWiMDLRResultCodes *hciResult, UINT8 *rspStatus)
bool | copyDevMgmtResultInfos (TWiMDLRResultCodes *hciResult, UINT8 *rspStatus)

## Protected Attributes
WiMOD_SAP_DevMgmt | SapDevMgmt
WiMOD_SAP_LoRaWAN | SapLoRaWan

## Detailed Description

Main class representing the interface to the WiMOD running the firmware LoRaWAN EndNode Modem.

THIS IS AN EXAMPLE IMPLEMENTATION ACCORDING THE THE HCI SPEC: V1.12 FOR FIRMWARE: LoRaWAN This class is the only API class a user should use for interacting with a WiMOD module that runs the IMST LoRaWAN EndNode Modem firmware.

## Constructor & Destructor Documentation

WiMODLoRaWAN::WiMODLoRaWAN | ( | Stream & | s | ) |

Constructor.

This function requires a cpp reference to the serial interface object that is to be used for communication.

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

## Member Function Documentation

bool WiMODLoRaWAN::ActivateDevice | ( | TWiMODLORAWAN_ActivateDeviceData & | activationData,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Activates the device via the APB procedure.

See also
  TWiMDLRResultCodes for interpretation of the values

Parameters

  activationData | structure holding the necessary 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

// ABP data
const uint32_t DEV_ADR = 0x22;
const char NWKSKEY[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0f, 0x10 };
const char APPSKEY[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0f, 0x10 };
// create a local variable
TWiMODLORAWAN_ActivateDeviceData activationData;
void setup() {
//setup data
activationData.DeviceAddress = DEV_ADR;
memcpy(activationData.NwkSKey, NWKSKEY, 16);
memcpy(activationData.AppSKey, APPSKEY, 16);
// activate device
if (wimod.ActivateDevice(activationData)) {
// ABP procedure done
...
} else {
// Error executing ABP join request
...
}
...

Here is the call graph for this function:

void WiMODLoRaWAN::begin | ( | void |  | ) |
| virtual

This function must be called once before any other service can be used.

#include <WiMODLoRaWAN.h>
WiMODLoRaWAN 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:

bool WiMODLoRaWAN::ClearRtcAlarm | ( | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Clears pending RTC Alarms of the WiMOD.

See also
  TWiMDLRResultCodes 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:

bool WiMODLoRaWAN::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.

Parameters

  RxMsg | Reference to low-level HCI message.

Warning
  DO NOT MANIPULATE THESE VALUES !!!

Parameters

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

Return values

  true | if the conversion was successful

void onRxData(TWiMODLR_HCIMessage& rxMsg) {
TWiMODLORAWAN_RX_Data radioRxMsg;
// convert/copy the raw message to RX radio buffer
if (wimod.convert(rxMsg, &radioRxMsg)) {
// OK, process RX data
...
}
}
...
void setup() {
...
// setup user callbacks for RX data events
wimod.RegisterRxCDataIndicationClient(onRxData);
wimod.RegisterRxUDataIndicationClient(onRxData);
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::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.

Parameters

  RxMsg | Reference to low-level HCI message.

Warning
  DO NOT MANIPULATE THESE VALUES !!!

Parameters

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

Return values

  true | if the conversion was successful

void myTxInd(TWiMODLR_HCIMessage& rxMsg) {
TWiMODLORAWAN_TxIndData txData;
// convert/copy the raw message to tx indication data
if (wimod.convert(rxMsg, &txData)) {
// OK, process data
...
}
}
...
void setup() {
...
// setup user callbacks for TX indication events
wimod.RegisterTxUDataIndicationClient(myTxInd);
wimod.RegisterTxCDataIndicationClient(myTxInd);
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::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.

Parameters

  RxMsg | Reference to low-level HCI message.

Warning
  DO NOT MANIPULATE THESE VALUES !!!

Parameters

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

Return values

  true | if the conversion was successful

void myMacCmdInd(TWiMODLR_HCIMessage& rxMsg) {
TWiMODLORAWAN_RX_MacCmdData macData;
// convert/copy the raw message to MAC cmd indication data
if (wimod.convert(rxMsg, &macData)) {
// OK, process data
...
}
}
...
void setup() {
...
// setup user callback for MAC cmd indication events
wimod.RegisterRxMacCmdIndicationClient(myMacCmdInd);
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::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.

Parameters

  RxMsg | Reference to low-level HCI message.

Warning
  DO NOT MANIPULATE THESE VALUES !!!

Parameters

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

Return values

  true | if the conversion was successful

void myJoinedNwkInd(TWiMODLR_HCIMessage& rxMsg) {
TWiMODLORAWAN_RX_JoinedNwkData joinData;
// convert/copy the raw message to a joined nwk indication data structure
if (wimod.convert(rxMsg, &joinData)) {
// OK, process data
...
}
}
...
void setup() {
...
// setup user callback for joined network indication (for OTAA procedure)
wimod.RegisterJoinedNwkIndicationClient(myJoinedNwkInd);
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::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.

Parameters

  RxMsg | Reference to low-level HCI message.

Warning
  DO NOT MANIPULATE THESE VALUES !!!

Parameters

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

Return values

  true | if the conversion was successful

void myRxAckInd(TWiMODLR_HCIMessage& rxMsg) {
TWiMODLORAWAN_RX_ACK_Data rxAckData;
// convert/copy the raw message to a RX ACK data structure
if (wimod.convert(rxMsg, &rxAckData)) {
// OK, process data
...
}
}
...
void setup() {
...
// setup user callback for receiving RX ACK indications
wimod.RegisterRxAckIndicationClient(myRxAckInd);
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::DeactivateDevice | ( | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Deactivate the device (logical disconnect from lora network)

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

...
// "disconnect" this endnode from the network
if (wimod.DeactivateDevice()) {
// node is disconnected and can not transfer data to server
// unless it will be re-activated
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::FactoryReset | ( | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Reset all internal settings to default values (incl. DevEUI !!!)

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 complete factory reset of the WiMOD module
if (wimod.FactoryReset()) {
// WiMOD module will reset all internal values and will
// do a reboot;
// wait a while for reboot to be completed
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::GetCustomConfig | ( | INT8 * | txPwrOffset,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Get the current offet for tx power level; expert level only.

Parameters

  txPwrOffset | pointer to store the offset value for tx power settings
  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

Here is the call graph for this function:

bool WiMODLoRaWAN::GetDeviceEUI | ( | UINT8 * | deviceEUI,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD.

Parameters

  deviceEUI | pointer for storing the received 64bit address
  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 for the device EUI
uint8_t devEUI[8];
// get the devEUI
if (wimod.GetDeviceEUI(devEUI)) {
...
}
...

Here is the call graph for this function:

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

GetDeviceInfo Cmd - Gets the basic device information of the WiMOD.

See also
  HCI command specification.

Parameters

  info | pointer for storing the requested information (structure)
  hciResult | pointer for storing the the local HCI transfer result. This is an optional parameter.
  rspStatus | pointer to store the response code of the WiMOD This is an optional parameter.

Return values

  true | if everything was successful

// create a local variable
TWiMODLR_DevMgmt_DevInfo devInfo;
// get information of WiMOD
wimod.GetDeviceInfo(&devInfo);
//access fields of structure
printf("ModulType-ID: %d:", devInfo.ModuleType);
printf("DeviceAddress: %x:", devInfo.DevAdr);
...

Here is the call graph for this function:

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

GetFirmwareInfo Cmd - Gets the basic information about the firmware of the WiMOD.

See also
  HCI command specification.

Parameters

  info | pointer for storing the requested information (structure)
  hciResult | pointer for storing the the local HCI transfer result. This is an optional parameter.
  rspStatus | pointer to store the response code of the WiMOD 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_FwInfo fwInfo;
// get information of WiMOD
wimod.GetFirmwareInfo(&fwInfo);
//access fields of structure
printf("FW-Version: %d.%d:", fwInfo.FirmwareMayorVersion, fwInfo.FirmwareMinorVersion );
printf("FW-Name: %s:", fwInfo.FirmwareName);
...

Here is the call graph for this function:

TWiMDLRResultCodes WiMODLoRaWAN::GetLastHciResult | ( | void |  | ) |

Gets the last HCI result code from the last executed command.

If you missed setting the HciResult parameter while executing the last command, this method can recall the last value of that parameter.

See also
  TWiMDLRResultCodes for possible values.

Returns
  the result value of the last executed command

UINT8 WiMODLoRaWAN::GetLastResponseStatus | ( | void |  | ) |

Gets the last response code of the WiMOD of the last executed command.

If you missed setting the rspStatus parameter while executing the last command, this method can recall the last value of that parameter.

See also
  LORAWAN_STATUS_* defines for possible values.

Returns
  the result value of the last executed command

- ...
  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
  ...
  }
  ...

bool WiMODLoRaWAN::GetNwkStatus | ( | TWiMODLORAWAN_NwkStatus_Data * | nwkStatus,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the current status of the network "connection".

Parameters

  nwkStatus | pointer for storing the requested information

See also
  LORAWAN_NWK_SATUS defines; e.g.:
  - LORAWAN_NWK_SATUS_INACTIVE,
  - LORAWAN_NWK_STATUS_ACTIVE_ABP,
  - LORAWAN_NWK_STATUS_ACTIVE_OTAA,
  - LORAWAN_NWK_STATUS_JOINING_OTAA

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
TWiMODLORAWAN_NwkStatus_Data nwkStatus;
// get the nwk status
if (wimod.GetNwkStatus(&nwkStatus)) {
switch (nwkStatus.NetworkStatus):
case LORAWAN_NWK_SATUS_INACTIVE: // device is not "connected"
case LORAWAN_NWK_STATUS_ACTIVE_ABP: // device has been activated by ABP
case LORAWAN_NWK_STATUS_ACTIVE_OTAA: // device has been activated by OTAA
case LORAWAN_NWK_STATUS_JOINING_OTAA:// an OTAA activation procedure is currently pending
...
}
...

Here is the call graph for this function:

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

Gets the current operation mode of the WiMOD module.

See also
  TWiMDLRResultCodes 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

// create a local variable
TWiMOD_OperationMode opMode;
// get information of WiMOD
wimod.GetOperationMode(&opMode);
// access value
if (opMode == OperationMode_Application) {
// do normal operations
...
} else {
// special operation mode; normal operations are disabled
...
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::GetRadioStackConfig | ( | TWiMODLORAWAN_RadioStackConfig * | data,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Gets the current radio config parameter set of the WiMOD.

Parameters

  data | pointer to data structure for storing the requested information

See also
  TWiMODLORAWAN_TX_Data 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
TWiMODLORAWAN_RadioStackConfig radioCfg;
// get current radio config
if (wimod.GetRadioStackConfig(&radioCfg)) {
// check / process
...
}

Here is the call graph for this function:

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

Gets the current RTC data info from WiMOD module.

See also
  TWiMDLRResultCodes 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:

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

Gets information about the RTC alarm feature of the WiMOD.

See also
  TWiMDLRResultCodes 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:

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

GetSystemStatus Cmd - Gets the basic information about the system status of the WiMOD.

See also
  HCI command specification.

Parameters

  info | pointer for storing the requested information (structure)
  hciResult | pointer for storing the the local HCI transfer result. This is an optional parameter.
  rspStatus | pointer to store the response code of the WiMOD 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_SystemStatus sysStatus;
// get information of WiMOD
wimod.GetSystemStatus(&sysStatus);
//access fields of structure
printf("Sys-SysTicks: %d:", sysStatus.SysTickCounter);
printf("Sys-Voltage (mv): %d:", sysStatus.BatteryStatus);
...

Here is the call graph for this function:

bool WiMODLoRaWAN::JoinNetwork | ( | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

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.

See also
  TWiMDLRResultCodes 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

void myNwkJoinedCallback(TWiMODLR_HCIMessage& rxMsg) {
// handle and check the given rsp data of the server
...
}
void setup() {
...
// setup OTAA / join related parameters and transfer it to WiMOD
wimod.SetJoinParameter(joinParams);
// register joined nwk callback
wimod.RegisterJoinedNwkIndicationClient(myNwkJoinedCallback);
// start OTAA procedure by sending a join request
if (wimod.JoinNetwork()) {
// OK procedure has been started
// wait for callback indicating status of procedure
} else {
// error
...
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::Ping | ( | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Ping Cmd - Checks the serial connection to the WiMOD module.

See also
  HCI command specification.

Parameters

  hciResult | pointer for storing the the local HCI transfer result. This is an optional parameter.
  rspStatus | pointer to store the response code of the WiMOD 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:

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

OR:

TWiMDLRResultCodes 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:

bool WiMODLoRaWAN::ReactivateDevice | ( | UINT32 * | devAdr,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Re-Activates the device via the APB procedure.

In case the device has been previously activated (e.g. during manufacturing) the user does not know the security keys. In this case a re-activation procedure must be used in order to use the stored values. (For APB ONLY!)

See also
  TWiMDLRResultCodes for interpretation of the values

Parameters

  devAdr | pointer where the store the "received" device address
  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

// ABP data
const uint32_t DEV_ADR = 0x22;
// security keys are not known the user
void setup() {
// local variable
uint32_t devAddr = DEV_ADR;
// activate device
if (wimod.ReactivateDevice(activationData)) {
// ABP procedure done
...
} else {
// Error executing ABP join request
...
}
...

Here is the call graph for this function:

void WiMODLoRaWAN::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.

Parameters

  cb | pointer to a callback function that should be called if the event occurs.

Here is the call graph for this function:

void WiMODLoRaWAN::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.

Parameters

  cb | pointer to a callback function that should be called if the event occurs.

void myJoinReqTxCallback(TWiMODLR_HCIMessage& rxMsg) {
// handle and check the given rsp data of the server
TWiMODLORAWAN_TxIndData txData;
wimod.convert(rxMsg, &txData);
printf("joining attempt: %d", txData.NumTxPackets);
...
}
void setup() {
...
// register joined nwk callback
wimod.RegisterJoinTxIndicationClient(myJoinReqTxCallback);
...
}

Here is the call graph for this function:

void WiMODLoRaWAN::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.

Parameters

  cb | pointer to a callback function that should be called if the event occurs.

void myNoDataInd() {
// no data has been received; timeout occurred.?
...
}
...
void setup() {
...
// setup user callback for "no data rx" indications
wimod.RegisterNoDataIndicationClient(myNoDataInd);
}
...

Here is the call graph for this function:

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

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

See also
  TWiMDLRResultCodes 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:

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

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

See also
  TWiMDLRResultCodes 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:

void WiMODLoRaWAN::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.

Parameters

  cb | pointer to a callback function that should be called if the event occurs.

Here is the call graph for this function:

void WiMODLoRaWAN::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.

Parameters

  cb | pointer to a callback function that should be called if the event occurs.

Here is the call graph for this function:

void WiMODLoRaWAN::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.

Parameters

  cb | pointer to a callback function that should be called if the event occurs.

Here is the call graph for this function:

void WiMODLoRaWAN::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.

Parameters

  cb | pointer to a callback function that should be called if the event occurs.

Here is the call graph for this function:

void WiMODLoRaWAN::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.

Parameters

  cb | pointer to a callback function that should be called if the event occurs.

void myTxInd(TWiMODLR_HCIMessage& rxMsg) {
TWiMODLORAWAN_TxIndData txData;
// convert/copy the raw message to tx indication data
if (wimod.convert(rxMsg, &txData)) {
// OK, process data
...
}
}
...
void setup() {
...
// setup user callback(s) for TX indication events
wimod.RegisterTxCDataIndicationClient(myTxInd);
}
...

Here is the call graph for this function:

void WiMODLoRaWAN::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.

Parameters

  cb | pointer to a callback function that should be called if the event occurs.

void myTxInd(TWiMODLR_HCIMessage& rxMsg) {
TWiMODLORAWAN_TxIndData txData;
// convert/copy the raw message to tx indication data
if (wimod.convert(rxMsg, &txData)) {
// OK, process data
...
}
}
...
void setup() {
...
// setup user callback(s) for TX indication events
wimod.RegisterTxUDataIndicationClient(myTxInd);
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::Reset | ( | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Reset Cmd - Reboots the WiMOD module.

See also
  HCI command specification.

Parameters

  hciResult | pointer for storing the the local HCI transfer result. This is an optional parameter.
  rspStatus | pointer to store the response code of the WiMOD This is an optional parameter.

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:

bool WiMODLoRaWAN::SendCData | ( | const TWiMODLORAWAN_TX_Data * | data,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

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

Parameters

  data | pointer to data structure containing the TX-data and options.

See also
  TWiMODLORAWAN_TX_Data 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
TWiMODLORAWAN_TX_Data txData;
// setup tx packet
txData.Port = 1;
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:

bool WiMODLoRaWAN::SendMacCmd | ( | const TWiMODLORAWAN_MacCmd * | cmd,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Send a MAC command to the server; expert level only.

Parameters

  cmd | pointer containing the MAC command and 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
TWiMODLORAWAN_MacCmd macCmd;
// setup
macCmd.DataServiceType = LORAWAN_MAC_DATA_SERVICE_TYPE_U_DATA;
macCmd.MacCmdID = // see LoRa spec. for MAC command IDs
macCmd.Length = ...;
macCmd.Payload = ...;
// send mac command
if (wimod.SendMacCmd(macCmd)) {
...
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::SendUData | ( | const TWiMODLORAWAN_TX_Data * | data,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

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

Parameters

  data | pointer to data structure containing the TX-data and options.

See also
  TWiMODLORAWAN_TX_Data 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
TWiMODLORAWAN_TX_Data txData;
// setup tx packet
txData.Port = 1;
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:

bool WiMODLoRaWAN::SetCustomConfig | ( | const INT8 | txPwrOffset,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Setup a custom config for tx power settings; expert level only.

Parameters

  txPwrOffset | new offset value for tx power settings
  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

Here is the call graph for this function:

bool WiMODLoRaWAN::SetDeviceEUI | ( | const UINT8 * | deviceEUI,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

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.

Parameters

  deviceEUI | pointer to data structure containing the new parameters (Must be an pointer of a 64bit address)
  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 for the device EUI
uint8_t devEUI[8];
// setup deviceEUI
...
// send the devEUI to the WiMOD module
if (wimod.SetDeviceEUI(devEUI)) {
// WiMOD module will use the given devEUI...
}
...

Here is the call graph for this function:

bool WiMODLoRaWAN::SetJoinParameter | ( | TWiMODLORAWAN_JoinParams & | joinParams,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Sets the parameters used for the OTAA activation procedure.

See also
  TWiMDLRResultCodes for interpretation of the values

Parameters

  joinParams | structure holding the necessary 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

// OTAA data
const char APPEUI[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 };
const char APPKEY[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0f, 0x10 };
void setup() {
// local variable
TWiMODLORAWAN_JoinParams joinParams;
// setup parameters
memcpy(joinParams.AppEUI, APPEUI, 8);
memcpy(joinParams.AppKey, APPKEY, 16);
// transfer parameters to WiMOD
wimod.SetJoinParameter(joinParams);
...

Here is the call graph for this function:

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

Sets the current operation mode of the WiMOD module.

See also
  TWiMDLRResultCodes 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

// create a local variable
TWiMOD_OperationMode opMode;
// set new operation mode
opMode = OperationMode_Application;
// set information of WiMOD
wimod.SetOperationMode(opMode);
...

Here is the call graph for this function:

bool WiMODLoRaWAN::SetRadioStackConfig | ( | const TWiMODLORAWAN_RadioStackConfig * | data,
|  | TWiMDLRResultCodes * | hciResult = `NULL`,
|  | UINT8 * | rspStatus = `NULL`
| ) |  |

Sets a new radio config parameter set of the WiMOD.

Parameters

  data | pointer to data structure containing the new parameters

See also
  TWiMODLORAWAN_TX_Data 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
TWiMODLORAWAN_RadioStackConfig radioCfg;
// setup new config
radioCfg.DataRateIndex = LORAWAN_DATA_RATE_LORA_SF9_125KHZ;
radioCfg.TXPowerLevel = LORAWAN_TX_POWER_LEVEL_MIN;
radioCfg.Options = LORAWAN_STK_OPTION_ADR |
LORAWAN_STK_OPTION_DEV_CLASS_C |
LORAWAN_STK_OPTION_EXT_PKT_FORMAT;
radioCfg.PowerSavingMode = LORAWAN_POWER_SAVING_MODE_OFF;
radioCfg.Retransmissions = 7;
radioCfg.BandIndex = LORAWAN_BAND_EU_868_RX2_SF9;
// set new radio config
wimod.SetRadioStackConfig(&radioCfg);
// wait a little bit for config activation

Here is the call graph for this function:

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

Sets the current RTC values to WiMOD module.

See also
  TWiMDLRResultCodes 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:

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

Sets and enables the RTC alarm feature of the WiMOD.

See also
  TWiMDLRResultCodes 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

WiMOD_SAP_DevMgmt WiMODLoRaWAN::SapDevMgmt
| protected

Service Access Point for 'DeviceManagement'

WiMOD_SAP_LoRaWAN WiMODLoRaWAN::SapLoRaWan
| protected

Service Access Point for 'LoRaWAN'

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

- WiMODLoRaWAN.h
- LoRaWAN/WiMODLoRaWAN.cpp