1#if !defined(_RADIOLIB_LORAWAN_PACKAGE_TS003_H) && !RADIOLIB_EXCLUDE_LORAWAN
2#define _RADIOLIB_LORAWAN_PACKAGE_TS003_H
4#include "LoRaWANPacMan.h"
13#define RADIOLIB_LORAWAN_TS003_PACKAGE_VERSION (0x00)
14#define RADIOLIB_LORAWAN_TS003_APP_TIME (0x01)
15#define RADIOLIB_LORAWAN_TS003_APP_TIME_PERIODICITY (0x02)
16#define RADIOLIB_LORAWAN_TS003_FORCE_DEVICE_RESYNC (0x03)
22class LoRaWANPackageTS003 :
public LoRaWANPackage {
26 LoRaWANPackageTS003(
const LoRaWANPackageTS003& obj) =
delete;
37 size_t processData(
const uint8_t* dataDown,
size_t lenDown, uint8_t* dataOut,
size_t* lenOut,
LoRaWANEvent_t* event)
override;
75 size_t buildAppTimeReq(uint8_t* dataOut);
79 uint8_t transmissions;
94 LoRaWANPackageTS003(LoRaWANPackageManager* pacMan,
RadioLibHal* hal,
LoRaWANNode* node, GetSecondsCb_t secondsCb);
97 friend LoRaWANPackageManager;
LoRaWAN-compatible node (class A device).
Definition LoRaWAN.h:557
void(* SetSecondsCb_t)(RadioLibTime_t)
Set the setSeconds callback function.
Definition LoRaWANPackageTS003.h:50
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 bu...
Definition LoRaWANPackageTS003.cpp:15
int16_t requestAppTime(bool force=false)
Schedule an application time request to be sent at the next opportunity.
Definition LoRaWANPackageTS003.cpp:170
size_t buildUplink(uint8_t *dataOut) override
Build the due AppTimeReq with the current time and advance the schedule. Called at the moment of tran...
Definition LoRaWANPackageTS003.cpp:42
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.
Definition LoRaWANPackageTS003.cpp:69
Hardware abstraction library base interface.
Definition Hal.h:18
unsigned long RadioLibTime_t
Type used for durations in RadioLib.
Definition TypeDef.h:783
Structure to save extra information about uplink/downlink event.
Definition LoRaWAN.h:514