From c3dbac37ef41d0da193e528bcbdd8e85c17a4642 Mon Sep 17 00:00:00 2001 From: Our Air Quality Date: Sat, 30 Dec 2017 20:51:53 +1100 Subject: [PATCH] Change the netif default to the station in STATIONAP mode. It seems most common for the connection to the wider internet to be via the station netif even if there is also an AP netif, so set the default to the station netif. The lwip ipv4 route logic will still use the AP netif if the destination is to that subnet. --- core/app_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/app_main.c b/core/app_main.c index 9c6ca9c..cd59c79 100644 --- a/core/app_main.c +++ b/core/app_main.c @@ -371,18 +371,18 @@ void sdk_user_init_task(void *params) { user_init(); sdk_user_init_flag = 1; sdk_wifi_mode_set(sdk_g_ic.s.wifi_mode); - if (sdk_g_ic.s.wifi_mode == 1) { + if (sdk_g_ic.s.wifi_mode == STATION_MODE) { sdk_wifi_station_start(); netif_set_default(sdk_g_ic.v.station_netif_info->netif); } - if (sdk_g_ic.s.wifi_mode == 2) { + if (sdk_g_ic.s.wifi_mode == SOFTAP_MODE) { sdk_wifi_softap_start(); netif_set_default(sdk_g_ic.v.softap_netif_info->netif); } - if (sdk_g_ic.s.wifi_mode == 3) { + if (sdk_g_ic.s.wifi_mode == STATIONAP_MODE) { sdk_wifi_station_start(); sdk_wifi_softap_start(); - netif_set_default(sdk_g_ic.v.softap_netif_info->netif); + netif_set_default(sdk_g_ic.v.station_netif_info->netif); } if (sdk_wifi_station_get_auto_connect()) { sdk_wifi_station_connect();