Changed interface of the onDetect exit routine's parameter

enhance/v120
Hieromon Ikasamo 5 years ago
parent 2b7c49ae18
commit e9fda58180
  1. 2
      examples/HandleClient/HandleClient.ino
  2. 2
      examples/HandlePortal/HandlePortal.ino
  3. 2
      examples/HandlePortalEX/HandlePortalEX.ino
  4. 2
      mkdocs/advancedusage.md
  5. 2
      mkdocs/api.md
  6. 2
      src/AutoConnect.h

@ -85,7 +85,7 @@ void sendRedirect(String uri) {
server.client().stop(); server.client().stop();
} }
bool atDetect(IPAddress softapIP) { bool atDetect(IPAddress& softapIP) {
Serial.println("Captive portal started, SoftAP IP:" + softapIP.toString()); Serial.println("Captive portal started, SoftAP IP:" + softapIP.toString());
return true; return true;
} }

@ -88,7 +88,7 @@ void sendRedirect(String uri) {
server.client().stop(); server.client().stop();
} }
bool atDetect(IPAddress softapIP) { bool atDetect(IPAddress& softapIP) {
Serial.println("Captive portal started, SoftAP IP:" + softapIP.toString()); Serial.println("Captive portal started, SoftAP IP:" + softapIP.toString());
return true; return true;
} }

@ -119,7 +119,7 @@ void sendRedirect(String uri) {
io.cancel(); io.cancel();
} }
bool atDetect(IPAddress softapIP) { bool atDetect(IPAddress& softapIP) {
Serial.println("Captive portal started, SoftAP IP:" + softapIP.toString()); Serial.println("Captive portal started, SoftAP IP:" + softapIP.toString());
return true; return true;
} }

@ -79,7 +79,7 @@ The captive portal will only be activated if 1st-WiFi::begin fails. Sketch can d
```cpp hl_lines="3 13" ```cpp hl_lines="3 13"
AutoConnect Portal; AutoConnect Portal;
bool startCP(IPAddress ip) { bool startCP(IPAddress& ip) {
digitalWrite(BUILTIN_LED, HIGH); digitalWrite(BUILTIN_LED, HIGH);
Serial.println("C.P. started, IP:" + WiFi.localIP().toString()); Serial.println("C.P. started, IP:" + WiFi.localIP().toString());
return true; return true;

@ -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*". An *fn* specifies the function called when the captive portal starts. Its prototype declaration is defined as "*DetectExit_ft*".
```cpp ```cpp
typedef std::function<bool(IPAddress softapIP)> DetectExit_ft typedef std::function<bool(IPAddress& softapIP)> DetectExit_ft
``` ```
<dl class="apidl"> <dl class="apidl">
<dt>**Parameter**</dt> <dt>**Parameter**</dt>

@ -261,7 +261,7 @@ class AutoConnect {
bool load(Stream& aux); bool load(Stream& aux);
#endif // !AUTOCONNECT_USE_JSON #endif // !AUTOCONNECT_USE_JSON
typedef std::function<bool(IPAddress)> DetectExit_ft; typedef std::function<bool(IPAddress&)> DetectExit_ft;
void onDetect(DetectExit_ft fn); void onDetect(DetectExit_ft fn);
void onNotFound(WebServerClass::THandlerFunction fn); void onNotFound(WebServerClass::THandlerFunction fn);

Loading…
Cancel
Save