diff --git a/mkdocs/faq.md b/mkdocs/faq.md index 4e8d264..c1e044d 100644 --- a/mkdocs/faq.md +++ b/mkdocs/faq.md @@ -27,7 +27,7 @@ ESP32 hardware equips only one RF circuitry for WiFi signal. At the AP_STA mode, ## Does not appear esp8266ap in smartphone. -Maybe it is successfully connected at the **first WiFi.begin**. ESP8266 remembers the last SSID successfully connected and will use at the next. It means SoftAP will only start up when the first *WiFi.begin()* fails. +Maybe it is successfully connected at the [**first WiFi.begin**](lsbegin.md#autoconnectbegin-logic-sequence). ESP8266 remembers the last SSID successfully connected and will use at the next. It means SoftAP will only start up when the first *WiFi.begin()* fails. The saved SSID would be cleared by *WiFi.disconnect()* with WIFI_STA mode. If you do not want automatic reconnection, you can erase the memorized SSID with the following simple sketch. diff --git a/src/AutoConnectElementBasis.h b/src/AutoConnectElementBasis.h index 6022534..a7f92e5 100644 --- a/src/AutoConnectElementBasis.h +++ b/src/AutoConnectElementBasis.h @@ -46,11 +46,11 @@ typedef enum { */ class AutoConnectElementBasis { public: - explicit AutoConnectElementBasis(const char* name = "", const char* value = "") : name(String(name)), value(String(value)) { + explicit AutoConnectElementBasis(const char* name = "", const char* value = "") : name(String(name)), value(String(value)), enable(true) { _type = AC_Element; } virtual ~AutoConnectElementBasis() {} - virtual const String toHTML(void) const { return value; } + virtual const String toHTML(void) const { return enable ? value : String(""); } ACElement_t typeOf(void) const { return _type; } #ifndef AUTOCONNECT_USE_JSON template @@ -59,6 +59,7 @@ class AutoConnectElementBasis { String name; /**< Element name */ String value; /**< Element value */ + bool enable; /**< Enabling the element */ protected: ACElement_t _type; /**< Element type identifier */ diff --git a/src/AutoConnectElementBasisImpl.h b/src/AutoConnectElementBasisImpl.h index 2f5e22a..4caf555 100644 --- a/src/AutoConnectElementBasisImpl.h +++ b/src/AutoConnectElementBasisImpl.h @@ -25,7 +25,7 @@ * @return An HTML string. */ const String AutoConnectButtonBasis::toHTML(void) const { - return String(F("")); + return enable ? String(F("")) : String(""); } /** @@ -37,14 +37,16 @@ const String AutoConnectButtonBasis::toHTML(void) const { * @return An HTML string. */ const String AutoConnectCheckboxBasis::toHTML(void) const { - String html; + String html = String(""); - html = String(F("