Interface to manage multiple LoRaWAN application packages.
More...
#include <LoRaWANPacMan.h>
|
|
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) () |
|
| | 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) |
Interface to manage multiple LoRaWAN application packages.
◆ LoRaWANPackageManager()
| LoRaWANPackageManager::LoRaWANPackageManager |
( |
RadioLibHal * | hal, |
|
|
LoRaWANNode * | node, |
|
|
GetSecondsCb_t | secondsCb ) |
Create a package manager.
- Parameters
-
| hal | Pointer to RadioLib HAL |
| node | Pointer to the LoRaWAN node |
| getSeconds | Pointer to getSeconds() function for time handling |
◆ enableTS003()
| int16_t LoRaWANPackageManager::enableTS003 |
( |
uint8_t | fPort, |
|
|
SetSecondsCb_t | setSecondsFunc ) |
Enable TS003 Application Time Synchronization package.
- Parameters
-
| fPort | The FPort to which this package will listen |
| setSecondsFunc | Pointer 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
-
| radio | Pointer to the PhysicalLayer radio instance for RF testing. |
| delayCb | Callback to delay for a number of seconds during RF testing. |
| intervalCb | Callback to set the uplink interval for the device. |
| confirmedCb | Callback to set whether subsequent uplinks should be confirmed. |
| rebootCb | Callback 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
-
| dataOut | Pointer to uplink buffer |
| lenOut | Pointer to uplink length |
| fPort | Pointer to uplink FPort |
- Returns
- true if data was fetched, false otherwise
◆ handleTask()
Execute any due tasks across all packages and report when the manager next needs servicing.
- Parameters
-
| tNext | Pointer 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
-
| data | Pointer to incoming payload |
| len | Length of incoming payload |
| eventDown | Pointer to LoRaWANEvent_t downlink event struct |
- Returns
- Status Codes
◆ requestAppTime()
| void LoRaWANPackageManager::requestAppTime |
( |
| ) |
|
The documentation for this class was generated from the following files:
- src/protocols/LoRaWAN/LoRaWANPacMan.h
- src/protocols/LoRaWAN/LoRaWANPacMan.cpp