mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-30 04:10:59 +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);
|
||||
command->SetRetried(markRetried);
|
||||
std::shared_ptr<WifiDirectExecutor> executor;
|
||||
std::lock_guard executorLock(executorLock_);
|
||||
auto ret = ScheduleActiveCommand(command, executor);
|
||||
CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed");
|
||||
if (executor != nullptr) {
|
||||
CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId());
|
||||
std::lock_guard executorLock(executorLock_);
|
||||
executor->SendEvent(command);
|
||||
}
|
||||
return ret;
|
||||
@ -76,11 +76,11 @@ int WifiDirectScheduler::DisconnectDevice(WifiDirectDisconnectInfo &info, WifiDi
|
||||
WifiDirectAnonymizeDeviceId(command->GetRemoteDeviceId()).c_str());
|
||||
|
||||
std::shared_ptr<WifiDirectExecutor> executor;
|
||||
std::lock_guard executorLock(executorLock_);
|
||||
auto ret = ScheduleActiveCommand(command, executor);
|
||||
CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed");
|
||||
if (executor != nullptr) {
|
||||
CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId());
|
||||
std::lock_guard executorLock(executorLock_);
|
||||
executor->SendEvent(command);
|
||||
}
|
||||
return ret;
|
||||
@ -96,12 +96,12 @@ int WifiDirectScheduler::ForceDisconnectDevice(
|
||||
WifiDirectAnonymizeDeviceId(WifiDirectUtils::UuidToNetworkId(command->GetRemoteDeviceId())).c_str(),
|
||||
WifiDirectAnonymizeDeviceId(command->GetRemoteDeviceId()).c_str(), info.linkType);
|
||||
std::shared_ptr<WifiDirectExecutor> executor;
|
||||
std::lock_guard executorLock(executorLock_);
|
||||
auto ret = ScheduleActiveCommand(command, executor);
|
||||
CONN_CHECK_AND_RETURN_RET_LOGE(
|
||||
ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed, ret=%{public}d", ret);
|
||||
if (executor != nullptr) {
|
||||
CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId());
|
||||
std::lock_guard executorLock(executorLock_);
|
||||
executor->SendEvent(command);
|
||||
}
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user