Skip to content

Commit

Permalink
Add some missed registrations of dataModelProvider in server init
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Nov 26, 2024
1 parent 0ac52eb commit 27cdc0f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <app/TestEventTriggerDelegate.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/ota-requestor/OTATestEventTriggerHandler.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
Expand Down Expand Up @@ -262,6 +263,7 @@ CHIP_ERROR AppTask::Init()
initParams.operationalKeystore = &sPSAOperationalKeystore;
#endif
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = CodegenDataModelProviderInstance();
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams));
AppFabricTableDelegate::Init();
Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <app/clusters/general-diagnostics-server/general-diagnostics-server.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/on-off-server/on-off-server.h>
#include <app/codegen-data-model-provider/Instance.h>

#include <app/server/Dnssd.h>
#include <app/server/Server.h>
Expand Down Expand Up @@ -273,6 +274,7 @@ void AppTask::InitServer(intptr_t arg)
VerifyOrDie(sTestEventTriggerDelegate.Init(ByteSpan(sTestEventTriggerEnableKey)) == CHIP_NO_ERROR);
VerifyOrDie(sTestEventTriggerDelegate.AddHandler(&sFaultTestEventTriggerHandler) == CHIP_NO_ERROR);
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = CodegenDataModelProviderInstance();
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;

chip::Server::GetInstance().Init(initParams);
Expand Down
4 changes: 3 additions & 1 deletion examples/ota-requestor-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <DeviceInfoProviderImpl.h>

#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/Server.h>
#include <app/util/endpoint-config-api.h>

Expand Down Expand Up @@ -78,7 +79,8 @@ static void InitServer(intptr_t context)
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
static AmebaObserver sAmebaObserver;
initParams.appDelegate = &sAmebaObserver;
initParams.dataModelProvider = CodegenDataModelProviderInstance();
initParams.appDelegate = &sAmebaObserver;
chip::Server::GetInstance().Init(initParams);
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
Expand Down

0 comments on commit 27cdc0f

Please sign in to comment.