fix(wifi): Fix default wifi-netif creation to assert if no event loop

- Added ESP_ERROR_CHECK() checks to `esp_wifi_set_default_wifi_..._handlers()` calls
- Added ESP_ERROR_CHECH() to `esp_netif_attach_wifi_...()` calls
- Updated documentation to reflect the changes

Closes https://github.com/espressif/esp-idf/issues/11580
This commit is contained in:
David Cermak
2023-06-21 12:26:29 +02:00
parent ef659e407e
commit 20fcc23f88
3 changed files with 15 additions and 8 deletions

View File

@@ -325,6 +325,7 @@ TEST(esp_netif, create_destroy_default_wifi)
// Helper constants to refer default STA and AP's params
static const esp_netif_inherent_config_t default_sta_cfg = ESP_NETIF_INHERENT_DEFAULT_WIFI_STA();
static const esp_netif_inherent_config_t default_ap_cfg = ESP_NETIF_INHERENT_DEFAULT_WIFI_AP();
TEST_ESP_OK(esp_event_loop_create_default());
// create default station
esp_netif_t *sta = esp_netif_create_default_wifi_sta();
@@ -352,6 +353,7 @@ TEST(esp_netif, create_destroy_default_wifi)
sta = esp_netif_create_default_wifi_sta();
TEST_ASSERT_NOT_NULL(sta);
esp_netif_destroy_default_wifi(sta);
TEST_ESP_OK(esp_event_loop_delete_default());
}
TEST(esp_netif, get_set_hostname)