|
|
@ -763,7 +763,9 @@ const char AutoConnect::_PAGE_DISCONN[] PROGMEM = { |
|
|
|
"</head>" |
|
|
|
"</head>" |
|
|
|
"<body style=\"padding-top:58px;\">" |
|
|
|
"<body style=\"padding-top:58px;\">" |
|
|
|
"<div class=\"container\">" |
|
|
|
"<div class=\"container\">" |
|
|
|
"{{MENU}}" |
|
|
|
"{{MENU_PRE}}" |
|
|
|
|
|
|
|
"{{MENU_AUX}}" |
|
|
|
|
|
|
|
"{{MENU_POST}}" |
|
|
|
"</body>" |
|
|
|
"</body>" |
|
|
|
"</html>" |
|
|
|
"</html>" |
|
|
|
}; |
|
|
|
}; |
|
|
@ -788,43 +790,43 @@ uint32_t AutoConnect::_getFlashChipRealSize() { |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_CSS_BASE(PageArgument& args) { |
|
|
|
String AutoConnect::_token_CSS_BASE(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
return String(_CSS_BASE); |
|
|
|
return String(FPSTR(_CSS_BASE)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_CSS_UL(PageArgument& args) { |
|
|
|
String AutoConnect::_token_CSS_UL(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
return String(_CSS_UL); |
|
|
|
return String(FPSTR(_CSS_UL)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_CSS_ICON_LOCK(PageArgument& args) { |
|
|
|
String AutoConnect::_token_CSS_ICON_LOCK(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
return String(_CSS_ICON_LOCK); |
|
|
|
return String(FPSTR(_CSS_ICON_LOCK)); |
|
|
|
} |
|
|
|
} |
|
|
|
String AutoConnect::_token_CSS_INPUT_BUTTON(PageArgument& args) { |
|
|
|
String AutoConnect::_token_CSS_INPUT_BUTTON(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
return String(_CSS_INPUT_BUTTON); |
|
|
|
return String(FPSTR(_CSS_INPUT_BUTTON)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_CSS_INPUT_TEXT(PageArgument& args) { |
|
|
|
String AutoConnect::_token_CSS_INPUT_TEXT(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
return String(_CSS_INPUT_TEXT); |
|
|
|
return String(FPSTR(_CSS_INPUT_TEXT)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_CSS_TABLE(PageArgument& args) { |
|
|
|
String AutoConnect::_token_CSS_TABLE(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
return String(_CSS_TABLE); |
|
|
|
return String(FPSTR(_CSS_TABLE)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_HEAD(PageArgument& args) { |
|
|
|
String AutoConnect::_token_HEAD(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
return String(_ELM_HTML_HEAD); |
|
|
|
return String((_ELM_HTML_HEAD)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_MENU_PRE(PageArgument& args) { |
|
|
|
String AutoConnect::_token_MENU_PRE(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
String currentMenu = String(_ELM_MENU_PRE); |
|
|
|
String currentMenu = FPSTR(_ELM_MENU_PRE); |
|
|
|
currentMenu.replace(String("MENU_TITLE"), _menuTitle); |
|
|
|
currentMenu.replace(String(F("MENU_TITLE")), _menuTitle); |
|
|
|
currentMenu.replace(String("HOME_URI"), _apConfig.homeUri); |
|
|
|
currentMenu.replace(String(F("HOME_URI")), _apConfig.homeUri); |
|
|
|
return currentMenu; |
|
|
|
return currentMenu; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -842,12 +844,12 @@ String AutoConnect::_token_MENU_POST(PageArgument& args) { |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_CSS_LUXBAR(PageArgument& args) { |
|
|
|
String AutoConnect::_token_CSS_LUXBAR(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
return String(_CSS_LUXBAR); |
|
|
|
return String(FPSTR(_CSS_LUXBAR)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_ESTAB_SSID(PageArgument& args) { |
|
|
|
String AutoConnect::_token_ESTAB_SSID(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
return (WiFi.status() == WL_CONNECTED ? WiFi.SSID() : String("N/A")); |
|
|
|
return (WiFi.status() == WL_CONNECTED ? WiFi.SSID() : String(F("N/A"))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_WIFI_MODE(PageArgument& args) { |
|
|
|
String AutoConnect::_token_WIFI_MODE(PageArgument& args) { |
|
|
@ -892,8 +894,7 @@ String AutoConnect::_token_STATION_STATUS(PageArgument& args) { |
|
|
|
"CONNECT_FAIL", |
|
|
|
"CONNECT_FAIL", |
|
|
|
"GOT_IP" |
|
|
|
"GOT_IP" |
|
|
|
}; |
|
|
|
}; |
|
|
|
uint8_t st = wifi_station_get_connect_status(); |
|
|
|
switch (_rsConnect) { |
|
|
|
switch (st) { |
|
|
|
|
|
|
|
case STATION_IDLE: |
|
|
|
case STATION_IDLE: |
|
|
|
wlStatusSymbol = wlStatusSymbols[0]; |
|
|
|
wlStatusSymbol = wlStatusSymbols[0]; |
|
|
|
break; |
|
|
|
break; |
|
|
@ -922,8 +923,7 @@ String AutoConnect::_token_STATION_STATUS(PageArgument& args) { |
|
|
|
"DISCONNECTED", |
|
|
|
"DISCONNECTED", |
|
|
|
"NO_SHIELD" |
|
|
|
"NO_SHIELD" |
|
|
|
}; |
|
|
|
}; |
|
|
|
wl_status_t st = WiFi.status(); |
|
|
|
switch (_rsConnect) { |
|
|
|
switch (st) { |
|
|
|
|
|
|
|
case WL_IDLE_STATUS: |
|
|
|
case WL_IDLE_STATUS: |
|
|
|
wlStatusSymbol = wlStatusSymbols[0]; |
|
|
|
wlStatusSymbol = wlStatusSymbols[0]; |
|
|
|
break; |
|
|
|
break; |
|
|
@ -949,7 +949,7 @@ String AutoConnect::_token_STATION_STATUS(PageArgument& args) { |
|
|
|
wlStatusSymbol = wlStatusSymbols[7]; |
|
|
|
wlStatusSymbol = wlStatusSymbols[7]; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
return "(" + String(st) + ") " + String(wlStatusSymbol); |
|
|
|
return "(" + String(_rsConnect) + ") " + String(wlStatusSymbol); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_LOCAL_IP(PageArgument& args) { |
|
|
|
String AutoConnect::_token_LOCAL_IP(PageArgument& args) { |
|
|
@ -994,7 +994,7 @@ String AutoConnect::_token_CHANNEL(PageArgument& args) { |
|
|
|
String AutoConnect::_token_DBM(PageArgument& args) { |
|
|
|
String AutoConnect::_token_DBM(PageArgument& args) { |
|
|
|
AC_UNUSED(args); |
|
|
|
AC_UNUSED(args); |
|
|
|
int32_t dBm = WiFi.RSSI(); |
|
|
|
int32_t dBm = WiFi.RSSI(); |
|
|
|
return (dBm == 31 ? String("N/A") : String(dBm)); |
|
|
|
return (dBm == 31 ? String(F("N/A")) : String(dBm)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String AutoConnect::_token_CPU_FREQ(PageArgument& args) { |
|
|
|
String AutoConnect::_token_CPU_FREQ(PageArgument& args) { |
|
|
@ -1111,127 +1111,126 @@ PageElement* AutoConnect::_setupPage(String uri) { |
|
|
|
|
|
|
|
|
|
|
|
// Setup /auto
|
|
|
|
// Setup /auto
|
|
|
|
elm->setMold(_PAGE_STAT); |
|
|
|
elm->setMold(_PAGE_STAT); |
|
|
|
elm->addToken(PSTR("HEAD"), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_BASE"), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_TABLE"), std::bind(&AutoConnect::_token_CSS_TABLE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_TABLE")), std::bind(&AutoConnect::_token_CSS_TABLE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_LUXBAR"), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_LUXBAR")), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_PRE"), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_PRE")), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_AUX"), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_AUX")), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_POST"), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_POST")), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("ESTAB_SSID"), std::bind(&AutoConnect::_token_ESTAB_SSID, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("ESTAB_SSID")), std::bind(&AutoConnect::_token_ESTAB_SSID, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("WIFI_MODE"), std::bind(&AutoConnect::_token_WIFI_MODE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("WIFI_MODE")), std::bind(&AutoConnect::_token_WIFI_MODE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("WIFI_STATUS"), std::bind(&AutoConnect::_token_WIFI_STATUS, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("WIFI_STATUS")), std::bind(&AutoConnect::_token_WIFI_STATUS, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("LOCAL_IP"), std::bind(&AutoConnect::_token_LOCAL_IP, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("LOCAL_IP")), std::bind(&AutoConnect::_token_LOCAL_IP, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("SOFTAP_IP"), std::bind(&AutoConnect::_token_SOFTAP_IP, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("SOFTAP_IP")), std::bind(&AutoConnect::_token_SOFTAP_IP, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("GATEWAY"), std::bind(&AutoConnect::_token_GATEWAY, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("GATEWAY")), std::bind(&AutoConnect::_token_GATEWAY, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("NETMASK"), std::bind(&AutoConnect::_token_NETMASK, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("NETMASK")), std::bind(&AutoConnect::_token_NETMASK, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("AP_MAC"), std::bind(&AutoConnect::_token_AP_MAC, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("AP_MAC")), std::bind(&AutoConnect::_token_AP_MAC, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("STA_MAC"), std::bind(&AutoConnect::_token_STA_MAC, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("STA_MAC")), std::bind(&AutoConnect::_token_STA_MAC, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CHANNEL"), std::bind(&AutoConnect::_token_CHANNEL, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CHANNEL")), std::bind(&AutoConnect::_token_CHANNEL, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("DBM"), std::bind(&AutoConnect::_token_DBM, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("DBM")), std::bind(&AutoConnect::_token_DBM, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CPU_FREQ"), std::bind(&AutoConnect::_token_CPU_FREQ, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CPU_FREQ")), std::bind(&AutoConnect::_token_CPU_FREQ, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("FLASH_SIZE"), std::bind(&AutoConnect::_token_FLASH_SIZE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("FLASH_SIZE")), std::bind(&AutoConnect::_token_FLASH_SIZE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CHIP_ID"), std::bind(&AutoConnect::_token_CHIP_ID, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CHIP_ID")), std::bind(&AutoConnect::_token_CHIP_ID, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("FREE_HEAP"), std::bind(&AutoConnect::_token_FREE_HEAP, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("FREE_HEAP")), std::bind(&AutoConnect::_token_FREE_HEAP, this, std::placeholders::_1)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (uri == String(AUTOCONNECT_URI_CONFIG)) { |
|
|
|
else if (uri == String(AUTOCONNECT_URI_CONFIG)) { |
|
|
|
|
|
|
|
|
|
|
|
// Setup /auto/config
|
|
|
|
// Setup /auto/config
|
|
|
|
elm->setMold(_PAGE_CONFIGNEW); |
|
|
|
elm->setMold(_PAGE_CONFIGNEW); |
|
|
|
elm->addToken(PSTR("HEAD"), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_BASE"), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_UL"), std::bind(&AutoConnect::_token_CSS_UL, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_UL")), std::bind(&AutoConnect::_token_CSS_UL, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_ICON_LOCK"), std::bind(&AutoConnect::_token_CSS_ICON_LOCK, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_ICON_LOCK")), std::bind(&AutoConnect::_token_CSS_ICON_LOCK, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_INPUT_BUTTON"), std::bind(&AutoConnect::_token_CSS_INPUT_BUTTON, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_INPUT_BUTTON")), std::bind(&AutoConnect::_token_CSS_INPUT_BUTTON, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_INPUT_TEXT"), std::bind(&AutoConnect::_token_CSS_INPUT_TEXT, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_INPUT_TEXT")), std::bind(&AutoConnect::_token_CSS_INPUT_TEXT, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_LUXBAR"), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_LUXBAR")), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_PRE"), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_PRE")), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_AUX"), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_AUX")), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_POST"), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_POST")), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("LIST_SSID"), std::bind(&AutoConnect::_token_LIST_SSID, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("LIST_SSID")), std::bind(&AutoConnect::_token_LIST_SSID, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("HIDDEN_COUNT"), std::bind(&AutoConnect::_token_HIDDEN_COUNT, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("HIDDEN_COUNT")), std::bind(&AutoConnect::_token_HIDDEN_COUNT, this, std::placeholders::_1)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (uri == String(AUTOCONNECT_URI_CONNECT)) { |
|
|
|
else if (uri == String(AUTOCONNECT_URI_CONNECT)) { |
|
|
|
|
|
|
|
|
|
|
|
// Setup /auto/connect
|
|
|
|
// Setup /auto/connect
|
|
|
|
elm->setMold("{{REQ}}"); |
|
|
|
elm->setMold("{{REQ}}"); |
|
|
|
elm->addToken(PSTR("REQ"), std::bind(&AutoConnect::_induceConnect, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("REQ")), std::bind(&AutoConnect::_induceConnect, this, std::placeholders::_1)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (uri == String(AUTOCONNECT_URI_OPEN)) { |
|
|
|
else if (uri == String(AUTOCONNECT_URI_OPEN)) { |
|
|
|
|
|
|
|
|
|
|
|
// Setup /auto/open
|
|
|
|
// Setup /auto/open
|
|
|
|
elm->setMold(_PAGE_OPENCREDT); |
|
|
|
elm->setMold(_PAGE_OPENCREDT); |
|
|
|
elm->addToken(PSTR("HEAD"), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_BASE"), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_ICON_LOCK"), std::bind(&AutoConnect::_token_CSS_ICON_LOCK, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_ICON_LOCK")), std::bind(&AutoConnect::_token_CSS_ICON_LOCK, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_INPUT_BUTTON"), std::bind(&AutoConnect::_token_CSS_INPUT_BUTTON, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_INPUT_BUTTON")), std::bind(&AutoConnect::_token_CSS_INPUT_BUTTON, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_LUXBAR"), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_LUXBAR")), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_PRE"), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_PRE")), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_AUX"), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_AUX")), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_POST"), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_POST")), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("OPEN_SSID"), std::bind(&AutoConnect::_token_OPEN_SSID, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("OPEN_SSID")), std::bind(&AutoConnect::_token_OPEN_SSID, this, std::placeholders::_1)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (uri == String(AUTOCONNECT_URI_DISCON)) { |
|
|
|
else if (uri == String(AUTOCONNECT_URI_DISCON)) { |
|
|
|
|
|
|
|
|
|
|
|
// Setup /auto/disc
|
|
|
|
// Setup /auto/disc
|
|
|
|
_menuTitle = String("Disconnect"); |
|
|
|
_menuTitle = FPSTR("Disconnect"); |
|
|
|
elm->setMold(_PAGE_DISCONN); |
|
|
|
elm->setMold(_PAGE_DISCONN); |
|
|
|
elm->addToken(PSTR("DISCONNECT"), std::bind(&AutoConnect::_induceDisconnect, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("DISCONNECT")), std::bind(&AutoConnect::_induceDisconnect, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("HEAD"), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_BASE"), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_LUXBAR"), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_LUXBAR")), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_PRE"), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_PRE")), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_AUX"), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_AUX")), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_POST"), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_POST")), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (uri == String(AUTOCONNECT_URI_RESET)) { |
|
|
|
else if (uri == String(AUTOCONNECT_URI_RESET)) { |
|
|
|
|
|
|
|
|
|
|
|
// Setup /auto/reset
|
|
|
|
// Setup /auto/reset
|
|
|
|
elm->setMold(_PAGE_RESETTING); |
|
|
|
elm->setMold(_PAGE_RESETTING); |
|
|
|
elm->addToken(PSTR("HEAD"), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("BOOTURI"), std::bind(&AutoConnect::_token_BOOTURI, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("BOOTURI")), std::bind(&AutoConnect::_token_BOOTURI, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("UPTIME"), std::bind(&AutoConnect::_token_UPTIME, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("UPTIME")), std::bind(&AutoConnect::_token_UPTIME, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("RESET"), std::bind(&AutoConnect::_induceReset, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("RESET")), std::bind(&AutoConnect::_induceReset, this, std::placeholders::_1)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else if (uri == String(AUTOCONNECT_URI_RESULT)) { |
|
|
|
else if (uri == String(AUTOCONNECT_URI_RESULT)) { |
|
|
|
|
|
|
|
|
|
|
|
// Setup /auto/result
|
|
|
|
// Setup /auto/result
|
|
|
|
elm->setMold("{{RESULT}}"); |
|
|
|
elm->setMold("{{RESULT}}"); |
|
|
|
elm->addToken(PSTR("RESULT"), std::bind(&AutoConnect::_invokeResult, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("RESULT")), std::bind(&AutoConnect::_invokeResult, this, std::placeholders::_1)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (uri == String(AUTOCONNECT_URI_SUCCESS)) { |
|
|
|
else if (uri == String(AUTOCONNECT_URI_SUCCESS)) { |
|
|
|
|
|
|
|
|
|
|
|
// Setup /auto/success
|
|
|
|
// Setup /auto/success
|
|
|
|
elm->setMold(_PAGE_SUCCESS); |
|
|
|
elm->setMold(_PAGE_SUCCESS); |
|
|
|
elm->addToken(PSTR("HEAD"), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_BASE"), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_TABLE"), std::bind(&AutoConnect::_token_CSS_TABLE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_TABLE")), std::bind(&AutoConnect::_token_CSS_TABLE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_LUXBAR"), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_LUXBAR")), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_PRE"), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_PRE")), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_AUX"), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_AUX")), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_POST"), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_POST")), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("ESTAB_SSID"), std::bind(&AutoConnect::_token_ESTAB_SSID, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("ESTAB_SSID")), std::bind(&AutoConnect::_token_ESTAB_SSID, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("WIFI_MODE"), std::bind(&AutoConnect::_token_WIFI_MODE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("WIFI_MODE")), std::bind(&AutoConnect::_token_WIFI_MODE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("WIFI_STATUS"), std::bind(&AutoConnect::_token_WIFI_STATUS, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("WIFI_STATUS")), std::bind(&AutoConnect::_token_WIFI_STATUS, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("LOCAL_IP"), std::bind(&AutoConnect::_token_LOCAL_IP, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("LOCAL_IP")), std::bind(&AutoConnect::_token_LOCAL_IP, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("GATEWAY"), std::bind(&AutoConnect::_token_GATEWAY, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("GATEWAY")), std::bind(&AutoConnect::_token_GATEWAY, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("NETMASK"), std::bind(&AutoConnect::_token_NETMASK, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("NETMASK")), std::bind(&AutoConnect::_token_NETMASK, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CHANNEL"), std::bind(&AutoConnect::_token_CHANNEL, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CHANNEL")), std::bind(&AutoConnect::_token_CHANNEL, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("DBM"), std::bind(&AutoConnect::_token_DBM, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("DBM")), std::bind(&AutoConnect::_token_DBM, this, std::placeholders::_1)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (uri == String(AUTOCONNECT_URI_FAIL)) { |
|
|
|
else if (uri == String(AUTOCONNECT_URI_FAIL)) { |
|
|
|
|
|
|
|
|
|
|
|
// Setup /auto/fail
|
|
|
|
// Setup /auto/fail
|
|
|
|
elm->setMold(_PAGE_FAIL); |
|
|
|
elm->setMold(_PAGE_FAIL); |
|
|
|
elm->addToken(PSTR("HEAD"), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_BASE"), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_TABLE"), std::bind(&AutoConnect::_token_CSS_TABLE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_TABLE")), std::bind(&AutoConnect::_token_CSS_TABLE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("CSS_LUXBAR"), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("CSS_LUXBAR")), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_PRE"), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_PRE")), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_AUX"), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_AUX")), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("MENU_POST"), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("MENU_POST")), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); |
|
|
|
elm->addToken(PSTR("STATION_STATUS"), std::bind(&AutoConnect::_token_STATION_STATUS, this, std::placeholders::_1)); |
|
|
|
elm->addToken(String(FPSTR("STATION_STATUS")), std::bind(&AutoConnect::_token_STATION_STATUS, this, std::placeholders::_1)); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
delete elm; |
|
|
|
delete elm; |
|
|
|