RadioLib
Universal wireless communication library for Arduino
Loading...
Searching...
No Matches
LoRaWANPackageTS009.h
1#if !defined(_RADIOLIB_LORAWAN_PACKAGE_TS009_H) && !RADIOLIB_EXCLUDE_LORAWAN
2#define _RADIOLIB_LORAWAN_PACKAGE_TS009_H
3
4#include "LoRaWAN.h"
5#include "LoRaWANPacMan.h"
6
7// TS009 - LCTT (LoRaWAN Conformance Test Tool) Testing Package
8// Implements commands for device testing and certification
9
10#define RADIOLIB_LORAWAN_TS009_PACKAGE_VERSION (0x00)
11#define RADIOLIB_LORAWAN_TS009_DUT_RESET (0x01)
12#define RADIOLIB_LORAWAN_TS009_DUT_JOIN (0x02)
13#define RADIOLIB_LORAWAN_TS009_SWITCH_CLASS (0x03)
14#define RADIOLIB_LORAWAN_TS009_ADR_BIT_CHANGE (0x04)
15#define RADIOLIB_LORAWAN_TS009_REGIONAL_DUTY_CYCLE (0x05)
16#define RADIOLIB_LORAWAN_TS009_TX_PERIODICITY_CHANGE (0x06)
17#define RADIOLIB_LORAWAN_TS009_TX_FRAMES_CTRL (0x07)
18#define RADIOLIB_LORAWAN_TS009_ECHO_PAYLOAD (0x08)
19#define RADIOLIB_LORAWAN_TS009_RX_APP_CNT (0x09)
20#define RADIOLIB_LORAWAN_TS009_RX_APP_CNT_RESET (0x0A)
21#define RADIOLIB_LORAWAN_TS009_LINK_CHECK (0x20)
22#define RADIOLIB_LORAWAN_TS009_DEVICE_TIME (0x21)
23#define RADIOLIB_LORAWAN_TS009_FRAG_SESSION_CNT (0x52)
24#define RADIOLIB_LORAWAN_TS009_RELAY_MODE_CTRL (0x53)
25#define RADIOLIB_LORAWAN_TS009_TX_CW (0x7D)
26#define RADIOLIB_LORAWAN_TS009_DUT_FPORT224_DISABLE (0x7E)
27#define RADIOLIB_LORAWAN_TS009_DUT_VERSIONS (0x7F)
28
33class LoRaWANPackageTS009 : public LoRaWANPackage {
34 public:
35
36 typedef void (*DelaySecondsCb_t)(RadioLibTime_t seconds);
37 typedef void (*UplinkIntervalCb_t)(RadioLibTime_t intervalSeconds);
38 typedef void (*ConfirmedCb_t)(bool confirmed);
39 typedef void (*RebootCb_t)();
40
41 // copy constructor is removed to prevent users from creating copies of this class
42 LoRaWANPackageTS009(const LoRaWANPackageTS009& obj) = delete;
43
48
52 void setDelaySecondsCallback(DelaySecondsCb_t delayCb);
53
57 void setUplinkIntervalCallback(UplinkIntervalCb_t intervalCb);
58
62 void setConfirmedCallback(ConfirmedCb_t confirmedCb);
63
67 void setRebootCallback(RebootCb_t rebootCb);
68
76 size_t processData(const uint8_t* dataDown, size_t lenDown, uint8_t* dataOut, size_t* lenOut, LoRaWANEvent_t* event) override;
77
78#if !RADIOLIB_GODMODE
79 protected:
80#endif
81
82 PhysicalLayer* radio;
83 DelaySecondsCb_t delaySecondsCallback;
84 UplinkIntervalCb_t uplinkIntervalCallback;
85 ConfirmedCb_t confirmedCallback;
86 RebootCb_t rebootCallback;
87
88 void reboot() {
89 if(this->rebootCallback != NULL) {
90 this->rebootCallback();
91 }
92 }
93
94#if !RADIOLIB_GODMODE
95 private:
96#endif
97 // private constructor, to not allow the user to create additional instances of this package
98
105 LoRaWANPackageTS009(LoRaWANPackageManager* pacMan, RadioLibHal* hal, LoRaWANNode* node, GetSecondsCb_t secondsCb);
106
107 uint8_t enabled = false;
108
109 // allow LoRaWANPackageManager to access the private constructor
110 friend LoRaWANPackageManager;
111};
112
113#endif
114
LoRaWAN-compatible node (class A device).
Definition LoRaWAN.h:557
void setPhysicalLayer(PhysicalLayer *radio)
Set radio module reference (for TX_CW command).
Definition LoRaWANPackageTS009.cpp:20
void setRebootCallback(RebootCb_t rebootCb)
Set reboot callback (for DUT_RESET command).
Definition LoRaWANPackageTS009.cpp:39
void setConfirmedCallback(ConfirmedCb_t confirmedCb)
Set confirmed callback (for TX_FRAMES_CTRL command).
Definition LoRaWANPackageTS009.cpp:35
void setDelaySecondsCallback(DelaySecondsCb_t delayCb)
Set delay seconds callback (for delays in various commands).
Definition LoRaWANPackageTS009.cpp:27
size_t processData(const uint8_t *dataDown, size_t lenDown, uint8_t *dataOut, size_t *lenOut, LoRaWANEvent_t *event) override
Process downlink data for TS009 LCTT package.
Definition LoRaWANPackageTS009.cpp:43
void setUplinkIntervalCallback(UplinkIntervalCb_t intervalCb)
Set uplink interval callback (for TX_PERIODICITY_CHANGE command).
Definition LoRaWANPackageTS009.cpp:31
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition PhysicalLayer.h:402
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