NetworkDebugPrinter packet optimization.

This commit is contained in:
Blaž Kristan
2022-11-11 14:39:47 +01:00
parent c0a783198e
commit 77f04d913a
5 changed files with 38 additions and 24 deletions

View File

@@ -7,10 +7,14 @@
class NetworkDebugPrinter : public Print {
private:
WiFiUDP debugUdp; // needs to be here otherwise UDP messages get truncated upon destruction
IPAddress debugPrintHostIP;
IPAddress debugPrintHostIP = INADDR_NONE;
bool udpConnected = false;
public:
virtual ~NetworkDebugPrinter() { flush(); }
virtual size_t write(uint8_t c);
virtual size_t write(const uint8_t *buf, size_t s);
void begin();
void flush();
};
extern NetworkDebugPrinter NetDebug;