!7914 新增对auth exception的事件的处理

Merge pull request !7914 from 高兴烨/master
This commit is contained in:
openharmony_ci 2024-09-29 12:29:45 +00:00 committed by Gitee
commit 64c3ea8845
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 15 additions and 0 deletions

View File

@ -188,6 +188,9 @@ void P2pV1Processor::WaitingReqResponseState()
})
.Handle<std::shared_ptr<TimeoutEvent>>([this](std::shared_ptr<TimeoutEvent> &event) {
OnWaitReqResponseTimeoutEvent();
})
.Handle<std::shared_ptr<AuthExceptionEvent>>([this](std::shared_ptr<AuthExceptionEvent> &event) {
ProcessAuthExceptionEvent(event);
});
}
@ -598,6 +601,17 @@ void P2pV1Processor::ProcessAuthConnEvent(std::shared_ptr<AuthOpenEvent> &event)
Terminate();
}
void P2pV1Processor::ProcessAuthExceptionEvent(const std::shared_ptr<AuthExceptionEvent> &event)
{
CONN_LOGE(CONN_WIFI_DIRECT, "AuthExceptionEvent error=%{public}d", event->error_);
if (connectCommand_ != nullptr) {
CleanupIfNeed(event->error_, connectCommand_->GetRemoteDeviceId());
connectCommand_->OnFailure(static_cast<WifiDirectErrorCode>(event->error_));
connectCommand_ = nullptr;
}
Terminate();
}
void P2pV1Processor::OnWaitReqResponseTimeoutEvent()
{
CONN_LOGE(CONN_WIFI_DIRECT, "wait connect response timeout");

View File

@ -76,6 +76,7 @@ private:
int ProcessNegotiateCommandCommon(std::shared_ptr<NegotiateCommand> &command);
void ProcessAuthConnEvent(std::shared_ptr<AuthOpenEvent> &event);
void ProcessAuthExceptionEvent(const std::shared_ptr<AuthExceptionEvent> &event);
void OnWaitReqResponseTimeoutEvent();
void OnWaitReuseResponseTimeoutEvent();