examples: protocol examples which use common connection component

updated to use esp_netif_init instead of tcpip_adapter in initialization code
This commit is contained in:
David Cermak 2019-08-31 16:19:21 +02:00
parent 21464465ea
commit a49b934ef8
32 changed files with 59 additions and 59 deletions

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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"
@ -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.

View file

@ -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();

View file

@ -14,7 +14,7 @@
#include <nvs_flash.h>
#include <sys/param.h>
#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.

View file

@ -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.

View file

@ -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.

View file

@ -13,7 +13,7 @@
#include <esp_system.h>
#include <nvs_flash.h>
#include <sys/param.h>
#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,

View file

@ -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();

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.