Skip to content

Commit

Permalink
Send OnSessionEstablishmentError if pairing in progress during shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
s-mcclain committed Feb 16, 2022
1 parent 72896fc commit ed5d3b0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,14 @@ CHIP_ERROR DeviceCommissioner::Shutdown()

ChipLogDetail(Controller, "Shutting down the commissioner");

// Check to see if pairing in progress before shutting down
CommissioneeDeviceProxy * device = mDeviceBeingCommissioned;
if (device->IsSessionSetupInProgress())
{
ChipLogDetail(Controller, "Setup in progress, stopping setup before shutting down");
OnSessionEstablishmentError(CHIP_ERROR_CONNECTION_ABORTED);
}

mSystemState->SessionMgr()->UnregisterRecoveryDelegate(*this);

#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY // make this commissioner discoverable
Expand Down

0 comments on commit ed5d3b0

Please sign in to comment.