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

LoRaWAN Application package for TS003 Application Time. More...

#include <LoRaWANPackageTS003.h>

Inheritance diagram for LoRaWANPackageTS003:
LoRaWANPackage

Public Types

typedef void(* SetSecondsCb_t) (RadioLibTime_t)
 Set the setSeconds callback function.
Public Types inherited from LoRaWANPackage
typedef RadioLibTime_t(* GetSecondsCb_t) ()

Public Member Functions

 LoRaWANPackageTS003 (const LoRaWANPackageTS003 &obj)=delete
size_t processData (const uint8_t *dataDown, size_t lenDown, uint8_t *dataOut, size_t *lenOut, LoRaWANEvent_t *event) override
 Process a single TS003 command, writing any answer into the provided buffer.
int16_t requestAppTime (bool force=false)
 Schedule an application time request to be sent at the next opportunity.
void setSecondsCb (SetSecondsCb_t setSecondsCb)
bool handleTask (RadioLibTime_t *tNext, bool *uplinkDue) override
 Report when the next AppTimeReq is due and whether one is due now. Does not build the payload (see buildUplink).
size_t buildUplink (uint8_t *dataOut) override
 Build the due AppTimeReq with the current time and advance the schedule. Called at the moment of transmission so the timestamp stays fresh.
Public Member Functions inherited from LoRaWANPackage
 LoRaWANPackage (const LoRaWANPackage &obj)=delete
RadioLibTime_t getSeconds ()
 Get current time via the stored callback.

Detailed Description

LoRaWAN Application package for TS003 Application Time.

Member Typedef Documentation

◆ SetSecondsCb_t

typedef void(* LoRaWANPackageTS003::SetSecondsCb_t) (RadioLibTime_t)

Set the setSeconds callback function.

Parameters
setSecondsCallback function to set device time

Member Function Documentation

◆ buildUplink()

size_t LoRaWANPackageTS003::buildUplink ( uint8_t * dataOut)
overridevirtual

Build the due AppTimeReq with the current time and advance the schedule. Called at the moment of transmission so the timestamp stays fresh.

Parameters
dataOutPointer to the manager's answer buffer
Returns
Number of uplink bytes written

Reimplemented from LoRaWANPackage.

◆ handleTask()

bool LoRaWANPackageTS003::handleTask ( RadioLibTime_t * tNext,
bool * uplinkDue )
overridevirtual

Report when the next AppTimeReq is due and whether one is due now. Does not build the payload (see buildUplink).

Parameters
tNextPointer that receives the time of the next task
uplinkDuePointer set to true if an AppTimeReq uplink is due now
Returns
true if a task is pending or scheduled, false otherwise

Reimplemented from LoRaWANPackage.

◆ processData()

size_t LoRaWANPackageTS003::processData ( const uint8_t * dataDown,
size_t lenDown,
uint8_t * dataOut,
size_t * lenOut,
LoRaWANEvent_t * event )
overridevirtual

Process a single TS003 command, writing any answer into the provided buffer.

Parameters
dataDownPointer to received command data
lenDownLength of command data
dataOutPointer to the manager's answer buffer
lenOutPointer that receives the number of answer bytes written
eventPointer to downlink event data
Returns
Number of bytes consumed

Reimplemented from LoRaWANPackage.

◆ requestAppTime()

int16_t LoRaWANPackageTS003::requestAppTime ( bool force = false)

Schedule an application time request to be sent at the next opportunity.

Parameters
forceRequire a response, even if the clock is already in sync
Returns
Status Codes

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