From fb6a163e1b391a44da0757bd1b63ad8f345bb9a1 Mon Sep 17 00:00:00 2001 From: yanxiaotao Date: Tue, 24 May 2022 21:14:58 +0800 Subject: [PATCH 1/3] bugfix from master 0524 Signed-off-by: yanxiaotao --- wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp | 3 +++ .../wifi_manage/wifi_sta/sta_auto_connect_service.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp b/wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp index 66ad7ad6d..8759993b4 100644 --- a/wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp +++ b/wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp @@ -110,6 +110,9 @@ static bool GetHotspotconfigFromJs(const napi_env& env, const napi_value& object value = 0; JsObjectToInt(env, object, "band", value); config.SetBand(BandType(value)); // 1: 2.4G, 2: 5G + if (config.GetBand() == BAND_5GHZ) { + config.SetChannel(AP_CHANNEL_5G_DEFAULT); + } value = 0; JsObjectToString(env, object, "preSharedKey", 64, str); // 64: max length config.SetPreSharedKey(str); diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_auto_connect_service.cpp b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_auto_connect_service.cpp index 3a1a76e06..435b07d2a 100644 --- a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_auto_connect_service.cpp +++ b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_auto_connect_service.cpp @@ -157,6 +157,7 @@ void StaAutoConnectService::ClearOvertimeBlockedBssid() { WIFI_LOGI("Enter StaAutoConnectService::ClearOvertimeBlockedBssid.\n"); if (blockedBssidMap.empty()) { + WIFI_LOGI("blockedBssidMap is empty !\n"); return; } bool updated = false; @@ -165,6 +166,7 @@ void StaAutoConnectService::ClearOvertimeBlockedBssid() BlockedBssidInfo status = iter->second; time_t now = time(0); int currentTimeStap = (int)now; + WIFI_LOGI("blockedFlag:%{public}d, currentTimeStap:%{public}d, blockedTime:%{public}d.\n"); if (status.blockedFlag && ((currentTimeStap - status.blockedTime) >= MAX_BSSID_BLOCKLIST_TIME)) { blockedBssidMap.erase(iter++); updated = true; -- Gitee From bfe84e87e8ebe684fc3c91d798a6623af7974154 Mon Sep 17 00:00:00 2001 From: yanxiaotao Date: Tue, 24 May 2022 21:23:33 +0800 Subject: [PATCH 2/3] bugfix from master 0524 Signed-off-by: yanxiaotao --- .../wifi_manage/wifi_sta/sta_auto_connect_service.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_auto_connect_service.cpp b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_auto_connect_service.cpp index 435b07d2a..a4b0c8bbb 100644 --- a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_auto_connect_service.cpp +++ b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_auto_connect_service.cpp @@ -166,7 +166,8 @@ void StaAutoConnectService::ClearOvertimeBlockedBssid() BlockedBssidInfo status = iter->second; time_t now = time(0); int currentTimeStap = (int)now; - WIFI_LOGI("blockedFlag:%{public}d, currentTimeStap:%{public}d, blockedTime:%{public}d.\n"); + WIFI_LOGI("blockedFlag:%{public}d, currentTimeStap:%{public}d, blockedTime:%{public}d.\n", + status.blockedFlag, currentTimeStap, status.blockedTime); if (status.blockedFlag && ((currentTimeStap - status.blockedTime) >= MAX_BSSID_BLOCKLIST_TIME)) { blockedBssidMap.erase(iter++); updated = true; -- Gitee From 97ca8366bd4a9b47848ed49615161735a5afd0a2 Mon Sep 17 00:00:00 2001 From: yanxiaotao Date: Wed, 25 May 2022 07:52:26 +0800 Subject: [PATCH 3/3] bugfix from master 0524 Signed-off-by: yanxiaotao --- wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp b/wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp index 8759993b4..ddfb4a556 100644 --- a/wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp +++ b/wifi/frameworks/js/napi/src/wifi_napi_hotspot.cpp @@ -110,7 +110,7 @@ static bool GetHotspotconfigFromJs(const napi_env& env, const napi_value& object value = 0; JsObjectToInt(env, object, "band", value); config.SetBand(BandType(value)); // 1: 2.4G, 2: 5G - if (config.GetBand() == BAND_5GHZ) { + if (config.GetBand() == BandType::BAND_5GHZ) { config.SetChannel(AP_CHANNEL_5G_DEFAULT); } value = 0; -- Gitee