From 35df7e57de601daf5bff90cab41c9ed5290fd0ca Mon Sep 17 00:00:00 2001 From: jgromes Date: Sat, 26 Aug 2023 18:36:48 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20b54aa?= =?UTF-8?q?77b4243526a06e52157b828de18703eecff=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 | 134 +++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 64 deletions(-) diff --git a/_lo_ra_w_a_n_8h_source.html b/_lo_ra_w_a_n_8h_source.html index 697b2217..786acc98 100644 --- a/_lo_ra_w_a_n_8h_source.html +++ b/_lo_ra_w_a_n_8h_source.html @@ -352,83 +352,89 @@ $(document).ready(function(){initNavTree('_lo_ra_w_a_n_8h_source.html',''); init
370  PhysicalLayer* phyLayer = NULL;
371  const LoRaWANBand_t* band = NULL;
372 
-
373  LoRaWANMacCommandQueue_t commandsUp = { .commands = { 0 }, .numCommands = 0 };
-
374  LoRaWANMacCommandQueue_t commandsDown = { .commands = { 0 }, .numCommands = 0 };
-
375 
-
376  // the following is either provided by the network server (OTAA)
-
377  // or directly entered by the user (ABP)
-
378  uint32_t devAddr = 0;
-
379  uint8_t appSKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
380  uint8_t fNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
381  uint8_t sNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
382  uint8_t nwkSEncKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
383  uint8_t jSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
384  float availableChannelsFreq[5] = { 0 };
-
385  uint16_t availableChannelsMask[6] = { 0 };
-
386 
-
387  // LoRaWAN revision (1.0 vs 1.1)
-
388  uint8_t rev = 0;
-
389 
-
390  // currently configured data rate DR0 - DR15 (band-dependent!)
-
391  uint8_t dataRate = 0;
+
373  LoRaWANMacCommandQueue_t commandsUp = {
+
374  .commands = { { .cid = 0, .len = 0, .payload = { 0 }, .repeat = 0, } },
+
375  .numCommands = 0,
+
376  };
+
377  LoRaWANMacCommandQueue_t commandsDown = {
+
378  .commands = { { .cid = 0, .len = 0, .payload = { 0 }, .repeat = 0, } },
+
379  .numCommands = 0,
+
380  };
+
381 
+
382  // the following is either provided by the network server (OTAA)
+
383  // or directly entered by the user (ABP)
+
384  uint32_t devAddr = 0;
+
385  uint8_t appSKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
386  uint8_t fNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
387  uint8_t sNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
388  uint8_t nwkSEncKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
389  uint8_t jSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
390  float availableChannelsFreq[5] = { 0 };
+
391  uint16_t availableChannelsMask[6] = { 0 };
392 
-
393  // currently configured channel (band-dependent!)
-
394  uint8_t chIndex = 0;
+
393  // LoRaWAN revision (1.0 vs 1.1)
+
394  uint8_t rev = 0;
395 
-
396  // timestamp to measure the RX1/2 delay (from uplink end)
-
397  uint32_t rxDelayStart = 0;
+
396  // currently configured data rate DR0 - DR15 (band-dependent!)
+
397  uint8_t dataRate = 0;
398 
-
399  // delays between the uplink and RX1/2 windows
-
400  uint32_t rxDelays[2] = { RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS, RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS };
+
399  // currently configured channel (band-dependent!)
+
400  uint8_t chIndex = 0;
401 
-
402  // device status - battery level
-
403  uint8_t battLevel = 0xFF;
+
402  // timestamp to measure the RX1/2 delay (from uplink end)
+
403  uint32_t rxDelayStart = 0;
404 
-
405  // find the first usable data rate in a given channel span
-
406  void findDataRate(uint8_t dr, DataRate_t* datr, const LoRaWANChannelSpan_t* span);
+
405  // delays between the uplink and RX1/2 windows
+
406  uint32_t rxDelays[2] = { RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS, RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS };
407 
-
414  int16_t configureChannel(uint8_t chan, uint8_t dr);
-
415 
-
416  // method to generate message integrity code
-
417  uint32_t generateMIC(uint8_t* msg, size_t len, uint8_t* key);
-
418 
-
419  // method to verify message integrity code
-
420  // it assumes that the MIC is the last 4 bytes of the message
-
421  bool verifyMIC(uint8_t* msg, size_t len, uint8_t* key);
-
422 
-
423  // configure the physical layer properties (frequency, sync word etc.)
-
424  int16_t setPhyProperties();
-
425 
-
426  // send a MAC command to the network server
-
427  int16_t sendMacCommand(uint8_t cid, uint8_t* payload, size_t payloadLen, uint8_t* reply, size_t replyLen);
+
408  // device status - battery level
+
409  uint8_t battLevel = 0xFF;
+
410 
+
411  // find the first usable data rate in a given channel span
+
412  void findDataRate(uint8_t dr, DataRate_t* datr, const LoRaWANChannelSpan_t* span);
+
413 
+
420  int16_t configureChannel(uint8_t chan, uint8_t dr);
+
421 
+
422  // method to generate message integrity code
+
423  uint32_t generateMIC(uint8_t* msg, size_t len, uint8_t* key);
+
424 
+
425  // method to verify message integrity code
+
426  // it assumes that the MIC is the last 4 bytes of the message
+
427  bool verifyMIC(uint8_t* msg, size_t len, uint8_t* key);
428 
-
429  // push MAC command to queue, done by copy
-
430  int16_t pushMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue);
-
431 
-
432  // pop MAC command from queue, done by copy unless CMD is NULL
-
433  int16_t popMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue, bool force = false);
+
429  // configure the physical layer properties (frequency, sync word etc.)
+
430  int16_t setPhyProperties();
+
431 
+
432  // send a MAC command to the network server
+
433  int16_t sendMacCommand(uint8_t cid, uint8_t* payload, size_t payloadLen, uint8_t* reply, size_t replyLen);
434 
-
435  // execute mac command, return the number of processed bytes for sequential processing
-
436  size_t execMacCommand(LoRaWANMacCommand_t* cmd);
-
437 
-
438  // function to encrypt and decrypt payloads
-
439  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);
+
435  // push MAC command to queue, done by copy
+
436  int16_t pushMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue);
+
437 
+
438  // pop MAC command from queue, done by copy unless CMD is NULL
+
439  int16_t popMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue, bool force = false);
440 
-
441  // network-to-host conversion method - takes data from network packet and converts it to the host endians
-
442  template<typename T>
-
443  static T ntoh(uint8_t* buff, size_t size = 0);
-
444 
-
445  // host-to-network conversion method - takes data from host variable and and converts it to network packet endians
-
446  template<typename T>
-
447  static void hton(uint8_t* buff, T val, size_t size = 0);
-
448 };
-
449 
-
450 #endif
+
441  // execute mac command, return the number of processed bytes for sequential processing
+
442  size_t execMacCommand(LoRaWANMacCommand_t* cmd);
+
443 
+
444  // function to encrypt and decrypt payloads
+
445  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);
+
446 
+
447  // network-to-host conversion method - takes data from network packet and converts it to the host endians
+
448  template<typename T>
+
449  static T ntoh(uint8_t* buff, size_t size = 0);
+
450 
+
451  // host-to-network conversion method - takes data from host variable and and converts it to network packet endians
+
452  template<typename T>
+
453  static void hton(uint8_t* buff, T val, size_t size = 0);
+
454 };
+
455 
+
456 #endif
LoRaWAN-compatible node (class A device).
Definition: LoRaWAN.h:268
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:271
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
-
void setDeviceStatus(uint8_t battLevel)
Set device status.
Definition: LoRaWAN.cpp:714
+
void setDeviceStatus(uint8_t battLevel)
Set device status.
Definition: LoRaWAN.cpp:715
int16_t downlink(uint8_t *data, size_t *len)
Wait for downlink from the server in either RX1 or RX2 window.
Definition: LoRaWAN.cpp:472
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