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

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

#include <WiMODGlobalLink24.h>

Collaboration diagram for WiMODGlobalLink24:

Public Member Functions

 WiMODGlobalLink24 (Stream &s)
 Constructor. More...
 
 ~WiMODGlobalLink24 (void)
 Desctructor.
 
void begin (TLoRaWANregion region=LoRaWAN_Region_proprietary_WW2G4)
 This function must be called once before any other service can be used. More...
 
void end (void)
 Shut shut down function.
 
bool Ping (TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Ping Cmd - Checks the serial connection to the WiMOD module. More...
 
bool Reset (TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Reset Cmd - Reboots the WiMOD module. More...
 
bool GetDeviceInfo (TWiMODLR_DevMgmt_DevInfoLoRaWan *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 GetDeviceInfo Cmd - Gets the basic device information of the WiMOD. More...
 
bool GetFirmwareInfo (TWiMODLR_DevMgmt_FwInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 GetFirmwareInfo Cmd - Gets the basic information about the firmware of the WiMOD. More...
 
bool GetSystemStatus (TWiMODLR_DevMgmt_SystemStatusLorawan *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 GetSystemStatus Cmd - Gets the basic information about the system status of the WiMOD. 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 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 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 GetHciConfig (TWiMODLR_DevMgmt_HciConfig *hciConfig, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Gets the current HCI configuration of the WiMOD. More...
 
bool SetHciConfig (TWiMODLR_DevMgmt_HciConfig &hciConfig, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Sets a new HCI configuration of the WiMOD. More...
 
bool ActivateDevice (TWiMODGlobalLink24_ActivateDeviceData &activationData, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Activates the device via the ABP procedure. More...
 
bool ReactivateDevice (UINT32 *devAdr, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Re-Activates the device via the ABP procedure. More...
 
bool SetJoinParameter (TWiMODGlobalLink24_JoinParams &joinParams, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Sets the parameters used for the OTAA activation procedure. More...
 
bool JoinNetwork (TWiMODLRResultCodes *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, TWiMODGlobalLink24_RX_Data *globalLink24RxData)
 Convert a received low level HCI-Msg to a high-level Rx Data structure. More...
 
bool convert (TWiMODLR_HCIMessage &rxMsg, TWiMODGlobalLink24_TxIndData *sendIndData)
 Convert a received low level HCI-Msg to a high-level tx ind structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODGlobalLink24_RX_MacCmdData *globalLink24MacCmdData)
 Convert a received low level HCI-Msg to a high-level MAC-Cmd structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODGlobalLink24_RX_JoinedNwkData *joinedNwkData)
 Convert a received low level HCI-Msg to a high-level NwkJoined structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODGlobalLink24_RX_ACK_Data *ackData)
 Convert a received low level HCI-Msg to a high-level AckData structure. More...
 
bool convert (TWiMODLR_HCIMessage &RxMsg, TWiMODGlobalLink24_NoData_Data *info)
 Convert a received low level HCI-Msg to a high-level NoData 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 TWiMODGlobalLink24_TX_Data *data, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Tries to send transmit U-Data to network server via RF link. More...
 
bool SendCData (const TWiMODGlobalLink24_TX_Data *data, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Tries to send transmit C-Data to network server via RF link. More...
 
bool SetRadioStackConfig (TWiMODGlobalLink24_RadioStackConfig *data, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Sets a new radio config parameter set of the WiMOD. More...
 
bool GetRadioStackConfig (TWiMODGlobalLink24_RadioStackConfig *data, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Gets the current radio config parameter set of the WiMOD. More...
 
bool DeactivateDevice (TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Deactivate the device (logical disconnect from lora network) More...
 
bool FactoryReset (TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Reset all internal settings to default values (incl. DevEUI !!!) More...
 
bool SetDeviceEUI (const UINT8 *deviceEUI, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Sets a new DeviceEUI (aka. IEEE-Address) to the WiMOD. More...
 
bool GetDeviceEUI (UINT8 *deviceEUI, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Gets the DeviceEUI (aka. IEEE-Address) of the WiMOD. More...
 
bool GetNwkStatus (TWiMODGlobalLink24_NwkStatus_Data *nwkStatus, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Gets the current status of the network "connection". More...
 
bool SendMacCmd (const TWiMODGlobalLink24_MacCmd *cmd, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Send a MAC command to the server; expert level only. More...
 
bool SetCustomConfig (const INT8 rfGain, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Setup a custom config for tx power settings; expert level only. More...
 
bool GetCustomConfig (INT8 *rfGain, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Get the current offet for tx power level; expert level only. More...
 
bool GetSupportedBands (TWiMODGlobalLink24_SupportedBands *supportedBands, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Get the supported bands of this firmware. More...
 
bool SetBatteryLevelStatus (UINT8 battStatus, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
 Set the Battry Level Status. 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 PrintBasicDeviceInfo (Stream &s)
 
void ConnectViaOTAA (const uint8_t *appEUI=NULL, const uint8_t *appKey=NULL)
 do a jump start and use OTAA to connect to a Nwk server More...
 
void ConvertAppEuiStrToArray (char *appEuiStr, uint8_t *appEuiArray)
 Converts a string containing an App EUI string into a given byte array. More...
 
void ConvertAppKeyStrToArray (char *appKeyStr, uint8_t *appKeyArray)
 Converts a string containing an App Key string into a given byte array. More...
 
void ConvertNwkSKeyStrToArray (char *nwkSKeyStr, uint8_t *nwkSKeyArray)
 Converts a string containing an NwkSKey string into a given byte array. More...
 
void ConvertAppSKeyStrToArray (char *appSKeyStr, uint8_t *appSKeyArray)
 Converts a string containing an AppSKey string into a given byte array. More...
 
TWiMODLRResultCodes 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...
 
void Process (void)
 
void EnableWakeupSequence (bool flag)
 

Protected Attributes

WiMODLoRaWAN GlobalLinkImp
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ WiMODGlobalLink24()

WiMODGlobalLink24::WiMODGlobalLink24 ( Stream &  s)

Constructor.

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

WiMODGlobalLink24 wimod(Serial3); // use the Arduino Serial3 as serial interface
void setup() {
// init stack
wimod.begin();
...
}

Member Function Documentation

◆ ActivateDevice()

bool WiMODGlobalLink24::ActivateDevice ( TWiMODGlobalLink24_ActivateDeviceData activationData,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Activates the device via the ABP procedure.

See also
TWiMODLRResultCodes for interpretation of the values
Parameters
activationDatastructure holding the necessary parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
msc_inline_mscgraph_1
// 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
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:

◆ begin()

void WiMODGlobalLink24::begin ( TLoRaWANregion  region = LoRaWAN_Region_proprietary_WW2G4)

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

WiMODGlobalLink24 wimod(Serial3); // use the Arduino Serial3 as serial interface
void setup() {
// init stack
wimod.begin();
...
}
Here is the call graph for this function:

◆ ClearRtcAlarm()

bool WiMODGlobalLink24::ClearRtcAlarm ( TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Clears pending RTC Alarms of the WiMOD.

See also
TWiMODLRResultCodes for interpretation of the values
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif 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:

◆ ConnectViaOTAA()

void WiMODGlobalLink24::ConnectViaOTAA ( const uint8_t *  appEUI = NULL,
const uint8_t *  appKey = NULL 
)

do a jump start and use OTAA to connect to a Nwk server

Parameters
appEUIpointer to an array containing the AppEUI data to use
appKeypointer to an array containing the AppKey data to use
Here is the call graph for this function:

◆ convert() [1/6]

bool WiMODGlobalLink24::convert ( TWiMODLR_HCIMessage RxMsg,
TWiMODGlobalLink24_NoData_Data info 
)

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

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

Parameters
RxMsgReference to low-level HCI message.
Warning
DO NOT MANIPULATE THESE VALUES !!!
Parameters
infoPointer to the buffer where to store the received information
Return values
trueif the conversion was successful
msc_inline_mscgraph_2
Here is the call graph for this function:

◆ convert() [2/6]

bool WiMODGlobalLink24::convert ( TWiMODLR_HCIMessage RxMsg,
TWiMODGlobalLink24_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
RxMsgReference to low-level HCI message.
Warning
DO NOT MANIPULATE THESE VALUES !!!
Parameters
ackDataPointer to the buffer where to store the received data
Return values
trueif the conversion was successful
msc_inline_mscgraph_3
void myRxAckInd(TWiMODLR_HCIMessage& rxMsg) {
// 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:

◆ convert() [3/6]

bool WiMODGlobalLink24::convert ( TWiMODLR_HCIMessage RxMsg,
TWiMODGlobalLink24_RX_Data globalLink24RxData 
)

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
RxMsgReference to low-level HCI message.
Warning
DO NOT MANIPULATE THESE VALUES !!!
Parameters
globalLink24RxDataPointer to the buffer where to store the received data
Return values
trueif the conversion was successful
msc_inline_mscgraph_4
void onRxData(TWiMODLR_HCIMessage& rxMsg) {
// 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:

◆ convert() [4/6]

bool WiMODGlobalLink24::convert ( TWiMODLR_HCIMessage RxMsg,
TWiMODGlobalLink24_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
RxMsgReference to low-level HCI message.
Warning
DO NOT MANIPULATE THESE VALUES !!!
Parameters
joinedNwkDataPointer to the buffer where to store the received data
Return values
trueif the conversion was successful
msc_inline_mscgraph_5
void myJoinedNwkInd(TWiMODLR_HCIMessage& rxMsg) {
// 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:

◆ convert() [5/6]

bool WiMODGlobalLink24::convert ( TWiMODLR_HCIMessage RxMsg,
TWiMODGlobalLink24_RX_MacCmdData globalLink24MacCmdData 
)

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
RxMsgReference to low-level HCI message.
Warning
DO NOT MANIPULATE THESE VALUES !!!
Parameters
globalLink24MacCmdDataPointer to the buffer where to store the received data
Return values
trueif the conversion was successful
msc_inline_mscgraph_6
void myMacCmdInd(TWiMODLR_HCIMessage& rxMsg) {
// 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:

◆ convert() [6/6]

bool WiMODGlobalLink24::convert ( TWiMODLR_HCIMessage RxMsg,
TWiMODGlobalLink24_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
RxMsgReference to low-level HCI message.
Warning
DO NOT MANIPULATE THESE VALUES !!!
Parameters
sendIndDataPointer to the buffer where to store the received data
Return values
trueif the conversion was successful
msc_inline_mscgraph_7
void myTxInd(TWiMODLR_HCIMessage& rxMsg) {
// 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:

◆ ConvertAppEuiStrToArray()

void WiMODGlobalLink24::ConvertAppEuiStrToArray ( char *  appEuiStr,
uint8_t *  appEuiArray 
)

Converts a string containing an App EUI string into a given byte array.

This convinience funtion offers the user the possibilty to use a string containing the AppEUI as text (e.g. "0x12 34 45 78 9A BC DE f0"). The string will be decoded to an byte array for further usage. The string can is interpreted as hex digits with or without a "0x" prefix. Each digit pair must be separated by a space char.

Parameters
appEuiStrString containing the hex coded appEUI
appEuiArrayarray that should store the converted byte values
Warning
There is no length check of the array. The user is responsible to reserve enough space.
Here is the call graph for this function:

◆ ConvertAppKeyStrToArray()

void WiMODGlobalLink24::ConvertAppKeyStrToArray ( char *  appKeyStr,
uint8_t *  appKeyArray 
)

Converts a string containing an App Key string into a given byte array.

This convinience funtion offers the user the possibilty to use a string containing the AppKey as text (e.g. "0x12 34 45 78 9A BC DE f0 10 20 30 40 50 60 70 80"). The string will be decoded to an byte array for further usage. The string can is interpreted as hex digits with or without a "0x" prefix. Each digit pair must be separated by a space char.

Parameters
appKeyStrString containing the hex coded appKey
appKeyArrayarray that should store the converted byte values
Warning
There is no length check of the array. The user is responsible to reserve enough space.
Here is the call graph for this function:

◆ ConvertAppSKeyStrToArray()

void WiMODGlobalLink24::ConvertAppSKeyStrToArray ( char *  appSKeyStr,
uint8_t *  appSKeyArray 
)

Converts a string containing an AppSKey string into a given byte array.

This convinience funtion offers the user the possibilty to use a string containing the AppSKey as text (e.g. "0x12 34 45 78 9A BC DE f0 10 20 30 40 50 60 70 80"). The string will be decoded to an byte array for further usage. The string can is interpreted as hex digits with or without a "0x" prefix. Each digit pair must be separated by a space char.

Parameters
appSKeyStrString containing the hex coded appKey
appSKeyArrayarray that should store the converted byte values
Warning
There is no length check of the array. The user is responsible to reserve enough space.
Here is the call graph for this function:

◆ ConvertNwkSKeyStrToArray()

void WiMODGlobalLink24::ConvertNwkSKeyStrToArray ( char *  nwkSKeyStr,
uint8_t *  nwkSKeyArray 
)

Converts a string containing an NwkSKey string into a given byte array.

This convinience funtion offers the user the possibilty to use a string containing the NwkSKey as text (e.g. "0x12 34 45 78 9A BC DE f0 10 20 30 40 50 60 70 80"). The string will be decoded to an byte array for further usage. The string can is interpreted as hex digits with or without a "0x" prefix. Each digit pair must be separated by a space char.

Parameters
nwkSKeyStrString containing the hex coded appKey
nwkSKeyArrayarray that should store the converted byte values
Warning
There is no length check of the array. The user is responsible to reserve enough space.
Here is the call graph for this function:

◆ DeactivateDevice()

bool WiMODGlobalLink24::DeactivateDevice ( TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Deactivate the device (logical disconnect from lora network)

Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif 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:

◆ ExecuteGenericCmd()

bool WiMODGlobalLink24::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
infopointer to a structure containing the HCI commands to execute
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif 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:

◆ FactoryReset()

bool WiMODGlobalLink24::FactoryReset ( TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif 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:

◆ GetCustomConfig()

bool WiMODGlobalLink24::GetCustomConfig ( INT8 *  rfGain,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

Parameters
rfGainpointer to store the offset value for tx power settings
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
Here is the call graph for this function:

◆ GetDeviceEUI()

bool WiMODGlobalLink24::GetDeviceEUI ( UINT8 *  deviceEUI,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

Parameters
deviceEUIpointer for storing the received 64bit address
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif 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:

◆ GetDeviceInfo()

bool WiMODGlobalLink24::GetDeviceInfo ( TWiMODLR_DevMgmt_DevInfoLoRaWan info,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

See also
HCI command specification.
Parameters
infopointer for storing the requested information (structure)
hciResultpointer for storing the the local HCI transfer result. This is an optional parameter.
rspStatuspointer to store the response code of the WiMOD This is an optional parameter.
Return values
trueif everything was successful
// create a local variable
// 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:

◆ GetFirmwareInfo()

bool WiMODGlobalLink24::GetFirmwareInfo ( TWiMODLR_DevMgmt_FwInfo info,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

See also
HCI command specification.
Parameters
infopointer for storing the requested information (structure)
hciResultpointer for storing the the local HCI transfer result. This is an optional parameter.
rspStatuspointer to store the response code of the WiMOD This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
// create a local variable
// 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:

◆ GetHciConfig()

bool WiMODGlobalLink24::GetHciConfig ( TWiMODLR_DevMgmt_HciConfig hciConfig,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Gets the current HCI configuration of the WiMOD.

See also
HCI documentation and feature specification for details
Parameters
hciConfigPointer to a structure where to store the HCI config related information
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
// create a local variable
// get information of WiMOD
wimod.GetHciConfig(&hciConfig);
...
// access values
if (hciConfig.NumWakeUpChars == 40) {
...
}
...
Here is the call graph for this function:

◆ GetLastHciResult()

TWiMODLRResultCodes WiMODGlobalLink24::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
TWiMODLRResultCodes for possible values.
Returns
the result value of the last executed command
msc_inline_mscgraph_8
...
if (wimod.Ping() == false) {
// 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
...
}
...
Here is the call graph for this function:

◆ GetLastResponseStatus()

UINT8 WiMODGlobalLink24::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 GLOBALLINK24_Status_Ok: // OK; No error;
    // --> check "remote" ResponseStatus
    case GLOBALLINK24_Status_Error: // general (un-specific) error
    case GLOBALLINK24_Status_Cmd_Not_Supported: // Command is not supported (or unknown)
    case GLOBALLINK24_Status_Wrong_parameter: // Wrong parameter applied
    case GLOBALLINK24_Status_Wrong_DeviceMode: // Device is in wong device mode for specific command
    case GLOBALLINK24_Status_Device_Not_Activated: // Device has NOT been activated; command has not been executed
    case GLOBALLINK24_Status_Device_Busy: // There is another operation pending; and or duty cycle restriction is active
    case GLOBALLINK24_Status_Queue_Full: // internal command queue is full
    case GLOBALLINK24_Status_Length_Error: // some error related to the given length information
    case GLOBALLINK24_Status_No_Factory_Settings: // Factory settings are not available
    case GLOBALLINK24_Status_Channel_Blocked: // Selected channel is blocked (duty cycle?)
    case GLOBALLINK24_Status_Channel_Not_Available: // Selected channel is not available
    ...
    }
    ...
Here is the call graph for this function:

◆ GetNwkStatus()

bool WiMODGlobalLink24::GetNwkStatus ( TWiMODGlobalLink24_NwkStatus_Data nwkStatus,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Gets the current status of the network "connection".

Parameters
nwkStatuspointer for storing the requested information
See also
LORAWAN_NWK_STATUS defines; e.g.:
  • LORAWAN_NWK_STATUS_INACTIVE,
  • LORAWAN_NWK_STATUS_ACTIVE_ABP,
  • LORAWAN_NWK_STATUS_ACTIVE_OTAA,
  • LORAWAN_NWK_STATUS_JOINING_OTAA
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
...
// (local) variable
TWiMODGlobalLink24_NwkStatus_Data nwkStatus;
// get the nwk status
if (wimod.GetNwkStatus(&nwkStatus)) {
switch (nwkStatus.NetworkStatus):
case LORAWAN_NWK_STATUS_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:

◆ GetOperationMode()

bool WiMODGlobalLink24::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
opModePointer where to store the information
See also
TWiMOD_OperationMode for details
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
// create a local variable
// 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:

◆ GetRadioStackConfig()

bool WiMODGlobalLink24::GetRadioStackConfig ( TWiMODGlobalLink24_RadioStackConfig data,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Gets the current radio config parameter set of the WiMOD.

Parameters
datapointer to data structure for storing the requested information
See also
TWiMODGlobalLink24_TX_Data for details
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
...
// local variable
TWiMODGlobalLink24_RadioStackConfig radioCfg;
// get current radio config
if (wimod.GetRadioStackConfig(&radioCfg)) {
// check / process
...
}
Here is the call graph for this function:

◆ GetRtc()

bool WiMODGlobalLink24::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
rtcTimePointer where to store the RTC information
See also
WIMOD_RTC_GET_* Macros for conversation of this value
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif 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 WiMODGlobalLink24::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
rtcAlarmPointer to a structure where to store the RTC alarm related information
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
// create a local variable
// 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:

◆ GetSupportedBands()

bool WiMODGlobalLink24::GetSupportedBands ( TWiMODGlobalLink24_SupportedBands supportedBands,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Get the supported bands of this firmware.

Parameters
supportedBandspointer to store area for result
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
Here is the call graph for this function:

◆ GetSystemStatus()

bool WiMODGlobalLink24::GetSystemStatus ( TWiMODLR_DevMgmt_SystemStatusLorawan info,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

See also
HCI command specification.
Parameters
infopointer for storing the requested information (structure)
hciResultpointer for storing the the local HCI transfer result. This is an optional parameter.
rspStatuspointer to store the response code of the WiMOD This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
// create a local variable
// 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:

◆ JoinNetwork()

bool WiMODGlobalLink24::JoinNetwork ( TWiMODLRResultCodes 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
TWiMODLRResultCodes for interpretation of the values
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
msc_inline_mscgraph_9
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:

◆ Ping()

bool WiMODGlobalLink24::Ping ( TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

See also
HCI command specification.
Parameters
hciResultpointer for storing the the local HCI transfer result. This is an optional parameter.
rspStatuspointer to store the response code of the WiMOD This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
if (wimod.Ping()) {
// success ...
} else {
// error ...
}

OR:

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

OR:

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:

◆ ReactivateDevice()

bool WiMODGlobalLink24::ReactivateDevice ( UINT32 *  devAdr,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Re-Activates the device via the ABP 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 ABP ONLY!)

See also
TWiMODLRResultCodes for interpretation of the values
Parameters
devAdrpointer where the store the "received" device address
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
msc_inline_mscgraph_10
// 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:

◆ RegisterJoinedNwkIndicationClient()

void WiMODGlobalLink24::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
cbpointer to a callback function that should be called if the event occurs.
msc_inline_mscgraph_11
Here is the call graph for this function:

◆ RegisterJoinTxIndicationClient()

void WiMODGlobalLink24::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
cbpointer 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
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:

◆ RegisterNoDataIndicationClient()

void WiMODGlobalLink24::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
cbpointer to a callback function that should be called if the event occurs.
msc_inline_mscgraph_12
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:

◆ RegisterPowerUpIndicationClient()

void WiMODGlobalLink24::RegisterPowerUpIndicationClient ( TDevMgmtPowerUpCallback  cb)

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

See also
TWiMODLRResultCodes for interpretation of the values
Parameters
cbPointer a callback function
See also
TDevMgmtPowerUpCallback for details
msc_inline_mscgraph_13
// 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 WiMODGlobalLink24::RegisterRtcAlarmIndicationClient ( TDevMgmtRtcAlarmCallback  cb)

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

See also
TWiMODLRResultCodes for interpretation of the values
Parameters
cbPointer a callback function
See also
TDevMgmtRtcAlarmCallback for details
msc_inline_mscgraph_14
// 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:

◆ RegisterRxAckIndicationClient()

void WiMODGlobalLink24::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
cbpointer to a callback function that should be called if the event occurs.
msc_inline_mscgraph_15
Here is the call graph for this function:

◆ RegisterRxCDataIndicationClient()

void WiMODGlobalLink24::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
cbpointer to a callback function that should be called if the event occurs.
msc_inline_mscgraph_16
Here is the call graph for this function:

◆ RegisterRxMacCmdIndicationClient()

void WiMODGlobalLink24::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
cbpointer to a callback function that should be called if the event occurs.
msc_inline_mscgraph_17
Here is the call graph for this function:

◆ RegisterRxUDataIndicationClient()

void WiMODGlobalLink24::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
cbpointer to a callback function that should be called if the event occurs.
msc_inline_mscgraph_18
Here is the call graph for this function:

◆ RegisterTxCDataIndicationClient()

void WiMODGlobalLink24::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
cbpointer to a callback function that should be called if the event occurs.
msc_inline_mscgraph_19
void myTxInd(TWiMODLR_HCIMessage& rxMsg) {
// 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:

◆ RegisterTxUDataIndicationClient()

void WiMODGlobalLink24::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
cbpointer to a callback function that should be called if the event occurs.
msc_inline_mscgraph_20
void myTxInd(TWiMODLR_HCIMessage& rxMsg) {
// 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:

◆ Reset()

bool WiMODGlobalLink24::Reset ( TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Reset Cmd - Reboots the WiMOD module.

See also
HCI command specification.
Parameters
hciResultpointer for storing the the local HCI transfer result. This is an optional parameter.
rspStatuspointer to store the response code of the WiMOD This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
Here is the call graph for this function:

◆ SendCData()

bool WiMODGlobalLink24::SendCData ( const TWiMODGlobalLink24_TX_Data data,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

Parameters
datapointer to data structure containing the TX-data and options.
See also
TWiMODGlobalLink24_TX_Data for details
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
msc_inline_mscgraph_21
...
// local variable
TWiMODGlobalLink24_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:

◆ SendMacCmd()

bool WiMODGlobalLink24::SendMacCmd ( const TWiMODGlobalLink24_MacCmd cmd,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

Parameters
cmdpointer containing the MAC command and parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
...
// (local) variable
TWiMODGlobalLink24_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:

◆ SendUData()

bool WiMODGlobalLink24::SendUData ( const TWiMODGlobalLink24_TX_Data data,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

Parameters
datapointer to data structure containing the TX-data and options.
See also
TWiMODGlobalLink24_TX_Data for details
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
msc_inline_mscgraph_22
...
// local variable
TWiMODGlobalLink24_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:

◆ SetBatteryLevelStatus()

bool WiMODGlobalLink24::SetBatteryLevelStatus ( UINT8  battStatus,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Set the Battry Level Status.


**


**

Parameters
battStatusStatus value; 0 : mains power, 1-254 : batt level; 255: undefiend
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
Here is the call graph for this function:

◆ SetCustomConfig()

bool WiMODGlobalLink24::SetCustomConfig ( const INT8  rfGain,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

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

Parameters
rfGainnew rfGain value for tx power settings; see HCI Spec.
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
Here is the call graph for this function:

◆ SetDeviceEUI()

bool WiMODGlobalLink24::SetDeviceEUI ( const UINT8 *  deviceEUI,
TWiMODLRResultCodes 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
deviceEUIpointer to data structure containing the new parameters (Must be an pointer of a 64bit address)
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif 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:

◆ SetHciConfig()

bool WiMODGlobalLink24::SetHciConfig ( TWiMODLR_DevMgmt_HciConfig hciConfig,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Sets a new HCI configuration of the WiMOD.

See also
HCI documentation and feature specification for details
Warning
Changing the Baudrate applies instandly afer the command is executed!
Parameters
hciConfigPointer to a structure where to store the HCI config related information
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
// create a local variable
// create new config values
...
// set information of WiMOD
wimod.GetHciConfig(&hciConfig);
...
Here is the call graph for this function:

◆ SetJoinParameter()

bool WiMODGlobalLink24::SetJoinParameter ( TWiMODGlobalLink24_JoinParams joinParams,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Sets the parameters used for the OTAA activation procedure.

See also
TWiMODLRResultCodes for interpretation of the values
Parameters
joinParamsstructure holding the necessary parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
// OTAA data
const char JOINEUI[] = { 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
// setup parameters
memcpy(joinParams.JoinEUI, JOINEUI, 8);
memcpy(joinParams.AppKey, APPKEY, 16);
// transfer parameters to WiMOD
wimod.SetJoinParameter(joinParams);
...
Here is the call graph for this function:

◆ SetOperationMode()

bool WiMODGlobalLink24::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
opModeThe new operation mode to set
See also
TWiMOD_OperationMode for details
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
// create a local variable
// set new operation mode
// set information of WiMOD
wimod.SetOperationMode(opMode);
...
Here is the call graph for this function:

◆ SetRadioStackConfig()

bool WiMODGlobalLink24::SetRadioStackConfig ( TWiMODGlobalLink24_RadioStackConfig data,
TWiMODLRResultCodes hciResult = NULL,
UINT8 *  rspStatus = NULL 
)

Sets a new radio config parameter set of the WiMOD.

Parameters
datapointer to data structure containing the new parameters
See also
TWiMODGlobalLink24_TX_Data for details
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
...
// local variable
TWiMODGlobalLink24_RadioStackConfig radioCfg;
// setup new config
radioCfg.DataRateIndex = (uint8_t) LoRaWAN_DataRate_WW2G4_LoRa_SF9_812kHz;
radioCfg.TXPowerLevel = LORAWAN_TX_POWER_LEVEL_MIN;
radioCfg.Options = LORAWAN_STK_OPTION_ADR |
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:

◆ SetRtc()

bool WiMODGlobalLink24::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
rtcTimeRTC information to setup
See also
WIMOD_RTC_MAKE_DATETIME_U32 Macro for conversation of this value
Parameters
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif 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 WiMODGlobalLink24::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
rtcAlarmPointer to a structure containing the RTC alarm related information
hciResultResult of the local command transmission to module This is an optional parameter.
rspStatusStatus byte contained in the local response of the module This is an optional parameter.
Return values
trueif everything is ok
falseif something went wrong; see hciResult & rspStatus for details
msc_inline_mscgraph_23
// create a local variable
// 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:

The documentation for this class was generated from the following files:
WIMOD_RTC_GET_MONTHS
#define WIMOD_RTC_GET_MONTHS(t)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:547
LORAWAN_STK_OPTION_DEV_CLASS_C
#define LORAWAN_STK_OPTION_DEV_CLASS_C
Definition: WiMOD_SAP_LORAWAN_IDs.h:270
WiMODLR_RESULT_SLIP_ENCODER_ERROR
@ WiMODLR_RESULT_SLIP_ENCODER_ERROR
Definition: WiMODLRHCI.h:155
TWiMODLORAWAN_ActivateDeviceData::AppSKey
UINT8 AppSKey[WiMODLORAWAN_APP_SESSION_KEY_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:443
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
TWiMODLR_DevMgmt_HciConfig::BaudrateID
TWiMOD_HCI_Baudrate BaudrateID
Definition: WiMOD_SAP_DEVMGMT_IDs.h:525
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_HCIMessage
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
TWiMODLORAWAN_JoinParams::AppKey
UINT8 AppKey[WiMODLORAWAN_APP_KEY_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:453
WiMODLR_RESULT_OK
@ WiMODLR_RESULT_OK
Definition: WiMODLRHCI.h:151
TWiMODLORAWAN_TxIndData::NumTxPackets
UINT8 NumTxPackets
Definition: WiMOD_SAP_LORAWAN_IDs.h:482
TWiMODGlobalLink24_ActivateDeviceData
Definition: WiMOD_SAP_GlobalLink24.h:93
TWiMODLR_DevMgmt_DevInfo::DevAdr
UINT16 DevAdr
Definition: WiMOD_SAP_DEVMGMT_IDs.h:176
TWiMODLR_DevMgmt_RtcAlarm
Structure containing the RTC Alarm config parameters of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:484
TWiMODGlobalLink24_RX_Data
Definition: WiMOD_SAP_GlobalLink24.h:97
LoRaWAN_DataRate_WW2G4_LoRa_SF9_812kHz
@ LoRaWAN_DataRate_WW2G4_LoRa_SF9_812kHz
Definition: WiMOD_SAP_GlobalLink24_IDs_WW2G4.h:94
TWiMODLR_DevMgmt_SystemStatus::SysTickCounter
UINT32 SysTickCounter
Definition: WiMOD_SAP_DEVMGMT_IDs.h:238
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
TWiMODGlobalLink24_TxIndData
Definition: WiMOD_SAP_GlobalLink24.h:95
WimodHciBaudrate_57600
@ WimodHciBaudrate_57600
Definition: WiMOD_SAP_DEVMGMT_IDs.h:506
TWiMODLORAWAN_JoinParams::JoinEUI
UINT8 JoinEUI[WiMODLORAWAN_JOIN_EUI_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:452
LORAWAN_STK_OPTION_ADR
#define LORAWAN_STK_OPTION_ADR
Definition: WiMOD_SAP_LORAWAN_IDs.h:268
TWiMODLR_DevMgmt_FwInfo::FirmwareMinorVersion
UINT8 FirmwareMinorVersion
Definition: WiMOD_SAP_DEVMGMT_IDs.h:223
WIMOD_RTC_GET_SECONDS
#define WIMOD_RTC_GET_SECONDS(t)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:543
TWiMODLR_DevMgmt_DevInfo::ModuleType
UINT8 ModuleType
Definition: WiMOD_SAP_DEVMGMT_IDs.h:175
TWiMODGlobalLink24_JoinParams
Definition: WiMOD_SAP_GlobalLink24.h:94
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
TWiMODLR_DevMgmt_FwInfo::FirmwareName
UINT8 FirmwareName[WIMOD_DEVMGMT_MAX_FIRMWARE_NAME_LEN]
Definition: WiMOD_SAP_DEVMGMT_IDs.h:227
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
TWiMODLR_DevMgmt_SystemStatus::BatteryStatus
UINT16 BatteryStatus
Definition: WiMOD_SAP_DEVMGMT_IDs.h:241
WiMODGlobalLink24.h
TWiMODLR_DevMgmt_DevInfo
Structure containing basic information about the WiMOD device.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:172
WiMODLR_RESULT_PAYLOAD_PTR_ERROR
@ WiMODLR_RESULT_PAYLOAD_PTR_ERROR
Definition: WiMODLRHCI.h:153
LORAWAN_STK_OPTION_EXT_PKT_FORMAT
#define LORAWAN_STK_OPTION_EXT_PKT_FORMAT
Definition: WiMOD_SAP_LORAWAN_IDs.h:273
TWiMODLRResultCodes
TWiMODLRResultCodes
Result codes for the local serial communication itself.
Definition: WiMODLRHCI.h:149
TWiMODLR_DevMgmt_FwInfo::FirmwareMayorVersion
UINT8 FirmwareMayorVersion
Definition: WiMOD_SAP_DEVMGMT_IDs.h:224
TWiMODGlobalLink24_RX_MacCmdData
Definition: WiMOD_SAP_GlobalLink24.h:98
WiMODLR_RESULT_NO_RESPONSE
@ WiMODLR_RESULT_NO_RESPONSE
Definition: WiMODLRHCI.h:156
TWiMODLR_DevMgmt_HciConfig
HCI Configuration Parameters.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:519
WiMODGlobalLink24
Main class representing the interface to the WiMOD running the firmware GlobalLink24 EndNode Modem.
Definition: WiMODGlobalLink24.h:93
TWiMODLR_DevMgmt_HciConfig::NumWakeUpChars
UINT16 NumWakeUpChars
Definition: WiMOD_SAP_DEVMGMT_IDs.h:526
TWiMODLORAWAN_ActivateDeviceData::DeviceAddress
UINT32 DeviceAddress
Definition: WiMOD_SAP_LORAWAN_IDs.h:441
TWiMODGlobalLink24_RX_ACK_Data
Definition: WiMOD_SAP_GlobalLink24.h:102
TWiMODLORAWAN_ActivateDeviceData::NwkSKey
UINT8 NwkSKey[WiMODLORAWAN_NWK_SESSION_KEY_LEN]
Definition: WiMOD_SAP_LORAWAN_IDs.h:442
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
TWiMODGlobalLink24_RX_JoinedNwkData
Definition: WiMOD_SAP_GlobalLink24.h:99
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