fix(wifi/example): Fix dpp example init error

Set wifi mode before calling esp_supp_dpp_init.

Closes https://github.com/espressif/esp-idf/pull/12769

Signed-off-by: Shreyas Sheth <shreyas.sheth@espressif.com>
release/v5.1
sparker 2023-12-11 17:02:57 +08:00 zatwierdzone przez Shreyas Sheth
rodzic d23b7a0361
commit c218c35439
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -155,9 +155,9 @@ void dpp_enrollee_init(void)
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_supp_dpp_init(dpp_enrollee_event_cb));
ESP_ERROR_CHECK(dpp_enrollee_bootstrap());
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_start());
/* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum