From 77d5cb5dc6d50651fd15f74b47859105c71fc317 Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Thu, 15 Mar 2018 17:54:47 +0900 Subject: [PATCH] Added boundaryOffet --- docs/advancedusage/index.html | 2 +- docs/api/index.html | 53 +++++++++++++++--------------- docs/examples/index.html | 2 +- docs/faq/index.html | 25 ++++++++++++-- docs/search/search_index.json | 33 +++++++++++-------- examples/Credential/Credential.ino | 16 +++++++-- mkdocs/advancedusage.md | 2 +- mkdocs/api.md | 27 +++++++-------- mkdocs/examples.md | 2 +- mkdocs/faq.md | 14 +++++++- src/AutoConnect.cpp | 4 +-- src/AutoConnect.h | 10 +++--- src/AutoConnectCredential.cpp | 23 ++++++------- src/AutoConnectPage.cpp | 2 +- 14 files changed, 133 insertions(+), 82 deletions(-) diff --git a/docs/advancedusage/index.html b/docs/advancedusage/index.html index 2daac38..d17d633 100644 --- a/docs/advancedusage/index.html +++ b/docs/advancedusage/index.html @@ -812,7 +812,7 @@

EEPROM library uses one sector of flash located just after the SPIFFS.

So in the default state, the credential storage area used by AutoConnect conflicts with data area owned by the user sketch. It will be destroyed together saved data in EEPROM by user sketch and AutoConnect each other. But you can move the storage area to avoid this.

-

The saveOffset in AutoConnectConfig specifies the start offset of the credentials storage area. The default value is 0.

+

The boundaryOffset in AutoConnectConfig specifies the start offset of the credentials storage area. The default value is 0.

Refers the hosted ESP8266WebServer

Constructing an AutoConnect object variable without parameters then creates and starts an ESP8266WebServer inside the AutoConnect. This object variable could be referred by AutoConnect::host() function to access ESP8266WebServer instance as like below.

AutoConnect Portal;
diff --git a/docs/api/index.html b/docs/api/index.html
index 5bb82f6..4685b0b 100644
--- a/docs/api/index.html
+++ b/docs/api/index.html
@@ -606,6 +606,13 @@
     autoSave
   
   
+
+        
+          
  • + + boundaryOffset + +
  • @@ -648,13 +655,6 @@ psk -
  • - -
  • - - saveOffset - -
  • @@ -957,6 +957,13 @@ autoSave + + +
  • + + boundaryOffset + +
  • @@ -999,13 +1006,6 @@ psk -
  • - -
  • - - saveOffset - -
  • @@ -1235,7 +1235,7 @@ Register the handler function for undefined URL request detected.
    Type
    bool
    Value
    -
    trueEnable the captive portal. This is a default.
    +
    trueEnable the captive portal. This is the default.
    falseDisable the captive portal.

    autoSave

    @@ -1247,6 +1247,17 @@ Register the handler function for undefined URL request detected.
    AC_SAVECREDENTIAL_AUTOThe credential saved automatically.
    AC_SAVECREDENTIAL_NEVERThe credential no saved.

    +

    boundaryOffset

    +

    Sets the offset address of the credential storage area for EEPROM. This value must be between greater than 4 and less than flash sector size. (4096 by SDK)
    +The default value is 0. +

    +
    Type
    +
    uint16_t
    +

    +
    +

    It will conflict with user data.

    +

    If the sketch leaves this offset at zero, it will conflict the storage area of credentials with the user sketch owned data. It needs to use the behind of credential area.

    +

    channel

    The channel number of WIFi when SoftAP starts.

    @@ -1292,17 +1303,6 @@ Register the handler function for undefined URL request detected.
    Type
    String

    -

    saveOffset

    -

    Sets the offset address of the credential storage area for EEPROM. This value must be between greater than 4 and less than flash sector size. (4096 by SDK)
    -The default value is 0. -

    -
    Type
    -
    uint16_t
    -

    -
    -

    It will conflict with user data.

    -

    If the sketch leaves this offset at zero, it will conflict the storage area of credentials with the user sketch owned data. It needs to use the behind of credential area.

    -

    AutoConnectConfig example

    AutoConenct        Portal;
     AutoConenctConfig  Config("", "passpass");    // SoftAp name is determined at runtime
    @@ -1311,6 +1311,7 @@ The default value is 0.
     Config.gateway = IPAddress(192,168,10,1);     // Sets WLAN router IP address
     Config.netmask = IPAddress(255,255,255,0);    // Sets WLAN scope
     Config.autoSave = AC_SAVECREDENTIAL_NEVER;    // No save credential
    +COnfig.boundaryOffet = 64;                    // Reserve 64 bytes for the user data in EEPROM. 
     Config.homeUri = "/index.html"                // Sets home path of the sketch application
     Portal.config(Config);                        // Configure AutoConnect
     Portal.begin();                               // Starts and behaves captive portal
    diff --git a/docs/examples/index.html b/docs/examples/index.html
    index bbedb74..05e3dc2 100644
    --- a/docs/examples/index.html
    +++ b/docs/examples/index.html
    @@ -565,7 +565,7 @@
     

    Here holds two case examples. Both examples perform the same function. Only how to incorporate the AutoConnect into the sketch differs. Also included in the sample folder, HandlePortal.ino also shows how to use the PageBuilder library for HTML assemblies.

    What does this example do?

    Uses the web interface to light the LED connected to the NodeMCU module D0 port (which could be referred to as BUILTIN_LED), the following animation is it.

    -

    Access to the ESP8266 module connected WiFi from the browser then the page contains the current value of the D0 port would be displayed. The page has the buttons to switch the port value. The LED blinks according to the value of the button that was clicked. This example is a typical sketch of manipulating ESP8266's GPIO via WLN.

    +

    Access to the ESP8266 module connected WiFi from the browser then the page contains the current value of the D0 port would be displayed. The page has the buttons to switch the port value. The LED blinks according to the value of the button that was clicked. This example is a typical sketch of manipulating ESP8266's GPIO via WLAN.

    Embed AutoConnect library into this sketch. There are few places to be changed. And you can use AutoConnect's captive portal function to establish a connection freely to other WiFi spots.

    Embed AutoConnect

    diff --git a/docs/faq/index.html b/docs/faq/index.html index 111684b..09e6e83 100644 --- a/docs/faq/index.html +++ b/docs/faq/index.html @@ -469,6 +469,13 @@