esp32-sk6812/include/UDPProto.h

33 lines
466 B
C
Raw Normal View History

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