forked from esp8266/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathESP8266HTTPUpdateServer.h
47 lines (36 loc) · 1.01 KB
/
ESP8266HTTPUpdateServer.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
43
44
45
46
47
#ifndef __HTTP_UPDATE_SERVER_H
#define __HTTP_UPDATE_SERVER_H
class ESP8266WebServer;
class ESP8266HTTPUpdateServer
{
public:
ESP8266HTTPUpdateServer(bool serial_debug=false);
void setup(ESP8266WebServer *server)
{
setup(server, emptyString, emptyString);
}
void setup(ESP8266WebServer *server, const String& path)
{
setup(server, path, emptyString, emptyString);
}
void setup(ESP8266WebServer *server, const String& username, const String& password)
{
setup(server, "/update", username, password);
}
void setup(ESP8266WebServer *server, const String& path, const String& username, const String& password);
void updateCredentials(const String& username, const String& password)
{
_username = username;
_password = password;
}
protected:
void _setUpdaterError();
private:
bool _serial_output;
ESP8266WebServer *_server;
String _username;
String _password;
bool _authenticated;
String _updaterError;
};
#endif