RadioLib
Universal wireless communication library for Arduino
LoRaWAN.h
1 #if !defined(_RADIOLIB_LORAWAN_H) && !defined(RADIOLIB_EXCLUDE_LORAWAN)
2 #define _RADIOLIB_LORAWAN_H
3 
4 #include "../../TypeDef.h"
5 #include "../PhysicalLayer/PhysicalLayer.h"
6 #include "../../utils/Cryptography.h"
7 
8 // preamble format
9 #define RADIOLIB_LORAWAN_LORA_SYNC_WORD (0x34)
10 #define RADIOLIB_LORAWAN_LORA_PREAMBLE_LEN (8)
11 #define RADIOLIB_LORAWAN_GFSK_SYNC_WORD (0xC194C1)
12 #define RADIOLIB_LORAWAN_GFSK_PREAMBLE_LEN (5)
13 
14 // MAC header field encoding MSB LSB DESCRIPTION
15 #define RADIOLIB_LORAWAN_MHDR_MTYPE_JOIN_REQUEST (0x00 << 5) // 7 5 message type: join request
16 #define RADIOLIB_LORAWAN_MHDR_MTYPE_JOIN_ACCEPT (0x01 << 5) // 7 5 join accept
17 #define RADIOLIB_LORAWAN_MHDR_MTYPE_UNCONF_DATA_UP (0x02 << 5) // 7 5 unconfirmed data up
18 #define RADIOLIB_LORAWAN_MHDR_MTYPE_UNCONF_DATA_DOWN (0x03 << 5) // 7 5 unconfirmed data down
19 #define RADIOLIB_LORAWAN_MHDR_MTYPE_CONF_DATA_UP (0x04 << 5) // 7 5 confirmed data up
20 #define RADIOLIB_LORAWAN_MHDR_MTYPE_CONF_DATA_DOWN (0x05 << 5) // 7 5 confirmed data down
21 #define RADIOLIB_LORAWAN_MHDR_MTYPE_PROPRIETARY (0x07 << 5) // 7 5 proprietary
22 #define RADIOLIB_LORAWAN_MHDR_MTYPE_MASK (0x07 << 5) // 7 5 bitmask of all possible options
23 #define RADIOLIB_LORAWAN_MHDR_MAJOR_R1 (0x00 << 0) // 1 0 major version: LoRaWAN R1
24 
25 // frame control field encoding
26 #define RADIOLIB_LORAWAN_FCTRL_ADR_ENABLED (0x01 << 7) // 7 7 adaptive data rate: enabled
27 #define RADIOLIB_LORAWAN_FCTRL_ADR_DISABLED (0x00 << 7) // 7 7 disabled
28 #define RADIOLIB_LORAWAN_FCTRL_ADR_ACK_REQ (0x01 << 6) // 6 6 adaptive data rate ACK request
29 #define RADIOLIB_LORAWAN_FCTRL_ACK (0x01 << 5) // 5 5 confirmed message acknowledge
30 #define RADIOLIB_LORAWAN_FCTRL_FRAME_PENDING (0x01 << 4) // 4 4 downlink frame is pending
31 
32 // port field
33 #define RADIOLIB_LORAWAN_FPORT_MAC_COMMAND (0x00 << 0) // 7 0 payload contains MAC commands only
34 #define RADIOLIB_LORAWAN_FPORT_RESERVED (0xE0 << 0) // 7 0 reserved port values
35 
36 // MAC commands - only those sent from end-device to gateway
37 #define RADIOLIB_LORAWAN_LINK_CHECK_REQ (0x02 << 0) // 7 0 MAC command: request to check connectivity to network
38 #define RADIOLIB_LORAWAN_LINK_ADR_ANS (0x03 << 0) // 7 0 answer to ADR change
39 #define RADIOLIB_LORAWAN_DUTY_CYCLE_ANS (0x04 << 0) // 7 0 answer to duty cycle change
40 #define RADIOLIB_LORAWAN_RX_PARAM_SETUP_ANS (0x05 << 0) // 7 0 answer to reception slot setup request
41 #define RADIOLIB_LORAWAN_DEV_STATUS_ANS (0x06 << 0) // 7 0 device status information
42 #define RADIOLIB_LORAWAN_NEW_CHANNEL_ANS (0x07 << 0) // 7 0 acknowledges change of a radio channel
43 #define RADIOLIB_LORAWAN_RX_TIMING_SETUP_ANS (0x08 << 0) // 7 0 acknowledges change of a reception slots timing
44 
45 #define RADIOLIB_LORAWAN_NOPTS_LEN (8)
46 
47 // data rat encoding
48 #define RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K (0x01 << 7) // 7 7 FSK @ 50 kbps
49 #define RADIOLIB_LORAWAN_DATA_RATE_SF_12 (0x06 << 4) // 6 4 LoRaWAN spreading factor: SF12
50 #define RADIOLIB_LORAWAN_DATA_RATE_SF_11 (0x05 << 4) // 6 4 SF11
51 #define RADIOLIB_LORAWAN_DATA_RATE_SF_10 (0x04 << 4) // 6 4 SF10
52 #define RADIOLIB_LORAWAN_DATA_RATE_SF_9 (0x03 << 4) // 6 4 SF9
53 #define RADIOLIB_LORAWAN_DATA_RATE_SF_8 (0x02 << 4) // 6 4 SF8
54 #define RADIOLIB_LORAWAN_DATA_RATE_SF_7 (0x01 << 4) // 6 4 SF7
55 #define RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ (0x00 << 0) // 3 0 LoRaWAN bandwidth: 500 kHz
56 #define RADIOLIB_LORAWAN_DATA_RATE_BW_250_KHZ (0x01 << 0) // 3 0 250 kHz
57 #define RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ (0x02 << 0) // 3 0 125 kHz
58 #define RADIOLIB_LORAWAN_DATA_RATE_UNUSED (0xFF << 0) // 7 0 unused data rate
59 
60 #define RADIOLIB_LORAWAN_CHANNEL_DIR_UPLINK (0x00 << 0)
61 #define RADIOLIB_LORAWAN_CHANNEL_DIR_DOWNLINK (0x01 << 0)
62 #define RADIOLIB_LORAWAN_CHANNEL_DIR_BOTH (0x02 << 0)
63 #define RADIOLIB_LORAWAN_CHANNEL_DIR_NONE (0x03 << 0)
64 #define RADIOLIB_LORAWAN_CFLIST_TYPE_FREQUENCIES (0)
65 #define RADIOLIB_LORAWAN_CFLIST_TYPE_MASK (1)
66 #define RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES (16)
67 
68 // recommended default settings
69 #define RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS (1000)
70 #define RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS ((RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS) + 1000)
71 #define RADIOLIB_LORAWAN_RX_WINDOW_LEN_MS (500)
72 #define RADIOLIB_LORAWAN_RX1_DR_OFFSET (0)
73 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_DELAY_1_MS (5000)
74 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_DELAY_2_MS (6000)
75 #define RADIOLIB_LORAWAN_MAX_FCNT_GAP (16384)
76 #define RADIOLIB_LORAWAN_ADR_ACK_LIMIT (64)
77 #define RADIOLIB_LORAWAN_ADR_ACK_DELAY (32)
78 #define RADIOLIB_LORAWAN_RETRANSMIT_TIMEOUT_MIN_MS (1000)
79 #define RADIOLIB_LORAWAN_RETRANSMIT_TIMEOUT_MAX_MS (3000)
80 #define RADIOLIB_LORAWAN_POWER_STEP_SIZE_DBM (-2)
81 
82 // join request message layout
83 #define RADIOLIB_LORAWAN_JOIN_REQUEST_LEN (23)
84 #define RADIOLIB_LORAWAN_JOIN_REQUEST_JOIN_EUI_POS (1)
85 #define RADIOLIB_LORAWAN_JOIN_REQUEST_DEV_EUI_POS (9)
86 #define RADIOLIB_LORAWAN_JOIN_REQUEST_DEV_NONCE_POS (17)
87 #define RADIOLIB_LORAWAN_JOIN_REQUEST_TYPE (0xFF)
88 #define RADIOLIB_LORAWAN_JOIN_REQUEST_TYPE_0 (0x00)
89 #define RADIOLIB_LORAWAN_JOIN_REQUEST_TYPE_1 (0x01)
90 #define RADIOLIB_LORAWAN_JOIN_REQUEST_TYPE_2 (0x02)
91 
92 // join accept message layout
93 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_MAX_LEN (33)
94 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_JOIN_NONCE_POS (1)
95 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_HOME_NET_ID_POS (4)
96 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_DEV_ADDR_POS (7)
97 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_JOIN_EUI_POS (4)
98 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_DL_SETTINGS_POS (11)
99 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_RX_DELAY_POS (12)
100 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_DEV_NONCE_POS (12)
101 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_POS (13)
102 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_LEN (16)
103 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_TYPE_POS (RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_POS + RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_LEN - 1)
104 
105 // join accept message variables
106 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_R_1_0 (0x00 << 7) // 7 7 LoRaWAN revision: 1.0
107 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_R_1_1 (0x01 << 7) // 7 7 1.1
108 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_F_NWK_S_INT_KEY (0x01)
109 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_APP_S_KEY (0x02)
110 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_S_NWK_S_INT_KEY (0x03)
111 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_NWK_S_ENC_KEY (0x04)
112 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_JS_ENC_KEY (0x05)
113 #define RADIOLIB_LORAWAN_JOIN_ACCEPT_JS_INT_KEY (0x06)
114 
115 // frame header layout
116 #define RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS (16)
117 #define RADIOLIB_LORAWAN_FHDR_DEV_ADDR_POS (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 1)
118 #define RADIOLIB_LORAWAN_FHDR_FCTRL_POS (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 5)
119 #define RADIOLIB_LORAWAN_FHDR_FCNT_POS (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 6)
120 #define RADIOLIB_LORAWAN_FHDR_FOPTS_POS (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 8)
121 #define RADIOLIB_LORAWAN_FHDR_FOPTS_LEN_MASK (0x0F)
122 #define RADIOLIB_LORAWAN_FHDR_FOPTS_MAX_LEN (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 16)
123 #define RADIOLIB_LORAWAN_FHDR_FPORT_POS(FOPTS) (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 8 + (FOPTS))
124 #define RADIOLIB_LORAWAN_FRAME_PAYLOAD_POS(FOPTS) (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 9 + (FOPTS))
125 #define RADIOLIB_LORAWAN_FRAME_LEN(PAYLOAD, FOPTS) (16 + 13 + (PAYLOAD) + (FOPTS))
126 
127 // payload encryption/MIC blocks common layout
128 #define RADIOLIB_LORAWAN_BLOCK_MAGIC_POS (0)
129 #define RADIOLIB_LORAWAN_BLOCK_DIR_POS (5)
130 #define RADIOLIB_LORAWAN_BLOCK_DEV_ADDR_POS (6)
131 #define RADIOLIB_LORAWAN_BLOCK_FCNT_POS (10)
132 
133 // payload encryption block layout
134 #define RADIOLIB_LORAWAN_ENC_BLOCK_MAGIC (0x01)
135 #define RADIOLIB_LORAWAN_ENC_BLOCK_COUNTER_ID_POS (4)
136 #define RADIOLIB_LORAWAN_ENC_BLOCK_COUNTER_POS (15)
137 
138 // payload MIC blocks layout
139 #define RADIOLIB_LORAWAN_MIC_BLOCK_MAGIC (0x49)
140 #define RADIOLIB_LORAWAN_MIC_BLOCK_LEN_POS (15)
141 #define RADIOLIB_LORAWAN_MIC_DATA_RATE_POS (3)
142 #define RADIOLIB_LORAWAN_MIC_CH_INDEX_POS (4)
143 
144 // magic word saved in persistent memory upon activation
145 #define RADIOLIB_LORAWAN_MAGIC (0x12AD101B)
146 
147 // MAC commands
148 #define RADIOLIB_LORAWAN_MAC_CMD_RESET_IND (0x01)
149 #define RADIOLIB_LORAWAN_MAC_CMD_LINK_CHECK_REQ (0x02)
150 #define RADIOLIB_LORAWAN_MAC_CMD_LINK_ADR_ANS (0x03)
151 #define RADIOLIB_LORAWAN_MAC_CMD_DUTY_CYCLE_ANS (0x04)
152 #define RADIOLIB_LORAWAN_MAC_CMD_RX_PARAM_SETUP_ANS (0x05)
153 #define RADIOLIB_LORAWAN_MAC_CMD_DEV_STATUS_ANS (0x06)
154 #define RADIOLIB_LORAWAN_MAC_CMD_NEW_CHANNEL_ANS (0x07)
155 #define RADIOLIB_LORAWAN_MAC_CMD_RX_TIMING_SETUP_ANS (0x08)
156 #define RADIOLIB_LORAWAN_MAC_CMD_TX_PARAM_SETUP_ANS (0x09)
157 #define RADIOLIB_LORAWAN_MAC_CMD_DI_CHANNEL_ANS (0x0A)
158 #define RADIOLIB_LORAWAN_MAC_CMD_REKEY_IND (0x0B)
159 #define RADIOLIB_LORAWAN_MAC_CMD_ADR_PARAM_SETUP_ANS (0x0C)
160 #define RADIOLIB_LORAWAN_MAC_CMD_DEVICE_TIME_REQ (0x0D)
161 #define RADIOLIB_LORAWAN_MAC_CMD_REJOIN_PARAM_SETUP_ANS (0x0F)
162 
170  uint8_t direction;
171 
174 
176  uint8_t numChannels;
177 
179  float freqStart;
180 
182  float freqStep;
183 
185  uint8_t dataRates[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES];
186 };
187 
188 // alias for unused channel span
189 #define RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE { .direction = RADIOLIB_LORAWAN_CHANNEL_DIR_NONE, .joinRequestDataRate = RADIOLIB_LORAWAN_DATA_RATE_UNUSED, .numChannels = 0, .freqStart = 0, .freqStep = 0, .dataRates = { 0 } }
190 
198 
201 
203  uint8_t payloadLenMax[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES];
204 
206  int8_t powerMax;
207 
210 
212  uint8_t cfListType;
213 
215  float fskFreq;
216 
219 
222 
225 };
226 
227 // supported bands
228 extern const LoRaWANBand_t EU868;
229 extern const LoRaWANBand_t US915;
230 extern const LoRaWANBand_t CN780;
231 extern const LoRaWANBand_t EU433;
232 extern const LoRaWANBand_t AU915;
233 extern const LoRaWANBand_t CN500;
234 extern const LoRaWANBand_t AS923;
235 extern const LoRaWANBand_t KR920;
236 extern const LoRaWANBand_t IN865;
237 
239  uint8_t cid;
240  size_t len;
241  uint8_t* payload;
242 };
243 
248 class LoRaWANNode {
249  public:
251  bool FSK;
252 
258  LoRaWANNode(PhysicalLayer* phy, const LoRaWANBand_t* band);
259 
264  void wipe();
265 
270  int16_t begin();
271 
282  int16_t beginOTAA(uint64_t joinEUI, uint64_t devEUI, uint8_t* nwkKey, uint8_t* appKey, bool force = false);
283 
294  int16_t beginAPB(uint32_t addr, uint8_t* nwkSKey, uint8_t* appSKey, uint8_t* fNwkSIntKey = NULL, uint8_t* sNwkSIntKey = NULL);
295 
296  #if defined(RADIOLIB_BUILD_ARDUINO)
303  int16_t uplink(String& str, uint8_t port);
304  #endif
305 
312  int16_t uplink(const char* str, uint8_t port);
313 
321  int16_t uplink(uint8_t* data, size_t len, uint8_t port);
322 
323  #if defined(RADIOLIB_BUILD_ARDUINO)
329  int16_t downlink(String& str);
330  #endif
331 
338  int16_t downlink(uint8_t* data, size_t* len);
339 
340 #if !defined(RADIOLIB_GODMODE)
341  private:
342 #endif
343  PhysicalLayer* phyLayer = NULL;
344  const LoRaWANBand_t* band = NULL;
345 
346  LoRaWANMacCommand_t* command = NULL;
347 
348  // the following is either provided by the network server (OTAA)
349  // or directly entered by the user (ABP)
350  uint32_t devAddr = 0;
351  uint8_t appSKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
352  uint8_t fNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
353  uint8_t sNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
354  uint8_t nwkSEncKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
355  uint8_t jSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
356  float availableChannelsFreq[5] = { 0 };
357  uint16_t availableChannelsMask[6] = { 0 };
358 
359  // LoRaWAN revision (1.0 vs 1.1)
360  uint8_t rev = 0;
361 
362  // currently configured data rate DR0 - DR15 (band-dependent!)
363  uint8_t dataRate = 0;
364 
365  // currently configured channel (band-dependent!)
366  uint8_t chIndex = 0;
367 
368  // timestamp to measure the RX1/2 delay (from uplink end)
369  uint32_t rxDelayStart = 0;
370 
371  // delays between the uplink and RX1/2 windows
372  uint32_t rxDelays[2] = { RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS, RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS };
373 
374  // find the first usable data rate in a given channel span
375  void findDataRate(uint8_t dr, DataRate_t* datr, const LoRaWANChannelSpan_t* span);
376 
383  int16_t configureChannel(uint8_t chan, uint8_t dr);
384 
385  // method to generate message integrity code
386  uint32_t generateMIC(uint8_t* msg, size_t len, uint8_t* key);
387 
388  // method to verify message integrity code
389  // it assumes that the MIC is the last 4 bytes of the message
390  bool verifyMIC(uint8_t* msg, size_t len, uint8_t* key);
391 
392  // configure the physical layer properties (frequency, sync word etc.)
393  int16_t setPhyProperties();
394 
395  // send a MAC command to the network server
396  int16_t sendMacCommand(uint8_t cid, uint8_t* payload, size_t payloadLen, uint8_t* reply, size_t replyLen);
397 
398  // function to encrypt and decrypt payloads
399  void processAES(uint8_t* in, size_t len, uint8_t* key, uint8_t* out, uint32_t fcnt, uint8_t dir, uint8_t ctrId, bool counter);
400 
401  // network-to-host conversion method - takes data from network packet and converts it to the host endians
402  template<typename T>
403  static T ntoh(uint8_t* buff, size_t size = 0);
404 
405  // host-to-network conversion method - takes data from host variable and and converts it to network packet endians
406  template<typename T>
407  static void hton(uint8_t* buff, T val, size_t size = 0);
408 };
409 
410 #endif
LoRaWAN-compatible node (class A device).
Definition: LoRaWAN.h:248
int16_t beginOTAA(uint64_t joinEUI, uint64_t devEUI, uint8_t *nwkKey, uint8_t *appKey, bool force=false)
Join network by performing over-the-air activation. By this procedure, the device will perform an exc...
Definition: LoRaWAN.cpp:60
bool FSK
Set to true to force the node to only use FSK channels. Set to false by default.
Definition: LoRaWAN.h:251
int16_t beginAPB(uint32_t addr, uint8_t *nwkSKey, uint8_t *appSKey, uint8_t *fNwkSIntKey=NULL, uint8_t *sNwkSIntKey=NULL)
Join network by performing activation by personalization. In this procedure, all necessary configurat...
Definition: LoRaWAN.cpp:297
int16_t downlink(uint8_t *data, size_t *len)
Wait for downlink from the server in either RX1 or RX2 window.
Definition: LoRaWAN.cpp:466
void wipe()
Wipe internal persistent parameters. This will reset all counters and saved variables,...
Definition: LoRaWAN.cpp:35
LoRaWANNode(PhysicalLayer *phy, const LoRaWANBand_t *band)
Default constructor.
Definition: LoRaWAN.cpp:29
int16_t uplink(const char *str, uint8_t port)
Send a message to the server.
Definition: LoRaWAN.cpp:322
int16_t begin()
Join network by loading information from persistent storage.
Definition: LoRaWAN.cpp:40
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition: PhysicalLayer.h:33
Structure to save information about LoRaWAN band.
Definition: LoRaWAN.h:195
uint8_t cfListType
Whether the optional channels are defined as list of frequencies or bit mask.
Definition: LoRaWAN.h:212
LoRaWANChannelSpan_t backupChannel
Backup downlink (RX2) channel - just a single channel, but using the same structure for convenience.
Definition: LoRaWAN.h:224
uint8_t downlinkDataRateBase
The base downlink data rate. Used to calculate data rate changes for adaptive data rate.
Definition: LoRaWAN.h:197
int8_t powerMax
Maximum allowed output power in this band in dBm.
Definition: LoRaWAN.h:206
LoRaWANChannelSpan_t defaultChannels[3]
Default uplink (TX/RX1) channels defined by LoRaWAN Regional Parameters.
Definition: LoRaWAN.h:221
uint8_t payloadLenMax[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES]
Array of allowed maximum payload lengths for each data rate.
Definition: LoRaWAN.h:203
int8_t powerNumSteps
Number of power steps in this band.
Definition: LoRaWAN.h:209
float fskFreq
FSK channel frequency.
Definition: LoRaWAN.h:215
uint8_t numChannelSpans
Number of channel spans in the band.
Definition: LoRaWAN.h:218
uint8_t downlinkDataRateMin
The minimum allowed downlink data rate. Used to calculate data rate changes for adaptive data rate.
Definition: LoRaWAN.h:200
Structure to save information about LoRaWAN channels. To save space, adjacent channels are saved in "...
Definition: LoRaWAN.h:168
uint8_t joinRequestDataRate
Allowed data rates for a join request message.
Definition: LoRaWAN.h:173
float freqStart
Center frequency of the first channel in span.
Definition: LoRaWAN.h:179
uint8_t numChannels
Total number of channels in the span.
Definition: LoRaWAN.h:176
uint8_t dataRates[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES]
Array of datarates supported by all channels in the span.
Definition: LoRaWAN.h:185
float freqStep
Frequency step between adjacent channels.
Definition: LoRaWAN.h:182
uint8_t direction
Whether this channel span is for uplink, downlink, or both directions.
Definition: LoRaWAN.h:170
Definition: LoRaWAN.h:238
Definition: PhysicalLayer.h:20