From 7fef4e325a0c75b48168f0cb7f7c786514b38d1b Mon Sep 17 00:00:00 2001 From: StevenCellist <47155822+StevenCellist@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:33:58 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20aecef?= =?UTF-8?q?283807d5e5fb0e88bbf4dba41b25bd75cc4=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 | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/_lo_ra_w_a_n_8h_source.html b/_lo_ra_w_a_n_8h_source.html index e4983beb..4eab6f2d 100644 --- a/_lo_ra_w_a_n_8h_source.html +++ b/_lo_ra_w_a_n_8h_source.html @@ -882,7 +882,33 @@ $(document).ready(function(){initNavTree('_lo_ra_w_a_n_8h_source.html',''); init
1127  static void hton(uint8_t* buff, T val, size_t size = 0);
1128 };
1129 
-
1130 #endif
+
1130 template<typename T>
+
1131 T LoRaWANNode::ntoh(uint8_t* buff, size_t size) {
+
1132  uint8_t* buffPtr = buff;
+
1133  size_t targetSize = sizeof(T);
+
1134  if(size != 0) {
+
1135  targetSize = size;
+
1136  }
+
1137  T res = 0;
+
1138  for(size_t i = 0; i < targetSize; i++) {
+
1139  res |= (uint32_t)(*(buffPtr++)) << 8*i;
+
1140  }
+
1141  return(res);
+
1142 }
+
1143 
+
1144 template<typename T>
+
1145 void LoRaWANNode::hton(uint8_t* buff, T val, size_t size) {
+
1146  uint8_t* buffPtr = buff;
+
1147  size_t targetSize = sizeof(T);
+
1148  if(size != 0) {
+
1149  targetSize = size;
+
1150  }
+
1151  for(size_t i = 0; i < targetSize; i++) {
+
1152  *(buffPtr++) = val >> 8*i;
+
1153  }
+
1154 }
+
1155 
+
1156 #endif
LoRaWANNode
LoRaWAN-compatible node (class A device).
Definition: LoRaWAN.h:530
LoRaWANNode::clearSession
void clearSession()
Clear an active session, so that the device will have to rejoin the network.
Definition: LoRaWAN.cpp:280
LoRaWANNode::setBufferNonces
int16_t setBufferNonces(uint8_t *persistentBuffer)
Fill the internal buffer that holds the LW base parameters with a supplied buffer.
Definition: LoRaWAN.cpp:244