-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTTP_Server.cpp
More file actions
35 lines (26 loc) · 850 Bytes
/
HTTP_Server.cpp
File metadata and controls
35 lines (26 loc) · 850 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
#include "HTTP_Server.h"
#include "Settings.h"
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
// Create http_server
HTTP_Server::HTTP_Server(bool inDebugMode)
{
debugMode = inDebugMode;
tryingReconnect = false;
}
void HTTP_Server::start(){
MDNS.begin(update_host);
httpUpdater.setup(&httpServer, update_path, update_username, update_password);
httpServer.begin();
MDNS.addService("http", "tcp", 80);
Serial.printf("HTTP Update Server ready! Open http://%s.local%s in your browser and login with username '%s' and password '%s'\n", update_host, update_path, update_username, update_password);
}
void HTTP_Server::handle(){
httpServer.handleClient();
MDNS.update();
}
void HTTP_Server::update(){
}