esp32-sk6812/include/UDPProto.h
Thomas Kolb 6a71074b4b UDPProto: added "ack request" + response packets
The ACK request packet contains a sequence number which is echoed back
to the client in a simple UDP packet. By evaluating the difference
between sent and received sequence number, the client can control how
much data is buffered on the way to the ESP.
2019-12-30 12:19:00 +01:00

30 lines
382 B
C++

#pragma once
#include <WiFiUdp.h>
class Fader;
class UDPProto
{
public:
enum {
SET_COLOUR = 0,
FADE_COLOUR = 1,
ADD_COLOUR = 2,
SET_FADESTEP = 3,
ACK_REQUEST = 255
};
UDPProto(Fader *fader);
bool start(uint16_t port);
bool check(void);
bool loop(void);
private:
WiFiUDP m_udpServer;
Fader *m_fader;
};