ver1

Revision:
153:7c00843e4bba
Parent:
151:2242ecfd733a
Child:
155:ecb07dbd16e3
--- a/plans/ChannelPlan_IN865.cpp	Thu May 10 13:53:26 2018 -0500
+++ b/plans/ChannelPlan_IN865.cpp	Tue May 29 12:02:57 2018 -0500
@@ -88,7 +88,7 @@
     _numChans125k = 16;
     _numChans500k = 0;
 
-    GetSettings()->Session.Rx2Frequency = 865550000;
+    GetSettings()->Session.Rx2Frequency = 866550000;
     GetSettings()->Session.Rx2DatarateIndex = DR_2;
 
     logInfo("Initialize datarates...");
@@ -878,10 +878,24 @@
 
 uint8_t lora::ChannelPlan_IN865::GetJoinDatarate() {
     uint8_t dr = GetSettings()->Session.TxDatarate;
-    
-    // Default join datarate is DR2:SF10BW125
-    dr = lora::DR_2;
-    
+    static uint8_t cnt = 0;
+
+    if (GetSettings()->Test.DisableRandomJoinDatarate == lora::OFF) {
+        if ((cnt++ % 20) == 0) {
+            dr = lora::DR_0;
+        } else if ((cnt % 16) == 0) {
+            dr = lora::DR_1;
+        } else if ((cnt % 12) == 0) {
+            dr = lora::DR_2;
+        } else if ((cnt % 8) == 0) {
+            dr = lora::DR_3;
+        } else if ((cnt % 4) == 0) {
+            dr = lora::DR_4;
+        } else {
+            dr = lora::DR_5;
+        }
+    }
+
     return dr;
 }