From 6ff409dbd73859c35ce5d8fd6819e410d2606625 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sat, 13 Jul 2024 15:11:00 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20a93dd?= =?UTF-8?q?1af91fde929b31fbc8284f04c195a4ff993=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 | 465 ++++++++++++++-------------- class_lo_ra_w_a_n_node-members.html | 35 ++- class_lo_ra_w_a_n_node.html | 21 ++ class_lo_ra_w_a_n_node.js | 1 + functions_s.html | 7 +- functions_vars.html | 3 + navtreedata.js | 10 +- navtreeindex1.js | 6 +- navtreeindex2.js | 4 +- navtreeindex3.js | 4 +- navtreeindex4.js | 6 +- navtreeindex5.js | 4 +- navtreeindex6.js | 1 + search/all_10.js | 346 +++++++++++---------- search/all_11.js | 36 +-- search/all_12.js | 8 +- search/all_13.js | 8 +- search/all_14.js | 10 +- search/all_15.js | 2 +- search/all_16.js | 2 +- search/all_17.js | 8 +- search/classes_0.js | 8 +- search/classes_1.js | 4 +- search/classes_2.js | 2 +- search/classes_3.js | 2 +- search/classes_4.js | 2 +- search/classes_5.js | 4 +- search/classes_6.js | 2 +- search/classes_7.js | 2 +- search/classes_8.js | 42 +-- search/classes_9.js | 4 +- search/classes_a.js | 2 +- search/classes_b.js | 4 +- search/classes_c.js | 28 +- search/classes_d.js | 54 ++-- search/classes_e.js | 2 +- search/defines_0.js | 6 +- search/enums_0.js | 2 +- search/enumvalues_0.js | 20 +- search/files_0.js | 16 +- search/functions_0.js | 20 +- search/functions_1.js | 20 +- search/functions_10.js | 12 +- search/functions_11.js | 6 +- search/functions_12.js | 4 +- search/functions_13.js | 6 +- search/functions_14.js | 2 +- search/functions_15.js | 8 +- search/functions_2.js | 38 +-- search/functions_3.js | 32 +- search/functions_4.js | 16 +- search/functions_5.js | 14 +- search/functions_6.js | 88 +++--- search/functions_7.js | 2 +- search/functions_8.js | 20 +- search/functions_9.js | 14 +- search/functions_a.js | 10 +- search/functions_b.js | 4 +- search/functions_c.js | 2 +- search/functions_d.js | 14 +- search/functions_e.js | 36 +-- search/functions_f.js | 302 +++++++++--------- search/groups_0.js | 2 +- search/groups_1.js | 2 +- search/groups_2.js | 2 +- search/groups_3.js | 4 +- search/groups_4.js | 4 +- search/groups_5.js | 2 +- search/pages_0.js | 2 +- search/pages_1.js | 2 +- search/typedefs_0.js | 2 +- search/typedefs_1.js | 4 +- search/variables_0.js | 4 +- search/variables_1.js | 10 +- search/variables_10.js | 27 +- search/variables_11.js | 18 +- search/variables_12.js | 2 +- search/variables_13.js | 4 +- search/variables_14.js | 4 +- search/variables_15.js | 2 +- search/variables_2.js | 22 +- search/variables_3.js | 26 +- search/variables_4.js | 4 +- search/variables_5.js | 40 +-- search/variables_6.js | 12 +- search/variables_7.js | 6 +- search/variables_8.js | 10 +- search/variables_9.js | 4 +- search/variables_a.js | 12 +- search/variables_b.js | 8 +- search/variables_c.js | 12 +- search/variables_d.js | 4 +- search/variables_e.js | 20 +- search/variables_f.js | 28 +- 94 files changed, 1102 insertions(+), 1066 deletions(-) diff --git a/_lo_ra_w_a_n_8h_source.html b/_lo_ra_w_a_n_8h_source.html index fdc96c72..11d55a68 100644 --- a/_lo_ra_w_a_n_8h_source.html +++ b/_lo_ra_w_a_n_8h_source.html @@ -608,259 +608,262 @@ $(document).ready(function(){initNavTree('_lo_ra_w_a_n_8h_source.html',''); init
867 
872  bool TS009 = false;
873 
-
874 #if !RADIOLIB_GODMODE
-
875  private:
-
876 #endif
-
877  PhysicalLayer* phyLayer = NULL;
-
878  const LoRaWANBand_t* band = NULL;
-
879 
-
880  static int16_t checkBufferCommon(uint8_t *buffer, uint16_t size);
-
881 
-
882  void activateCommon(uint8_t initialDr);
-
883 
-
884  // a buffer that holds all LW base parameters that should persist at all times!
-
885  uint8_t bufferNonces[RADIOLIB_LORAWAN_NONCES_BUF_SIZE] = { 0 };
-
886 
-
887  // a buffer that holds all LW session parameters that preferably persist, but can be afforded to get lost
-
888  uint8_t bufferSession[RADIOLIB_LORAWAN_SESSION_BUF_SIZE] = { 0 };
-
889 
-
890  LoRaWANMacCommandQueue_t commandsUp = {
-
891  .numCommands = 0,
-
892  .len = 0,
-
893  .commands = { { .cid = 0, .payload = { 0 }, .len = 0, .repeat = 0, } },
-
894  };
-
895  LoRaWANMacCommandQueue_t commandsDown = {
-
896  .numCommands = 0,
-
897  .len = 0,
-
898  .commands = { { .cid = 0, .payload = { 0 }, .len = 0, .repeat = 0, } },
-
899  };
+
886  RadioLibTime_t scanGuard = 10;
+
887 
+
888 #if !RADIOLIB_GODMODE
+
889  private:
+
890 #endif
+
891  PhysicalLayer* phyLayer = NULL;
+
892  const LoRaWANBand_t* band = NULL;
+
893 
+
894  static int16_t checkBufferCommon(uint8_t *buffer, uint16_t size);
+
895 
+
896  void activateCommon(uint8_t initialDr);
+
897 
+
898  // a buffer that holds all LW base parameters that should persist at all times!
+
899  uint8_t bufferNonces[RADIOLIB_LORAWAN_NONCES_BUF_SIZE] = { 0 };
900 
-
901  uint16_t lwMode = RADIOLIB_LORAWAN_MODE_NONE;
-
902  uint8_t lwClass = RADIOLIB_LORAWAN_CLASS_A;
-
903  bool isActive = false;
-
904 
-
905  uint64_t joinEUI = 0;
-
906  uint64_t devEUI = 0;
-
907  uint8_t nwkKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
908  uint8_t appKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
909 
-
910  // the following is either provided by the network server (OTAA)
-
911  // or directly entered by the user (ABP)
-
912  uint32_t devAddr = 0;
-
913  uint8_t appSKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
914  uint8_t fNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
915  uint8_t sNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
916  uint8_t nwkSEncKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
-
917  uint8_t jSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
901  // a buffer that holds all LW session parameters that preferably persist, but can be afforded to get lost
+
902  uint8_t bufferSession[RADIOLIB_LORAWAN_SESSION_BUF_SIZE] = { 0 };
+
903 
+
904  LoRaWANMacCommandQueue_t commandsUp = {
+
905  .numCommands = 0,
+
906  .len = 0,
+
907  .commands = { { .cid = 0, .payload = { 0 }, .len = 0, .repeat = 0, } },
+
908  };
+
909  LoRaWANMacCommandQueue_t commandsDown = {
+
910  .numCommands = 0,
+
911  .len = 0,
+
912  .commands = { { .cid = 0, .payload = { 0 }, .len = 0, .repeat = 0, } },
+
913  };
+
914 
+
915  uint16_t lwMode = RADIOLIB_LORAWAN_MODE_NONE;
+
916  uint8_t lwClass = RADIOLIB_LORAWAN_CLASS_A;
+
917  bool isActive = false;
918 
-
919  uint16_t keyCheckSum = 0;
-
920 
-
921  // device-specific parameters, persistent through sessions
-
922  uint16_t devNonce = 0;
-
923  uint32_t joinNonce = 0;
-
924 
-
925  // session-specific parameters
-
926  uint32_t homeNetId = 0;
-
927  uint8_t adrLimitExp = RADIOLIB_LORAWAN_ADR_ACK_LIMIT_EXP;
-
928  uint8_t adrDelayExp = RADIOLIB_LORAWAN_ADR_ACK_DELAY_EXP;
-
929  uint8_t nbTrans = 1; // Number of allowed frame retransmissions
-
930  uint8_t txPowerSteps = 0;
-
931  uint8_t txPowerMax = 0;
-
932  uint32_t fCntUp = 0;
-
933  uint32_t aFCntDown = 0;
-
934  uint32_t nFCntDown = 0;
-
935  uint32_t confFCntUp = RADIOLIB_LORAWAN_FCNT_NONE;
-
936  uint32_t confFCntDown = RADIOLIB_LORAWAN_FCNT_NONE;
-
937  uint32_t adrFCnt = 0;
+
919  uint64_t joinEUI = 0;
+
920  uint64_t devEUI = 0;
+
921  uint8_t nwkKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
922  uint8_t appKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
923 
+
924  // the following is either provided by the network server (OTAA)
+
925  // or directly entered by the user (ABP)
+
926  uint32_t devAddr = 0;
+
927  uint8_t appSKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
928  uint8_t fNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
929  uint8_t sNwkSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
930  uint8_t nwkSEncKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
931  uint8_t jSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
+
932 
+
933  uint16_t keyCheckSum = 0;
+
934 
+
935  // device-specific parameters, persistent through sessions
+
936  uint16_t devNonce = 0;
+
937  uint32_t joinNonce = 0;
938 
-
939  // modulation of the currently configured channel
-
940  uint8_t modulation = RADIOLIB_LORAWAN_MODULATION_LORA;
-
941 
-
942  // ADR is enabled by default
-
943  bool adrEnabled = true;
-
944 
-
945  // duty cycle is set upon initialization and activated in regions that impose this
-
946  bool dutyCycleEnabled = false;
-
947  uint32_t dutyCycle = 0;
-
948 
-
949  // dwell time is set upon initialization and activated in regions that impose this
-
950  bool dwellTimeEnabledUp = false;
-
951  uint16_t dwellTimeUp = 0;
-
952  bool dwellTimeEnabledDn = false;
-
953  uint16_t dwellTimeDn = 0;
-
954 
-
955  // enable/disable CSMA for LoRaWAN
-
956  bool enableCSMA;
-
957 
-
958  // number of backoff slots to be decremented after DIFS phase. 0 to disable BO.
-
959  // A random BO avoids collisions in the case where two or more nodes start the CSMA
-
960  // process at the same time.
-
961  uint8_t backoffMax;
-
962 
-
963  // number of CADs to estimate a clear CH
-
964  uint8_t difsSlots;
-
965 
-
966  // available channel frequencies from list passed during OTA activation
-
967  LoRaWANChannel_t availableChannels[2][RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS];
-
968 
-
969  // currently configured channels for TX and RX1
-
970  LoRaWANChannel_t currentChannels[2] = { RADIOLIB_LORAWAN_CHANNEL_NONE, RADIOLIB_LORAWAN_CHANNEL_NONE };
+
939  // session-specific parameters
+
940  uint32_t homeNetId = 0;
+
941  uint8_t adrLimitExp = RADIOLIB_LORAWAN_ADR_ACK_LIMIT_EXP;
+
942  uint8_t adrDelayExp = RADIOLIB_LORAWAN_ADR_ACK_DELAY_EXP;
+
943  uint8_t nbTrans = 1; // Number of allowed frame retransmissions
+
944  uint8_t txPowerSteps = 0;
+
945  uint8_t txPowerMax = 0;
+
946  uint32_t fCntUp = 0;
+
947  uint32_t aFCntDown = 0;
+
948  uint32_t nFCntDown = 0;
+
949  uint32_t confFCntUp = RADIOLIB_LORAWAN_FCNT_NONE;
+
950  uint32_t confFCntDown = RADIOLIB_LORAWAN_FCNT_NONE;
+
951  uint32_t adrFCnt = 0;
+
952 
+
953  // modulation of the currently configured channel
+
954  uint8_t modulation = RADIOLIB_LORAWAN_MODULATION_LORA;
+
955 
+
956  // ADR is enabled by default
+
957  bool adrEnabled = true;
+
958 
+
959  // duty cycle is set upon initialization and activated in regions that impose this
+
960  bool dutyCycleEnabled = false;
+
961  uint32_t dutyCycle = 0;
+
962 
+
963  // dwell time is set upon initialization and activated in regions that impose this
+
964  bool dwellTimeEnabledUp = false;
+
965  uint16_t dwellTimeUp = 0;
+
966  bool dwellTimeEnabledDn = false;
+
967  uint16_t dwellTimeDn = 0;
+
968 
+
969  // enable/disable CSMA for LoRaWAN
+
970  bool enableCSMA;
971 
-
972  // currently configured datarates for TX and RX1
-
973  uint8_t dataRates[2] = { RADIOLIB_LORAWAN_DATA_RATE_UNUSED, RADIOLIB_LORAWAN_DATA_RATE_UNUSED };
-
974 
-
975  // Rx2 channel properties - may be changed by MAC command
-
976  LoRaWANChannel_t rx2 = RADIOLIB_LORAWAN_CHANNEL_NONE;
-
977 
-
978  // offset between TX and RX1 (such that RX1 has equal or lower DR)
-
979  uint8_t rx1DrOffset = 0;
-
980 
-
981  // LoRaWAN revision (1.0 vs 1.1)
-
982  uint8_t rev = 0;
-
983 
-
984  // Time on Air of last uplink
-
985  RadioLibTime_t lastToA = 0;
-
986 
-
987  // timestamp to measure the RX1/2 delay (from uplink end)
-
988  RadioLibTime_t rxDelayStart = 0;
-
989 
-
990  // timestamp when the Rx1/2 windows were closed (timeout or uplink received)
-
991  RadioLibTime_t rxDelayEnd = 0;
-
992 
-
993  // delays between the uplink and RX1/2 windows
-
994  RadioLibTime_t rxDelays[2] = { RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS, RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS };
-
995 
-
996  // device status - battery level
-
997  uint8_t battLevel = 0xFF;
-
998 
-
999  // indicates whether an uplink has MAC commands as payload
-
1000  bool isMACPayload = false;
-
1001 
-
1002  // save the selected sub-band in case this must be restored in ADR control
-
1003  uint8_t subBand = 0;
-
1004 
-
1005  // initalize the Nonces buffer after beginX() has been called
-
1006  void createNonces();
-
1007 
-
1008  // this will reset the device credentials, so the device starts completely new
-
1009  void clearNonces();
-
1010 
-
1011  // wait for, open and listen during Rx1 and Rx2 windows; only performs listening
-
1012  int16_t downlinkCommon();
-
1013 
-
1014  // method to generate message integrity code
-
1015  uint32_t generateMIC(uint8_t* msg, size_t len, uint8_t* key);
-
1016 
-
1017  // method to verify message integrity code
-
1018  // it assumes that the MIC is the last 4 bytes of the message
-
1019  bool verifyMIC(uint8_t* msg, size_t len, uint8_t* key);
-
1020 
-
1021  // configure the common physical layer properties (preamble, sync word etc.)
-
1022  // channels must be configured separately by setupChannelsDyn()!
-
1023  int16_t setPhyProperties(uint8_t dir);
+
972  // number of backoff slots to be decremented after DIFS phase. 0 to disable BO.
+
973  // A random BO avoids collisions in the case where two or more nodes start the CSMA
+
974  // process at the same time.
+
975  uint8_t backoffMax;
+
976 
+
977  // number of CADs to estimate a clear CH
+
978  uint8_t difsSlots;
+
979 
+
980  // available channel frequencies from list passed during OTA activation
+
981  LoRaWANChannel_t availableChannels[2][RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS];
+
982 
+
983  // currently configured channels for TX and RX1
+
984  LoRaWANChannel_t currentChannels[2] = { RADIOLIB_LORAWAN_CHANNEL_NONE, RADIOLIB_LORAWAN_CHANNEL_NONE };
+
985 
+
986  // currently configured datarates for TX and RX1
+
987  uint8_t dataRates[2] = { RADIOLIB_LORAWAN_DATA_RATE_UNUSED, RADIOLIB_LORAWAN_DATA_RATE_UNUSED };
+
988 
+
989  // Rx2 channel properties - may be changed by MAC command
+
990  LoRaWANChannel_t rx2 = RADIOLIB_LORAWAN_CHANNEL_NONE;
+
991 
+
992  // offset between TX and RX1 (such that RX1 has equal or lower DR)
+
993  uint8_t rx1DrOffset = 0;
+
994 
+
995  // LoRaWAN revision (1.0 vs 1.1)
+
996  uint8_t rev = 0;
+
997 
+
998  // Time on Air of last uplink
+
999  RadioLibTime_t lastToA = 0;
+
1000 
+
1001  // timestamp to measure the RX1/2 delay (from uplink end)
+
1002  RadioLibTime_t rxDelayStart = 0;
+
1003 
+
1004  // timestamp when the Rx1/2 windows were closed (timeout or uplink received)
+
1005  RadioLibTime_t rxDelayEnd = 0;
+
1006 
+
1007  // delays between the uplink and RX1/2 windows
+
1008  RadioLibTime_t rxDelays[2] = { RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS, RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS };
+
1009 
+
1010  // device status - battery level
+
1011  uint8_t battLevel = 0xFF;
+
1012 
+
1013  // indicates whether an uplink has MAC commands as payload
+
1014  bool isMACPayload = false;
+
1015 
+
1016  // save the selected sub-band in case this must be restored in ADR control
+
1017  uint8_t subBand = 0;
+
1018 
+
1019  // initalize the Nonces buffer after beginX() has been called
+
1020  void createNonces();
+
1021 
+
1022  // this will reset the device credentials, so the device starts completely new
+
1023  void clearNonces();
1024 
-
1025  // print the available channels through debug
-
1026  void printChannels();
+
1025  // wait for, open and listen during Rx1 and Rx2 windows; only performs listening
+
1026  int16_t downlinkCommon();
1027 
-
1028  // setup uplink/downlink channel data rates and frequencies
-
1029  // for dynamic channels, there is a small set of predefined channels
-
1030  // in case of JoinRequest, add some optional extra frequencies
-
1031  int16_t setupChannelsDyn(bool joinRequest = false);
-
1032 
-
1033  // setup uplink/downlink channel data rates and frequencies
-
1034  // for fixed bands, we only allow one sub-band at a time to be selected
-
1035  int16_t setupChannelsFix(uint8_t subBand);
-
1036 
-
1037  // a join-accept can piggy-back a set of channels or channel masks
-
1038  int16_t processCFList(uint8_t* cfList);
-
1039 
-
1040  // select a set of random TX/RX channels for up- and downlink
-
1041  int16_t selectChannels();
-
1042 
-
1043  // find the first usable data rate for the given band
-
1044  int16_t findDataRate(uint8_t dr, DataRate_t* dataRate);
-
1045 
-
1046  // restore all available channels from persistent storage
-
1047  int16_t restoreChannels();
-
1048 
-
1049  // push MAC command to queue, done by copy
-
1050  int16_t pushMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue);
-
1051 
-
1052  // delete a specific MAC command from queue, indicated by the command ID
-
1053  // if a payload pointer is supplied, this returns the payload of the MAC command
-
1054  int16_t deleteMacCommand(uint8_t cid, LoRaWANMacCommandQueue_t* queue, uint8_t* payload = NULL);
-
1055 
-
1056  // execute mac command, return the number of processed bytes for sequential processing
-
1057  bool execMacCommand(LoRaWANMacCommand_t* cmd);
-
1058 
-
1059  // apply a channel mask to a set of readily defined channels (dynamic bands only)
-
1060  bool applyChannelMaskDyn(uint8_t chMaskCntl, uint16_t chMask);
-
1061 
-
1062  // define or delete channels from a fixed set of channels (fixed bands only)
-
1063  bool applyChannelMaskFix(uint8_t chMaskCntl, uint16_t chMask);
-
1064 
-
1065  // get the payload length for a specific MAC command
-
1066  uint8_t getMacPayloadLength(uint8_t cid);
-
1067 
-
1074  void setCSMA(uint8_t backoffMax, uint8_t difsSlots, bool enableCSMA = false);
+
1028  // method to generate message integrity code
+
1029  uint32_t generateMIC(uint8_t* msg, size_t len, uint8_t* key);
+
1030 
+
1031  // method to verify message integrity code
+
1032  // it assumes that the MIC is the last 4 bytes of the message
+
1033  bool verifyMIC(uint8_t* msg, size_t len, uint8_t* key);
+
1034 
+
1035  // configure the common physical layer properties (preamble, sync word etc.)
+
1036  // channels must be configured separately by setupChannelsDyn()!
+
1037  int16_t setPhyProperties(uint8_t dir);
+
1038 
+
1039  // print the available channels through debug
+
1040  void printChannels();
+
1041 
+
1042  // setup uplink/downlink channel data rates and frequencies
+
1043  // for dynamic channels, there is a small set of predefined channels
+
1044  // in case of JoinRequest, add some optional extra frequencies
+
1045  int16_t setupChannelsDyn(bool joinRequest = false);
+
1046 
+
1047  // setup uplink/downlink channel data rates and frequencies
+
1048  // for fixed bands, we only allow one sub-band at a time to be selected
+
1049  int16_t setupChannelsFix(uint8_t subBand);
+
1050 
+
1051  // a join-accept can piggy-back a set of channels or channel masks
+
1052  int16_t processCFList(uint8_t* cfList);
+
1053 
+
1054  // select a set of random TX/RX channels for up- and downlink
+
1055  int16_t selectChannels();
+
1056 
+
1057  // find the first usable data rate for the given band
+
1058  int16_t findDataRate(uint8_t dr, DataRate_t* dataRate);
+
1059 
+
1060  // restore all available channels from persistent storage
+
1061  int16_t restoreChannels();
+
1062 
+
1063  // push MAC command to queue, done by copy
+
1064  int16_t pushMacCommand(LoRaWANMacCommand_t* cmd, LoRaWANMacCommandQueue_t* queue);
+
1065 
+
1066  // delete a specific MAC command from queue, indicated by the command ID
+
1067  // if a payload pointer is supplied, this returns the payload of the MAC command
+
1068  int16_t deleteMacCommand(uint8_t cid, LoRaWANMacCommandQueue_t* queue, uint8_t* payload = NULL);
+
1069 
+
1070  // execute mac command, return the number of processed bytes for sequential processing
+
1071  bool execMacCommand(LoRaWANMacCommand_t* cmd);
+
1072 
+
1073  // apply a channel mask to a set of readily defined channels (dynamic bands only)
+
1074  bool applyChannelMaskDyn(uint8_t chMaskCntl, uint16_t chMask);
1075 
-
1076  // Performs CSMA as per LoRa Alliance Technical Recommendation 13 (TR-013).
-
1077  void performCSMA();
+
1076  // define or delete channels from a fixed set of channels (fixed bands only)
+
1077  bool applyChannelMaskFix(uint8_t chMaskCntl, uint16_t chMask);
1078 
-
1079  // perform a single CAD operation for the under SF/CH combination. Returns either busy or otherwise.
-
1080  bool performCAD();
-
1081 
-
1082  // function to encrypt and decrypt payloads
-
1083  void processAES(const uint8_t* in, size_t len, uint8_t* key, uint8_t* out, uint32_t fCnt, uint8_t dir, uint8_t ctrId, bool counter);
-
1084 
-
1085  // 16-bit checksum method that takes a uint8_t array of even length and calculates the checksum
-
1086  static uint16_t checkSum16(uint8_t *key, uint16_t keyLen);
-
1087 
-
1088  // network-to-host conversion method - takes data from network packet and converts it to the host endians
-
1089  template<typename T>
-
1090  static T ntoh(uint8_t* buff, size_t size = 0);
-
1091 
-
1092  // host-to-network conversion method - takes data from host variable and and converts it to network packet endians
-
1093  template<typename T>
-
1094  static void hton(uint8_t* buff, T val, size_t size = 0);
-
1095 };
-
1096 
-
1097 #endif
+
1079  // get the payload length for a specific MAC command
+
1080  uint8_t getMacPayloadLength(uint8_t cid);
+
1081 
+
1088  void setCSMA(uint8_t backoffMax, uint8_t difsSlots, bool enableCSMA = false);
+
1089 
+
1090  // Performs CSMA as per LoRa Alliance Technical Recommendation 13 (TR-013).
+
1091  void performCSMA();
+
1092 
+
1093  // perform a single CAD operation for the under SF/CH combination. Returns either busy or otherwise.
+
1094  bool performCAD();
+
1095 
+
1096  // function to encrypt and decrypt payloads
+
1097  void processAES(const uint8_t* in, size_t len, uint8_t* key, uint8_t* out, uint32_t fCnt, uint8_t dir, uint8_t ctrId, bool counter);
+
1098 
+
1099  // 16-bit checksum method that takes a uint8_t array of even length and calculates the checksum
+
1100  static uint16_t checkSum16(uint8_t *key, uint16_t keyLen);
+
1101 
+
1102  // network-to-host conversion method - takes data from network packet and converts it to the host endians
+
1103  template<typename T>
+
1104  static T ntoh(uint8_t* buff, size_t size = 0);
+
1105 
+
1106  // host-to-network conversion method - takes data from host variable and and converts it to network packet endians
+
1107  template<typename T>
+
1108  static void hton(uint8_t* buff, T val, size_t size = 0);
+
1109 };
+
1110 
+
1111 #endif
LoRaWAN-compatible node (class A device).
Definition: LoRaWAN.h:524
void clearSession()
Clear an active session, so that the device will have to rejoin the network.
Definition: LoRaWAN.cpp:69
int16_t setBufferNonces(uint8_t *persistentBuffer)
Fill the internal buffer that holds the LW base parameters with a supplied buffer.
Definition: LoRaWAN.cpp:85
-
int16_t setDatarate(uint8_t drUp)
Set uplink datarate. This should not be used when ADR is enabled.
Definition: LoRaWAN.cpp:2024
+
int16_t setDatarate(uint8_t drUp)
Set uplink datarate. This should not be used when ADR is enabled.
Definition: LoRaWAN.cpp:2020
int16_t uplink(const char *str, uint8_t fPort, bool isConfirmed=false, LoRaWANEvent_t *event=NULL)
Send a message to the server.
Definition: LoRaWAN.cpp:895
+
RadioLibTime_t scanGuard
Rx window padding in milliseconds according to the spec, the Rx window must be at least enough time t...
Definition: LoRaWAN.h:886
void beginOTAA(uint64_t joinEUI, uint64_t devEUI, uint8_t *nwkKey, uint8_t *appKey)
Set the device credentials and activation configuration.
Definition: LoRaWAN.cpp:457
-
uint8_t maxPayloadDwellTime()
Returns the maximum payload given the currently present dwell time limits. WARNING: the addition of M...
Definition: LoRaWAN.cpp:2107
-
void setDutyCycle(bool enable=true, RadioLibTime_t msPerHour=0)
Toggle adherence to dutyCycle limits to on or off.
Definition: LoRaWAN.cpp:2065
-
RadioLibTime_t timeUntilUplink()
Returns time in milliseconds until next uplink is available under dutyCycle limits.
Definition: LoRaWAN.cpp:2089
-
void setDeviceStatus(uint8_t battLevel)
Set device status.
Definition: LoRaWAN.cpp:1719
-
RadioLibTime_t dutyCycleInterval(RadioLibTime_t msPerHour, RadioLibTime_t airtime)
Calculate the minimum interval to adhere to a certain dutyCycle. This interval is based on the ToA of...
Definition: LoRaWAN.cpp:2079
-
void setDwellTime(bool enable, RadioLibTime_t msPerUplink=0)
Toggle adherence to dwellTime limits to on or off.
Definition: LoRaWAN.cpp:2098
-
uint32_t getAFCntDown()
Returns the last application downlink's frame counter; also 0 if no application downlink occured yet.
Definition: LoRaWAN.cpp:1735
-
RadioLibTime_t getLastToA()
Get the Time-on-air of the last uplink message.
Definition: LoRaWAN.cpp:2932
+
uint8_t maxPayloadDwellTime()
Returns the maximum payload given the currently present dwell time limits. WARNING: the addition of M...
Definition: LoRaWAN.cpp:2103
+
void setDutyCycle(bool enable=true, RadioLibTime_t msPerHour=0)
Toggle adherence to dutyCycle limits to on or off.
Definition: LoRaWAN.cpp:2061
+
RadioLibTime_t timeUntilUplink()
Returns time in milliseconds until next uplink is available under dutyCycle limits.
Definition: LoRaWAN.cpp:2085
+
void setDeviceStatus(uint8_t battLevel)
Set device status.
Definition: LoRaWAN.cpp:1715
+
RadioLibTime_t dutyCycleInterval(RadioLibTime_t msPerHour, RadioLibTime_t airtime)
Calculate the minimum interval to adhere to a certain dutyCycle. This interval is based on the ToA of...
Definition: LoRaWAN.cpp:2075
+
void setDwellTime(bool enable, RadioLibTime_t msPerUplink=0)
Toggle adherence to dwellTime limits to on or off.
Definition: LoRaWAN.cpp:2094
+
uint32_t getAFCntDown()
Returns the last application downlink's frame counter; also 0 if no application downlink occured yet.
Definition: LoRaWAN.cpp:1731
+
RadioLibTime_t getLastToA()
Get the Time-on-air of the last uplink message.
Definition: LoRaWAN.cpp:2928
int16_t activateABP(uint8_t initialDr=RADIOLIB_LORAWAN_DATA_RATE_UNUSED)
Join network by restoring ABP session or performing over-the-air activation. In this procedure,...
Definition: LoRaWAN.cpp:826
bool TS009
TS009 Protocol Specification Verification switch (allows FPort 224 and cuts off uplink payload instea...
Definition: LoRaWAN.h:872
uint8_t * getBufferNonces()
Returns the pointer to the internal buffer that holds the LW base parameters.
Definition: LoRaWAN.cpp:77
-
int16_t sendReceive(const char *strUp, uint8_t fPort, uint8_t *dataDown, size_t *lenDown, bool isConfirmed=false, LoRaWANEvent_t *eventUp=NULL, LoRaWANEvent_t *eventDown=NULL)
Send a message to the server and wait for a downlink during Rx1 and/or Rx2 window.
Definition: LoRaWAN.cpp:1699
+
int16_t sendReceive(const char *strUp, uint8_t fPort, uint8_t *dataDown, size_t *lenDown, bool isConfirmed=false, LoRaWANEvent_t *eventUp=NULL, LoRaWANEvent_t *eventDown=NULL)
Send a message to the server and wait for a downlink during Rx1 and/or Rx2 window.
Definition: LoRaWAN.cpp:1695
uint8_t * getBufferSession()
Returns the pointer to the internal buffer that holds the LW session parameters.
Definition: LoRaWAN.cpp:121
void beginABP(uint32_t addr, uint8_t *fNwkSIntKey, uint8_t *sNwkSIntKey, uint8_t *nwkSEncKey, uint8_t *appSKey)
Set the device credentials and activation configuration.
Definition: LoRaWAN.cpp:796
bool isActivated()
Whether there is an ongoing session active.
Definition: LoRaWAN.cpp:885
-
int16_t setTxPower(int8_t txPower)
Configure TX power of the radio module.
Definition: LoRaWAN.cpp:2128
-
int16_t getMacDeviceTimeAns(uint32_t *gpsEpoch, uint8_t *fraction, bool returnUnix=true)
Returns the network time after requesting a DeviceTime MAC command. Returns 'true' if a network respo...
Definition: LoRaWAN.cpp:2911
-
uint32_t getNFCntDown()
Returns the last network downlink's frame counter; also 0 if no network downlink occured yet.
Definition: LoRaWAN.cpp:1731
-
uint64_t getDevAddr()
Returns the DevAddr of the device, regardless of OTAA or ABP mode.
Definition: LoRaWAN.cpp:2928
-
int16_t downlink(uint8_t *data, size_t *len, LoRaWANEvent_t *event=NULL)
Wait for downlink from the server in either RX1 or RX2 window.
Definition: LoRaWAN.cpp:1344
+
int16_t setTxPower(int8_t txPower)
Configure TX power of the radio module.
Definition: LoRaWAN.cpp:2124
+
int16_t getMacDeviceTimeAns(uint32_t *gpsEpoch, uint8_t *fraction, bool returnUnix=true)
Returns the network time after requesting a DeviceTime MAC command. Returns 'true' if a network respo...
Definition: LoRaWAN.cpp:2907
+
uint32_t getNFCntDown()
Returns the last network downlink's frame counter; also 0 if no network downlink occured yet.
Definition: LoRaWAN.cpp:1727
+
uint64_t getDevAddr()
Returns the DevAddr of the device, regardless of OTAA or ABP mode.
Definition: LoRaWAN.cpp:2924
+
int16_t downlink(uint8_t *data, size_t *len, LoRaWANEvent_t *event=NULL)
Wait for downlink from the server in either RX1 or RX2 window.
Definition: LoRaWAN.cpp:1340
int16_t setBufferSession(uint8_t *persistentBuffer)
Fill the internal buffer that holds the LW session parameters with a supplied buffer.
Definition: LoRaWAN.cpp:140
LoRaWANNode(PhysicalLayer *phy, const LoRaWANBand_t *band, uint8_t subBand=0)
Default constructor.
Definition: LoRaWAN.cpp:30
int16_t activateOTAA(uint8_t initialDr=RADIOLIB_LORAWAN_DATA_RATE_UNUSED, LoRaWANJoinEvent_t *joinEvent=NULL)
Join network by restoring OTAA session or performing over-the-air activation. By this procedure,...
Definition: LoRaWAN.cpp:484
-
uint32_t getFCntUp()
Returns the last uplink's frame counter; also 0 if no uplink occured yet.
Definition: LoRaWAN.cpp:1724
-
int16_t setRx2Dr(uint8_t dr)
Configure the Rx2 datarate for ABP mode. This should not be needed for LoRaWAN 1.1 as it is configure...
Definition: LoRaWAN.cpp:2192
-
int16_t sendMacCommandReq(uint8_t cid)
Add a MAC command to the uplink queue. Only LinkCheck and DeviceTime are available to the user....
Definition: LoRaWAN.cpp:2219
-
int16_t getMacLinkCheckAns(uint8_t *margin, uint8_t *gwCnt)
Returns the quality of connectivity after requesting a LinkCheck MAC command. Returns 'true' if a net...
Definition: LoRaWAN.cpp:2900
-
void setADR(bool enable=true)
Toggle ADR to on or off.
Definition: LoRaWAN.cpp:2061
-
void resetFCntDown()
Reset the downlink frame counters (application and network) This is unsafe and can possibly allow rep...
Definition: LoRaWAN.cpp:1739
+
uint32_t getFCntUp()
Returns the last uplink's frame counter; also 0 if no uplink occured yet.
Definition: LoRaWAN.cpp:1720
+
int16_t setRx2Dr(uint8_t dr)
Configure the Rx2 datarate for ABP mode. This should not be needed for LoRaWAN 1.1 as it is configure...
Definition: LoRaWAN.cpp:2188
+
int16_t sendMacCommandReq(uint8_t cid)
Add a MAC command to the uplink queue. Only LinkCheck and DeviceTime are available to the user....
Definition: LoRaWAN.cpp:2215
+
int16_t getMacLinkCheckAns(uint8_t *margin, uint8_t *gwCnt)
Returns the quality of connectivity after requesting a LinkCheck MAC command. Returns 'true' if a net...
Definition: LoRaWAN.cpp:2896
+
void setADR(bool enable=true)
Toggle ADR to on or off.
Definition: LoRaWAN.cpp:2057
+
void resetFCntDown()
Reset the downlink frame counters (application and network) This is unsafe and can possibly allow rep...
Definition: LoRaWAN.cpp:1735
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition: PhysicalLayer.h:54
unsigned long RadioLibTime_t
Type used for durations in RadioLib.
Definition: TypeDef.h:616
Structure to save information about LoRaWAN band.
Definition: LoRaWAN.h:386
diff --git a/class_lo_ra_w_a_n_node-members.html b/class_lo_ra_w_a_n_node-members.html index 1497cfc9..456bc5dc 100644 --- a/class_lo_ra_w_a_n_node-members.html +++ b/class_lo_ra_w_a_n_node-members.html @@ -110,23 +110,24 @@ $(document).ready(function(){initNavTree('class_lo_ra_w_a_n_node.html',''); init LoRaWANNode(PhysicalLayer *phy, const LoRaWANBand_t *band, uint8_t subBand=0)LoRaWANNode maxPayloadDwellTime()LoRaWANNode resetFCntDown()LoRaWANNode - sendMacCommandReq(uint8_t cid)LoRaWANNode - sendReceive(const char *strUp, uint8_t fPort, uint8_t *dataDown, size_t *lenDown, bool isConfirmed=false, LoRaWANEvent_t *eventUp=NULL, LoRaWANEvent_t *eventDown=NULL)LoRaWANNode - sendReceive(uint8_t *dataUp, size_t lenUp, uint8_t fPort, uint8_t *dataDown, size_t *lenDown, bool isConfirmed=false, LoRaWANEvent_t *eventUp=NULL, LoRaWANEvent_t *eventDown=NULL)LoRaWANNode - sendReceive(uint8_t *dataUp, size_t lenUp, uint8_t fPort=1, bool isConfirmed=false, LoRaWANEvent_t *eventUp=NULL, LoRaWANEvent_t *eventDown=NULL)LoRaWANNode - setADR(bool enable=true)LoRaWANNode - setBufferNonces(uint8_t *persistentBuffer)LoRaWANNode - setBufferSession(uint8_t *persistentBuffer)LoRaWANNode - setDatarate(uint8_t drUp)LoRaWANNode - setDeviceStatus(uint8_t battLevel)LoRaWANNode - setDutyCycle(bool enable=true, RadioLibTime_t msPerHour=0)LoRaWANNode - setDwellTime(bool enable, RadioLibTime_t msPerUplink=0)LoRaWANNode - setRx2Dr(uint8_t dr)LoRaWANNode - setTxPower(int8_t txPower)LoRaWANNode - timeUntilUplink()LoRaWANNode - TS009LoRaWANNode - uplink(const char *str, uint8_t fPort, bool isConfirmed=false, LoRaWANEvent_t *event=NULL)LoRaWANNode - uplink(uint8_t *data, size_t len, uint8_t fPort, bool isConfirmed=false, LoRaWANEvent_t *event=NULL)LoRaWANNode + scanGuardLoRaWANNode + sendMacCommandReq(uint8_t cid)LoRaWANNode + sendReceive(const char *strUp, uint8_t fPort, uint8_t *dataDown, size_t *lenDown, bool isConfirmed=false, LoRaWANEvent_t *eventUp=NULL, LoRaWANEvent_t *eventDown=NULL)LoRaWANNode + sendReceive(uint8_t *dataUp, size_t lenUp, uint8_t fPort, uint8_t *dataDown, size_t *lenDown, bool isConfirmed=false, LoRaWANEvent_t *eventUp=NULL, LoRaWANEvent_t *eventDown=NULL)LoRaWANNode + sendReceive(uint8_t *dataUp, size_t lenUp, uint8_t fPort=1, bool isConfirmed=false, LoRaWANEvent_t *eventUp=NULL, LoRaWANEvent_t *eventDown=NULL)LoRaWANNode + setADR(bool enable=true)LoRaWANNode + setBufferNonces(uint8_t *persistentBuffer)LoRaWANNode + setBufferSession(uint8_t *persistentBuffer)LoRaWANNode + setDatarate(uint8_t drUp)LoRaWANNode + setDeviceStatus(uint8_t battLevel)LoRaWANNode + setDutyCycle(bool enable=true, RadioLibTime_t msPerHour=0)LoRaWANNode + setDwellTime(bool enable, RadioLibTime_t msPerUplink=0)LoRaWANNode + setRx2Dr(uint8_t dr)LoRaWANNode + setTxPower(int8_t txPower)LoRaWANNode + timeUntilUplink()LoRaWANNode + TS009LoRaWANNode + uplink(const char *str, uint8_t fPort, bool isConfirmed=false, LoRaWANEvent_t *event=NULL)LoRaWANNode + uplink(uint8_t *data, size_t len, uint8_t fPort, bool isConfirmed=false, LoRaWANEvent_t *event=NULL)LoRaWANNode diff --git a/class_lo_ra_w_a_n_node.html b/class_lo_ra_w_a_n_node.html index 16b4b114..da6057a7 100644 --- a/class_lo_ra_w_a_n_node.html +++ b/class_lo_ra_w_a_n_node.html @@ -224,6 +224,9 @@ Public Attributes bool TS009 = false  TS009 Protocol Specification Verification switch (allows FPort 224 and cuts off uplink payload instead of rejecting if maximum length exceeded).
  +RadioLibTime_t scanGuard = 10 + Rx window padding in milliseconds according to the spec, the Rx window must be at least enough time to effectively detect a preamble but we pad it a bit on both sides (start and end) to make sure it is wide enough The larger this number the more power will be consumed! So be careful about changing it. For debugging purposes 50 is a reasonable start, but for production devices it should be as low as possible. 0 is a valid time. More...

Detailed Description

LoRaWAN-compatible node (class A device).

@@ -1335,6 +1338,24 @@ bool 
Returns
Status Codes
+
+ +

Member Data Documentation

+ +

◆ scanGuard

+ +
+
+ + + + +
RadioLibTime_t LoRaWANNode::scanGuard = 10
+
+ +

Rx window padding in milliseconds according to the spec, the Rx window must be at least enough time to effectively detect a preamble but we pad it a bit on both sides (start and end) to make sure it is wide enough The larger this number the more power will be consumed! So be careful about changing it. For debugging purposes 50 is a reasonable start, but for production devices it should be as low as possible. 0 is a valid time.

+

500 is the maximum value, but it is not a good idea to go anywhere near that. If you have to go above 50 you probably have a bug somewhere. Check your device timing.

+

The documentation for this class was generated from the following files: