|
54 | 54 | .. code:: cpp
|
55 | 55 |
|
56 | 56 | WiFi.mode(m)
|
57 |
| - WiFi.getMode() |
58 | 57 |
|
59 | 58 | - ``WiFi.mode(m)``: set mode to ``WIFI_AP``, ``WIFI_STA``,
|
60 | 59 | ``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) |
63 | 69 |
|
64 | 70 | WiFi power management, DTIM
|
65 | 71 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
@@ -95,17 +101,56 @@ periodic beacon at a frequency specified by the DTIM Interval. Beacons are
|
95 | 101 | packets sent by an access point to synchronize a wireless network.
|
96 | 102 |
|
97 | 103 |
|
| 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 | + |
98 | 147 | Other Function Calls
|
99 | 148 | ~~~~~~~~~~~~~~~~~~~~
|
100 | 149 |
|
101 | 150 | .. code:: cpp
|
102 | 151 |
|
103 | 152 | int32_t channel (void)
|
104 | 153 | WiFiSleepType_t getSleepMode ()
|
105 |
| - bool setPhyMode (WiFiPhyMode_t mode) |
106 |
| - WiFiPhyMode_t getPhyMode () |
107 |
| - void setOutputPower (float dBm) |
108 |
| - WiFiMode_t getMode () |
109 | 154 | bool enableSTA (bool enable)
|
110 | 155 | bool enableAP (bool enable)
|
111 | 156 | bool forceSleepBegin (uint32 sleepUs=0)
|
|
0 commit comments