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

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -73,7 +73,9 @@ esp_err_t esp_wifi_clear_default_wifi_driver_and_handlers(void *esp_netif);
* @brief Creates default WIFI AP. In case of any init error this API aborts.
*
* @note The API creates esp_netif object with default WiFi access point config,
* attaches the netif to wifi and registers default wifi handlers.
* attaches the netif to wifi and registers wifi handlers to the default event loop.
* This API uses assert() to check for potential errors, so it could abort the program.
* (Note that the default event loop needs to be created prior to calling this API)
*
* @return pointer to esp-netif instance
*/
@@ -83,7 +85,9 @@ esp_netif_t* esp_netif_create_default_wifi_ap(void);
* @brief Creates default WIFI STA. In case of any init error this API aborts.
*
* @note The API creates esp_netif object with default WiFi station config,
* attaches the netif to wifi and registers default wifi handlers.
* attaches the netif to wifi and registers wifi handlers to the default event loop.
* This API uses assert() to check for potential errors, so it could abort the program.
* (Note that the default event loop needs to be created prior to calling this API)
*
* @return pointer to esp-netif instance
*/
@@ -93,7 +97,8 @@ esp_netif_t* esp_netif_create_default_wifi_sta(void);
* @brief Creates default WIFI NAN. In case of any init error this API aborts.
*
* @note The API creates esp_netif object with default WiFi station config,
* attaches the netif to wifi and registers default wifi handlers.
* attaches the netif to wifi and registers wifi handlers to the default event loop.
* (Note that the default event loop needs to be created prior to calling this API)
*
* @return pointer to esp-netif instance
*/