Files
WLED_MM_Infinity/wled00/net_debug.cpp
Frank 70a5d8b843 a few more compile-time infos about enabled/disabled features
helps to understand what you'll get
2024-05-04 01:16:45 +02:00

32 lines
913 B
C++

#include "wled.h"
#ifdef WLED_DEBUG_HOST //WLEDMM: this looks unnecessary 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;
#else
#pragma message "Net debug disabled"
#endif