1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

Update WiFi scan docs (#8685)

This commit is contained in:
Max Prokhorov 2022-10-10 18:08:06 +03:00 committed by GitHub
parent 5c22dbc163
commit 7b2c627ed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

View File

@ -236,3 +236,29 @@ The ``networkItem`` is a zero based index of network discovered during scan. All
6: UPC Wi-Free, Ch:11 (-79dBm)
For code samples please refer to separate section with `examples <scan-examples.rst>`__ dedicated specifically to the Scan Class.
getScanInfoByIndex
^^^^^^^^^^^^^^^^^^
Similar to the ``getNetworkInfo``, but instead returns a pointer to the Nth ``bss_info`` structure which is internally used by the NONOS SDK.
.. code:: cpp
WiFi.getScanInfoByIndex(networkItem)
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.
.. code:: cpp
auto n = WiFi.scanNetworks(false, true);
if (n <= 0) {
// scan failed or there are no results
return;
}
for (int i = 0; i < n; i++)
const auto* info = WiFi.getScanInfoByIndex(i)
// ... use the raw data from the bss_info structure ...
}
See ``tools/sdk/include/user_interface.h`` for all available fields and `examples <scan-examples.rst>`__.

View File

@ -1,5 +1,11 @@
:orphan:
IDE example
^^^^^^^^^^^
- For the currently installed Core, see Arduino IDE > *Examples* > *ESP8266WiFi* > *WiFiScan*.
- For the latest development version, see `WiFiScan.ino <https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino>`__.
Scan
~~~~