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

Common interface for all application packages. More...

#include <LoRaWANPacMan.h>

Inheritance diagram for LoRaWANPackage:
LoRaWANPackageTS003 LoRaWANPackageTS009

Public Types

typedef RadioLibTime_t(* GetSecondsCb_t) ()

Public Member Functions

 LoRaWANPackage (const LoRaWANPackage &obj)=delete
virtual size_t processData (const uint8_t *dataIn, size_t lenIn, uint8_t *dataOut, size_t *lenOut, LoRaWANEvent_t *event)
 Process a single package command, writing any answer into the buffer provided by the package manager.
virtual bool handleTask (RadioLibTime_t *tNext, bool *uplinkDue)
 Execute any scheduled task that is due now and report when this package next needs servicing. When an uplink is due now it reports so via uplinkDue; the bytes are produced later by buildUplink() at the actual moment of transmission.
virtual size_t buildUplink (uint8_t *dataOut)
 Build the uplink that handleTask() reported as due, at the moment of transmission, and advance the package's transmit schedule.
RadioLibTime_t getSeconds ()
 Get current time via the stored callback.

Detailed Description

Common interface for all application packages.

Member Function Documentation

◆ buildUplink()

size_t LoRaWANPackage::buildUplink ( uint8_t * dataOut)
virtual

Build the uplink that handleTask() reported as due, at the moment of transmission, and advance the package's transmit schedule.

Parameters
dataOutPointer to the manager's answer buffer (write uplink here)
Returns
Number of uplink bytes written (0 if nothing to send)

Reimplemented in LoRaWANPackageTS003.

◆ getSeconds()

RadioLibTime_t LoRaWANPackage::getSeconds ( )
inline

Get current time via the stored callback.

Returns
Current time in seconds from the callback

◆ handleTask()

bool LoRaWANPackage::handleTask ( RadioLibTime_t * tNext,
bool * uplinkDue )
virtual

Execute any scheduled task that is due now and report when this package next needs servicing. When an uplink is due now it reports so via uplinkDue; the bytes are produced later by buildUplink() at the actual moment of transmission.

Parameters
tNextPointer that receives the time of the next task.
uplinkDuePointer set to true if an uplink is ready to be sent now.
Returns
true if the package has a pending or scheduled task, false otherwise

Reimplemented in LoRaWANPackageTS003.

◆ processData()

size_t LoRaWANPackage::processData ( const uint8_t * dataIn,
size_t lenIn,
uint8_t * dataOut,
size_t * lenOut,
LoRaWANEvent_t * event )
virtual

Process a single package command, writing any answer into the buffer provided by the package manager.

Parameters
dataInPointer to incoming command data
lenInLength of incoming data
dataOutPointer to the manager's answer buffer (write answer here)
lenOutPointer that receives the number of answer bytes written
eventDownlink event details
Returns
Number of bytes consumed

Reimplemented in LoRaWANPackageTS003, and LoRaWANPackageTS009.


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