This commit is contained in:
tablatronix
2020-01-22 10:42:08 -06:00
parent 0a7d7469fd
commit 87009dc443
3 changed files with 8 additions and 7 deletions
+4 -5
View File
@@ -2350,7 +2350,7 @@ void WiFiManager::setMenu(const char * menu[], uint8_t size){
}
}
}
// DEBUG_WM(getMenuOut());
DEBUG_WM(getMenuOut());
}
/**
@@ -2373,7 +2373,7 @@ void WiFiManager::setMenu(std::vector<const char *>& menu){
}
}
}
// DEBUG_WM(getMenuOut());
DEBUG_WM(getMenuOut());
}
@@ -2384,9 +2384,8 @@ void WiFiManager::setMenu(std::vector<const char *>& menu){
* @since $dev
*/
void WiFiManager::setParamsPage(bool enable){
_paramsInWifi= false;
_menuIdsDefault = {"wifi","param","info","exit"};
setMenu(_menuIdsDefault);
_paramsInWifi = !enable;
setMenu(enable ? _menuIdsParams : _menuIdsDefault);
}
// GETTERS
+1
View File
@@ -307,6 +307,7 @@ class WiFiManager
private:
std::vector<uint8_t> _menuIds;
std::vector<const char *> _menuIdsParams = {"wifi","param","info","exit"};
std::vector<const char *> _menuIdsDefault = {"wifi","info","exit"};
// ip configs @todo struct ?
@@ -173,9 +173,9 @@ void setup() {
// wm.setMenu(menu,9); // custom menu array must provide length
std::vector<const char *> menu = {"wifi","wifinoscan","info","param","close","sep","erase","restart","exit"};
wm.setMenu(menu); // custom menu, pass vector
// wm.setMenu(menu); // custom menu, pass vector
// wm.setParamsPage(true); // move params to seperate page, not wifi, do not combine with setmenu!
wm.setParamsPage(true); // move params to seperate page, not wifi, do not combine with setmenu!
// set static sta ip
// wm.setSTAStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
@@ -244,6 +244,7 @@ void loop() {
if ( digitalRead(TRIGGER_PIN) == LOW ){
Serial.println("BUTTON PRESSED");
wm.setConfigPortalTimeout(140);
wm.setParamsPage(false); // move params to seperate page, not wifi, do not combine with setmenu!
// disable captive portal redirection
// wm.setCaptivePortalEnable(false);