Files
WLED_MM_Infinity/wled00/net_debug.cpp
Ewoud bb6662ee35 NetDebug: switch between serial/netdebug, store ip and port in settings
pio.ini: enable WLED_DEBUG_HOST in esp32_4MB_M_debug and esp32_16MB_M_debug

audio_reactive, um6050, wled.h
- replace DEBUGOUT.print(x) by DEBUGOUT(x) etc

wled.h: switch between serial/netdebug

cfg.cpp, set.cpp, wled.cpp, xml.cpp
- store netDebugPrintIP and netDebugPrintPort in cfg.json

index.js: rename info tab on off to Net Debug

settings.sync: add netdebug

net_debug.h/cpp: use global netDebugPrintIP remove debugPrintHostIP
2023-02-24 15:40:16 +01:00

30 lines
870 B
C++

#include "wled.h"
#ifdef WLED_DEBUG_HOST //WLEDMM: this looks unnecesarry as .h is not included anyway if no netdebug
size_t NetworkDebugPrinter::write(uint8_t c) {
if (!WLED_CONNECTED || !netDebugEnabled) return 0;
//WLEDMM: init IP moved to initInterfaces
debugUdp.beginPacket(netDebugPrintIP, netDebugPrintPort); //WLEDMM: using netDebugPrintIP instead of debugPrintHostIP
debugUdp.write(c);
debugUdp.endPacket();
return 1;
}
size_t NetworkDebugPrinter::write(const uint8_t *buf, size_t size) {
if (!WLED_CONNECTED || buf == nullptr || !netDebugEnabled) return 0;
//WLEDMM: init IP moved to initInterfaces
debugUdp.beginPacket(netDebugPrintIP, netDebugPrintPort); //WLEDMM: using netDebugPrintIP instead of debugPrintHostIP
size = debugUdp.write(buf, size);
debugUdp.endPacket();
return size;
}
NetworkDebugPrinter NetDebug;
#endif