diff --git a/mkdocs/advancedusage.md b/mkdocs/advancedusage.md index 591081b..e3fb4c2 100644 --- a/mkdocs/advancedusage.md +++ b/mkdocs/advancedusage.md @@ -199,7 +199,50 @@ To implement embedding your legacy web pages to the AutoConnect menu, you can us 5. [Begin](api.md#begin) the portal. 6. Performs [*AutoConnect::handleClient*](api.md#handleClient) in the **loop** function. -For details, see section [Constructing the menu](menuize.md) of Examples page. +```cpp hl_lines="10 28 32" +#include +#include +#include + +ESP8266WebServer server; + +// Declaration for casting legacy page to AutoConnect menu. +// Specifies an uri and the menu label. +AutoConnect portal(server); +AutoConnectAux hello("/hello", "Hello"); // Step #1 as the above procedure + +// Step #2 as the above procedure +// A conventional web page driven by the ESP8266WebServer::on handler. +// This is a legacy. +void handleHello() { + server.send(200, "text/html", String(F( +"" +"" +"Hello, world" +"" + ))); +} + +void setup() { + // Step #3 as the above procedure + // Register the "on" handler as usual to ESP8266WebServer. + // Match this URI with the URI of AutoConnectAux to cast. + server.on("/hello", handleHello); + + // Step #4 as the above procedure + // Joins AutoConnectAux to cast the page via the handleRoot to AutoConnect. + portal.join({ hello }); + portal.begin(); // Step #5 as the above procedure +} + +void loop() { + portal.handleClient(); // Step #6 as the above procedure +} +``` + + + +For more details, see section [Constructing the menu](menuize.md) of Examples page. ### Change menu title diff --git a/mkdocs/changelabel.md b/mkdocs/changelabel.md index 27de924..951a866 100644 --- a/mkdocs/changelabel.md +++ b/mkdocs/changelabel.md @@ -29,13 +29,15 @@ AutoConnect label texts are pre-assigned with a fixed string so that it can be d - + - + + + @@ -64,6 +66,10 @@ AutoConnect label texts are pre-assigned with a fixed string so that it can be d + + + + diff --git a/mkdocs/images/castmenu.png b/mkdocs/images/castmenu.png new file mode 100644 index 0000000..1110395 Binary files /dev/null and b/mkdocs/images/castmenu.png differ diff --git a/mkdocs/menu.md b/mkdocs/menu.md index c80db6a..c7fe316 100644 --- a/mkdocs/menu.md +++ b/mkdocs/menu.md @@ -12,7 +12,7 @@ The following screen will appear as the AutoConnect menu when you access to **Au ## Right on top -Currently, AutoConnect supports four menus. Undermost menu as "HOME" returns to the home path of its sketch. +Currently, AutoConnect supports six menus. Undermost menu as "HOME" returns to the home path of its sketch. - **Configure new AP**: Configure SSID and Password for new access point. - **Open SSIDs**: Opens the past SSID which has been established connection from the flash. diff --git a/src/AutoConnectLabels.h b/src/AutoConnectLabels.h index 282778b..c3488c6 100644 --- a/src/AutoConnectLabels.h +++ b/src/AutoConnectLabels.h @@ -229,7 +229,7 @@ // Text: The update page caption #ifndef AUTOCONNECT_TEXT_UPDATINGFIRMWARE -#define AUTOCONNECT_TEXT_UPDATINGFIRMWARE "Updating firmware via OTA" +#define AUTOCONNECT_TEXT_UPDATINGFIRMWARE "Updating firmware" #endif // !AUTOCONNECT_TEXT_UPDATINGFIRMWARE // Text: The update page's file selection button label
Label placedPre-defined textID (#define macro)
Menu itemConfigure new APAUTOCONNECT_MENULABEL_CONFIGNEW
Menu itemConfigure new APAUTOCONNECT_MENULABEL_CONFIGNEW
Open SSIDsAUTOCONNECT_MENULABEL_OPENSSIDS
DisconnectAUTOCONNECT_MENULABEL_DISCONNECT
Reset...AUTOCONNECT_MENULABEL_RESET
HOMEAUTOCONNECT_MENULABEL_HOME
UpdateAUTOCONNECT_MENULABEL_UPDATE
Button labelRESETAUTOCONNECT_BUTTONLABEL_RESET
Device infoAUTOCONNECT_MENULABEL_DEVINFO
Button labelRESETAUTOCONNECT_BUTTONLABEL_RESET
UPDATEAUTOCONNECT_BUTTONLABEL_UPDATE
Page titlePage not foundAUTOCONNECT_PAGETITLE_NOTFOUND
AutoConnect configAUTOCONNECT_PAGETITLE_CONFIG
AutoConnect connectingAUTOCONNECT_PAGETITLE_CONNECTING
PassphraseAUTOCONNECT_PAGECONFIG_PASSPHRASE
Enable DHCPAUTOCONNECT_PAGECONFIG_ENABLEDHCP
ApplyAUTOCONNECT_PAGECONFIG_APPLY
Page:[update] textUpdating firmwareAUTOCONNECT_TEXT_UPDATINGFIRMWARE
Select firmware:AUTOCONNECT_TEXT_SELECTFIRMWARE
Successfully updated, rebooting...AUTOCONNECT_TEXT_OTASUCCESS
Failed to update:AUTOCONNECT_TEXT_OTAFAILURE
Page:[connection failed]Connection FailedAUTOCONNECT_PAGECONNECTIONFAILED_CONNECTIONFAILED
TextNo saved credentials.AUTOCONNECT_TEXT_NOSAVEDCREDENTIALS
Menu TextConnectingAUTOCONNECT_MENUTEXT_CONNECTING