Skip to content

Commit

Permalink
Close BLE connections if commissioning window closes before PASE esta…
Browse files Browse the repository at this point in the history
…blishment. (#18576)

Fixes #17508
  • Loading branch information
bzbarsky-apple authored May 19, 2022
1 parent d466935 commit c916c11
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/server/CommissioningWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,15 @@ void CommissioningWindowManager::CloseCommissioningWindow()
{
if (mWindowStatus != AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen)
{
#if CONFIG_NETWORK_LAYER_BLE
if (mListeningForPASE)
{
// We never established PASE, so never armed a fail-safe and hence
// can't rely on it expiring to close our BLE connection. Do that
// manually here.
mServer->GetBleLayerObject()->CloseAllBleConnections();
}
#endif
ChipLogProgress(AppServer, "Closing pairing window");
Cleanup();
}
Expand Down

0 comments on commit c916c11

Please sign in to comment.