From 09f4d01e339ca6241e472f06e39a7ebcbd70cb8d Mon Sep 17 00:00:00 2001 From: Develo Date: Mon, 12 Nov 2018 21:57:41 -0300 Subject: [PATCH] Update generic-class.rst Fix link to WiFiEvents Add note about WiFiClients and WiFiServers going down when a WiFi interface goes down, and that it's the user's responsibility to bring them back up. --- doc/esp8266wifi/generic-class.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/esp8266wifi/generic-class.rst b/doc/esp8266wifi/generic-class.rst index e7344284b1..f93b473135 100644 --- a/doc/esp8266wifi/generic-class.rst +++ b/doc/esp8266wifi/generic-class.rst @@ -12,7 +12,6 @@ onEvent void onEvent (WiFiEventCb cb, WiFiEvent_t event=WIFI_EVENT_ANY) __attribute__((deprecated)) -To see how to use ``onEvent`` please check example sketch `WiFiClientEvents.ino `__ available inside examples folder of the ESP8266WiFi library. WiFiEventHandler ~~~~~~~~~~~~~~~~ @@ -27,7 +26,14 @@ WiFiEventHandler WiFiEventHandler onSoftAPModeStationConnected (std::function< void(const WiFiEventSoftAPModeStationConnected &)>) WiFiEventHandler onSoftAPModeStationDisconnected (std::function< void(const WiFiEventSoftAPModeStationDisconnected &)>) -To see a sample application with ``WiFiEventHandler``, please check separate section with `examples :arrow\_right: `__ dedicated specifically to the Generic Class.. +It should be noted that when an WiFi interface goes down, all WiFiClients are stopped, and all WiFiServers stop serving. When the interface comes up, it is up to the user to reconnect the relevant WiFiClients and bring the WiFiServers back up. +For the WiFi station interface, it is suggested to set a callback for onStationModeDisconnected() that shuts down the user app's WiFiClients and WiFiServers (resource cleanup), and another callback for onStationModeGotIP() that brings them back up. +For the SoftAP interface, when the interface is brought up, any servers should be brought up as well. + +A detailed explanation of ``WiFiEventHandler`` can be found in the section with `examples :arrow\_right: `__ dedicated specifically to the Generic Class.. + +Alternatively, check the example sketch `WiFiEvents.ino `__ available inside examples folder of the ESP8266WiFi library. + persistent ~~~~~~~~~~