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
Copy file name to clipboardExpand all lines: doc/esp8266wifi/scan-class.rst
+26
Original file line number
Diff line number
Diff line change
@@ -236,3 +236,29 @@ The ``networkItem`` is a zero based index of network discovered during scan. All
236
236
6: UPC Wi-Free, Ch:11 (-79dBm)
237
237
238
238
For code samples please refer to separate section with `examples <scan-examples.rst>`__ dedicated specifically to the Scan Class.
239
+
240
+
getScanInfoByIndex
241
+
^^^^^^^^^^^^^^^^^^
242
+
243
+
Similar to the ``getNetworkInfo``, but instead returns a pointer to the Nth ``bss_info`` structure which is internally used by the NONOS SDK.
244
+
245
+
.. code:: cpp
246
+
247
+
WiFi.getScanInfoByIndex(networkItem)
248
+
249
+
The ``networkItem`` is a zero based index of network discovered during scan. Function will return ``nullptr`` when ``networkItem`` is greater than the number of networks in the scan result or when there are no scan results available.
250
+
251
+
.. code:: cpp
252
+
253
+
auto n = WiFi.scanNetworks(false, true);
254
+
if (n <= 0) {
255
+
// scan failed or there are no results
256
+
return;
257
+
}
258
+
259
+
for (int i = 0; i < n; i++)
260
+
const auto* info = WiFi.getScanInfoByIndex(i)
261
+
// ... use the raw data from the bss_info structure ...
262
+
}
263
+
264
+
See ``tools/sdk/include/user_interface.h`` for all available fields and `examples <scan-examples.rst>`__.
Copy file name to clipboardExpand all lines: doc/esp8266wifi/scan-examples.rst
+6
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
:orphan:
2
2
3
+
IDE example
4
+
^^^^^^^^^^^
5
+
6
+
- For the currently installed Core, see Arduino IDE > *Examples* > *ESP8266WiFi* > *WiFiScan*.
7
+
- For the latest development version, see `WiFiScan.ino <https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino>`__.
0 commit comments