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