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(* RebootCb_t) ()
 

Public Member Functions

 LoRaWANPackageManager (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 enableTS009 (PhysicalLayer *radio, DelaySecondsCb_t delayCb, UplinkIntervalCb_t intervalCb, RebootCb_t rebootCb)
 Enable TS009 Certification Protocol package.
 
void requestAppTime ()
 Send an application time request.
 
bool getConfirmed ()
 Check whether subsequent uplinks should be confirmed.
 
int16_t processDownlink (const uint8_t *data, size_t len, LoRaWANEvent_t *eventDown)
 Process a multi-package downlink payload (TS007 section 3.1).
 
LoRaWANTaskInfo hasTask ()
 Query the next scheduled task across all packages and return the first.
 
bool getUplinkData (uint8_t *dataOut, size_t *lenOut, uint8_t *fPort)
 Fetch uplink data from the first package reporting an UPLINK task.
 
bool doAction ()
 Execute the first applicable ACTION task (calls package->doAction()).
 
size_t processPackageManagerData (uint8_t *dataDown, size_t lenDown, uint8_t *ansOut, size_t *ansLen)
 Process TS007 package management commands at the manager level.
 
bool isEnabledFPort (uint8_t fPort)
 

Detailed Description

Interface to manage multiple LoRaWAN application packages.

Constructor & Destructor Documentation

◆ LoRaWANPackageManager()

LoRaWANPackageManager::LoRaWANPackageManager ( LoRaWANNode node,
GetSecondsCb_t  secondsCb 
)

Create a package manager.

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

Member Function Documentation

◆ doAction()

bool LoRaWANPackageManager::doAction ( )

Execute the first applicable ACTION task (calls package->doAction()).

Returns
true if an action was performed, false otherwise

◆ 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

◆ enableTS009()

int16_t LoRaWANPackageManager::enableTS009 ( PhysicalLayer radio,
DelaySecondsCb_t  delayCb,
UplinkIntervalCb_t  intervalCb,
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
rebootCbCallback to perform a device reboot
Returns
Status Codes

◆ getConfirmed()

bool LoRaWANPackageManager::getConfirmed ( )

Check whether subsequent uplinks should be confirmed.

Returns
true if uplinks should be confirmed, false otherwise

◆ 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

◆ hasTask()

LoRaWANTaskInfo LoRaWANPackageManager::hasTask ( )

Query the next scheduled task across all packages and return the first.

Returns
LoRaWANTaskInfo struct with time and action fields

◆ 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

◆ processPackageManagerData()

size_t LoRaWANPackageManager::processPackageManagerData ( uint8_t *  dataDown,
size_t  lenDown,
uint8_t *  ansOut,
size_t *  ansLen 
)

Process TS007 package management commands at the manager level.

Parameters
dataDownPointer to received downlink data
lenDownLength of downlink data
ansOutPointer to buffer for answer
ansLenPointer to store answer length
Returns
Number of bytes consumed from dataDown

◆ requestAppTime()

void LoRaWANPackageManager::requestAppTime ( )

Send an application time request.

Returns
Status Codes

The documentation for this class was generated from the following files: