ver1

Revision:
178:8f7d93f3bbb5
Parent:
172:7ec44396a51b
Child:
179:578d8030ba57
diff -r e884b333c060 -r 8f7d93f3bbb5 plans/ChannelPlan_US915.cpp
--- a/plans/ChannelPlan_US915.cpp	Wed Sep 05 16:38:51 2018 -0500
+++ b/plans/ChannelPlan_US915.cpp	Wed Sep 12 15:04:15 2018 -0500
@@ -28,8 +28,6 @@
 ChannelPlan_US915::ChannelPlan_US915()
 :
   ChannelPlan(NULL, NULL)
-  , _bcnFreqHop(true)
-  , _pingFreqHop(true)
 {
 
 }
@@ -37,8 +35,6 @@
 ChannelPlan_US915::ChannelPlan_US915(Settings* settings)
 :
   ChannelPlan(NULL, settings)
-  , _bcnFreqHop(true)
-  , _pingFreqHop(true)
 {
 
 }
@@ -46,8 +42,6 @@
 ChannelPlan_US915::ChannelPlan_US915(SxRadio* radio, Settings* settings)
 :
   ChannelPlan(radio, settings)
-  , _bcnFreqHop(true)
-  , _pingFreqHop(true)
 {
 
 }
@@ -94,9 +88,10 @@
     GetSettings()->Session.Rx2Frequency = US915_500K_DBASE;
 
     GetSettings()->Session.BeaconFrequency = US915_BEACON_FREQ_BASE;
-    GetSettings()->Session.BeaconDatarateIndex = US915_BEACON_DR;
+    GetSettings()->Session.BeaconFreqHop = true;
     GetSettings()->Session.PingSlotFrequency = US915_BEACON_FREQ_BASE;
     GetSettings()->Session.PingSlotDatarateIndex = US915_BEACON_DR;
+    GetSettings()->Session.PingSlotFreqHop = true;
 
     _minDatarate = US915_MIN_DATARATE;
     _maxDatarate = US915_MAX_DATARATE;
@@ -458,7 +453,7 @@
 
         case RX_BEACON:
             rxw.Frequency = GetSettings()->Session.BeaconFrequency;
-            index = GetSettings()->Session.BeaconDatarateIndex;
+            index = US915_BEACON_DR;
             break;
 
         case RX_SLOT:
@@ -575,7 +570,7 @@
         logInfo("PingSlotChannelReq accepted DR: %d Freq: %d", datarate, freq);
         GetSettings()->Session.PingSlotFrequency = freq;
         GetSettings()->Session.PingSlotDatarateIndex = datarate;
-        _pingFreqHop = freqHop;
+        GetSettings()->Session.PingSlotFreqHop = freqHop;
     } else {
         logInfo("PingSlotChannelReq rejected DR: %d Freq: %d", datarate, freq);
     }
@@ -606,7 +601,7 @@
     if (status & 0x01) {
         logInfo("BeaconFrequencyReq accepted Freq: %d", freq);
         GetSettings()->Session.BeaconFrequency = freq;
-        _bcnFreqHop = freqHop;
+        GetSettings()->Session.BeaconFreqHop = freqHop;
     } else {
         logInfo("BeaconFrequencyReq rejected Freq: %d", freq);
     }
@@ -1090,13 +1085,13 @@
     uint32_t channel;
     uint32_t freq;
 
-    if (_bcnFreqHop) {
+    if (GetSettings()->Session.BeaconFreqHop) {
         channel = (time / period) % US915_BEACON_CHANNELS;
         freq = US915_BEACON_FREQ_BASE + (channel * US915_BEACON_FREQ_STEP);
         GetSettings()->Session.BeaconFrequency = freq;
     }
 
-    if (_pingFreqHop) {
+    if (GetSettings()->Session.PingSlotFreqHop) {
         channel = (time / period + devAddr) % US915_BEACON_CHANNELS;
         freq = US915_BEACON_FREQ_BASE + (channel * US915_BEACON_FREQ_STEP);
         GetSettings()->Session.PingSlotFrequency = freq;