Skip to content

Commit

Permalink
update commissioner discovery controller logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov committed Jul 15, 2024
1 parent b5e49ad commit 6702e1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/controller/CommissionerDiscoveryController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,13 @@ void CommissionerDiscoveryController::Cancel()
return;
}
UDCClientState * client = mUdcServer->GetUDCClients().FindUDCClientState(mCurrentInstance);
if (client == nullptr || client->GetUDCClientProcessingState() != UDCClientProcessingState::kPromptingUser)

// state needs to be either kPromptingUser or kObtainingOnboardingPayload
if (client == nullptr || !(client->GetUDCClientProcessingState() == UDCClientProcessingState::kPromptingUser ||
client->GetUDCClientProcessingState() == UDCClientProcessingState::kObtainingOnboardingPayload ||
client->GetUDCClientProcessingState() == UDCClientProcessingState::kWaitingForCommissionerPasscodeReady))
{
ChipLogError(AppServer, "UX Cancel: invalid state for cancel");
ChipLogError(AppServer, "UX Cancel: invalid state for cancel, state: %hhu", client->GetUDCClientProcessingState());
return;
}
client->SetUDCClientProcessingState(UDCClientProcessingState::kUserDeclined);
Expand Down

0 comments on commit 6702e1a

Please sign in to comment.