Skip to content

Commit 979e5ce

Browse files
authored
Update generic-class.rst (#5338)
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.
1 parent 055748f commit 979e5ce

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/esp8266wifi/generic-class.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ onEvent
1212
1313
void onEvent (WiFiEventCb cb, WiFiEvent_t event=WIFI_EVENT_ANY) __attribute__((deprecated))
1414
15-
To see how to use ``onEvent`` please check example sketch `WiFiClientEvents.ino <https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino>`__ available inside examples folder of the ESP8266WiFi library.
1615
1716
WiFiEventHandler
1817
~~~~~~~~~~~~~~~~
@@ -27,7 +26,14 @@ WiFiEventHandler
2726
WiFiEventHandler onSoftAPModeStationConnected (std::function< void(const WiFiEventSoftAPModeStationConnected &)>)
2827
WiFiEventHandler onSoftAPModeStationDisconnected (std::function< void(const WiFiEventSoftAPModeStationDisconnected &)>)
2928
30-
To see a sample application with ``WiFiEventHandler``, please check separate section with `examples :arrow\_right: <generic-examples.rst>`__ dedicated specifically to the Generic Class..
29+
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.
30+
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.
31+
For the SoftAP interface, when the interface is brought up, any servers should be brought up as well.
32+
33+
A detailed explanation of ``WiFiEventHandler`` can be found in the section with `examples :arrow\_right: <generic-examples.rst>`__ dedicated specifically to the Generic Class..
34+
35+
Alternatively, check the example sketch `WiFiEvents.ino <https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino>`__ available inside examples folder of the ESP8266WiFi library.
36+
3137

3238
persistent
3339
~~~~~~~~~~

0 commit comments

Comments
 (0)