-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebServer.h
41 lines (33 loc) · 819 Bytes
/
WebServer.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
#pragma once
#include <EthernetClient.h>
#include "EepromConfiguration.h"
namespace web
{
enum class TokenType
{
NONE,
MQTT_SERVER,
DNS_SERVER,
GATEWAY,
IP_ADDRESS,
SUBNET_MASK,
MQTT_PUBLISH_INTERVAL
};
class WebServer
{
public:
explicit WebServer(EthernetClient *ethClient, EepromConfiguration* configuration);
virtual ~WebServer() = default;
void update();
void enable();
void disable();
[[nodiscard]] bool enabled();
private:
void serveHtml(EthernetClient& client);
TokenType getParameterType(char*& token);
EthernetClient *_ethClient;
EthernetServer _server;
EepromConfiguration* _configuration;
bool _enabled = false;
};
}