-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWrapperJsonServer.h
More file actions
48 lines (38 loc) · 1.05 KB
/
Copy pathWrapperJsonServer.h
File metadata and controls
48 lines (38 loc) · 1.05 KB
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
#ifndef WrapperJsonServer_h
#define WrapperJsonServer_h
#include "BaseHeader.h"
#include <ArduinoJson.h>
#include <WiFiServer.h>
#include <WiFiClient.h>
#define TCP_BUFFER 512
class WrapperJsonServer {
public:
WrapperJsonServer();
WrapperJsonServer(uint16_t ledCount, uint16_t tcpPort);
void
begin(void),
handle(void);
void
onLedColorWipe(void(* function) (byte, byte, byte)),
onClearCmd(void(* function) (void)),
onEffectChange(void(* function) (Mode, int));
private:
void
handleConnection(boolean newClient),
readData(void);
void
ledColorWipe(byte r, byte g, byte b),
(* ledColorWipePointer) (byte, byte, byte);
void
clearCmd(void),
(* clearCmdPointer) (void);
void
effectChange(Mode effect, int interval = 0),
(* effectChangePointer) (Mode, int);
WiFiServer _tcpServer;
WiFiClient _tcpClient;
uint16_t _ledCount;
uint16_t _tcpPort;
byte* _activeLedColor;
};
#endif