From e0360bf15609179b4d7f9c7cf035c3bcfe9da449 Mon Sep 17 00:00:00 2001 From: suda-morris <362953310@qq.com> Date: Thu, 4 Jul 2019 12:18:43 +0800 Subject: [PATCH] temporarily work around for fixing eth2ap Closes https://github.com/espressif/esp-idf/issues/3726 Closes https://github.com/espressif/esp-idf/issues/3728 --- examples/ethernet/eth2ap/README.md | 2 ++ examples/ethernet/eth2ap/main/ethernet_example_main.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/ethernet/eth2ap/README.md b/examples/ethernet/eth2ap/README.md index 26d81db12..e2b3e0321 100644 --- a/examples/ethernet/eth2ap/README.md +++ b/examples/ethernet/eth2ap/README.md @@ -1,6 +1,8 @@ # eth2ap Example (See the README.md file in the upper level 'examples' directory for more information about examples. To try a more complex application about Ethernet to WiFi data forwarding, please go to [iot-solution](https://github.com/espressif/esp-iot-solution/tree/master/examples/eth2wifi).) +**Note:** This example uses some internal APIs (e.g. `esp_wifi_internal_tx`) which might get changed between minor versions of ESP-IDF. + ## Overview ![eth2ap](eth2ap.png) diff --git a/examples/ethernet/eth2ap/main/ethernet_example_main.c b/examples/ethernet/eth2ap/main/ethernet_example_main.c index 6ea43dd3b..4796cd9a1 100644 --- a/examples/ethernet/eth2ap/main/ethernet_example_main.c +++ b/examples/ethernet/eth2ap/main/ethernet_example_main.c @@ -192,7 +192,8 @@ static void initialize_wifi(void) { ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, wifi_event_handler, NULL)); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); - ESP_ERROR_CHECK(esp_wifi_init_internal(&cfg)); + ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + ESP_ERROR_CHECK(tcpip_adapter_clear_default_wifi_handlers()); ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM)); wifi_config_t wifi_config = { .ap = {