Chapter 4. API Guides
Scan Configuration
The scan type and other per-scan attributes are configured by esp_wifi_scan_start(). The table below
provides a detailed description of wifi_scan_config_t.
Field Description
ssid If the SSID is not NULL, it is only the AP with the
same SSID that can be scanned.
bssid If the BSSID is not NULL, it is only the AP with the
same BSSID that can be scanned.
channel If “channel”is 0, there will be an all-channel scan;
otherwise, there will be a specific-channel scan.
show_hidden If“show_hidden”is 0, the scan ignores the AP with a
hidden SSID; otherwise, the scan considers the hidden
AP a normal one.
scan_type If“scan_type”is WIFI_SCAN_TYPE_ACTIVE, the
scan is “active”; otherwise, it is a “passive”one.
scan_time This field is used to control how long the scan dwells on
each channel.
For passive scans, scan_time.passive designates the
dwell time for each channel.
For active scans, dwell times for each channel
are listed in the table below. Here, min is
short for scan time.active.min and max is short for
scan_time.active.max.
• min=0, max=0: scan dwells on each channel for
120 ms.
• min>0, max=0: scan dwells on each channel for
120 ms.
• min=0, max>0: scan dwells on each channel for
max ms.
• min>0, max>0: the minimum time the scan
dwells on each channel is min ms. If no AP is
found during this time frame, the scan switches
to the next channel. Otherwise, the scan dwells
on the channel for max ms.
If you want to improve the performance of the the scan,
you can try to modify these two parameters.
There are also some global scan attributes which are configured by API esp_wifi_set_config(), refer to
Station Basic Configuration
Scan All APs on All Channels (Foreground)
Scenario:
The scenario above describes an all-channel, foreground scan. The foreground scan can only occur in Station mode
where the station does not connect to any AP. Whether it is a foreground or background scan is totally determined
by the Wi-Fi driver, and cannot be configured by the application.
Detailed scenario description:
Scan Configuration Phase
• s1.1: Call esp_wifi_set_country() to set the country info if the default country info is not what you
want, refer to Wi-Fi Country Code.
Espressif Systems 1523
Submit Document Feedback
Release v4.4