forked from rjwats/esp8266-react
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDemoProject.h
More file actions
36 lines (27 loc) · 839 Bytes
/
Copy pathDemoProject.h
File metadata and controls
36 lines (27 loc) · 839 Bytes
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
#ifndef DemoProject_h
#define DemoProject_h
#include <AdminSettingsService.h>
#include <ESP8266React.h>
#define BLINK_LED 2
#define MAX_DELAY 1000
#define DEFAULT_BLINK_SPEED 100
#define DEMO_SETTINGS_FILE "/config/demoSettings.json"
#define DEMO_SETTINGS_PATH "/rest/demoSettings"
class DemoSettings {
public:
uint8_t blinkSpeed;
};
class DemoProject : public AdminSettingsService<DemoSettings> {
public:
DemoProject(AsyncWebServer* server, FS* fs, SecurityManager* securityManager);
~DemoProject();
void loop();
private:
unsigned long _lastBlink = 0;
AsyncWebSocket ws;
protected:
void onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len);
void readFromJsonObject(JsonObject& root);
void writeToJsonObject(JsonObject& root);
};
#endif