From b727baa7239bab34f05c8c1ceb6a29bbb2351088 Mon Sep 17 00:00:00 2001 From: Rohit Jadhav Date: Fri, 8 Jul 2022 15:43:12 +0530 Subject: [PATCH] [ESP32] Fixed server initialisation order --- src/app/server/Server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 44c30043dc4a5c..b9994f54ff7227 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -179,9 +179,6 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) deviceInfoprovider->SetStorageDelegate(mDeviceStorage); } - // This initializes clusters, so should come after lower level initialization. - InitDataModelHandler(&mExchangeMgr); - // Init transport before operations with secure session mgr. err = mTransports.Init(UdpListenParameters(DeviceLayer::UDPEndPointManager()) .SetAddressType(IPAddressType::kIPv6) @@ -247,6 +244,9 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) } #endif // CHIP_CONFIG_ENABLE_SERVER_IM_EVENT + // This initializes clusters, so should come after lower level initialization. + InitDataModelHandler(&mExchangeMgr); + #if defined(CHIP_APP_USE_ECHO) err = InitEchoHandler(&mExchangeMgr); SuccessOrExit(err);