Skip to content

Commit

Permalink
Enable Active mode during commissioning
Browse files Browse the repository at this point in the history
  • Loading branch information
jepenven-silabs committed Dec 7, 2022
1 parent b149561 commit 630febf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback(

Breadcrumb::Set(commandPath.mEndpointId, 0);
response.errorCode = CommissioningError::kOk;

}
}

Expand Down
16 changes: 6 additions & 10 deletions src/app/server/CommissioningWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ void CommissioningWindowManager::ResetState()
mECMIterations = 0;
mECMSaltLength = 0;

#if CHIP_DEVICE_CONFIG_ENABLE_SED
DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(false);
#endif

UpdateWindowStatus(CommissioningWindowStatus::kWindowNotOpen);

UpdateOpenerFabricIndex(NullNullable);
Expand Down Expand Up @@ -213,6 +217,8 @@ CHIP_ERROR CommissioningWindowManager::OpenCommissioningWindow(Seconds16 commiss

mCommissioningTimeoutTimerArmed = true;



return AdvertiseAndListenForPASE();
}

Expand All @@ -223,10 +229,7 @@ CHIP_ERROR CommissioningWindowManager::AdvertiseAndListenForPASE()
mPairingSession.Clear();

#if CHIP_DEVICE_CONFIG_ENABLE_SED
if (!mIsBLE && !mListeningForPASE)
{
DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(true);
}
#endif

ReturnErrorOnFailure(mServer->GetExchangeManager().RegisterUnsolicitedMessageHandlerForType(
Expand Down Expand Up @@ -455,13 +458,6 @@ CHIP_ERROR CommissioningWindowManager::StopAdvertisement(bool aShuttingDown)
{
RestoreDiscriminator();

#if CHIP_DEVICE_CONFIG_ENABLE_SED
if (!mIsBLE && mListeningForPASE)
{
DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(false);
}
#endif

mServer->GetExchangeManager().UnregisterUnsolicitedMessageHandlerForType(Protocols::SecureChannel::MsgType::PBKDFParamRequest);
mListeningForPASE = false;
mPairingSession.Clear();
Expand Down

0 comments on commit 630febf

Please sign in to comment.