Merge pull request #532 from ourairquality/netif-default-station

Change the netif default to the station in STATIONAP mode.
This commit is contained in:
Ruslan V. Uss 2017-12-30 18:53:09 +05:00 committed by GitHub
commit 4715d5e8ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();