The [**handleClient**](api.md#handleclient) function of AutoConnect can include the response of the URI handler added by the user using the "*on*" function of ESP8266WebServer/WebServer. If ESP8266WebServer/WebServer is assigned internally by AutoConnect, the Sketch can obtain that reference with the [**host**](api.md#host) function.
Creates an AutoConnectAux dynamically with the specified URI and integrates it into the menu. Calls with a request handler parameter can use this function as menu registration for a legacy page of ESP8266WebServer/WebServer. If the **handler** parameter specified, also it will register the request handler for the ESP8266WebServer/WebServer.
AutoConnect manages the menu items using a sequence list, and this function always adds the item to the end of the list. Therefore, the order of the menu items is the additional order.
Returns the pointer to created AutoConnectAux instance, the `nullptr` if an AutoConnectAux with the same URI already exists.
<dlclass="apidl">
<dt>**Parameter**</dt>
<dd><spanclass="apidef">uri</span><spanclass="apidesc">A string of the URI.</span></dd>
<dd><spanclass="apidef">title</span><spanclass="apidesc">Title for menu item.</span></dd>
<dd><spanclass="apidef">handler</span><spanclass="apidesc">Request handler function as type of **ESP8266WebServer::THandlerFunction**/**WebServer::THandlerFunction**.</span></dd>
<dt>**Return value**</dt>
<dd>A Pointer to a created AutoConnectAux instance.</dd>
The WebServer must have instantiated for calling with a request handler parameter. AutoConnect can instantiate and host a WebServer internally, but in that case, the point in time to call the append function with a request handler parameter must be after AutoConnect::begin.
Starts establishing the WiFi connection. The WiFi mode at this time is WIFI_STA.
AutoConnect first invokes *WiFi.begin*. If the *ssid* and the *passphrase* are missing, its *WiFi.begin* has no SSID and Password. Regardless of the result, ESP8266WebServer/WebServer will start immediately after the first *WiFi.begin*.
The captive portal will not be started if the connection has been established with first *WiFi.begin*. If the connection cannot establish, switch to WIFI_AP_STA mode and activate SoftAP. Then DNS server starts.
<dd><spanclass="apidef">config</span><spanclass="apidesc">Reference to [**AutoConnectConfig**](apiconfig.md) containing SoftAP's parameters and static IP parameters.</span></dd>
<dd><spanclass="apidef">ap</span><spanclass="apidesc">SSID for SoftAP. The default value is **esp8266ap** for ESP8266, **esp32ap** for ESP32.</span></dd>
<dd><spanclass="apidef">password</span><spanclass="apidesc">Password for SodtAP. The default value is **12345678**.</span></dd>
Detach the AutoConnectAux with the specified URI from the management of AutoConnect. An unmanaged AutoConnectAux will no longer appear in menu items, and its page handler will no longer respond even if the URI is accessed directly.
<dlclass="apidl">
<dt>**Parameter**</dt>
<dd><spanclass="apidef">uri</span><spanclass="apidesc">URI of AutoConnectAux to be detached.</span></dd>
If the request handler registered in the detaching AutoConnectAux is for a legacy page of the ESP8266WebServer/WebServer, the URI is still valid after detaching. AutoConnect does not delete the request handler registered to ESP8266WebServer/WebServer with the `on` function. (It cannot be removed)
Disable the [AutoConnect menu](menu.md) items specified by the items parameter with logical OR value using **AC_MENUITEM_t** constant.
This function only works for AutoConnect primary menu items. It has no effect on disable for AutoConnectAux items. To disable the items by AutoConnectAux, use the [AutoConnectAux::menu](apiaux.md#menu) function.
<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>
Enable the [AutoConnect menu](menu.md) items specified by the items parameter with logical OR value using **AC_MENUITEM_t** constant.
This function only works for AutoConnect primary menu items. It has no effect on enable for AutoConnectAux items. To enable the items by AutoConnectAux, use the [AutoConnectAux::menu](apiaux.md#menu) function.
<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.
Returns the total amount of memory required to hold the AutoConnect credentials and any custom configuration settings stored in EEPROM. The Sketch that writes its own custom data to the EEPROM must call `EEPROM.begin` with this value.
<dlclass="apidl">
<dt>**Return value**</dt>
<dd>Total amount size of saved AutoConnect credentials and custom data.</dd>
</dl>
!!! note "The getEEPROMUsedSize is available for only ESP8266 use"
It is available for only ESP8266 use and will return 0 when used with ESP32.
Process the AutoConnect menu interface. The handleClient() function of the ESP8266WebServer/WebServer hosted by AutoConnect is also called from within AutoConnect, and the client request handlers contained in the user sketch are also handled.
The handleRequest function is not supposed to use with AutoConnect::handleClient. It should be used with ESP8266WebServer::handleClient or WebServer::handleClient.
Join the AutoConnectAux object to AutoConnect. AutoConnectAux objects can be joined one by one, or joined altogether. The AutoConnectAux object joined by the join function can be handled from the AutoConnect menu.
<dd><spanclass="apidef">aux</span><spanclass="apidesc">Reference to AutoConnectAux. It can be std::vector of std::reference_wrapper of AutoConnectAux with [list initialization](https://en.cppreference.com/w/cpp/language/list_initialization).</span></dd>
<dd><spanclass="apidef">true</span><spanclass="apidesc">The JSON document as AutoConnectAux successfully loaded.</span></dd>
<dd><spanclass="apidef">false</span><spanclass="apidesc">Loading JSON document unsuccessful, probably syntax errors have occurred or insufficient memory. You can diagnose the cause of loading failure using the [ArduinoJson Assistant](https://arduinojson.org/v5/assistant/).</span></dd>
<dd><spanclass="apidef">uri</span><spanclass="apidesc">A string of the URI assigned to the AutoConnectAux page.</span></dd>
<dd><spanclass="apidef">handler</span><spanclass="apidesc">A function that behaves when a request to the AutoConnectAux page occurs. AuxHandlerFunctionT type is defined by the following declaration.<pclass=""apidesc">`String handler(AutoConnectAux&, PageArgument&)`</p></span></dd>
<dd><spanclass="apidef">order</span><spanclass="apidesc">Specifies when the handler is called with the following enumeration value.</span></dd>
Called before AutoConnect generates the HTML of the page. You set the value of AutoConnectElements in the handler then its value will be displayed on the page.
: - **AC_EXIT_LATER** :
Called after AutoConnect generates the HTML of the page. You can append to HTML generated by AutoConnect.
: - **AC_EXIT_BOTH** :
Called even before generating HTML and after generated.
AutoConnect identifies the URI (ie. the referrer URI) that caused the request each time from the client occurs and will save the URI If the request source is a custom Web page of AutoConnectAux. The **where** function returns a pointer of AutoConnectAux which is a URI of a least recent request from the custom Web page.<br>
This function is provided to access the fields (ie. the AutoConnectElements) with a custom Web page handler of a page and is available only for request source that is the custom Web pages. It is invalid for HTTP requests from individual pages registered with the **on** handler of ESP8266WebServer/WebServer for ESP32. In other words, this function only returns the AutoConnecAux page which is a least recently displayed.