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

Refactor SafeAttributePersistenceProvider and AttributePersistenceProvider to move ember-specific bits to codegendatamodelprovider #36476

Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4b94904
Move persistence providers code into util since they depend on ember.
andreilitvin Nov 12, 2024
c26c9f0
Fix up more includes
andreilitvin Nov 12, 2024
64d9acf
Restyled by clang-format
restyled-commits Nov 12, 2024
80e826b
Fix up qpg build
andreilitvin Nov 12, 2024
4fe03be
Also fix nrfconnect deferred attribute persistence use
andreilitvin Nov 12, 2024
6ffb911
Fix path
andreilitvin Nov 12, 2024
f387b7b
Add persistence to esp32 CMakeLists.txt
andy31415 Nov 12, 2024
964cf5b
Take out ember and non-ember bits of the persistence provider
andy31415 Nov 12, 2024
c0ee99d
Persistence test actually only ever tests the save side of the persis…
andy31415 Nov 12, 2024
7d421d0
Start using Safe and Attribute persistence in a separate way. Still n…
andy31415 Nov 12, 2024
dfbf1d5
A bit of work to make Server init decoupled ember specific persistenc…
andy31415 Nov 12, 2024
770d7b2
Some compile fixes
andy31415 Nov 12, 2024
498268e
Make all applications provide a datamodel provider
andy31415 Nov 12, 2024
fd485fe
CI passes. We probably have to fix tons of dependencies still
andy31415 Nov 12, 2024
3e91e55
Restyled by clang-format
restyled-commits Nov 12, 2024
59de647
Fix efr32 build
andy31415 Nov 13, 2024
4cfc7a2
Fix qpg and nrf deferred persistence providers
andy31415 Nov 13, 2024
cd67f5a
Restyle
andy31415 Nov 13, 2024
9b100f5
Make attribute persistence part of libchip as it is generic and code …
andy31415 Nov 13, 2024
944e910
Fix android dependency
andy31415 Nov 13, 2024
efc0391
Fix up ordering of startup in Server.cpp
andy31415 Nov 13, 2024
9790c14
Restyle
andy31415 Nov 13, 2024
9f4da18
Update placement of storage int again, just before fabric so order is…
andy31415 Nov 13, 2024
b2f16b7
Merge branch 'master' into move_persistence_provider
andy31415 Nov 14, 2024
66861cf
Merge branch 'move_persistence_provider' into more_persistence_provid…
andy31415 Nov 14, 2024
22e9875
Merge branch 'master' into more_persistence_provider_refactor
andy31415 Nov 18, 2024
9388a04
Fix wrong paste text
andy31415 Nov 18, 2024
43372b9
Remove redundant previs for CodegenDataModelProviderInstance
andy31415 Nov 18, 2024
2483cd7
One more path update
andy31415 Nov 18, 2024
76272de
Merge branch 'master' into more_persistence_provider_refactor
andreilitvin Nov 19, 2024
aa88e5d
Undo examples change: looking to undo the server init provider argume…
andreilitvin Nov 19, 2024
a7be8c3
Fix includes
andreilitvin Nov 19, 2024
e325098
Revert more codegendatamodelprovider usage
andreilitvin Nov 19, 2024
35db533
Remove more usage of dataModelProvider input. This should now be a cl…
andreilitvin Nov 19, 2024
7cad7d6
Fix include
andreilitvin Nov 19, 2024
b4f465f
Fix up logic for Deferred persistence providers
andreilitvin Nov 19, 2024
60d388d
Merge branch 'master' into more_persistence_provider_refactor
andy31415 Nov 20, 2024
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
2 changes: 2 additions & 0 deletions examples/air-purifier-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <air-purifier-manager.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/endpoint-config-api.h>
#include <lib/core/ErrorStr.h>
Expand Down Expand Up @@ -133,6 +134,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model and CHIP App Server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
#if CONFIG_ENABLE_AMEBA_CRYPTO
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
static chip::AmebaPersistentStorageOperationalKeystore sAmebaPersistentStorageOpKeystore;
Expand Down
2 changes: 2 additions & 0 deletions examples/air-purifier-app/cc32xx/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <lib/support/CHIPPlatformMemory.h>
#include <platform/CHIPDeviceLayer.h>

