ver1

Revision:
151:2242ecfd733a
Parent:
139:b2e9d643eef9
Child:
152:34599f2c02c7
diff -r 7f5203f0d4d5 -r 2242ecfd733a plans/ChannelPlan_AS923.cpp
--- a/plans/ChannelPlan_AS923.cpp	Fri May 04 15:33:24 2018 -0500
+++ b/plans/ChannelPlan_AS923.cpp	Fri May 04 15:44:58 2018 -0500
@@ -461,18 +461,22 @@
         status &= 0xFE; // Channel index KO
     }
 
-    if (!GetRadio()->CheckRfFrequency(chParam.Frequency)) {
+    if (chParam.Frequency == 0) {
+        chParam.DrRange.Value = 0;
+    } else if (chParam.Frequency < _minFrequency || chParam.Frequency > _maxFrequency) {
         logError("New Channel frequency KO");
         status &= 0xFE; // Channel frequency KO
     }
 
-    if (chParam.DrRange.Fields.Min > chParam.DrRange.Fields.Max) {
+    if (chParam.DrRange.Fields.Min > chParam.DrRange.Fields.Max && chParam.Frequency != 0) {
         logError("New Channel datarate min/max KO");
         status &= 0xFD; // Datarate range KO
-    } else if (chParam.DrRange.Fields.Min < _minDatarate || chParam.DrRange.Fields.Min > _maxDatarate) {
+    } else if ((chParam.DrRange.Fields.Min < _minDatarate || chParam.DrRange.Fields.Min > _maxDatarate) &&
+               chParam.Frequency != 0) {
         logError("New Channel datarate min KO");
         status &= 0xFD; // Datarate range KO
-    } else if (chParam.DrRange.Fields.Max < _minDatarate || chParam.DrRange.Fields.Max > _maxDatarate) {
+    } else if ((chParam.DrRange.Fields.Max < _minDatarate || chParam.DrRange.Fields.Max > _maxDatarate) &&
+               chParam.Frequency != 0) {
         logError("New Channel datarate max KO");
         status &= 0xFD; // Datarate range KO
     }
@@ -569,7 +573,7 @@
     //
     // Remark MaxTxPower = 0 and MinTxPower = 7
     //
-    if (power < 0 || power > 7) {
+    if (power > 7) {
         status &= 0xFB; // TxPower KO
     }