RadioLib
Universal wireless communication library for Arduino
Loading...
Searching...
No Matches
LoRaWANPackageManager Class Reference

Interface to manage multiple LoRaWAN application packages. More...

#include <LoRaWANPacMan.h>

Public Types

typedef RadioLibTime_t(* GetSecondsCb_t) ()
typedef void(* SetSecondsCb_t) (RadioLibTime_t seconds)
typedef void(* DelaySecondsCb_t) (RadioLibTime_t seconds)
typedef void(* UplinkIntervalCb_t) (RadioLibTime_t intervalSeconds)
typedef void(* ConfirmedCb_t) (bool confirmed)
typedef void(* RebootCb_t) ()

Public Member Functions

 LoRaWANPackageManager (RadioLibHal *hal, LoRaWANNode *node, GetSecondsCb_t secondsCb)
 Create a package manager.
int16_t enableTS003 (uint8_t fPort, SetSecondsCb_t setSecondsFunc)
 Enable TS003 Application Time Synchronization package.
int16_t enableTS007 ()
 Enable TS007 Multi-package Access Control package.
int16_t enableTS009 (PhysicalLayer *radio, DelaySecondsCb_t delayCb, UplinkIntervalCb_t intervalCb, ConfirmedCb_t confirmedCb, RebootCb_t rebootCb)
 Enable TS009 Certification Protocol package.
void requestAppTime ()
 Send an application time request.
int16_t processDownlink (const uint8_t *data, size_t len, LoRaWANEvent_t *eventDown)
 Process a multi-package downlink payload (TS007 section 3.1).
bool handleTask (RadioLibTime_t *tNext)
 Execute any due tasks across all packages and report when the manager next needs servicing.
bool getUplinkData (uint8_t *dataOut, size_t *lenOut, uint8_t *fPort)
 Fetch uplink data from the first package reporting an UPLINK task.
bool isEnabledFPort (uint8_t fPort)

Detailed Description

Interface to manage multiple LoRaWAN application packages.

Constructor & Destructor Documentation

◆ LoRaWANPackageManager()

LoRaWANPackageManager::LoRaWANPackageManager ( RadioLibHal * hal,
LoRaWANNode * node,
GetSecondsCb_t secondsCb )

Create a package manager.

Parameters
halPointer to RadioLib HAL
nodePointer to the LoRaWAN node
getSecondsPointer to getSeconds() function for time handling

Member Function Documentation

◆ enableTS003()

int16_t LoRaWANPackageManager::enableTS003 ( uint8_t fPort,
SetSecondsCb_t setSecondsFunc )

Enable TS003 Application Time Synchronization package.

Parameters
fPortThe FPort to which this package will listen
setSecondsFuncPointer to setSeconds() function
Returns
Status Codes

◆ enableTS007()

int16_t LoRaWANPackageManager::enableTS007 ( )

Enable TS007 Multi-package Access Control package.

Returns
Status Codes

◆ enableTS009()

int16_t LoRaWANPackageManager::enableTS009 ( PhysicalLayer * radio,
DelaySecondsCb_t delayCb,
UplinkIntervalCb_t intervalCb,
ConfirmedCb_t confirmedCb,
RebootCb_t rebootCb )

Enable TS009 Certification Protocol package.

Parameters
radioPointer to the PhysicalLayer radio instance for RF testing.
delayCbCallback to delay for a number of seconds during RF testing.
intervalCbCallback to set the uplink interval for the device.
confirmedCbCallback to set whether subsequent uplinks should be confirmed.
rebootCbCallback to perform a device reboot.
Returns
Status Codes

◆ getUplinkData()

bool LoRaWANPackageManager::getUplinkData ( uint8_t * dataOut,
size_t * lenOut,
uint8_t * fPort )

Fetch uplink data from the first package reporting an UPLINK task.

Parameters
dataOutPointer to uplink buffer
lenOutPointer to uplink length
fPortPointer to uplink FPort
Returns
true if data was fetched, false otherwise

◆ handleTask()

bool LoRaWANPackageManager::handleTask ( RadioLibTime_t * tNext)

Execute any due tasks across all packages and report when the manager next needs servicing.

Parameters
tNextPointer that receives the relative time (in seconds) until the next task. Returns 0 if uplink data is ready to be sent now. It includes dutycycle constraints if applicable.
Returns
true if any package has a pending or scheduled task, false otherwise

◆ processDownlink()

int16_t LoRaWANPackageManager::processDownlink ( const uint8_t * data,
size_t len,
LoRaWANEvent_t * eventDown )

Process a multi-package downlink payload (TS007 section 3.1).

Parameters
dataPointer to incoming payload
lenLength of incoming payload
eventDownPointer to LoRaWANEvent_t downlink event struct
Returns
Status Codes

◆ requestAppTime()

void LoRaWANPackageManager::requestAppTime ( )

Send an application time request.

Returns
Status Codes

The documentation for this class was generated from the following files:
  • src/protocols/LoRaWAN/LoRaWANPacMan.h
  • src/protocols/LoRaWAN/LoRaWANPacMan.cpp