#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>

Expand Down Expand Up @@ -164,6 +165,7 @@ int AppTask::Init()
PLAT_LOG("Initialize Server");
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
chip::Server::GetInstance().Init(initParams);

// Initialize device attestation config
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/endpoint-config-api.h>
Expand Down Expand Up @@ -149,6 +150,7 @@ static void InitServer(intptr_t context)
initParams.appDelegate = &sAmebaObserver;

initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();

#if CONFIG_ENABLE_AMEBA_CRYPTO
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "LEDWidget.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.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 @@ -129,6 +130,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
chip::Server::GetInstance().Init(initParams);

// We only have network commissioning on endpoint 0.
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/linux/fuzzing-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#include "AppMain.h"
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/Server.h>

#include <CommissionableInit.h>
Expand Down Expand Up @@ -56,6 +57,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize)
// ChipLinuxAppMainLoop blocks, and we don't want that here.
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
VerifyOrDie(Server::GetInstance().Init(initParams) == CHIP_NO_ERROR);

ApplicationInit();
Expand Down
3 changes: 2 additions & 1 deletion examples/all-clusters-app/mbed/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ int AppTask::Init()
// Init ZCL Data Model and start server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
error = Server::GetInstance().Init(initParams);
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
error = Server::GetInstance().Init(initParams);
if (error != CHIP_NO_ERROR)
{
ChipLogError(NotSpecified, "Server initialization failed: %s", error.AsString());
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,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/util/attribute-storage.h>
#include <app/util/endpoint-config-api.h>

Expand Down Expand Up @@ -226,6 +227,7 @@ CHIP_ERROR AppTask::Init()
initParams.operationalKeystore = &sPSAOperationalKeystore;
#endif
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams));
AppFabricTableDelegate::Init();
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/nxp/mw320/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
#include <app/util/af-types.h>
Expand Down Expand Up @@ -1068,6 +1069,7 @@ static void run_chip_srv(System::Layer * aSystemLayer, void * aAppState)

static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
chip::Server::GetInstance().Init(initParams);
PRINTF("Done to call chip::Server() \r\n");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/endpoint-config-api.h>
Expand Down Expand Up @@ -157,6 +158,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model and CHIP App Server
static chip::CommonCaseDeviceServerInitParams initParams;
initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
chip::Server::GetInstance().Init(initParams);

// Initialize device attestation config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "LEDWidget.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.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 @@ -127,6 +128,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
chip::Server::GetInstance().Init(initParams);

// We only have network commissioning on endpoint 0.
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-minimal-app/linux/fuzzing-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#include "AppMain.h"
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/Server.h>

using namespace chip;
Expand Down Expand Up @@ -43,6 +44,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize)
// ChipLinuxAppMainLoop blocks, and we don't want that here.
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
VerifyOrDie(Server::GetInstance().Init(initParams) == CHIP_NO_ERROR);

ApplicationInit();
Expand Down
6 changes: 4 additions & 2 deletions examples/all-clusters-minimal-app/mbed/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#include "AppTask.h"
#include "LEDWidget.h"
#include <DFUManager.h>
#include <app/server/OnboardingCodesUtil.h>

#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
Expand Down Expand Up @@ -67,7 +68,8 @@ int AppTask::Init()
// Init ZCL Data Model and start server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
error = Server::GetInstance().Init(initParams);
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
error = Server::GetInstance().Init(initParams);
if (error != CHIP_NO_ERROR)
{
ChipLogError(NotSpecified, "Server initialization failed: %s", error.AsString());
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "LEDUtil.h"
#include "binding-handler.h"

#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>

Expand Down Expand Up @@ -173,6 +174,7 @@ CHIP_ERROR AppTask::Init()
initParams.operationalKeystore = &sPSAOperationalKeystore;
#endif
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams));
AppFabricTableDelegate::Init();

Expand Down
2 changes: 2 additions & 0 deletions examples/chef/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/endpoint-config-api.h>
Expand Down Expand Up @@ -104,6 +105,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model and CHIP App Server
static chip::CommonCaseDeviceServerInitParams initParams;
initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
chip::Server::GetInstance().Init(initParams);
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
Expand Down
2 changes: 2 additions & 0 deletions examples/chef/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <platform/CHIPDeviceLayer.h>

