Quellcode durchsuchen

Don't consider unclassifiable packets an error (happens when packets are received on wrong channel)

Christopher Mullins vor 8 Jahren
Ursprung
Commit
01efa2302f
2 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen
  1. 3 0
      lib/MiLight/MiLightRemoteConfig.cpp
  2. 4 1
      src/main.cpp

+ 3 - 0
lib/MiLight/MiLightRemoteConfig.cpp

@@ -59,7 +59,10 @@ const MiLightRemoteConfig* MiLightRemoteConfig::fromReceivedPacket(
     }
   }
 
+  // This can happen under normal circumstances, so not an error condition
+#ifdef DEBUG_PRINTF
   Serial.println(F("ERROR - tried to fetch remote config for unknown packet"));
+#endif
 
   return NULL;
 }

+ 4 - 1
src/main.cpp

@@ -134,7 +134,10 @@ void handleListen() {
       );
 
       if (remoteConfig == NULL) {
-        Serial.println(F("ERROR: Couldn't find remote for received packet!"));
+        // This can happen under normal circumstances, so not an error condition
+#ifdef DEBUG_PRINTF
+        Serial.println(F("WARNING: Couldn't find remote for received packet"));
+#endif
         return;
       }