@ -121,6 +121,35 @@ Set SoftAP's WiFi configuration and static IP configuration.
<dd><spanclass="apidef">false</span><spanclass="aidesc">Configuration parameter is invalid, some values out of range.</span></dd>
<dd><spanclass="apidef">false</span><spanclass="aidesc">Configuration parameter is invalid, some values out of range.</span></dd>
</dl>
</dl>
### <iclass="fa fa-caret-right"></i> enableMenu
```cpp
void enableMenu(const uint16_t items)
```
Enable the [AutoConnect menu](menu.md) items specified by the items parameter with logical OR value using **AC_MENUITEM_t** constant.
<dlclass="apidl">
<dt>**Parameter**</dt>
<dd><spanclass="apidef">items</span><spanclass="apidesc">Specify the combined value of **AC_MENUITEM_t** of the items applying to the AutoConnect menu. It provides the value calculated from the **logical OR** by the AC_MENUITEM_t value of each item applied as a menu. AC_MENUITEM_t is enumeration type to identify each menu item and it has the below values.</span></dd>
: - **AC_MENUITEM_CONFIGNEW** :
[Configure new AP](menu.md#configure-new-ap)
: - **AC_MENUITEM_OPENSSIDS** :
[Open SSIDs](menu.md#open-ssids)
: - **AC_MENUITEM_DISCONNECT** :
[Disconnect](menu.md#disconnect)
: - **AC_MENUITEM_RESET** :
[Reset...](menu.md#reset)
: - **AC_MENUITEM_HOME** :
[HOME](menu.md#home)
: - **AC_MENUITEM_DEVINFO** :
[Device statistics](menu.md#where-the-from) as AutoConnect root page
</dl>
!!! note "It is added, not replaced."
The initial configuration of the AutoConnect menu items:
The enableMenu function adds an indication of the specified items to the current. Therefore, use the [disableMenu](#disableMenu) to remove the specified item from the initial menu.
The end function releases the instance of ESP8266WebServer/WebServer and DNSServer. It can not process them after the end function.
The end function releases the instance of ESP8266WebServer/WebServer and DNSServer. It can not process them after the end function.
### <iclass="fa fa-caret-right"></i> disableMenu
```cpp
void disableMenu(const uint16_t items)
```
Disable the [AutoConnect menu](menu.md) items specified by the items parameter with logical OR value using **AC_MENUITEM_t** constant.
<dlclass="apidl">
<dt>**Parameter**</dt>
<dd><spanclass="apidef">items</span><spanclass="apidesc">Specify the combined value of **AC_MENUITEM_t** of the items deleting from the AutoConnect menu. It provides the value calculated from the **logical OR** by the AC_MENUITEM_t value of each item. Refer to the [enableMenu](#enablemenu) about AC_MENUITEM_t.</span></dd>
@ -40,9 +40,9 @@ 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>
<dd><spanclass="apidef">IPAddress</span><spanclass="apidesc">The default value is **172.217.28.1**</span></dd>
</dl>
</dl>
### <iclass="fa fa-caret-right"></i>applyMenu
### <iclass="fa fa-caret-right"></i>menuItems
Configure applying items of the [AutoConnect menu](menu.md). You can arbitrarily combine valid menus by coordinating the applyMenu value.
Configure applying items of the [AutoConnect menu](menu.md). You can arbitrarily combine valid menus by coordinating the menuItems value.
<dlclass="apidl">
<dlclass="apidl">
<dt>**Type**</dt>
<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>
<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>
@ -57,10 +57,10 @@ Configure applying items of the [AutoConnect menu](menu.md). You can arbitrarily
</dl>
</dl>
!!! info "How to specify the value of the menu items"
!!! 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:
An menuItems 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.
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.
@ -78,7 +78,7 @@ Also, you can change the HOME path using the AutoConnect API. The [**AutoConnect
## <iclass="fa fa-bars"></i> Applying the active menu items
## <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.
Each of the above menu items can be configured with a Sketch. [AutoConnectConfig::menuItems](apiconfig.md#menuitems) specifies the menu items that will be enabled at runtime. You can also adjust available menu items using [AutoConnect::enableMenu](api.md#enablemenu) and [AutoConnect::disableMenu](api.md#disablemenu) function. It is an alternative to [AutoConnectConfig::menuItems](apiconfig.md#menuitems) and provides a shortcut to avoid using AutoConnectConfig.
For example, by disabling the [Configure new AP](#configure-new-ap) and [Disconnect](#disconnect) item, you can prevent the configuration for unknown access points.
For example, by disabling the [Configure new AP](#configure-new-ap) and [Disconnect](#disconnect) item, you can prevent the configuration for unknown access points.