You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
To see a sample application with ``WiFiEventHandler``, please check separate section with `examples :arrow\_right: <generic-examples.rst>`__ dedicated specifically to the Generic Class..
31
31
@@ -34,25 +34,21 @@ persistent
34
34
35
35
.. code:: cpp
36
36
37
-
WiFi.persistent(persistent)
37
+
WiFi.persistent(persistent)
38
38
39
-
Module is able to reconnect to last used Wi-Fi network on power up or reset basing on settings stored in specific sectors of flash memory. By default these settings are written to flash each time they are used in functions like ``WiFi.begin(ssid, password)``. This happens no matter if SSID or password has been actually changed.
39
+
ESP8266 is able to reconnect to the last used Wi-Fi network or establishes the same Access Point upon power up or reset.
40
+
By default, these settings are written to specific sectors of flash memory every time they are changed in ``WiFi.begin(ssid, passphrase)`` or ``WiFi.softAP(ssid, passphrase, channel)``, and when ``WiFi.disconnect`` or ``WiFi.softAPdisconnect`` is invoked.
41
+
Frequently calling these functions could cause wear on the flash memory (see issue `#1054 <https://github.com/esp8266/Arduino/issues/1054>`__).
40
42
41
-
This might result in some wear of flash memory depending on how often such functions are called.
42
-
43
-
Setting ``persistent`` to ``false`` will get SSID / password written to flash only if currently used values do not match what is already stored in flash.
44
-
45
-
Please note that functions ``WiFi.disconnect`` or ``WiFi.softAPdisconnect`` reset currently used SSID / password. If ``persistent`` is set to ``false``, then using these functions will not affect SSID / password stored in flash.
46
-
47
-
To learn more about this functionality, and why it has been introduced, check issue report `#1054 <https://github.com/esp8266/Arduino/issues/1054>`__.
43
+
Once ``WiFi.persistent(false)`` is called, ``WiFi.begin``, ``WiFi.disconnect``, ``WiFi.softAP``, or ``WiFi.softAPdisconnect`` only changes the current in-memory Wi-Fi settings, and does not affect the Wi-Fi settings stored in flash memory.
48
44
49
45
mode
50
46
~~~~
51
47
52
48
.. code:: cpp
53
49
54
-
WiFi.mode(m)
55
-
WiFi.getMode()
50
+
WiFi.mode(m)
51
+
WiFi.getMode()
56
52
57
53
- ``WiFi.mode(m)``: set mode to ``WIFI_AP``, ``WIFI_STA``,
58
54
``WIFI_AP_STA`` or ``WIFI_OFF``
@@ -64,17 +60,17 @@ Other Function Calls
64
60
65
61
.. code:: cpp
66
62
67
-
int32_t channel (void)
68
-
bool setSleepMode (WiFiSleepType_t type)
69
-
WiFiSleepType_t getSleepMode ()
70
-
bool setPhyMode (WiFiPhyMode_t mode)
71
-
WiFiPhyMode_t getPhyMode ()
72
-
void setOutputPower (float dBm)
73
-
WiFiMode_t getMode ()
74
-
bool enableSTA (bool enable)
75
-
bool enableAP (bool enable)
76
-
bool forceSleepBegin (uint32 sleepUs=0)
77
-
bool forceSleepWake ()
63
+
int32_t channel (void)
64
+
bool setSleepMode (WiFiSleepType_t type)
65
+
WiFiSleepType_t getSleepMode ()
66
+
bool setPhyMode (WiFiPhyMode_t mode)
67
+
WiFiPhyMode_t getPhyMode ()
68
+
void setOutputPower (float dBm)
69
+
WiFiMode_t getMode ()
70
+
bool enableSTA (bool enable)
71
+
bool enableAP (bool enable)
72
+
bool forceSleepBegin (uint32 sleepUs=0)
73
+
bool forceSleepWake ()
78
74
int hostByName (const char *aHostname, IPAddress &aResult)
79
75
80
76
Documentation for the above functions is not yet prepared.
0 commit comments