Skip to content

Commit

Permalink
Fixing Darwin CI build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pgregorr-amazon committed May 7, 2024
1 parent c965cde commit 2a8c8e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ CHIP_ERROR CastingApp::PostStartRegistrations()
// Register DeviceEvent Handler
ReturnErrorOnFailure(chip::DeviceLayer::PlatformMgrImpl().AddEventHandler(ChipDeviceEventHandler::Handle, 0));

#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT
// Set a handler for Commissioner's CommissionerDeclaration messages.
chip::Server::GetInstance().GetUserDirectedCommissioningClient()->SetCommissionerDeclarationHandler(
CommissionerDeclarationHandler::GetInstance());
#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT

mState = CASTING_APP_RUNNING; // CastingApp started successfully, set state to RUNNING
return CHIP_NO_ERROR;
Expand All @@ -153,8 +155,10 @@ CHIP_ERROR CastingApp::Stop()
ChipLogProgress(Discovery, "CastingApp::Stop() called");
VerifyOrReturnError(mState == CASTING_APP_RUNNING, CHIP_ERROR_INCORRECT_STATE);

#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT
// Remove the handler previously set for Commissioner's CommissionerDeclaration messages.
chip::Server::GetInstance().GetUserDirectedCommissioningClient()->SetCommissionerDeclarationHandler(nullptr);
#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT

// Shutdown the Matter server
chip::Server::GetInstance().Shutdown();
Expand Down

0 comments on commit 2a8c8e7

Please sign in to comment.