From 7384be15c596db06307e7ccfb60e92b39b72309e Mon Sep 17 00:00:00 2001 From: Cliff Rawlings Date: Tue, 26 Jul 2022 13:08:26 -0700 Subject: [PATCH] Move UseECM check for StartAdvertisement Moved UseECM check above AppDelegate to ensure status is set before Commissioning Window is activated. --- src/app/server/CommissioningWindowManager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 5d1e574fe97c34..eaea53d90ec00d 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -374,11 +374,6 @@ CHIP_ERROR CommissioningWindowManager::StartAdvertisement() } #endif // CONFIG_NETWORK_LAYER_BLE - if (mAppDelegate != nullptr) - { - mAppDelegate->OnCommissioningWindowOpened(); - } - if (mUseECM) { mWindowStatus = AdministratorCommissioning::CommissioningWindowStatus::kEnhancedWindowOpen; @@ -388,6 +383,11 @@ CHIP_ERROR CommissioningWindowManager::StartAdvertisement() mWindowStatus = AdministratorCommissioning::CommissioningWindowStatus::kBasicWindowOpen; } + if (mAppDelegate != nullptr) + { + mAppDelegate->OnCommissioningWindowOpened(); + } + // reset all advertising, switching to our new commissioning mode. app::DnssdServer::Instance().StartServer();