wifi scan modify

Signed-off-by: ruan-shaofei <ruanshaofei2020@163.com>
This commit is contained in:
ruan-shaofei 2024-08-08 16:37:52 +08:00
parent 2a8174f707
commit 3c6b871153

View File

@ -284,7 +284,6 @@ void LocatorWifiScanEventCallback::OnWifiScanStateChanged(int state)
LBSLOGD(LOCATOR, "OnWifiScanStateChanged state=%{public}d", state);
if (state == 0) {
LBSLOGE(LOCATOR, "OnWifiScanStateChanged false");
return;
}
auto dataManager = LocatorRequiredDataManager::GetInstance();
if (dataManager == nullptr) {
@ -337,12 +336,16 @@ __attribute__((no_sanitize("cfi"))) void LocatorRequiredDataManager::StartWifiSc
if (wifiScanPtr_ == nullptr) {
return;
}
if (scanListHandler_ != nullptr) {
scanListHandler_->SendHighPriorityEvent(EVENT_GET_WIFI_LIST, 0, DEFAULT_TIMEOUT_4S);
}
int ret = wifiScanPtr_->Scan();
if (ret != Wifi::WIFI_OPT_SUCCESS) {
LBSLOGE(LOCATOR, "%{public}s WifiScan failed, ret=%{public}d", __func__, ret);
if (scanListHandler_ != nullptr) {
scanListHandler_->SendHighPriorityEvent(EVENT_GET_WIFI_LIST, 0, 0);
}
} else {
if (scanListHandler_ != nullptr) {
scanListHandler_->SendHighPriorityEvent(EVENT_GET_WIFI_LIST, 0, DEFAULT_TIMEOUT_4S);
}
}
#endif
LBSLOGD(LOCATOR, "StartWifiScan timeInterval_=%{public}d", timeInterval_);