From e9fda58180aa9a0f1b9165e64b56d1807d96b3df Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Tue, 14 Jan 2020 11:48:27 +0900 Subject: [PATCH] Changed interface of the onDetect exit routine's parameter --- examples/HandleClient/HandleClient.ino | 2 +- examples/HandlePortal/HandlePortal.ino | 2 +- examples/HandlePortalEX/HandlePortalEX.ino | 2 +- mkdocs/advancedusage.md | 2 +- mkdocs/api.md | 2 +- src/AutoConnect.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/HandleClient/HandleClient.ino b/examples/HandleClient/HandleClient.ino index 2b16e44..eee01e1 100644 --- a/examples/HandleClient/HandleClient.ino +++ b/examples/HandleClient/HandleClient.ino @@ -85,7 +85,7 @@ void sendRedirect(String uri) { server.client().stop(); } -bool atDetect(IPAddress softapIP) { +bool atDetect(IPAddress& softapIP) { Serial.println("Captive portal started, SoftAP IP:" + softapIP.toString()); return true; } diff --git a/examples/HandlePortal/HandlePortal.ino b/examples/HandlePortal/HandlePortal.ino index 048cabb..ddd892d 100644 --- a/examples/HandlePortal/HandlePortal.ino +++ b/examples/HandlePortal/HandlePortal.ino @@ -88,7 +88,7 @@ void sendRedirect(String uri) { server.client().stop(); } -bool atDetect(IPAddress softapIP) { +bool atDetect(IPAddress& softapIP) { Serial.println("Captive portal started, SoftAP IP:" + softapIP.toString()); return true; } diff --git a/examples/HandlePortalEX/HandlePortalEX.ino b/examples/HandlePortalEX/HandlePortalEX.ino index 181ef99..91b054a 100644 --- a/examples/HandlePortalEX/HandlePortalEX.ino +++ b/examples/HandlePortalEX/HandlePortalEX.ino @@ -119,7 +119,7 @@ void sendRedirect(String uri) { io.cancel(); } -bool atDetect(IPAddress softapIP) { +bool atDetect(IPAddress& softapIP) { Serial.println("Captive portal started, SoftAP IP:" + softapIP.toString()); return true; } diff --git a/mkdocs/advancedusage.md b/mkdocs/advancedusage.md index a9a0c94..a0eef35 100644 --- a/mkdocs/advancedusage.md +++ b/mkdocs/advancedusage.md @@ -79,7 +79,7 @@ The captive portal will only be activated if 1st-WiFi::begin fails. Sketch can d ```cpp hl_lines="3 13" AutoConnect Portal; -bool startCP(IPAddress ip) { +bool startCP(IPAddress& ip) { digitalWrite(BUILTIN_LED, HIGH); Serial.println("C.P. started, IP:" + WiFi.localIP().toString()); return true; diff --git a/mkdocs/api.md b/mkdocs/api.md index f7627a7..fd73661 100644 --- a/mkdocs/api.md +++ b/mkdocs/api.md @@ -315,7 +315,7 @@ Register the function which will call from AutoConnect at the start of the capti An *fn* specifies the function called when the captive portal starts. Its prototype declaration is defined as "*DetectExit_ft*". ```cpp -typedef std::function DetectExit_ft +typedef std::function DetectExit_ft ```
**Parameter**
diff --git a/src/AutoConnect.h b/src/AutoConnect.h index a483087..1cec25d 100644 --- a/src/AutoConnect.h +++ b/src/AutoConnect.h @@ -261,7 +261,7 @@ class AutoConnect { bool load(Stream& aux); #endif // !AUTOCONNECT_USE_JSON - typedef std::function DetectExit_ft; + typedef std::function DetectExit_ft; void onDetect(DetectExit_ft fn); void onNotFound(WebServerClass::THandlerFunction fn);