-
Notifications
You must be signed in to change notification settings - Fork 2
/
httpportal.h
42 lines (33 loc) · 913 Bytes
/
httpportal.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 httpportal_h
#define httpportal_h
// @USES wifimanager portal
#include <log.h>
#include <WiFiManager.h>
WiFiManager portal(Logger); // use netlog for logging wm
// WiFiManager portal;
void begin_httpportal(){
// portal.setDebugLevel();
// portal.setDebugOutput(true);
portal.startWebPortal();
}
void stop_httpportal(){
portal.stopWebPortal();
}
void process_httpportal(){
portal.process();
}
void init_httpportal(String title = "",bool begin = true){
portal.setDebugOutput(true,"[HTTPD] ");
// invert theme, dark
portal.setDarkMode(true);
std::vector<const char *> menu = {"wifi","param","info","sep","update","restart","exit"};
portal.setMenu(menu); // custom menu, pass vector
portal.setTitle(title);
// portal.setBackButton(true);
// portal.setHostname(getHostname());
if(begin) begin_httpportal();
}
void begin_httpportalap(){
portal.startConfigPortal();
}
#endif