This commit is contained in:
Ewoud
2023-03-08 14:02:11 +01:00
parent 1aa3ba9fad
commit 3fe96a99ad

View File

@@ -728,13 +728,13 @@ WLED_GLOBAL volatile uint8_t jsonBufferLock _INIT(0);
#include "net_debug.h"
// On the host side, use netcat to receive the log statements: nc -l 7868 -u
// use -D WLED_DEBUG_HOST='"192.168.xxx.xxx"' or FQDN within quotes
WLED_GLOBAL bool _INIT(false);
WLED_GLOBAL bool netDebugEnabled _INIT(false);
WLED_GLOBAL int netDebugPrintPort _INIT(0);
WLED_GLOBAL IPAddress netDebugPrintIP _INIT_N(((0, 0, 0, 0))); // IP address of the bridge
#define DEBUGOUT(x) ( || !canUseSerial())?NetDebug.print(x):Serial.print(x)
#define DEBUGOUTLN(x) ( || !canUseSerial())?NetDebug.println(x):Serial.println(x)
#define DEBUGOUTF(x...) ( || !canUseSerial())?NetDebug.printf(x):Serial.printf(x)
#define DEBUGOUTFlush() ( || !canUseSerial())?NetDebug.flush():Serial.flush()
#define DEBUGOUT(x) (netDebugEnabled || !canUseSerial())?NetDebug.print(x):Serial.print(x)
#define DEBUGOUTLN(x) (netDebugEnabled || !canUseSerial())?NetDebug.println(x):Serial.println(x)
#define DEBUGOUTF(x...) (netDebugEnabled || !canUseSerial())?NetDebug.printf(x):Serial.printf(x)
#define DEBUGOUTFlush() (netDebugEnabled || !canUseSerial())?NetDebug.flush():Serial.flush()
#else
#define DEBUGOUT(x) {if (canUseSerial()) Serial.print(x);}
#define DEBUGOUTLN(x) {if (canUseSerial()) Serial.println(x);}