mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2025-03-01 15:57:05 +00:00
update core/connection/wifi_direct_cpp/wifi_direct_scheduler.cpp.
Signed-off-by: shiyifan <shiyifan10@huawei.com>
This commit is contained in:
parent
d4c40e1306
commit
60c6f7e3bd
@ -36,11 +36,11 @@ int WifiDirectScheduler::ConnectDevice(const WifiDirectConnectInfo &info, const
|
|||||||
auto command = CommandFactory::GetInstance().CreateConnectCommand(info, callback);
|
auto command = CommandFactory::GetInstance().CreateConnectCommand(info, callback);
|
||||||
command->SetRetried(markRetried);
|
command->SetRetried(markRetried);
|
||||||
std::shared_ptr<WifiDirectExecutor> executor;
|
std::shared_ptr<WifiDirectExecutor> executor;
|
||||||
|
std::lock_guard executorLock(executorLock_);
|
||||||
auto ret = ScheduleActiveCommand(command, executor);
|
auto ret = ScheduleActiveCommand(command, executor);
|
||||||
CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed");
|
CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed");
|
||||||
if (executor != nullptr) {
|
if (executor != nullptr) {
|
||||||
CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId());
|
CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId());
|
||||||
std::lock_guard executorLock(executorLock_);
|
|
||||||
executor->SendEvent(command);
|
executor->SendEvent(command);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@ -76,11 +76,11 @@ int WifiDirectScheduler::DisconnectDevice(WifiDirectDisconnectInfo &info, WifiDi
|
|||||||
WifiDirectAnonymizeDeviceId(command->GetRemoteDeviceId()).c_str());
|
WifiDirectAnonymizeDeviceId(command->GetRemoteDeviceId()).c_str());
|
||||||
|
|
||||||
std::shared_ptr<WifiDirectExecutor> executor;
|
std::shared_ptr<WifiDirectExecutor> executor;
|
||||||
|
std::lock_guard executorLock(executorLock_);
|
||||||
auto ret = ScheduleActiveCommand(command, executor);
|
auto ret = ScheduleActiveCommand(command, executor);
|
||||||
CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed");
|
CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed");
|
||||||
if (executor != nullptr) {
|
if (executor != nullptr) {
|
||||||
CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId());
|
CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId());
|
||||||
std::lock_guard executorLock(executorLock_);
|
|
||||||
executor->SendEvent(command);
|
executor->SendEvent(command);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@ -96,12 +96,12 @@ int WifiDirectScheduler::ForceDisconnectDevice(
|
|||||||
WifiDirectAnonymizeDeviceId(WifiDirectUtils::UuidToNetworkId(command->GetRemoteDeviceId())).c_str(),
|
WifiDirectAnonymizeDeviceId(WifiDirectUtils::UuidToNetworkId(command->GetRemoteDeviceId())).c_str(),
|
||||||
WifiDirectAnonymizeDeviceId(command->GetRemoteDeviceId()).c_str(), info.linkType);
|
WifiDirectAnonymizeDeviceId(command->GetRemoteDeviceId()).c_str(), info.linkType);
|
||||||
std::shared_ptr<WifiDirectExecutor> executor;
|
std::shared_ptr<WifiDirectExecutor> executor;
|
||||||
|
std::lock_guard executorLock(executorLock_);
|
||||||
auto ret = ScheduleActiveCommand(command, executor);
|
auto ret = ScheduleActiveCommand(command, executor);
|
||||||
CONN_CHECK_AND_RETURN_RET_LOGE(
|
CONN_CHECK_AND_RETURN_RET_LOGE(
|
||||||
ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed, ret=%{public}d", ret);
|
ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed, ret=%{public}d", ret);
|
||||||
if (executor != nullptr) {
|
if (executor != nullptr) {
|
||||||
CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId());
|
CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId());
|
||||||
std::lock_guard executorLock(executorLock_);
|
|
||||||
executor->SendEvent(command);
|
executor->SendEvent(command);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user