mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-10-04 11:01:35 +02:00
esp_netif, examples: esp_netif_init() moved into ESP_ERROR_CHECK()
esp_netif_init() returns standard esp_err_t error code (unlike tcpip_adapter init), so shall be checked for the return value Also to make the initialization code more consistent.
This commit is contained in:
committed by
Rocha Euripedes
parent
6b4a3b3759
commit
5488fe31ba
@@ -169,7 +169,7 @@ void app_main(void)
|
|||||||
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
||||||
|
|
||||||
ESP_ERROR_CHECK(nvs_flash_init());
|
ESP_ERROR_CHECK(nvs_flash_init());
|
||||||
esp_netif_init();
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
|
|
||||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||||
|
@@ -139,7 +139,7 @@ void app_main(void)
|
|||||||
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
||||||
|
|
||||||
ESP_ERROR_CHECK(nvs_flash_init());
|
ESP_ERROR_CHECK(nvs_flash_init());
|
||||||
esp_netif_init();
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
|
|
||||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||||
|
@@ -111,7 +111,7 @@ void app_main(void)
|
|||||||
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
||||||
|
|
||||||
ESP_ERROR_CHECK(nvs_flash_init());
|
ESP_ERROR_CHECK(nvs_flash_init());
|
||||||
esp_netif_init();
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
|
|
||||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||||
|
@@ -128,7 +128,7 @@ void app_main(void)
|
|||||||
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
||||||
|
|
||||||
ESP_ERROR_CHECK(nvs_flash_init());
|
ESP_ERROR_CHECK(nvs_flash_init());
|
||||||
esp_netif_init();
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
|
|
||||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||||
|
@@ -138,7 +138,7 @@ void app_main(void)
|
|||||||
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
||||||
|
|
||||||
ESP_ERROR_CHECK(nvs_flash_init());
|
ESP_ERROR_CHECK(nvs_flash_init());
|
||||||
esp_netif_init();
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
|
|
||||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||||
|
@@ -111,7 +111,7 @@ void app_main(void)
|
|||||||
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
||||||
|
|
||||||
ESP_ERROR_CHECK(nvs_flash_init());
|
ESP_ERROR_CHECK(nvs_flash_init());
|
||||||
esp_netif_init();
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
|
|
||||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||||
|
@@ -120,7 +120,7 @@ void app_main(void)
|
|||||||
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
|
||||||
|
|
||||||
ESP_ERROR_CHECK(nvs_flash_init());
|
ESP_ERROR_CHECK(nvs_flash_init());
|
||||||
esp_netif_init();
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
|
|
||||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||||
|
Reference in New Issue
Block a user