diff --git a/src/AutoConnectPage.cpp b/src/AutoConnectPage.cpp
index 5e5861d..1d70999 100644
--- a/src/AutoConnectPage.cpp
+++ b/src/AutoConnectPage.cpp
@@ -3,7 +3,7 @@
* @file AutoConnectPage.h
* @author hieromon@gmail.com
* @version 1.1.0
- * @date 2019-10-13
+ * @date 2019-10-15
* @copyright MIT license.
*/
@@ -289,7 +289,7 @@ const char AutoConnect::_CSS_SPINNER[] PROGMEM = {
"position:relative;"
"margin:100px auto"
"}"
- ".double-bounce1, .double-bounce2{"
+ ".dbl-bounce1, .dbl-bounce2{"
"width:100%;"
"height:100%;"
"border-radius:50%;"
@@ -301,7 +301,7 @@ const char AutoConnect::_CSS_SPINNER[] PROGMEM = {
"-webkit-animation:sk-bounce 2.0s infinite ease-in-out;"
"animation:sk-bounce 2.0s infinite ease-in-out"
"}"
- ".double-bounce2{"
+ ".dbl-bounce2{"
"-webkit-animation-delay:-1.0s;"
"animation-delay:-1.0s"
"}"
@@ -487,10 +487,10 @@ const char AutoConnect::_CSS_LUXBAR[] PROGMEM = {
"white-space:nowrap;"
"}"
"}"
- ".lb-cb:checked+.lb-menu .lb-burger-doublespin span::before{"
+ ".lb-cb:checked+.lb-menu .lb-burger-dblspin span::before{"
"transform:rotate(225deg)"
"}"
- ".lb-cb:checked+.lb-menu .lb-burger-doublespin span::after{"
+ ".lb-cb:checked+.lb-menu .lb-burger-dblspin span::after{"
"transform:rotate(-225deg)"
"}"
".lb-menu-material,"
@@ -525,7 +525,7 @@ const char AutoConnect::_ELM_MENU_PRE[] PROGMEM = {
"
"
""
"- " AUTOCONNECT_MENULABEL_CONFIGNEW "
"
"- " AUTOCONNECT_MENULABEL_OPENSSIDS "
"
@@ -751,8 +751,8 @@ const char AutoConnect::_PAGE_CONNECTING[] PROGMEM = {
"{{MENU_PRE}}"
"{{MENU_POST}}"
""
- "
"
- "
"
+ "
"
+ "
"
"
{{CUR_SSID}}
"
"
"
""
@@ -1006,15 +1006,17 @@ String AutoConnect::_token_WIFI_STATUS(PageArgument& args) {
String AutoConnect::_token_STATION_STATUS(PageArgument& args) {
AC_UNUSED(args);
- const char* wlStatusSymbol ="";
- static const char* wlStatusSymbols[] = {
+ PGM_P wlStatusSymbol = PSTR("");
+ // const char* wlStatusSymbol ="";
+ PGM_P wlStatusSymbols[] = {
+ // static const char* wlStatusSymbols[] = {
#if defined(ARDUINO_ARCH_ESP8266)
- "IDLE",
- "CONNECTING",
- "WRONG_PASSWORD",
- "NO_AP_FOUND",
- "CONNECT_FAIL",
- "GOT_IP"
+ PSTR("IDLE"),
+ PSTR("CONNECTING"),
+ PSTR("WRONG_PASSWORD"),
+ PSTR("NO_AP_FOUND"),
+ PSTR("CONNECT_FAIL"),
+ PSTR("GOT_IP")
};
switch (wifi_station_get_connect_status()) {
case STATION_IDLE:
@@ -1036,14 +1038,14 @@ String AutoConnect::_token_STATION_STATUS(PageArgument& args) {
wlStatusSymbol = wlStatusSymbols[5];
break;
#elif defined(ARDUINO_ARCH_ESP32)
- "IDLE",
- "NO_SSID_AVAIL",
- "SCAN_COMPLETED",
- "CONNECTED",
- "CONNECT_FAILED",
- "CONNECTION_LOST",
- "DISCONNECTED",
- "NO_SHIELD"
+ PSTR("IDLE"),
+ PSTR("NO_SSID_AVAIL"),
+ PSTR("SCAN_COMPLETED"),
+ PSTR("CONNECTED"),
+ PSTR("CONNECT_FAILED"),
+ PSTR("CONNECTION_LOST"),
+ PSTR("DISCONNECTED"),
+ PSTR("NO_SHIELD")
};
switch (_rsConnect) {
case WL_IDLE_STATUS:
@@ -1072,7 +1074,7 @@ String AutoConnect::_token_STATION_STATUS(PageArgument& args) {
break;
#endif
}
- return String("(") + String(_rsConnect) + String(") ") + String(wlStatusSymbol);
+ return String("(") + String(_rsConnect) + String(") ") + String(FPSTR(wlStatusSymbol));
}
String AutoConnect::_token_LOCAL_IP(PageArgument& args) {
@@ -1260,10 +1262,16 @@ String AutoConnect::_token_CONFIG_STAIP(PageArgument& args) {
String AutoConnect::_token_OPEN_SSID(PageArgument& args) {
AC_UNUSED(args);
- AutoConnectCredential credit(_apConfig.boundaryOffset);
- station_config_t entry;
+ static const char _ssidList[] PROGMEM = "%s
";
+ static const char _ssidRssi[] PROGMEM = "%d% Ch.%d";
+ static const char _ssidNA[] PROGMEM = "N/A";
+ static const char _ssidLock[] PROGMEM = "";
+ static const char _ssidNull[] PROGMEM = "";
String ssidList;
- String rssiSym;
+ station_config_t entry;
+ char slCont[176];
+ char rssiCont[32];
+ AutoConnectCredential credit(_apConfig.boundaryOffset);
uint8_t creEntries = credit.entries();
if (creEntries > 0) {
@@ -1274,20 +1282,23 @@ String AutoConnect::_token_OPEN_SSID(PageArgument& args) {
ssidList = String(F("No saved credentials.
"));
for (uint8_t i = 0; i < creEntries; i++) {
+ rssiCont[0] = '\0';
+ PGM_P rssiSym = _ssidNA;
+ PGM_P ssidLock = _ssidNull;
credit.load(i, &entry);
AC_DBG("A credential #%d loaded\n", (int)i);
- ssidList += String(F("(entry.ssid)) + String(F("\">"));
for (int8_t sc = 0; sc < (int8_t)_scanCount; sc++) {
if (!memcmp(entry.bssid, WiFi.BSSID(sc), sizeof(station_config_t::bssid))) {
_connectCh = WiFi.channel(sc);
- rssiSym = String(AutoConnect::_toWiFiQuality(WiFi.RSSI(sc))) + String(F("% Ch.")) + String(_connectCh) + String(F(""));
+ snprintf_P(rssiCont, sizeof(rssiCont), (PGM_P)_ssidRssi, AutoConnect::_toWiFiQuality(WiFi.RSSI(sc)), _connectCh);
+ rssiSym = rssiCont;
if (WiFi.encryptionType(sc) != ENC_TYPE_NONE)
- rssiSym += String(F(""));
+ ssidLock = _ssidLock;
break;
}
}
- ssidList += rssiSym + String(F("
"));
+ snprintf_P(slCont, sizeof(slCont), (PGM_P)_ssidList, AUTOCONNECT_PARAMID_CRED, reinterpret_cast(entry.ssid), rssiSym, ssidLock);
+ ssidList += String(slCont);
}
return ssidList;
}