@ -40,6 +40,30 @@ Sets IP address for Soft AP in captive portal. When AutoConnect fails the initia
<dd><spanclass="apidef">IPAddress</span><spanclass="apidesc">The default value is **172.217.28.1**</span></dd>
</dl>
### <iclass="fa fa-caret-right"></i> applyMenu
Configure applying items of the [AutoConnect menu](menu.md). You can arbitrarily combine valid menus by coordinating the applyMenu value.
<dlclass="apidl">
<dt>**Type**</dt>
<dd><spanclass="apidef">uint16_t</span><spanclass="apidesc">It provides the combined **AC_MENUITEM_t** value of the item to apply to the AutoConnect menu.<br>Specify the value calculated from the **logical OR** by the AC_MENUITEM_t value of each item applied as a menu. It affects not only disappear the items from the menu also invalidates the URI they have. As a consequence, even if it accesses the URL directly will occur a 404 error.<br>The default value is logical OR of AC_MENUITEM_CONFIGNEW, AC_MENUITEM_OPENSSIDS, AC_MENUITEM_DISCONNECT, AC_MENUITEM_RESET and AC_MENUITEM_HOME.</span></dd>
<dt>**Value**</dt>
<dd><spanclass="apidef">AC_MENUITEM_NONE</span><spanclass="apidesc"></span><spanclass="apidef"> </span><spanclass="apidesc">No assign items except for the AutoConnectAux page item.</span></dd>
<dd><spanclass="apidef">AC_MENUITEM_CONFIGNEW</span><spanclass="apidesc"></span><spanclass="apidef"> </span><spanclass="apidesc">Appends [Configure new AP](menu.md#config-new-ap) item.</span></dd>
<dd><spanclass="apidef">AC_MENUITEM_DEVINFO</span><spanclass="apidesc"></span><spanclass="apidef"> </span><spanclass="apidesc">Appends the **Device info** item which links to [AutoConnect statistics page](menu.md##where-the-from).</span></dd>
</dl>
!!! info "How to specify the value of the menu items"
An applyMenu accepts the logical OR of AC_MENUITEM_t type value. For example, to enable only Open SSIDs and HOME items, specify:
However, even if you specify like the above, the AutoConnectAux page items still display on the menu. To remove the AutoConnectAux items, use the [AutoConnectAux::menu](apiaux.md#menu) function.
Automatically will try to reconnect with the past established access point (BSSID) when the current configured SSID in ESP8266/ESP32 could not be connected. By enabling this option, *AutoConnect::begin()* function will attempt to reconnect to a known access point using credentials stored in the flash, even if the connection failed by current SSID.
@ -76,6 +76,26 @@ A **HOME** item at the bottom of the menu list is a link to the home path, and t
Also, you can change the HOME path using the AutoConnect API. The [**AutoConnect::home**](api.md#home) function sets the URI as a link of the HOME item in the AutoConnect menu.
## <iclass="fa fa-bars"></i> Applying the active menu items
Each of the above menu items can be configured with a Sketch. [AutoConnectConfig::applyMenu](apiconfig.md#applymenu) specifies the menu items that will be enabled at runtime.
For example, by disabling the [Configure new AP](#configure-new-ap) and [Disconnect](#disconnect) item, you can prevent the configuration for unknown access points.
Details for [AutoConnectConfig::applyMenu](apiconfig.md#applymenu).
## <iclass="fa fa-bars"></i> Attaching to AutoConnect menu
The AutoConnect menu can contain your sketch's web pages as extra items as a custom. It works for HTML pages implemented by the **ESP8266WebServer::on** handler or the **WebServer::on** handler for ESP32. That is, you can make them invoke the legacy web pages from the AutoConnect menu. The below screen-shot is the result of adding an example sketch for the ESP8266WebServer library known as [FSBrowser](https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer/examples/FSBrowser) to the AutoConnect menu item. It can add Edit and List items with little modification to the legacy sketch code.