diff --git a/examples/bluetooth/bluedroid/ble/blufi/main/blufi_example_main.c b/examples/bluetooth/bluedroid/ble/blufi/main/blufi_example_main.c index 3cb5e6a51b..d3a8c847ab 100644 --- a/examples/bluetooth/bluedroid/ble/blufi/main/blufi_example_main.c +++ b/examples/bluetooth/bluedroid/ble/blufi/main/blufi_example_main.c @@ -200,7 +200,8 @@ static void initialise_wifi(void) esp_netif_init(); wifi_event_group = xEventGroupCreate(); ESP_ERROR_CHECK(esp_event_loop_create_default()); - assert(esp_netif_create_default_wifi_sta()); + esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); + assert(sta_netif); ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &wifi_event_handler, NULL)); ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &ip_event_handler, NULL)); diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c index b082e153a5..87db1c7853 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c @@ -129,8 +129,10 @@ void initialise_wifi(void) esp_netif_init(); wifi_event_group = xEventGroupCreate(); ESP_ERROR_CHECK(esp_event_loop_create_default()); - assert(sta_netif = esp_netif_create_default_wifi_sta()); - assert(ap_netif = esp_netif_create_default_wifi_ap()); + esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); + assert(sta_netif); + esp_netif_t *ap_netif = esp_netif_create_default_wifi_ap(); + assert(ap_netif); ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &wifi_event_handler, NULL)); ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &ip_event_handler, NULL)); diff --git a/examples/protocols/esp_local_ctrl/main/app_main.c b/examples/protocols/esp_local_ctrl/main/app_main.c index 43ba8bf241..a4dc11dc51 100644 --- a/examples/protocols/esp_local_ctrl/main/app_main.c +++ b/examples/protocols/esp_local_ctrl/main/app_main.c @@ -68,7 +68,8 @@ void wifi_init_sta(void) esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); - assert(esp_netif_create_default_wifi_sta()); + esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); + assert(sta_netif); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK(esp_wifi_init(&cfg)); diff --git a/examples/system/console/main/cmd_wifi.c b/examples/system/console/main/cmd_wifi.c index e26a9dcea9..87555b6565 100644 --- a/examples/system/console/main/cmd_wifi.c +++ b/examples/system/console/main/cmd_wifi.c @@ -47,8 +47,10 @@ static void initialise_wifi(void) 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()); + esp_netif_t *ap_netif = esp_netif_create_default_wifi_ap(); + assert(ap_netif); + esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); + assert(sta_netif); 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) ); diff --git a/examples/wifi/iperf/main/cmd_wifi.c b/examples/wifi/iperf/main/cmd_wifi.c index 5da2736da1..380d7a9689 100644 --- a/examples/wifi/iperf/main/cmd_wifi.c +++ b/examples/wifi/iperf/main/cmd_wifi.c @@ -111,8 +111,10 @@ void initialise_wifi(void) esp_netif_init(); wifi_event_group = xEventGroupCreate(); ESP_ERROR_CHECK( esp_event_loop_create_default() ); - assert(netif_ap = esp_netif_create_default_wifi_ap()); - assert(netif_sta = esp_netif_create_default_wifi_sta()); + netif_ap = esp_netif_create_default_wifi_ap(); + assert(netif_ap); + netif_sta = esp_netif_create_default_wifi_sta(); + assert(netif_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_SCAN_DONE, &scan_done_handler, NULL) ); diff --git a/examples/wifi/power_save/main/power_save.c b/examples/wifi/power_save/main/power_save.c index 8e2a5ef6d9..fd7bbbf96b 100644 --- a/examples/wifi/power_save/main/power_save.c +++ b/examples/wifi/power_save/main/power_save.c @@ -57,7 +57,8 @@ static void wifi_power_save(void) { esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); - assert(esp_netif_create_default_wifi_sta()); + esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); + assert(sta_netif); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK(esp_wifi_init(&cfg)); diff --git a/examples/wifi/scan/main/scan.c b/examples/wifi/scan/main/scan.c index d3759d3c98..b3547551e0 100644 --- a/examples/wifi/scan/main/scan.c +++ b/examples/wifi/scan/main/scan.c @@ -116,7 +116,8 @@ static void wifi_scan(void) { esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); - assert(esp_netif_create_default_wifi_sta()); + esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); + assert(sta_netif); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK(esp_wifi_init(&cfg)); diff --git a/examples/wifi/smart_config/main/smartconfig_main.c b/examples/wifi/smart_config/main/smartconfig_main.c index 62b3ab4a91..b6498ca54b 100644 --- a/examples/wifi/smart_config/main/smartconfig_main.c +++ b/examples/wifi/smart_config/main/smartconfig_main.c @@ -81,7 +81,8 @@ static void initialise_wifi(void) esp_netif_init(); s_wifi_event_group = xEventGroupCreate(); ESP_ERROR_CHECK(esp_event_loop_create_default()); - assert(esp_netif_create_default_wifi_sta()); + esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); + assert(sta_netif); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK( esp_wifi_init(&cfg) ); diff --git a/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c b/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c index a9386a63d0..b800a40025 100644 --- a/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c +++ b/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c @@ -107,7 +107,8 @@ static void initialise_wifi(void) esp_netif_init(); wifi_event_group = xEventGroupCreate(); ESP_ERROR_CHECK(esp_event_loop_create_default()); - assert(sta_netif = esp_netif_create_default_wifi_sta()); + esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); + assert(sta_netif); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK( esp_wifi_init(&cfg) ); diff --git a/examples/wifi/wps/main/wps.c b/examples/wifi/wps/main/wps.c index 17095e9316..14d9a28599 100644 --- a/examples/wifi/wps/main/wps.c +++ b/examples/wifi/wps/main/wps.c @@ -99,7 +99,8 @@ static void start_wps(void) { esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); - assert(esp_netif_create_default_wifi_sta()); + esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); + assert(sta_netif); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK(esp_wifi_init(&cfg));