mbed-os/features/lorawan/LoRaWANInterface.cpp

207 lines
6.0 KiB
C++
Raw Normal View History

Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
/**
* @file
*
* @brief Implementation of LoRaWANBase
*
* Copyright (c) 2017, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "lorawan/LoRaWANInterface.h"
using namespace events;
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
inline LoRaWANStack& stk_obj()
{
return LoRaWANStack::get_lorawan_stack();
}
Architecture rework, bug fixing & missing features MAC layer is now a class rather than being a blob. In addition to that Mac commands are now being handled in a seperate subsystem (a class of its own). In future we will do the same with othe sublayers of MAC like MLME, MCPS etc. The drive behind this exercise is to make MAC and supporting layers into an object oriented system. Major bug fixes include: - last join time inclusion in band parameters - disabling rx2 window if we missed the slot already - MLME uplink schdule hook - nbRep according to spec - maintaining datarate after successful joining - suppressing MLME requests if MAC is in TX_DELAYED state - Uplink dwell time verification Some missing features are implemented. Details are as follows. Support for LinkCheckRequet: An application API is added, add_link_check_request() to delegate a request for Link Check Request MAC command. * Application provides a callback function that needs to be called on reception of link check response. * Mac command is piggybacked with data frames. This API makes the sticky MAC command stick with the application payloads until/unless the application un-sticks the said mac command using remove_link_check_request() API. Handling fPending bit: If in the Downlink, we get the fPending bit set in fctrl octet, we attempt to send an empty message back to Network Server to open additional Receive windows. This operation is independent of the application. An RX_DONE event is queued bedore generating the said empty message. Specification does not mention what can be the type of that empty message. We have decided it to be of CONFIRMED type as it gives us an added benefit of retries if the corresponding RX slots are missed. Radio event callbacks as Mbed callbacks: radio_events_t structure has been carrying C-style callbacks which was inherited from the legacy code. These callbacks has now been changed to Mbed Callbacks that makes sure that we can be object oriented from now on.
2017-12-15 10:30:40 +00:00
LoRaWANInterface::LoRaWANInterface(LoRaRadio& radio) : _link_check_requested(false)
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
// Pass mac_handlers to radio to the radio driver after
// binding radio driver to PHY layer
radio_events_t *events = stk_obj().bind_radio_driver(radio);
radio.lock();
radio.init_radio(events);
radio.unlock();
}
LoRaWANInterface::~LoRaWANInterface()
{
}
lorawan_status_t LoRaWANInterface::initialize(EventQueue *queue)
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
if(!queue) {
return LORAWAN_STATUS_PARAMETER_INVALID;
}
return stk_obj().initialize_mac_layer(queue);
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
}
lorawan_status_t LoRaWANInterface::connect()
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
// connection attempt without parameters.
// System tries to look for configuration in mbed_lib.json that can be
// overridden by mbed_app.json. However, if none of the json files are
// available (highly unlikely), we still fallback to some default parameters.
// Check lorawan_data_structure for fallback defaults.
lorawan_connect_t connection_params;
if (MBED_CONF_LORA_OVER_THE_AIR_ACTIVATION) {
static uint8_t dev_eui[] = MBED_CONF_LORA_DEVICE_EUI;
static uint8_t app_eui[] = MBED_CONF_LORA_APPLICATION_EUI;
static uint8_t app_key[] = MBED_CONF_LORA_APPLICATION_KEY;
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
/**
*
* OTAA join
*/
connection_params.connect_type = LORAWAN_CONNECTION_OTAA;
connection_params.connection_u.otaa.app_eui = app_eui;
connection_params.connection_u.otaa.dev_eui = dev_eui;
connection_params.connection_u.otaa.app_key = app_key;
connection_params.connection_u.otaa.nb_trials = MBED_CONF_LORA_NB_TRIALS;
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
return connect(connection_params);
} else {
static uint8_t nwk_skey[] = MBED_CONF_LORA_NWKSKEY;
static uint8_t app_skey[] = MBED_CONF_LORA_APPSKEY;
static uint32_t dev_addr = MBED_CONF_LORA_DEVICE_ADDRESS;
static uint32_t nwk_id = (MBED_CONF_LORA_DEVICE_ADDRESS & LORAWAN_NETWORK_ID_MASK);
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
/**
*
* ABP connection
*/
connection_params.connect_type = LORAWAN_CONNECTION_ABP;
connection_params.connection_u.abp.nwk_id = nwk_id;
connection_params.connection_u.abp.dev_addr = dev_addr;
connection_params.connection_u.abp.nwk_skey = nwk_skey;
connection_params.connection_u.abp.app_skey = app_skey;
return connect(connection_params);
}
}
lorawan_status_t LoRaWANInterface::connect(const lorawan_connect_t &connect)
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
lorawan_status_t mac_status;
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
if (connect.connect_type == LORAWAN_CONNECTION_OTAA) {
mac_status = stk_obj().join_request_by_otaa(connect);
} else if (connect.connect_type == LORAWAN_CONNECTION_ABP) {
mac_status = stk_obj().activation_by_personalization(connect);
} else {
return LORAWAN_STATUS_PARAMETER_INVALID;
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
}
return mac_status;
}
lorawan_status_t LoRaWANInterface::disconnect()
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
return stk_obj().shutdown();
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
}
lorawan_status_t LoRaWANInterface::add_link_check_request()
Architecture rework, bug fixing & missing features MAC layer is now a class rather than being a blob. In addition to that Mac commands are now being handled in a seperate subsystem (a class of its own). In future we will do the same with othe sublayers of MAC like MLME, MCPS etc. The drive behind this exercise is to make MAC and supporting layers into an object oriented system. Major bug fixes include: - last join time inclusion in band parameters - disabling rx2 window if we missed the slot already - MLME uplink schdule hook - nbRep according to spec - maintaining datarate after successful joining - suppressing MLME requests if MAC is in TX_DELAYED state - Uplink dwell time verification Some missing features are implemented. Details are as follows. Support for LinkCheckRequet: An application API is added, add_link_check_request() to delegate a request for Link Check Request MAC command. * Application provides a callback function that needs to be called on reception of link check response. * Mac command is piggybacked with data frames. This API makes the sticky MAC command stick with the application payloads until/unless the application un-sticks the said mac command using remove_link_check_request() API. Handling fPending bit: If in the Downlink, we get the fPending bit set in fctrl octet, we attempt to send an empty message back to Network Server to open additional Receive windows. This operation is independent of the application. An RX_DONE event is queued bedore generating the said empty message. Specification does not mention what can be the type of that empty message. We have decided it to be of CONFIRMED type as it gives us an added benefit of retries if the corresponding RX slots are missed. Radio event callbacks as Mbed callbacks: radio_events_t structure has been carrying C-style callbacks which was inherited from the legacy code. These callbacks has now been changed to Mbed Callbacks that makes sure that we can be object oriented from now on.
2017-12-15 10:30:40 +00:00
{
_link_check_requested = true;
return stk_obj().set_link_check_request();
}
void LoRaWANInterface::remove_link_check_request()
{
_link_check_requested = false;
}
lorawan_status_t LoRaWANInterface::set_datarate(uint8_t data_rate)
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
return stk_obj().set_channel_data_rate(data_rate);
}
lorawan_status_t LoRaWANInterface::set_confirmed_msg_retries(uint8_t count)
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
return stk_obj().set_confirmed_msg_retry(count);
}
lorawan_status_t LoRaWANInterface::enable_adaptive_datarate()
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
return stk_obj().enable_adaptive_datarate(true);
}
lorawan_status_t LoRaWANInterface::disable_adaptive_datarate()
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
return stk_obj().enable_adaptive_datarate(false);
}
lorawan_status_t LoRaWANInterface::set_channel_plan(const lorawan_channelplan_t &channel_plan)
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
return stk_obj().add_channels(channel_plan);
}
lorawan_status_t LoRaWANInterface::get_channel_plan(lorawan_channelplan_t &channel_plan)
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
return stk_obj().get_enabled_channels(channel_plan);
}
lorawan_status_t LoRaWANInterface::remove_channel(uint8_t id)
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
return stk_obj().remove_a_channel(id);
}
lorawan_status_t LoRaWANInterface::remove_channel_plan()
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
{
return stk_obj().drop_channel_list();
}
int16_t LoRaWANInterface::send(uint8_t port, const uint8_t* data,
uint16_t length, int flags)
{
Architecture rework, bug fixing & missing features MAC layer is now a class rather than being a blob. In addition to that Mac commands are now being handled in a seperate subsystem (a class of its own). In future we will do the same with othe sublayers of MAC like MLME, MCPS etc. The drive behind this exercise is to make MAC and supporting layers into an object oriented system. Major bug fixes include: - last join time inclusion in band parameters - disabling rx2 window if we missed the slot already - MLME uplink schdule hook - nbRep according to spec - maintaining datarate after successful joining - suppressing MLME requests if MAC is in TX_DELAYED state - Uplink dwell time verification Some missing features are implemented. Details are as follows. Support for LinkCheckRequet: An application API is added, add_link_check_request() to delegate a request for Link Check Request MAC command. * Application provides a callback function that needs to be called on reception of link check response. * Mac command is piggybacked with data frames. This API makes the sticky MAC command stick with the application payloads until/unless the application un-sticks the said mac command using remove_link_check_request() API. Handling fPending bit: If in the Downlink, we get the fPending bit set in fctrl octet, we attempt to send an empty message back to Network Server to open additional Receive windows. This operation is independent of the application. An RX_DONE event is queued bedore generating the said empty message. Specification does not mention what can be the type of that empty message. We have decided it to be of CONFIRMED type as it gives us an added benefit of retries if the corresponding RX slots are missed. Radio event callbacks as Mbed callbacks: radio_events_t structure has been carrying C-style callbacks which was inherited from the legacy code. These callbacks has now been changed to Mbed Callbacks that makes sure that we can be object oriented from now on.
2017-12-15 10:30:40 +00:00
if (_link_check_requested) {
// add a link check request with normal data, until the application
// explicitly removes it.
add_link_check_request();
}
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
if (data) {
return stk_obj().handle_tx(port, data, length, flags);
} else {
return LORAWAN_STATUS_PARAMETER_INVALID;
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
}
}
int16_t LoRaWANInterface::receive(uint8_t port, uint8_t* data, uint16_t length,
int flags)
{
if (data && length > 0) {
return stk_obj().handle_rx(port, data, length, flags);
} else {
return LORAWAN_STATUS_PARAMETER_INVALID;
Adding LoRaWANInterface - implementing, LoRaWANBase This class is the doorway for the user application into the Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase and hence would work with any stack implementation underneath, ensuring seemless portability for applications. It takes a pre-constructed object of LoRaRadio and delegates it in the downward direction. Before calling connect() user must call initialize() function in order to initialize stack and mac layers. connect() APIs can be used to either provide relevent keys and connection method at runtime or compile time (using Mbed config system). enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off automatic rate control. Otherwisem set_datarate() could be used to set a particular data rate on the current channel. set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will retry for a given number of times before timing out. set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan. These APIs are particularly useful in case of ABP (activation by personalization). Because in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list) sent by the base station in conjunction with Network server. This list overwrites all user configured channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the parameter for number of channels to 1. remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific channel. send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here. lora_event_callback() API is used to set a callback function from the application side which is used by the stack to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2017-11-27 13:34:56 +00:00
}
}
lorawan_status_t LoRaWANInterface::add_app_callbacks(lorawan_app_callbacks_t *callbacks)
{
if (!callbacks || !callbacks->events) {
// Event Callback is mandatory
return LORAWAN_STATUS_PARAMETER_INVALID;
}
stk_obj().set_lora_callbacks(callbacks);
return LORAWAN_STATUS_OK;
}