Commit Graph

2 Commits (6281073d8beab7bd479a02b1894428205828a06b)

Author SHA1 Message Date
Hasnain Virk 6281073d8b [IOTCELL-279] Using Application provided EventQueue
The EventQueue thread in LoRaMac.cpp is disbanded and the LoRaWAN
protocol is redesigned to store a pointer for an application
provided EventQueue. It means that now the stack runs in the
same thread as application. Application provided EventQueue is used
to defer ISRs from radio driver and timer callbacks as well as the
application events are queued to the same event loop.
2018-02-09 11:00:56 -06:00
Hasnain Virk f33ef6528b 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.
2018-02-09 11:00:56 -06:00