ver1

Revision:
178:8f7d93f3bbb5
Parent:
172:7ec44396a51b
Child:
179:578d8030ba57
--- a/plans/ChannelPlan_AU915.cpp	Wed Sep 05 16:38:51 2018 -0500
+++ b/plans/ChannelPlan_AU915.cpp	Wed Sep 12 15:04:15 2018 -0500
@@ -28,8 +28,6 @@
 ChannelPlan_AU915::ChannelPlan_AU915()
 :
   ChannelPlan(NULL, NULL)
-  , _bcnFreqHop(true)
-  , _pingFreqHop(true)
 {
 
 }
@@ -37,8 +35,6 @@
 ChannelPlan_AU915::ChannelPlan_AU915(Settings* settings)
 :
   ChannelPlan(NULL, settings)
-  , _bcnFreqHop(true)
-  , _pingFreqHop(true)
 {
 
 }
@@ -46,8 +42,6 @@
 ChannelPlan_AU915::ChannelPlan_AU915(SxRadio* radio, Settings* settings)
 :
   ChannelPlan(radio, settings)
-  , _bcnFreqHop(true)
-  , _pingFreqHop(true)
 {
 
 }
@@ -94,9 +88,10 @@
     GetSettings()->Session.Rx2Frequency = AU915_500K_DBASE;
 
     GetSettings()->Session.BeaconFrequency = AU915_BEACON_FREQ_BASE;
-    GetSettings()->Session.BeaconDatarateIndex = AU915_BEACON_DR;
+    GetSettings()->Session.BeaconFreqHop = true;
     GetSettings()->Session.PingSlotFrequency = AU915_BEACON_FREQ_BASE;
     GetSettings()->Session.PingSlotDatarateIndex = AU915_BEACON_DR;
+    GetSettings()->Session.PingSlotFreqHop = true;
 
     _minDatarate = AU915_MIN_DATARATE;
     _maxDatarate = AU915_MAX_DATARATE;
@@ -449,7 +444,7 @@
 
         case RX_BEACON:
             rxw.Frequency = GetSettings()->Session.BeaconFrequency;
-            index = GetSettings()->Session.BeaconDatarateIndex;
+            index = AU915_BEACON_DR;
             break;
 
         case RX_SLOT:
@@ -566,7 +561,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);
     }
@@ -597,7 +592,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);
     }
@@ -1080,13 +1075,13 @@
     uint32_t channel;
     uint32_t freq;
 
-    if (_bcnFreqHop) {
+    if (GetSettings()->Session.BeaconFreqHop) {
         channel = (time / period) % AU915_BEACON_CHANNELS;
         freq = AU915_BEACON_FREQ_BASE + (channel * AU915_BEACON_FREQ_STEP);
         GetSettings()->Session.BeaconFrequency = freq;
     }
 
-    if (_pingFreqHop) {
+    if (GetSettings()->Session.PingSlotFreqHop) {
         channel = (time / period + devAddr) % AU915_BEACON_CHANNELS;
         freq = AU915_BEACON_FREQ_BASE + (channel * AU915_BEACON_FREQ_STEP);
         GetSettings()->Session.PingSlotFrequency = freq;