Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions drivers/wifi/esp32/Kconfig.esp32
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@
highest RSSI. Without this, a fast scan is performed which connects to the first AP
found.

config ESP32_WIFI_STA_CONNECT_TO_BSSID
bool "Use a MAC address to specify which AP to connect to."
help
When enabled, the MAC address of the desired AP can be specified for connecting to a

Check failure on line 82 in drivers/wifi/esp32/Kconfig.esp32

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

drivers/wifi/esp32/Kconfig.esp32:82 trailing whitespace
specific access point. Should one wish to connect to not use this feature while enabled,
they should set the BSSID array in the connection parameters to 0.

config ESP32_WIFI_NET_ALLOC_SPIRAM
bool "Allocate memory of WiFi and NET in SPIRAM"
depends on ESP_SPIRAM
Expand Down
10 changes: 10 additions & 0 deletions drivers/wifi/esp32/src/esp_wifi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,16 @@ static int esp32_wifi_connect(const struct device *dev,
wifi_config.sta.sort_method = WIFI_CONNECT_AP_BY_SIGNAL;
#endif

#if defined(CONFIG_ESP32_WIFI_STA_CONNECT_TO_BSSID)
if (params->bssid[0] != 0 && params->bssid[1] != 0 &&
params->bssid[2] != 0 && params->bssid[3] != 0 &&
params->bssid[4] != 0 && params->bssid[5] != 0) {

memcpy(wifi_config.sta.bssid, params->bssid, sizeof(params->bssid));
wifi_config.sta.bssid_set = true;
}
#endif

if (params->channel == WIFI_CHANNEL_ANY) {
wifi_config.sta.channel = 0U;
data->status.channel = 0U;
Expand Down
Loading