From 1c74010469bf5fa932155c70b4aa0a4ca4dd752a Mon Sep 17 00:00:00 2001 From: jgromes Date: Thu, 14 Sep 2023 18:59:56 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=2058eab?= =?UTF-8?q?402ad0a0b55a6890e891cbe63c4f8b72304=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _lo_ra_w_a_n_8h_source.html | 502 +++++++++++++++++---------------- _physical_layer_8h_source.html | 2 +- 2 files changed, 255 insertions(+), 249 deletions(-) diff --git a/_lo_ra_w_a_n_8h_source.html b/_lo_ra_w_a_n_8h_source.html index 783ea642..b4e595c4 100644 --- a/_lo_ra_w_a_n_8h_source.html +++ b/_lo_ra_w_a_n_8h_source.html @@ -238,266 +238,272 @@ $(document).ready(function(){initNavTree('_lo_ra_w_a_n_8h_source.html',''); init
150 #define RADIOLIB_LORAWAN_MAGIC (0x12AD101B)
151 
152 // MAC commands
-
153 #define RADIOLIB_LORAWAN_MAC_CMD_RESET_IND (0x01)
-
154 #define RADIOLIB_LORAWAN_MAC_CMD_LINK_CHECK_REQ (0x02)
-
155 #define RADIOLIB_LORAWAN_MAC_CMD_LINK_ADR_ANS (0x03)
-
156 #define RADIOLIB_LORAWAN_MAC_CMD_DUTY_CYCLE_ANS (0x04)
-
157 #define RADIOLIB_LORAWAN_MAC_CMD_RX_PARAM_SETUP_ANS (0x05)
-
158 #define RADIOLIB_LORAWAN_MAC_CMD_DEV_STATUS_ANS (0x06)
-
159 #define RADIOLIB_LORAWAN_MAC_CMD_NEW_CHANNEL_ANS (0x07)
-
160 #define RADIOLIB_LORAWAN_MAC_CMD_RX_TIMING_SETUP_ANS (0x08)
-
161 #define RADIOLIB_LORAWAN_MAC_CMD_TX_PARAM_SETUP_ANS (0x09)
-
162 #define RADIOLIB_LORAWAN_MAC_CMD_DI_CHANNEL_ANS (0x0A)
-
163 #define RADIOLIB_LORAWAN_MAC_CMD_REKEY_IND (0x0B)
-
164 #define RADIOLIB_LORAWAN_MAC_CMD_ADR_PARAM_SETUP_ANS (0x0C)
-
165 #define RADIOLIB_LORAWAN_MAC_CMD_DEVICE_TIME_REQ (0x0D)
-
166 #define RADIOLIB_LORAWAN_MAC_CMD_REJOIN_PARAM_SETUP_ANS (0x0F)
-
167 
-
168 // the length of internal MAC command queue - hopefully this is enough for most use cases
-
169 #define RADIOLIB_LORAWAN_MAC_COMMAND_QUEUE_SIZE (8)
-
170 
-
171 // the maximum number of simultaneously available channels
-
172 #define RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS (8)
-
173 
-
179 struct LoRaWANChannelSpan_t {
-
181  uint8_t direction;
-
182 
-
184  uint8_t joinRequestDataRate;
-
185 
-
187  uint8_t numChannels;
-
188 
-
190  float freqStart;
-
191 
-
193  float freqStep;
-
194 
-
196  uint8_t dataRates[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES];
-
197 };
-
198 
-
199 // alias for unused channel span
-
200 #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 } }
-
201 
-
206 struct LoRaWANBand_t {
-
208  uint8_t downlinkDataRateBase;
-
209 
-
211  uint8_t downlinkDataRateMin;
-
212 
-
214  uint8_t payloadLenMax[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES];
-
215 
-
217  int8_t powerMax;
-
218 
-
220  int8_t powerNumSteps;
-
221 
-
223  uint8_t cfListType;
-
224 
-
226  float fskFreq;
-
227 
-
229  uint8_t numChannelSpans;
-
230 
-
232  LoRaWANChannelSpan_t defaultChannels[3];
-
233 
-
235  LoRaWANChannelSpan_t backupChannel;
-
236 };
-
237 
-
238 // supported bands
-
239 extern const LoRaWANBand_t EU868;
-
240 extern const LoRaWANBand_t US915;
-
241 extern const LoRaWANBand_t CN780;
-
242 extern const LoRaWANBand_t EU433;
-
243 extern const LoRaWANBand_t AU915;
-
244 extern const LoRaWANBand_t CN500;
-
245 extern const LoRaWANBand_t AS923;
-
246 extern const LoRaWANBand_t KR920;
-
247 extern const LoRaWANBand_t IN865;
-
248 
-
253 struct LoRaWANMacCommand_t {
-
255  uint8_t cid;
-
256 
-
258  size_t len;
-
259 
-
261  uint8_t payload[5];
-
262 
-
264  uint8_t repeat;
-
265 };
-
266 
-
267 struct LoRaWANMacCommandQueue_t {
-
268  LoRaWANMacCommand_t commands[RADIOLIB_LORAWAN_MAC_COMMAND_QUEUE_SIZE];
-
269  size_t numCommands;
-
270 };
-
271 
-
276 class LoRaWANNode {
-
277  public:
-
279  bool FSK;
-
280 
-
285  int8_t startChannel;
-
286 
-
291  int8_t numChannels;
-
292 
-
298  LoRaWANNode(PhysicalLayer* phy, const LoRaWANBand_t* band);
-
299 
-
304  void wipe();
-
305 
-
310  int16_t begin();
-
311 
-
322  int16_t beginOTAA(uint64_t joinEUI, uint64_t devEUI, uint8_t* nwkKey, uint8_t* appKey, bool force = false);
-
323 
-
334  int16_t beginAPB(uint32_t addr, uint8_t* nwkSKey, uint8_t* appSKey, uint8_t* fNwkSIntKey = NULL, uint8_t* sNwkSIntKey = NULL);
-
335 
-
336  #if defined(RADIOLIB_BUILD_ARDUINO)
-
343  int16_t uplink(String& str, uint8_t port);
-
344  #endif
-
345 
-
352  int16_t uplink(const char* str, uint8_t port);
-
353 
-
361  int16_t uplink(uint8_t* data, size_t len, uint8_t port);
-
362 
-
363  #if defined(RADIOLIB_BUILD_ARDUINO)
-
369  int16_t downlink(String& str);
-
370  #endif
-
371 
-
378  int16_t downlink(uint8_t* data, size_t* len);
-
379 
-
385  void setDeviceStatus(uint8_t battLevel);
-
386 
-
387 #if !defined(RADIOLIB_GODMODE)
-
388  private:
-
389 #endif
-
390  PhysicalLayer* phyLayer = NULL;
-
391  const LoRaWANBand_t* band = NULL;
-
392 
-
393  LoRaWANMacCommandQueue_t commandsUp = {
-
394  .commands = { { .cid = 0, .len = 0, .payload = { 0 }, .repeat = 0, } },
-
395  .numCommands = 0,
-
396  };
-
397  LoRaWANMacCommandQueue_t commandsDown = {
-
398  .commands = { { .cid = 0, .len = 0, .payload = { 0 }, .repeat = 0, } },
-
399  .numCommands = 0,
-
400  };
-
401 
-
402  // the following is either provided by the network server (OTAA)
-
403  // or directly entered by the user (ABP)
-
404  uint32_t devAddr = 0;
-
405  uint8_t appSKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
406  uint8_t fNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
407  uint8_t sNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
408  uint8_t nwkSEncKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
409  uint8_t jSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
410 
-
411  // available channel frequencies from list passed during OTA activation
-
412  float availableChannelsFreq[2][RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS] = { { 0 }, { 0 } };
-
413 
-
414  // currently configured channel frequency
-
415  float channelFreq[2] = { 0 };
-
416 
-
417  // LoRaWAN revision (1.0 vs 1.1)
-
418  uint8_t rev = 0;
-
419 
-
420  // currently configured data rate for uplink and downlink: DR0 - DR15 (band-dependent!)
-
421  uint8_t dataRate[2] = { 0 };
-
422 
-
423  // currently configured channel for uplink and downlink (band-dependent!)
-
424  uint8_t chIndex[2] = { 0 };
-
425 
-
426  // timestamp to measure the RX1/2 delay (from uplink end)
-
427  uint32_t rxDelayStart = 0;
-
428 
-
429  // delays between the uplink and RX1/2 windows
-
430  uint32_t rxDelays[2] = { RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS, RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS };
+
153 #define RADIOLIB_LORAWAN_MAC_CMD_RESET (0x01)
+
154 #define RADIOLIB_LORAWAN_MAC_CMD_LINK_CHECK (0x02)
+
155 #define RADIOLIB_LORAWAN_MAC_CMD_LINK_ADR (0x03)
+
156 #define RADIOLIB_LORAWAN_MAC_CMD_DUTY_CYCLE (0x04)
+
157 #define RADIOLIB_LORAWAN_MAC_CMD_RX_PARAM_SETUP (0x05)
+
158 #define RADIOLIB_LORAWAN_MAC_CMD_DEV_STATUS (0x06)
+
159 #define RADIOLIB_LORAWAN_MAC_CMD_NEW_CHANNEL (0x07)
+
160 #define RADIOLIB_LORAWAN_MAC_CMD_RX_TIMING_SETUP (0x08)
+
161 #define RADIOLIB_LORAWAN_MAC_CMD_TX_PARAM_SETUP (0x09)
+
162 #define RADIOLIB_LORAWAN_MAC_CMD_DL_CHANNEL (0x0A)
+
163 #define RADIOLIB_LORAWAN_MAC_CMD_REKEY (0x0B)
+
164 #define RADIOLIB_LORAWAN_MAC_CMD_ADR_PARAM_SETUP (0x0C)
+
165 #define RADIOLIB_LORAWAN_MAC_CMD_DEVICE_TIME (0x0D)
+
166 #define RADIOLIB_LORAWAN_MAC_CMD_FORCE_REJOIN (0x0E)
+
167 #define RADIOLIB_LORAWAN_MAC_CMD_REJOIN_PARAM_SETUP (0x0F)
+
168 #define RADIOLIB_LORAWAN_MAC_CMD_PROPRIETARY (0x80)
+
169 
+
170 // the length of internal MAC command queue - hopefully this is enough for most use cases
+
171 #define RADIOLIB_LORAWAN_MAC_COMMAND_QUEUE_SIZE (8)
+
172 
+
173 // the maximum number of simultaneously available channels
+
174 #define RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS (8)
+
175 
+
181 struct LoRaWANChannelSpan_t {
+
183  uint8_t direction;
+
184 
+
186  uint8_t joinRequestDataRate;
+
187 
+
189  uint8_t numChannels;
+
190 
+
192  float freqStart;
+
193 
+
195  float freqStep;
+
196 
+
198  uint8_t dataRates[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES];
+
199 };
+
200 
+
201 // alias for unused channel span
+
202 #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 } }
+
203 
+
208 struct LoRaWANBand_t {
+
210  uint8_t downlinkDataRateBase;
+
211 
+
213  uint8_t downlinkDataRateMin;
+
214 
+
216  uint8_t payloadLenMax[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES];
+
217 
+
219  int8_t powerMax;
+
220 
+
222  int8_t powerNumSteps;
+
223 
+
225  uint8_t cfListType;
+
226 
+
228  float fskFreq;
+
229 
+
231  uint8_t numChannelSpans;
+
232 
+
234  LoRaWANChannelSpan_t defaultChannels[3];
+
235 
+
237  LoRaWANChannelSpan_t backupChannel;
+
238 };
+
239 
+
240 // supported bands
+
241 extern const LoRaWANBand_t EU868;
+
242 extern const LoRaWANBand_t US915;
+
243 extern const LoRaWANBand_t CN780;
+
244 extern const LoRaWANBand_t EU433;
+
245 extern const LoRaWANBand_t AU915;
+
246 extern const LoRaWANBand_t CN500;
+
247 extern const LoRaWANBand_t AS923;
+
248 extern const LoRaWANBand_t KR920;
+
249 extern const LoRaWANBand_t IN865;
+
250 
+
255 struct LoRaWANMacCommand_t {
+
257  uint8_t cid;
+
258 
+
260  size_t len;
+
261 
+
263  uint8_t payload[5];
+
264 
+
266  uint8_t repeat;
+
267 };
+
268 
+
269 struct LoRaWANMacCommandQueue_t {
+
270  LoRaWANMacCommand_t commands[RADIOLIB_LORAWAN_MAC_COMMAND_QUEUE_SIZE];
+
271  size_t numCommands;
+
272 };
+
273 
+
278 class LoRaWANNode {
+
279  public:
+
281  bool FSK;
+
282 
+
287  int8_t startChannel;
+
288 
+
293  int8_t numChannels;
+
294 
+
300  LoRaWANNode(PhysicalLayer* phy, const LoRaWANBand_t* band);
+
301 
+
306  void wipe();
+
307 
+
312  int16_t begin();
+
313 
+
324  int16_t beginOTAA(uint64_t joinEUI, uint64_t devEUI, uint8_t* nwkKey, uint8_t* appKey, bool force = false);
+
325 
+
336  int16_t beginAPB(uint32_t addr, uint8_t* nwkSKey, uint8_t* appSKey, uint8_t* fNwkSIntKey = NULL, uint8_t* sNwkSIntKey = NULL);
+
337 
+
338  #if defined(RADIOLIB_BUILD_ARDUINO)
+
345  int16_t uplink(String& str, uint8_t port);
+
346  #endif
+
347 
+
354  int16_t uplink(const char* str, uint8_t port);
+
355 
+
363  int16_t uplink(uint8_t* data, size_t len, uint8_t port);
+
364 
+
365  #if defined(RADIOLIB_BUILD_ARDUINO)
+
371  int16_t downlink(String& str);
+
372  #endif
+
373 
+
380  int16_t downlink(uint8_t* data, size_t* len);
+
381 
+
387  void setDeviceStatus(uint8_t battLevel);
+
388 
+
389 #if !defined(RADIOLIB_GODMODE)
+
390  private:
+
391 #endif
+
392  PhysicalLayer* phyLayer = NULL;
+
393  const LoRaWANBand_t* band = NULL;
+
394 
+
395  LoRaWANMacCommandQueue_t commandsUp = {
+
396  .commands = { { .cid = 0, .len = 0, .payload = { 0 }, .repeat = 0, } },
+
397  .numCommands = 0,
+
398  };
+
399  LoRaWANMacCommandQueue_t commandsDown = {
+
400  .commands = { { .cid = 0, .len = 0, .payload = { 0 }, .repeat = 0, } },
+
401  .numCommands = 0,
+
402  };
+
403 
+
404  // the following is either provided by the network server (OTAA)
+
405  // or directly entered by the user (ABP)
+
406  uint32_t devAddr = 0;
+
407  uint8_t appSKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
408  uint8_t fNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
409  uint8_t sNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
410  uint8_t nwkSEncKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
411  uint8_t jSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
412 
+
413  // available channel frequencies from list passed during OTA activation
+
414  float availableChannelsFreq[2][RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS] = { { 0 }, { 0 } };
+
415 
+
416  // currently configured channel frequency
+
417  float channelFreq[2] = { 0 };
+
418 
+
419  // LoRaWAN revision (1.0 vs 1.1)
+
420  uint8_t rev = 0;
+
421 
+
422  // currently configured data rate for uplink and downlink: DR0 - DR15 (band-dependent!)
+
423  uint8_t dataRate[2] = { 0 };
+
424 
+
425  // currently configured channel for uplink and downlink (band-dependent!)
+
426  uint8_t chIndex[2] = { 0 };
+
427 
+
428  // backup channel properties - may be changed by MAC command
+
429  float backupFreq = 0;
+
430  uint8_t backupDataRate = 0;
431 
-
432  // device status - battery level
-
433  uint8_t battLevel = 0xFF;
+
432  // timestamp to measure the RX1/2 delay (from uplink end)
+
433  uint32_t rxDelayStart = 0;
434 
-
435  // method to generate message integrity code
-
436  uint32_t generateMIC(uint8_t* msg, size_t len, uint8_t* key);
+
435  // delays between the uplink and RX1/2 windows
+
436  uint32_t rxDelays[2] = { RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS, RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS };
437 
-
438  // method to verify message integrity code
-
439  // it assumes that the MIC is the last 4 bytes of the message
-
440  bool verifyMIC(uint8_t* msg, size_t len, uint8_t* key);
-
441 
-
442  // configure the common physical layer properties (preamble, sync word etc.)
-
443  // channels must be configured separately by setupChannels()!
-
444  int16_t setPhyProperties();
-
445 
-
446  // setup uplink/downlink channel data rates and frequencies
-
447  // will attempt to randomly select based on currently used band plan
-
448  int16_t setupChannels();
-
449 
-
450  // find the first usable data rate in a given channel span
-
451  uint8_t findDataRate(uint8_t dr, DataRate_t* dataRate, const LoRaWANChannelSpan_t* span);
-
452 
-
453  // find a channel ID that conforms to the requested direction and ID range
-
454  int16_t findChannelId(uint8_t dir, uint8_t* ch, uint8_t* dr, int8_t min, int8_t max);
+
438  // device status - battery level
+
439  uint8_t battLevel = 0xFF;
+
440 
+
441  // method to generate message integrity code
+
442  uint32_t generateMIC(uint8_t* msg, size_t len, uint8_t* key);
+
443 
+
444  // method to verify message integrity code
+
445  // it assumes that the MIC is the last 4 bytes of the message
+
446  bool verifyMIC(uint8_t* msg, size_t len, uint8_t* key);
+
447 
+
448  // configure the common physical layer properties (preamble, sync word etc.)
+
449  // channels must be configured separately by setupChannels()!
+
450  int16_t setPhyProperties();
+
451 
+
452  // setup uplink/downlink channel data rates and frequencies
+
453  // will attempt to randomly select based on currently used band plan
+
454  int16_t setupChannels();
455 
-
456  // find a channel span that any given channel id belongs to
-
457  LoRaWANChannelSpan_t* findChannelSpan(uint8_t dir, uint8_t ch, uint8_t* spanChannelId);
+
456  // find the first usable data rate in a given channel span
+
457  uint8_t findDataRate(uint8_t dr, DataRate_t* dataRate, const LoRaWANChannelSpan_t* span);
458 
-
459  // calculate channel frequency in MHz based on channel ID and direction
-
460  int16_t findChannelFreq(uint8_t dir, uint8_t ch, float* freq);
+
459  // find a channel ID that conforms to the requested direction and ID range
+
460  int16_t findChannelId(uint8_t dir, uint8_t* ch, uint8_t* dr, int8_t min, int8_t max);
461 
-
462  // configure channel based on cached data rate ID and frequency
-
463  int16_t configureChannel(uint8_t dir);
+
462  // find a channel span that any given channel id belongs to
+
463  LoRaWANChannelSpan_t* findChannelSpan(uint8_t dir, uint8_t ch, uint8_t* spanChannelId);
464 
-
465  // send a MAC command to the network server
-
466  int16_t sendMacCommand(uint8_t cid, uint8_t* payload, size_t payloadLen, uint8_t* reply, size_t replyLen);
+
465  // calculate channel frequency in MHz based on channel ID and direction
+
466  int16_t findChannelFreq(uint8_t dir, uint8_t ch, float* freq);
467 
-
468  // push MAC command to queue, done by copy
-
469  int16_t pushMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue);
-
470 
-
471  // pop MAC command from queue, done by copy unless CMD is NULL
-
472  int16_t popMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue, bool force = false);
+
468  // configure channel based on cached data rate ID and frequency
+
469  int16_t configureChannel(uint8_t dir);
+
470 
+
471  // send a MAC command to the network server
+
472  int16_t sendMacCommand(uint8_t cid, uint8_t* payload, size_t payloadLen, uint8_t* reply, size_t replyLen);
473 
-
474  // execute mac command, return the number of processed bytes for sequential processing
-
475  size_t execMacCommand(LoRaWANMacCommand_t* cmd);
-
476 
-
477  // function to encrypt and decrypt payloads
-
478  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);
+
474  // push MAC command to queue, done by copy
+
475  int16_t pushMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue);
+
476 
+
477  // pop MAC command from queue, done by copy unless CMD is NULL
+
478  int16_t popMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue, bool force = false);
479 
-
480  // network-to-host conversion method - takes data from network packet and converts it to the host endians
-
481  template<typename T>
-
482  static T ntoh(uint8_t* buff, size_t size = 0);
-
483 
-
484  // host-to-network conversion method - takes data from host variable and and converts it to network packet endians
-
485  template<typename T>
-
486  static void hton(uint8_t* buff, T val, size_t size = 0);
-
487 };
-
488 
-
489 #endif
-
LoRaWAN-compatible node (class A device).
Definition: LoRaWAN.h:276
-
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:62
-
bool FSK
Set to true to force the node to only use FSK channels. Set to false by default.
Definition: LoRaWAN.h:279
-
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:329
-
void setDeviceStatus(uint8_t battLevel)
Set device status.
Definition: LoRaWAN.cpp:763
-
int16_t downlink(uint8_t *data, size_t *len)
Wait for downlink from the server in either RX1 or RX2 window.
Definition: LoRaWAN.cpp:515
-
int8_t numChannels
Number of supported channels. Some band plans only support a subset of available channels....
Definition: LoRaWAN.h:291
-
void wipe()
Wipe internal persistent parameters. This will reset all counters and saved variables,...
Definition: LoRaWAN.cpp:37
-
int8_t startChannel
Starting channel offset. Some band plans only support a subset of available channels....
Definition: LoRaWAN.h:285
+
480  // execute mac command, return the number of processed bytes for sequential processing
+
481  size_t execMacCommand(LoRaWANMacCommand_t* cmd);
+
482 
+
483  // function to encrypt and decrypt payloads
+
484  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);
+
485 
+
486  // network-to-host conversion method - takes data from network packet and converts it to the host endians
+
487  template<typename T>
+
488  static T ntoh(uint8_t* buff, size_t size = 0);
+
489 
+
490  // host-to-network conversion method - takes data from host variable and and converts it to network packet endians
+
491  template<typename T>
+
492  static void hton(uint8_t* buff, T val, size_t size = 0);
+
493 };
+
494 
+
495 #endif
+
LoRaWAN-compatible node (class A device).
Definition: LoRaWAN.h:278
+
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:63
+
bool FSK
Set to true to force the node to only use FSK channels. Set to false by default.
Definition: LoRaWAN.h:281
+
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:330
+
void setDeviceStatus(uint8_t battLevel)
Set device status.
Definition: LoRaWAN.cpp:773
+
int16_t downlink(uint8_t *data, size_t *len)
Wait for downlink from the server in either RX1 or RX2 window.
Definition: LoRaWAN.cpp:516
+
int8_t numChannels
Number of supported channels. Some band plans only support a subset of available channels....
Definition: LoRaWAN.h:293
+
void wipe()
Wipe internal persistent parameters. This will reset all counters and saved variables,...
Definition: LoRaWAN.cpp:38
+
int8_t startChannel
Starting channel offset. Some band plans only support a subset of available channels....
Definition: LoRaWAN.h:287
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:358
-
int16_t begin()
Join network by loading information from persistent storage.
Definition: LoRaWAN.cpp:42
+
int16_t uplink(const char *str, uint8_t port)
Send a message to the server.
Definition: LoRaWAN.cpp:359
+
int16_t begin()
Join network by loading information from persistent storage.
Definition: LoRaWAN.cpp:43
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition: PhysicalLayer.h:34
-
Structure to save information about LoRaWAN band.
Definition: LoRaWAN.h:206
-
uint8_t cfListType
Whether the optional channels are defined as list of frequencies or bit mask.
Definition: LoRaWAN.h:223
-
LoRaWANChannelSpan_t backupChannel
Backup downlink (RX2) channel - just a single channel, but using the same structure for convenience.
Definition: LoRaWAN.h:235
-
uint8_t downlinkDataRateBase
The base downlink data rate. Used to calculate data rate changes for adaptive data rate.
Definition: LoRaWAN.h:208
-
int8_t powerMax
Maximum allowed output power in this band in dBm.
Definition: LoRaWAN.h:217
-
LoRaWANChannelSpan_t defaultChannels[3]
Default uplink (TX/RX1) channels defined by LoRaWAN Regional Parameters.
Definition: LoRaWAN.h:232
-
uint8_t payloadLenMax[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES]
Array of allowed maximum payload lengths for each data rate.
Definition: LoRaWAN.h:214
-
int8_t powerNumSteps
Number of power steps in this band.
Definition: LoRaWAN.h:220
-
float fskFreq
FSK channel frequency.
Definition: LoRaWAN.h:226
-
uint8_t numChannelSpans
Number of channel spans in the band.
Definition: LoRaWAN.h:229
-
uint8_t downlinkDataRateMin
The minimum allowed downlink data rate. Used to calculate data rate changes for adaptive data rate.
Definition: LoRaWAN.h:211
-
Structure to save information about LoRaWAN channels. To save space, adjacent channels are saved in "...
Definition: LoRaWAN.h:179
-
uint8_t joinRequestDataRate
Allowed data rates for a join request message.
Definition: LoRaWAN.h:184
-
float freqStart
Center frequency of the first channel in span.
Definition: LoRaWAN.h:190
-
uint8_t numChannels
Total number of channels in the span.
Definition: LoRaWAN.h:187
-
uint8_t dataRates[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES]
Array of datarates supported by all channels in the span.
Definition: LoRaWAN.h:196
-
float freqStep
Frequency step between adjacent channels.
Definition: LoRaWAN.h:193
-
uint8_t direction
Whether this channel span is for uplink, downlink, or both directions.
Definition: LoRaWAN.h:181
-
Structure to save information about MAC command.
Definition: LoRaWAN.h:253
-
size_t len
Length of the payload.
Definition: LoRaWAN.h:258
-
uint8_t cid
The command ID.
Definition: LoRaWAN.h:255
-
uint8_t repeat
Repetition counter (the command will be uplinked repeat + 1 times)
Definition: LoRaWAN.h:264
-
uint8_t payload[5]
Payload buffer (5 bytes is the longest possible)
Definition: LoRaWAN.h:261
-
Definition: LoRaWAN.h:267
+
Structure to save information about LoRaWAN band.
Definition: LoRaWAN.h:208
+
uint8_t cfListType
Whether the optional channels are defined as list of frequencies or bit mask.
Definition: LoRaWAN.h:225
+
LoRaWANChannelSpan_t backupChannel
Backup downlink (RX2) channel - just a single channel, but using the same structure for convenience.
Definition: LoRaWAN.h:237
+
uint8_t downlinkDataRateBase
The base downlink data rate. Used to calculate data rate changes for adaptive data rate.
Definition: LoRaWAN.h:210
+
int8_t powerMax
Maximum allowed output power in this band in dBm.
Definition: LoRaWAN.h:219
+
LoRaWANChannelSpan_t defaultChannels[3]
Default uplink (TX/RX1) channels defined by LoRaWAN Regional Parameters.
Definition: LoRaWAN.h:234
+
uint8_t payloadLenMax[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES]
Array of allowed maximum payload lengths for each data rate.
Definition: LoRaWAN.h:216
+
int8_t powerNumSteps
Number of power steps in this band.
Definition: LoRaWAN.h:222
+
float fskFreq
FSK channel frequency.
Definition: LoRaWAN.h:228
+
uint8_t numChannelSpans
Number of channel spans in the band.
Definition: LoRaWAN.h:231
+
uint8_t downlinkDataRateMin
The minimum allowed downlink data rate. Used to calculate data rate changes for adaptive data rate.
Definition: LoRaWAN.h:213
+
Structure to save information about LoRaWAN channels. To save space, adjacent channels are saved in "...
Definition: LoRaWAN.h:181
+
uint8_t joinRequestDataRate
Allowed data rates for a join request message.
Definition: LoRaWAN.h:186
+
float freqStart
Center frequency of the first channel in span.
Definition: LoRaWAN.h:192
+
uint8_t numChannels
Total number of channels in the span.
Definition: LoRaWAN.h:189
+
uint8_t dataRates[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES]
Array of datarates supported by all channels in the span.
Definition: LoRaWAN.h:198
+
float freqStep
Frequency step between adjacent channels.
Definition: LoRaWAN.h:195
+
uint8_t direction
Whether this channel span is for uplink, downlink, or both directions.
Definition: LoRaWAN.h:183
+
Structure to save information about MAC command.
Definition: LoRaWAN.h:255
+
size_t len
Length of the payload.
Definition: LoRaWAN.h:260
+
uint8_t cid
The command ID.
Definition: LoRaWAN.h:257
+
uint8_t repeat
Repetition counter (the command will be uplinked repeat + 1 times)
Definition: LoRaWAN.h:266
+
uint8_t payload[5]
Payload buffer (5 bytes is the longest possible)
Definition: LoRaWAN.h:263
+
Definition: LoRaWAN.h:269
Definition: PhysicalLayer.h:21
diff --git a/_physical_layer_8h_source.html b/_physical_layer_8h_source.html index d7cdf419..75fdd967 100644 --- a/_physical_layer_8h_source.html +++ b/_physical_layer_8h_source.html @@ -293,7 +293,7 @@ $(document).ready(function(){initNavTree('_physical_layer_8h_source.html',''); i
Client for Bell modem communication. The public interface is the same as Arduino Serial.
Definition: BellModem.h:57
Client for FSK-4 communication. The public interface is the same as Arduino Serial.
Definition: FSK4.h:15
Client for Hellschreiber transmissions.
Definition: Hellschreiber.h:90
-
LoRaWAN-compatible node (class A device).
Definition: LoRaWAN.h:276
+
LoRaWAN-compatible node (class A device).
Definition: LoRaWAN.h:278
Implements all common low-level methods to control the wireless module. Every module class contains o...
Definition: Module.h:31
Client for Morse Code communication. The public interface is the same as Arduino Serial.
Definition: Morse.h:93
Client for Pager communication.
Definition: Pager.h:62