mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-17 09:14:04 +00:00
examples: modify other examples and tests to use esp_netif instead of tcpip_adapter
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/event_groups.h"
|
||||
#include "esp_wifi.h"
|
||||
#include "tcpip_adapter.h"
|
||||
#include "esp_netif.h"
|
||||
#include "esp_event.h"
|
||||
#include "cmd_wifi.h"
|
||||
|
||||
@@ -44,9 +44,11 @@ static void initialise_wifi(void)
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
tcpip_adapter_init();
|
||||
esp_netif_init();
|
||||
wifi_event_group = xEventGroupCreate();
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
assert(esp_netif_create_default_wifi_ap());
|
||||
assert(esp_netif_create_default_wifi_sta());
|
||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
ESP_ERROR_CHECK( esp_wifi_init(&cfg) );
|
||||
ESP_ERROR_CHECK( esp_event_handler_register(WIFI_EVENT, WIFI_EVENT_STA_DISCONNECTED, &event_handler, NULL) );
|
||||
|
Reference in New Issue
Block a user