Mbed OS Reference
Loading...
Searching...
No Matches
lorawan_app_callbacks_t Struct Reference

Stack level callback functions. More...

#include <lorawan_types.h>

Data Fields

mbed::Callback< void(lorawan_event_t)> events
 Mandatory. More...
 
mbed::Callback< void(uint8_t, uint8_t)> link_check_resp
 This callback is optional. More...
 
mbed::Callback< uint8_t(void)> battery_level
 This callback is optional. More...
 

Detailed Description

Stack level callback functions.

'lorawan_app_callbacks_t' is a structure that holds pointers to the application provided methods which are needed to be called in response to certain requests. The structure is default constructed to set all pointers to NULL. So if the user does not provide the pointer, a response will not be posted. However, the 'lorawan_events' callback is mandatory to be provided as it contains essential events.

A link check request could be sent whenever the device tries to send a message and if the network server responds with a link check response, the stack notifies the application be calling the appropriate method set using 'link_check_resp' callback. The result is thus transported to the application via callback function provided.

'battery_level' callback goes in the down direction, i.e., it informs the stack about the battery level by calling a function provided by the upper layers.

Definition at line 247 of file lorawan_types.h.

Field Documentation

◆ events

Mandatory.

Event Callback must be provided

Definition at line 251 of file lorawan_types.h.

◆ link_check_resp

mbed::Callback<void(uint8_t, uint8_t)> link_check_resp

This callback is optional.

The first parameter to the callback function is the demodulation margin, and the second parameter is the number of gateways that successfully received the last request.

Definition at line 259 of file lorawan_types.h.

◆ battery_level

mbed::Callback<uint8_t(void)> battery_level

This callback is optional.

If the callback is not set, the stack returns 255 to gateway.

Battery level return value must follow the specification for DevStatusAns MAC command:

0       The end-device is connected to an external power source
1 - 254 The battery level, 1 being at minimum and 254 being at maximum
255     The end-device was not able to measure the battery level.

Definition at line 271 of file lorawan_types.h.