Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle Move UseECM check for StartAdvertisement #21254

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/app/server/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ class AppDelegate
virtual ~AppDelegate() {}
virtual void OnCommissioningSessionStarted() {}
virtual void OnCommissioningSessionStopped() {}

/*
* This is called anytime a basic or enhanced commissioning window is opened.
*
* The type of the window can be retrieved by calling
* CommissioningWindowManager::CommissioningWindowStatus()
*/
virtual void OnCommissioningWindowOpened() {}
virtual void OnCommissioningWindowClosed() {}
};
10 changes: 5 additions & 5 deletions src/app/server/CommissioningWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,6 @@ CHIP_ERROR CommissioningWindowManager::StartAdvertisement()
}
#endif // CONFIG_NETWORK_LAYER_BLE

if (mAppDelegate != nullptr)
{
mAppDelegate->OnCommissioningWindowOpened();
}

if (mUseECM)
{
mWindowStatus = AdministratorCommissioning::CommissioningWindowStatus::kEnhancedWindowOpen;
Expand All @@ -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();

Expand Down