mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
fixes #987
This commit is contained in:
+4
-5
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user