Skip to content

Commit

Permalink
Add shutdown calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Nov 23, 2023
1 parent 49113d4 commit 06b663a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/InteractionModelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1936,7 +1936,7 @@ bool InteractionModelEngine::HasSubscriptionsToResume()
#endif // CHIP_CONFIG_PERSIST_SUBSCRIPTIONS && CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION

#if CHIP_CONFIG_ENABLE_ICD_SERVER
void InteractionModelEngine::SetICDData(ICDData & data)
void InteractionModelEngine::SetICDData(ICDData * data)
{
ReadHandler::SetICDData(data);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/InteractionModelEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler,
CHIP_ERROR ResumeSubscriptions();

#if CHIP_CONFIG_ENABLE_ICD_SERVER
void SetICDData(ICDData & data);
void SetICDData(ICDData * data);
#endif

#if CONFIG_BUILD_FOR_HOST_UNIT_TEST
Expand Down
2 changes: 1 addition & 1 deletion src/app/ReadHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class ReadHandler : public Messaging::ExchangeDelegate
}

#if CHIP_CONFIG_ENABLE_ICD_SERVER
static void SetICDData(ICDData & icdData) { mICDData = &icdData; }
static void SetICDData(ICDData * icdData) { mICDData = icdData; }
#endif

private:
Expand Down
2 changes: 1 addition & 1 deletion src/app/server/Dnssd.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class DLL_EXPORT DnssdServer : public ICDStateObserver
template <class AdvertisingParams>
void AddICDKeyToAdvertisement(AdvertisingParams & advParams);

void SetICDManager(ICDManager & manager) { mICDManager = &manager; };
void SetICDManager(ICDManager * manager) { mICDManager = manager; };
#endif
/// Start operational advertising
CHIP_ERROR AdvertiseOperational();
Expand Down
10 changes: 8 additions & 2 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams)
app::DnssdServer::Instance().SetInterfaceId(mInterfaceId);

#if CHIP_CONFIG_ENABLE_ICD_SERVER
app::DnssdServer::Instance().SetICDManager(mICDManager);
app::DnssdServer::Instance().SetICDManager(&mICDManager);
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER

if (GetFabricTable().FabricCount() != 0)
Expand Down Expand Up @@ -333,7 +333,7 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams)
SuccessOrExit(err);

#if CHIP_CONFIG_ENABLE_ICD_SERVER
chip::app::InteractionModelEngine::GetInstance()->SetICDData(mICDData);
chip::app::InteractionModelEngine::GetInstance()->SetICDData(&mICDData);
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER

// This code is necessary to restart listening to existing groups after a reboot
Expand Down Expand Up @@ -503,10 +503,16 @@ void Server::Shutdown()
PlatformMgr().RemoveEventHandler(OnPlatformEventWrapper, 0);
mCASEServer.Shutdown();
mCASESessionManager.Shutdown();
#if CHIP_CONFIG_ENABLE_ICD_SERVER
app::DnssdServer::Instance().SetICDManager(nullptr);
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
app::DnssdServer::Instance().SetCommissioningModeProvider(nullptr);
chip::Dnssd::ServiceAdvertiser::Instance().Shutdown();

chip::Dnssd::Resolver::Instance().Shutdown();
#if CHIP_CONFIG_ENABLE_ICD_SERVER
chip::app::InteractionModelEngine::GetInstance()->SetICDData(nullptr);
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
chip::app::InteractionModelEngine::GetInstance()->Shutdown();
mCommissioningWindowManager.Shutdown();
mMessageCounterManager.Shutdown();
Expand Down

0 comments on commit 06b663a

Please sign in to comment.