#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>

Expand Down Expand Up @@ -159,6 +160,7 @@ void InitServer(intptr_t)
// Start IM server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
chip::Server::GetInstance().Init(initParams);

// Device Attestation & Onboarding codes
Expand Down
4 changes: 3 additions & 1 deletion examples/chef/nrfconnect/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <lib/support/CHIPMem.h>
#include <platform/CHIPDeviceLayer.h>

#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>

Expand Down Expand Up @@ -125,7 +126,8 @@ int main()
initParams.operationalKeystore = &sPSAOperationalKeystore;
#endif
(void) initParams.InitializeStaticResourcesBeforeServerInit();
err = chip::Server::GetInstance().Init(initParams);
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
err = chip::Server::GetInstance().Init(initParams);
if (err != CHIP_NO_ERROR)
{
return 1;
Expand Down
2 changes: 2 additions & 0 deletions examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
#include "AppTask.h"
#include "AppEvent.h"
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <lib/core/ErrorStr.h>
Expand Down Expand Up @@ -298,6 +299,7 @@ void AppTask::InitServer(intptr_t arg)
{
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();

auto & infoProvider = chip::DeviceLayer::DeviceInfoProviderImpl::GetDefaultInstance();
infoProvider.SetStorageDelegate(initParams.persistentStorageDelegate);
Expand Down
2 changes: 2 additions & 0 deletions examples/light-switch-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/endpoint-config-api.h>
Expand Down Expand Up @@ -103,6 +104,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model and CHIP App Server
static chip::CommonCaseDeviceServerInitParams initParams;
initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
#if CONFIG_ENABLE_AMEBA_CRYPTO
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
static chip::AmebaPersistentStorageOperationalKeystore sAmebaPersistentStorageOpKeystore;
Expand Down
2 changes: 2 additions & 0 deletions examples/light-switch-app/cc13x4_26x4/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "FreeRTOS.h"

#include <app/codegen-data-model-provider/Instance.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <examples/platform/cc13x4_26x4/CC13X4_26X4DeviceAttestationCreds.h>
Expand Down Expand Up @@ -324,6 +325,7 @@ int AppTask::Init()
static DefaultTestEventTriggerDelegate sTestEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) };
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();

// Initialize info provider
sExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate);
Expand Down
2 changes: 2 additions & 0 deletions examples/light-switch-app/genio/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
Expand Down Expand Up @@ -124,6 +125,7 @@ CHIP_ERROR AppTask::Init()
// Init ZCL Data Model and start server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
chip::Server::GetInstance().Init(initParams);

// Initialize device attestation config
Expand Down
2 changes: 2 additions & 0 deletions examples/light-switch-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <credentials/DeviceAttestationCredsProvider.h>
Expand Down Expand Up @@ -235,6 +236,7 @@ CHIP_ERROR AppTask::Init()
initParams.operationalKeystore = &sPSAOperationalKeystore;
#endif
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams));
AppFabricTableDelegate::Init();
Expand Down
3 changes: 3 additions & 0 deletions examples/light-switch-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ using namespace ::chip;
#include <app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerHandler.h>
#include <app/clusters/general-diagnostics-server/general-diagnostics-server.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
Expand Down Expand Up @@ -204,6 +205,7 @@ void AppTask::InitServer(intptr_t arg)
{
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();

gExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate);
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
Expand All @@ -220,6 +222,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 = chip::app::CodegenDataModelProviderInstance();
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;

chip::Server::GetInstance().Init(initParams);
Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/codegen-data-model-provider/Instance.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/endpoint-config-api.h>
#include <lib/core/ErrorStr.h>
Expand Down Expand Up @@ -123,6 +124,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model and CHIP App Server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();
#if CONFIG_ENABLE_AMEBA_CRYPTO
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
static chip::AmebaPersistentStorageOperationalKeystore sAmebaPersistentStorageOpKeystore;
Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/cc13x4_26x4/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

#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/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
Expand Down Expand Up @@ -315,6 +316,7 @@ int AppTask::Init()
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;

(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance();

// Initialize info provider
sExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate);
Expand Down
Loading
Loading