-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWebFrontend.h
43 lines (38 loc) · 1.13 KB
/
WebFrontend.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
#ifndef _WEBFRONTEND_h
#define _WEBFRONTEND_h
#include "Arduino.h"
#include "WiFi.h"
#include "ESP32WebServer.h"
#include "StateManager.h"
#include "Settings.h"
#include "BME280.h"
class WebFrontend {
public:
WebFrontend(int port, Settings *settings);
void Handle();
void Begin(StateManager *stateManager, BME280 *bme280);
ESP32WebServer *GetWebServer();
typedef void CommandCallbackType(String);
typedef String HardwareCallbackType();
void SetCommandCallback(CommandCallbackType callback);
void SetHardwareCallback(HardwareCallbackType callback);
void SetPassword(String password);
private:
int m_port;
ESP32WebServer m_webserver;
StateManager *m_stateManager;
BME280 *m_bme280;
CommandCallbackType *m_commandCallback;
HardwareCallbackType *m_hardwareCallback;
String m_password;
String GetNavigation();
String GetTop();
String GetBottom();
String GetRedirectToRoot(String message = "");
bool IsAuthentified();
String GetDisplayName();
String BuildHardwareRow(String text1, String text2, String text3 = "");
Settings *m_settings;
String GetBinGroupRow(byte nbr, uint16_t lastBin);
};
#endif