-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebServer.h
39 lines (34 loc) · 896 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
#ifndef WEBSERVER_H
#define WEBSERVER_H
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ArduinoOTA.h>
#include <ESP8266WiFi.h>
#include <Arduino.h>
#include "WeMo.h"
class WebServer
{
private:
int WebPort = 80;
int WebSecurePort = 443;
//Check onwards
String header;
// Current time
unsigned long currentTime = millis();
// Previous time
unsigned long previousTime = 0;
// Define timeout time in milliseconds (example: 2000ms = 2s)
static const long timeoutTime; // = 2000;
void AddButton(String switchName, bool outputState, int index, WiFiClient client);
void ButtonSelect();
void EndDoc(WiFiClient client);
void WebBody(WiFiClient client);
public:
WiFiServer *server = NULL;
bool StartWebServer();
WebServer();
WebServer(int port);
void RootDoc(WiFiClient client);
void IndexPage();
};
#endif