From a49b934ef895690f2b5e3709340db856e27475e2 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Sat, 31 Aug 2019 16:19:21 +0200 Subject: [PATCH] examples: protocol examples which use common connection component updated to use esp_netif_init instead of tcpip_adapter in initialization code --- .../coap_client/main/coap_client_example_main.c | 2 +- .../coap_server/main/coap_server_example_main.c | 2 +- .../esp_http_client/main/esp_http_client_example.c | 4 ++-- .../http2_request/main/http2_request_example_main.c | 4 ++-- .../http_request/main/http_request_example_main.c | 2 +- .../protocols/http_server/advanced_tests/main/main.c | 4 ++-- .../protocols/http_server/file_serving/main/main.c | 4 ++-- .../http_server/persistent_sockets/main/main.c | 4 ++-- .../http_server/restful_server/main/esp_rest_main.c | 4 ++-- examples/protocols/http_server/simple/main/main.c | 4 ++-- .../https_mbedtls/main/https_mbedtls_example_main.c | 4 ++-- .../https_request/main/https_request_example_main.c | 4 ++-- examples/protocols/https_server/main/main.c | 4 ++-- examples/protocols/mdns/main/mdns_example_main.c | 2 +- .../protocols/mqtt/publish_test/main/publish_test.c | 4 ++-- examples/protocols/mqtt/ssl/main/app_main.c | 4 ++-- .../protocols/mqtt/ssl_mutual_auth/main/app_main.c | 4 ++-- examples/protocols/mqtt/tcp/main/app_main.c | 4 ++-- examples/protocols/mqtt/ws/main/app_main.c | 4 ++-- examples/protocols/mqtt/wss/main/app_main.c | 4 ++-- .../main/openssl_client_example_main.c | 4 ++-- .../main/openssl_server_example_main.c | 4 ++-- examples/protocols/sntp/main/sntp_example_main.c | 2 +- .../protocols/sockets/tcp_client/main/tcp_client.c | 4 ++-- .../protocols/sockets/tcp_server/main/tcp_server.c | 4 ++-- .../protocols/sockets/udp_client/main/udp_client.c | 4 ++-- .../udp_multicast/main/udp_multicast_example_main.c | 12 ++++++------ .../protocols/sockets/udp_server/main/udp_server.c | 4 ++-- .../protocols/websocket/main/websocket_example.c | 2 +- .../main/advanced_https_ota_example.c | 2 +- .../ota/native_ota_example/main/native_ota_example.c | 2 +- .../ota/simple_ota_example/main/simple_ota_example.c | 2 +- 32 files changed, 59 insertions(+), 59 deletions(-) diff --git a/examples/protocols/coap_client/main/coap_client_example_main.c b/examples/protocols/coap_client/main/coap_client_example_main.c index de7ec60be..423e9f7a1 100644 --- a/examples/protocols/coap_client/main/coap_client_example_main.c +++ b/examples/protocols/coap_client/main/coap_client_example_main.c @@ -440,7 +440,7 @@ clean_up: void app_main(void) { ESP_ERROR_CHECK( nvs_flash_init() ); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/coap_server/main/coap_server_example_main.c b/examples/protocols/coap_server/main/coap_server_example_main.c index 562c85a83..b8adb783d 100644 --- a/examples/protocols/coap_server/main/coap_server_example_main.c +++ b/examples/protocols/coap_server/main/coap_server_example_main.c @@ -306,7 +306,7 @@ clean_up: void app_main(void) { ESP_ERROR_CHECK( nvs_flash_init() ); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/esp_http_client/main/esp_http_client_example.c b/examples/protocols/esp_http_client/main/esp_http_client_example.c index 348471a61..10d96034c 100644 --- a/examples/protocols/esp_http_client/main/esp_http_client_example.c +++ b/examples/protocols/esp_http_client/main/esp_http_client_example.c @@ -15,7 +15,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "esp_event.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "esp_tls.h" @@ -541,7 +541,7 @@ void app_main(void) ret = nvs_flash_init(); } ESP_ERROR_CHECK(ret); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/http2_request/main/http2_request_example_main.c b/examples/protocols/http2_request/main/http2_request_example_main.c index 9b6bb739e..aaaa251a8 100644 --- a/examples/protocols/http2_request/main/http2_request_example_main.c +++ b/examples/protocols/http2_request/main/http2_request_example_main.c @@ -21,7 +21,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "protocol_examples_common.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "sh2lib.h" @@ -131,7 +131,7 @@ static void http2_task(void *args) void app_main(void) { ESP_ERROR_CHECK( nvs_flash_init() ); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/http_request/main/http_request_example_main.c b/examples/protocols/http_request/main/http_request_example_main.c index 12621e06a..e3a485bca 100644 --- a/examples/protocols/http_request/main/http_request_example_main.c +++ b/examples/protocols/http_request/main/http_request_example_main.c @@ -122,7 +122,7 @@ static void http_get_task(void *pvParameters) void app_main(void) { ESP_ERROR_CHECK( nvs_flash_init() ); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/http_server/advanced_tests/main/main.c b/examples/protocols/http_server/advanced_tests/main/main.c index 118a380a8..c30683ef0 100644 --- a/examples/protocols/http_server/advanced_tests/main/main.c +++ b/examples/protocols/http_server/advanced_tests/main/main.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "esp_system.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "esp_eth.h" #include "protocol_examples_common.h" @@ -46,7 +46,7 @@ void app_main(void) static httpd_handle_t server = NULL; ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/http_server/file_serving/main/main.c b/examples/protocols/http_server/file_serving/main/main.c index 4a6faf5a2..463e6c643 100644 --- a/examples/protocols/http_server/file_serving/main/main.c +++ b/examples/protocols/http_server/file_serving/main/main.c @@ -15,7 +15,7 @@ #include "esp_system.h" #include "esp_spiffs.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" /* This example demonstrates how to create file server @@ -67,7 +67,7 @@ esp_err_t start_file_server(const char *base_path); void app_main(void) { ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/http_server/persistent_sockets/main/main.c b/examples/protocols/http_server/persistent_sockets/main/main.c index 8e6132b1e..3905c4450 100644 --- a/examples/protocols/http_server/persistent_sockets/main/main.c +++ b/examples/protocols/http_server/persistent_sockets/main/main.c @@ -12,7 +12,7 @@ #include #include #include -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "esp_eth.h" #include "protocol_examples_common.h" @@ -216,7 +216,7 @@ void app_main(void) static httpd_handle_t server = NULL; ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/http_server/restful_server/main/esp_rest_main.c b/examples/protocols/http_server/restful_server/main/esp_rest_main.c index 9e28bf0ec..15580769b 100644 --- a/examples/protocols/http_server/restful_server/main/esp_rest_main.c +++ b/examples/protocols/http_server/restful_server/main/esp_rest_main.c @@ -13,7 +13,7 @@ #include "esp_spiffs.h" #include "sdmmc_cmd.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "esp_event.h" #include "esp_log.h" #include "mdns.h" @@ -126,7 +126,7 @@ esp_err_t init_fs(void) void app_main(void) { ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); initialise_mdns(); netbiosns_init(); diff --git a/examples/protocols/http_server/simple/main/main.c b/examples/protocols/http_server/simple/main/main.c index d7bec4466..93e624170 100644 --- a/examples/protocols/http_server/simple/main/main.c +++ b/examples/protocols/http_server/simple/main/main.c @@ -14,7 +14,7 @@ #include #include #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "esp_eth.h" #include "protocol_examples_common.h" @@ -272,7 +272,7 @@ void app_main(void) static httpd_handle_t server = NULL; ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c b/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c index ce5823f60..482133bf8 100644 --- a/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c +++ b/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c @@ -31,7 +31,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "protocol_examples_common.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "lwip/err.h" #include "lwip/sockets.h" @@ -274,7 +274,7 @@ static void https_get_task(void *pvParameters) void app_main(void) { ESP_ERROR_CHECK( nvs_flash_init() ); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/https_request/main/https_request_example_main.c b/examples/protocols/https_request/main/https_request_example_main.c index 3b986f6bd..b41fadb59 100644 --- a/examples/protocols/https_request/main/https_request_example_main.c +++ b/examples/protocols/https_request/main/https_request_example_main.c @@ -32,7 +32,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "protocol_examples_common.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "lwip/err.h" #include "lwip/sockets.h" @@ -151,7 +151,7 @@ static void https_get_task(void *pvParameters) void app_main(void) { ESP_ERROR_CHECK( nvs_flash_init() ); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/https_server/main/main.c b/examples/protocols/https_server/main/main.c index 6d6a36931..5f68eab0a 100644 --- a/examples/protocols/https_server/main/main.c +++ b/examples/protocols/https_server/main/main.c @@ -13,7 +13,7 @@ #include #include #include -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "esp_eth.h" #include "protocol_examples_common.h" @@ -103,7 +103,7 @@ void app_main(void) static httpd_handle_t server = NULL; ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* Register event handlers to start server when Wi-Fi or Ethernet is connected, diff --git a/examples/protocols/mdns/main/mdns_example_main.c b/examples/protocols/mdns/main/mdns_example_main.c index 003c8e784..76cb3b1b6 100644 --- a/examples/protocols/mdns/main/mdns_example_main.c +++ b/examples/protocols/mdns/main/mdns_example_main.c @@ -186,7 +186,7 @@ static void mdns_example_task(void *pvParameters) void app_main(void) { ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_event_loop_create_default()); initialise_mdns(); diff --git a/examples/protocols/mqtt/publish_test/main/publish_test.c b/examples/protocols/mqtt/publish_test/main/publish_test.c index 918f9a191..2a20d1a41 100644 --- a/examples/protocols/mqtt/publish_test/main/publish_test.c +++ b/examples/protocols/mqtt/publish_test/main/publish_test.c @@ -14,7 +14,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "esp_event.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "freertos/FreeRTOS.h" @@ -169,7 +169,7 @@ void app_main(void) esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE); ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/mqtt/ssl/main/app_main.c b/examples/protocols/mqtt/ssl/main/app_main.c index 007465429..f8e857351 100644 --- a/examples/protocols/mqtt/ssl/main/app_main.c +++ b/examples/protocols/mqtt/ssl/main/app_main.c @@ -14,7 +14,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "esp_event.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "esp_log.h" @@ -139,7 +139,7 @@ void app_main(void) esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE); ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/mqtt/ssl_mutual_auth/main/app_main.c b/examples/protocols/mqtt/ssl_mutual_auth/main/app_main.c index 5c6eab7ee..858f58aa7 100644 --- a/examples/protocols/mqtt/ssl_mutual_auth/main/app_main.c +++ b/examples/protocols/mqtt/ssl_mutual_auth/main/app_main.c @@ -14,7 +14,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "esp_event.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "freertos/FreeRTOS.h" @@ -111,7 +111,7 @@ void app_main(void) esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE); ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/mqtt/tcp/main/app_main.c b/examples/protocols/mqtt/tcp/main/app_main.c index 7acd68536..d4b631e1a 100644 --- a/examples/protocols/mqtt/tcp/main/app_main.c +++ b/examples/protocols/mqtt/tcp/main/app_main.c @@ -15,7 +15,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "esp_event.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "freertos/FreeRTOS.h" @@ -138,7 +138,7 @@ void app_main(void) esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE); ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/mqtt/ws/main/app_main.c b/examples/protocols/mqtt/ws/main/app_main.c index cacea73e9..5af121fee 100644 --- a/examples/protocols/mqtt/ws/main/app_main.c +++ b/examples/protocols/mqtt/ws/main/app_main.c @@ -14,7 +14,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "esp_event.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "freertos/FreeRTOS.h" @@ -111,7 +111,7 @@ void app_main(void) esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE); ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/mqtt/wss/main/app_main.c b/examples/protocols/mqtt/wss/main/app_main.c index 529e96060..29b5de16a 100644 --- a/examples/protocols/mqtt/wss/main/app_main.c +++ b/examples/protocols/mqtt/wss/main/app_main.c @@ -14,7 +14,7 @@ #include "esp_system.h" #include "nvs_flash.h" #include "esp_event.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "freertos/FreeRTOS.h" @@ -120,7 +120,7 @@ void app_main(void) esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE); ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/openssl_client/main/openssl_client_example_main.c b/examples/protocols/openssl_client/main/openssl_client_example_main.c index a06ef6cdd..09f508c9f 100644 --- a/examples/protocols/openssl_client/main/openssl_client_example_main.c +++ b/examples/protocols/openssl_client/main/openssl_client_example_main.c @@ -20,7 +20,7 @@ #include "esp_wifi.h" #include "esp_event.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "lwip/sockets.h" @@ -174,7 +174,7 @@ void app_main(void) { ESP_ERROR_CHECK( nvs_flash_init() ); ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/openssl_server/main/openssl_server_example_main.c b/examples/protocols/openssl_server/main/openssl_server_example_main.c index 9db6fc04f..2c94dd36d 100644 --- a/examples/protocols/openssl_server/main/openssl_server_example_main.c +++ b/examples/protocols/openssl_server/main/openssl_server_example_main.c @@ -19,7 +19,7 @@ #include "esp_log.h" #include "esp_wifi.h" #include "esp_event.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "nvs_flash.h" #include "protocol_examples_common.h" @@ -208,7 +208,7 @@ static void openssl_server_init(void) void app_main(void) { ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/sntp/main/sntp_example_main.c b/examples/protocols/sntp/main/sntp_example_main.c index 59d22d7fe..94e842153 100644 --- a/examples/protocols/sntp/main/sntp_example_main.c +++ b/examples/protocols/sntp/main/sntp_example_main.c @@ -119,7 +119,7 @@ void app_main(void) static void obtain_time(void) { ESP_ERROR_CHECK( nvs_flash_init() ); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK( esp_event_loop_create_default() ); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/sockets/tcp_client/main/tcp_client.c b/examples/protocols/sockets/tcp_client/main/tcp_client.c index 5e98718df..f8a93eaa7 100644 --- a/examples/protocols/sockets/tcp_client/main/tcp_client.c +++ b/examples/protocols/sockets/tcp_client/main/tcp_client.c @@ -16,7 +16,7 @@ #include "esp_event.h" #include "esp_log.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "lwip/err.h" @@ -112,7 +112,7 @@ static void tcp_client_task(void *pvParameters) void app_main(void) { ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/sockets/tcp_server/main/tcp_server.c b/examples/protocols/sockets/tcp_server/main/tcp_server.c index bd9606e3a..6f3de3f04 100644 --- a/examples/protocols/sockets/tcp_server/main/tcp_server.c +++ b/examples/protocols/sockets/tcp_server/main/tcp_server.c @@ -15,7 +15,7 @@ #include "esp_event.h" #include "esp_log.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "lwip/err.h" @@ -137,7 +137,7 @@ CLEAN_UP: void app_main(void) { ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/sockets/udp_client/main/udp_client.c b/examples/protocols/sockets/udp_client/main/udp_client.c index bb3175579..36de61fde 100644 --- a/examples/protocols/sockets/udp_client/main/udp_client.c +++ b/examples/protocols/sockets/udp_client/main/udp_client.c @@ -16,7 +16,7 @@ #include "esp_event.h" #include "esp_log.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "lwip/err.h" @@ -111,7 +111,7 @@ static void udp_client_task(void *pvParameters) void app_main(void) { ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/sockets/udp_multicast/main/udp_multicast_example_main.c b/examples/protocols/sockets/udp_multicast/main/udp_multicast_example_main.c index e20ce9fd3..1aaec8b74 100644 --- a/examples/protocols/sockets/udp_multicast/main/udp_multicast_example_main.c +++ b/examples/protocols/sockets/udp_multicast/main/udp_multicast_example_main.c @@ -16,7 +16,7 @@ #include "esp_event.h" #include "esp_log.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "lwip/err.h" @@ -62,8 +62,8 @@ static int socket_add_ipv4_multicast_group(int sock, bool assign_source_if) #if LISTEN_ALL_IF imreq.imr_interface.s_addr = IPADDR_ANY; #else - tcpip_adapter_ip_info_t ip_info = { 0 }; - err = tcpip_adapter_get_ip_info(EXAMPLE_INTERFACE, &ip_info); + esp_netif_ip_info_t ip_info = { 0 }; + err = esp_netif_get_ip_info(get_example_netif(), &ip_info); if (err != ESP_OK) { ESP_LOGE(V4TAG, "Failed to get IP address info. Error 0x%x", err); goto err; @@ -203,7 +203,7 @@ static int create_multicast_ipv6_socket(void) // (Note the interface may have other non-LL IPV6 addresses as well, // but it doesn't matter in this context as the address is only // used to identify the interface.) - err = tcpip_adapter_get_ip6_linklocal(EXAMPLE_INTERFACE, &if_ipaddr); + err = esp_netif_get_ip6_linklocal(EXAMPLE_INTERFACE, (esp_ip6_addr_t*)&if_ipaddr); inet6_addr_from_ip6addr(&if_inaddr, &if_ipaddr); if (err != ESP_OK) { ESP_LOGE(V6TAG, "Failed to get IPV6 LL address. Error 0x%x", err); @@ -212,7 +212,7 @@ static int create_multicast_ipv6_socket(void) #endif // LISTEN_ALL_IF // search for netif index - netif_index = tcpip_adapter_get_netif_index(EXAMPLE_INTERFACE); + netif_index = esp_netif_get_netif_index(EXAMPLE_INTERFACE); if(netif_index < 0) { ESP_LOGE(V6TAG, "Failed to get netif index"); goto err; @@ -484,7 +484,7 @@ static void mcast_example_task(void *pvParameters) void app_main(void) { ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/sockets/udp_server/main/udp_server.c b/examples/protocols/sockets/udp_server/main/udp_server.c index 262d2b213..812126afe 100644 --- a/examples/protocols/sockets/udp_server/main/udp_server.c +++ b/examples/protocols/sockets/udp_server/main/udp_server.c @@ -15,7 +15,7 @@ #include "esp_event.h" #include "esp_log.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" +#include "esp_netif.h" #include "protocol_examples_common.h" #include "lwip/err.h" @@ -112,7 +112,7 @@ static void udp_server_task(void *pvParameters) void app_main(void) { ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/protocols/websocket/main/websocket_example.c b/examples/protocols/websocket/main/websocket_example.c index f82ac9494..82e7ba385 100644 --- a/examples/protocols/websocket/main/websocket_example.c +++ b/examples/protocols/websocket/main/websocket_example.c @@ -90,7 +90,7 @@ void app_main(void) esp_log_level_set("TRANS_TCP", ESP_LOG_DEBUG); ESP_ERROR_CHECK(nvs_flash_init()); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c b/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c index e6b4bd15c..6728e63b2 100644 --- a/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c +++ b/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c @@ -125,7 +125,7 @@ void app_main(void) } ESP_ERROR_CHECK( err ); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/system/ota/native_ota_example/main/native_ota_example.c b/examples/system/ota/native_ota_example/main/native_ota_example.c index 08b6c9bb6..0e8b32d5e 100644 --- a/examples/system/ota/native_ota_example/main/native_ota_example.c +++ b/examples/system/ota/native_ota_example/main/native_ota_example.c @@ -278,7 +278,7 @@ void app_main(void) } ESP_ERROR_CHECK( err ); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. diff --git a/examples/system/ota/simple_ota_example/main/simple_ota_example.c b/examples/system/ota/simple_ota_example/main/simple_ota_example.c index 494c85f54..086b0f83a 100644 --- a/examples/system/ota/simple_ota_example/main/simple_ota_example.c +++ b/examples/system/ota/simple_ota_example/main/simple_ota_example.c @@ -112,7 +112,7 @@ void app_main(void) } ESP_ERROR_CHECK(err); - tcpip_adapter_init(); + esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.