Skip to content

Commit 4609e44

Browse files
authoredJul 6, 2020
Add some pending methods to generic-class docs (#7427)
1 parent cc1cc0b commit 4609e44

File tree

1 file changed

+52
-7
lines changed

1 file changed

+52
-7
lines changed
 

‎doc/esp8266wifi/generic-class.rst

+52-7
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,18 @@ mode
5454
.. code:: cpp
5555
5656
WiFi.mode(m)
57-
WiFi.getMode()
5857
5958
- ``WiFi.mode(m)``: set mode to ``WIFI_AP``, ``WIFI_STA``,
6059
``WIFI_AP_STA`` or ``WIFI_OFF``
61-
- ``WiFi.getMode()``: return current Wi-Fi mode (one out of four modes
62-
above)
60+
61+
getMode
62+
~~~~~~~
63+
64+
.. code:: cpp
65+
66+
WiFiMode_t WiFi.getMode()
67+
68+
- ``WiFi.getMode()``: return current Wi-Fi mode (one out of four modes above)
6369

6470
WiFi power management, DTIM
6571
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -95,17 +101,56 @@ periodic beacon at a frequency specified by the DTIM Interval. Beacons are
95101
packets sent by an access point to synchronize a wireless network.
96102

97103

104+
setOutputPower
105+
~~~~~~~~~~~~~~
106+
107+
.. code:: cpp
108+
109+
void WiFi.setOutputPower(float dBm)
110+
111+
Sets the max transmit power, in dBm. Values range from 0 to 20.5 [dBm] inclusive, and should be multiples of 0.25.
112+
This is essentially a thin wrapper around the SDK's system_phy_set_max_tpw() api call.
113+
114+
If wifi connection issues are encountered due to signal noise, one thing to try is to reduce the Tx power.
115+
This has been found effective in cases where STA mode is in use with 802.11n phy (default). Reducing to
116+
e.g.: 17.5dBm or slightly lower can reduce noise and improve connectivity, although max range will also be reduced.
117+
118+
setPhyMode
119+
~~~~~~~~~~
120+
121+
.. code:: cpp
122+
123+
bool setPhyMode (WiFiPhyMode_t mode)
124+
125+
Sets the WiFi radio phy mode. Argument is an enum of type WiFiPhyMode_t, valid values are:
126+
- ``WIFI_PHY_MODE_11B``: 802.11b mode
127+
- ``WIFI_PHY_MODE_11G``: 802.11g mode
128+
- ``WIFI_PHY_MODE_11N``: 802.11n mode
129+
130+
Per the NONOS SDK API Reference document, the AP mode only supports b/g, see notes in section on wifi_set_phy_mode() api.
131+
Returns true success, false otherwise.
132+
133+
Some experiments have shown that 802.11b mode has longest LOS range, while 802.11n mode has longest indoor range.
134+
135+
It has been observed that some wifi routers may degrade from 802.11n to g/b if an ESP8266 in g/b phy mode connects to them. That
136+
means that the entire wifi connectivity of all devices are impacted.
137+
138+
getPhyMode
139+
~~~~~~~~~~
140+
141+
.. code:: cpp
142+
143+
WiFiPhyMode_t getPhyMode (WiFiPhyMode_t mode)
144+
145+
Gets the WiFi radio phy mode that is currently set.
146+
98147
Other Function Calls
99148
~~~~~~~~~~~~~~~~~~~~
100149

101150
.. code:: cpp
102151
103152
int32_t channel (void)
104153
WiFiSleepType_t getSleepMode ()
105-
bool setPhyMode (WiFiPhyMode_t mode)
106-
WiFiPhyMode_t getPhyMode ()
107-
void setOutputPower (float dBm)
108-
WiFiMode_t getMode ()
109154
bool enableSTA (bool enable)
110155
bool enableAP (bool enable)
111156
bool forceSleepBegin (uint32 sleepUs=0)

0 commit comments

Comments
 (0)