From 52c18e77aea5e9c45c480f18e5306e89099a980f Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sat, 4 Feb 2023 23:59:28 +0100 Subject: [PATCH] Compile fix for net_debug --- wled00/bus_manager.h | 1 + wled00/net_debug.h | 1 + wled00/wled.h | 5 +---- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index 8250695f9..f3ad049aa 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -16,6 +16,7 @@ void colorRGBtoRGBW(byte* rgb); // enable additional debug output #if defined(WLED_DEBUG_HOST) + #include "net_debug.h" #define DEBUGOUT NetDebug #else #define DEBUGOUT Serial diff --git a/wled00/net_debug.h b/wled00/net_debug.h index abe863fd3..13028fdc1 100644 --- a/wled00/net_debug.h +++ b/wled00/net_debug.h @@ -13,6 +13,7 @@ class NetworkDebugPrinter : public Print { virtual size_t write(const uint8_t *buf, size_t s); }; +// use it on your linux/macOS with: nc -p 7868 -u -l -s extern NetworkDebugPrinter NetDebug; #endif \ No newline at end of file diff --git a/wled00/wled.h b/wled00/wled.h index 35aa9888d..4ffbbc896 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -96,10 +96,6 @@ #include "my_config.h" #endif -#ifdef WLED_DEBUG_HOST -#include "net_debug.h" -#endif - #include #ifdef WLED_ADD_EEPROM_SUPPORT #include @@ -724,6 +720,7 @@ WLED_GLOBAL volatile uint8_t jsonBufferLock _INIT(0); // enable additional debug output #if defined(WLED_DEBUG_HOST) + #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 #define DEBUGOUT NetDebug