Skip to content

Commit 6702e1a

Browse files
committed
update commissioner discovery controller logic
1 parent b5e49ad commit 6702e1a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/controller/CommissionerDiscoveryController.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,13 @@ void CommissionerDiscoveryController::Cancel()
589589
return;
590590
}
591591
UDCClientState * client = mUdcServer->GetUDCClients().FindUDCClientState(mCurrentInstance);
592-
if (client == nullptr || client->GetUDCClientProcessingState() != UDCClientProcessingState::kPromptingUser)
592+
593+
// state needs to be either kPromptingUser or kObtainingOnboardingPayload
594+
if (client == nullptr || !(client->GetUDCClientProcessingState() == UDCClientProcessingState::kPromptingUser ||
595+
client->GetUDCClientProcessingState() == UDCClientProcessingState::kObtainingOnboardingPayload ||
596+
client->GetUDCClientProcessingState() == UDCClientProcessingState::kWaitingForCommissionerPasscodeReady))
593597
{
594-
ChipLogError(AppServer, "UX Cancel: invalid state for cancel");
598+
ChipLogError(AppServer, "UX Cancel: invalid state for cancel, state: %hhu", client->GetUDCClientProcessingState());
595599
return;
596600
}
597601
client->SetUDCClientProcessingState(UDCClientProcessingState::kUserDeclined);

0 commit comments

Comments
 (0)