-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUDPIOHandler.h
57 lines (39 loc) · 1.22 KB
/
UDPIOHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//Copyright (c) Piet Wauters 2022 <[email protected]>
#ifndef UDPIOHANDLER_H
#define UDPIOHANDLER_H
#include "SubjectObserverTemplate.h"
#include "FencingStateMachine.h"
#include "CyranoHandler.h"
#include <WiFi.h>
#include <WiFiClient.h>
#include "AsyncUDP.h"
#define UDP_GREEN "#23C48E"
#define UDP_BLUE "#04C0F8"
#define UDP_YELLOW "#ED9D00"
#define UDP_RED "#D3435C"
#define UDP_DARK_BLUE "#5F7CD8"
#include "EventDefinitions.h"
class UDPIOHandler : public Subject<UDPIOHandler> , public Observer<FencingStateMachine>, public SingletonMixin<UDPIOHandler>
{
public:
/** Default destructor */
virtual ~UDPIOHandler();
void update (FencingStateMachine *subject, uint32_t eventtype);
void InputChanged(uint32_t eventtype = EVENT_UI_INPUT) {notify(eventtype);}
void run();
void ConnectToAP();
void Start();
void UDPCheck();
protected:
private:
friend class SingletonMixin<UDPIOHandler>;
/** Default constructor */
UDPIOHandler();
void ProcessLightsChange(uint32_t eventtype);
int m_minutes;
int m_seconds;
int m_hundredths;
int previous_seconds;
AsyncUDP Commandudp;
};
#endif // UDPIOHANDLER_H