esp_netif and examples: using wifi driver handle, update examples and tests to pass the CI

This commit is contained in:
David Cermak
2019-09-04 13:58:29 +02:00
parent 4366347fd4
commit 3a19bf055d
24 changed files with 193 additions and 93 deletions

View File

@@ -8,6 +8,7 @@
*/
#include <string.h>
#include "esp_wifi.h"
#include "esp_wifi_default.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_log.h"
@@ -308,11 +309,10 @@ static esp_err_t create_wifi_netifs(void)
esp_netif_config_t cfg_ap = {
.base = &netif_cfg,
.stack = ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP,
.driver = ESP_NETIF_DRIVER_DEFAULT_WIFI_AP,
};
esp_netif_t *netif_ap = esp_netif_new(&cfg_ap);
assert(netif_ap);
ESP_ERROR_CHECK(esp_wifi_set_default_wifi_ap_handlers(netif_ap));
ESP_ERROR_CHECK(esp_wifi_set_default_wifi_driver_and_handlers(ESP_IF_WIFI_AP, netif_ap));
memcpy(&netif_cfg, ESP_NETIF_BASE_DEFAULT_WIFI_STA, sizeof(netif_cfg));
@@ -320,12 +320,11 @@ static esp_err_t create_wifi_netifs(void)
esp_netif_config_t cfg_sta = {
.base = &netif_cfg,
.stack = ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA,
.driver = ESP_NETIF_DRIVER_DEFAULT_WIFI_STA,
};
netif_sta = esp_netif_new(&cfg_sta);
assert(netif_sta);
ESP_ERROR_CHECK(esp_wifi_set_default_wifi_sta_handlers(netif_sta));
ESP_ERROR_CHECK(esp_wifi_set_default_wifi_driver_and_handlers(ESP_IF_WIFI_STA, netif_sta));
return ESP_OK;
}