From fba7848bd55fc5b54a66a5682058173801c00aad Mon Sep 17 00:00:00 2001 From: alvin hsiao Date: Thu, 11 Aug 2022 14:41:44 +0800 Subject: [PATCH] [Infineon] Fix "Failed to write calendar type with error: 0x87" --- examples/lighting-app/cyw30739/src/main.cpp | 4 ++-- examples/lock-app/cyw30739/src/main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/lighting-app/cyw30739/src/main.cpp b/examples/lighting-app/cyw30739/src/main.cpp index 3e5f413a0d994c..4d5775f308c57a 100644 --- a/examples/lighting-app/cyw30739/src/main.cpp +++ b/examples/lighting-app/cyw30739/src/main.cpp @@ -151,6 +151,8 @@ void InitApp(intptr_t args) /* Start CHIP datamodel server */ static chip::CommonCaseDeviceServerInitParams initParams; (void) initParams.InitializeStaticResourcesBeforeServerInit(); + gExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate); + chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams; nativeParams.lockCb = [] { ThreadStackMgr().LockThreadStack(); }; nativeParams.unlockCb = [] { ThreadStackMgr().UnlockThreadStack(); }; @@ -159,8 +161,6 @@ void InitApp(intptr_t args) chip::Server::GetInstance().Init(initParams); SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); - gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage()); - chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); LightMgr().Init(); LightMgr().SetCallbacks(LightManagerCallback, nullptr); diff --git a/examples/lock-app/cyw30739/src/main.cpp b/examples/lock-app/cyw30739/src/main.cpp index 3a7a0d8c3ca235..6e184b06f0a67f 100644 --- a/examples/lock-app/cyw30739/src/main.cpp +++ b/examples/lock-app/cyw30739/src/main.cpp @@ -176,6 +176,8 @@ void InitApp(intptr_t args) /* Start CHIP datamodel server */ static chip::CommonCaseDeviceServerInitParams initParams; (void) initParams.InitializeStaticResourcesBeforeServerInit(); + gExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate); + chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams; nativeParams.lockCb = [] { ThreadStackMgr().LockThreadStack(); }; nativeParams.unlockCb = [] { ThreadStackMgr().UnlockThreadStack(); }; @@ -184,8 +186,6 @@ void InitApp(intptr_t args) chip::Server::GetInstance().Init(initParams); SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); - gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage()); - chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); // Initial lock state chip::app::DataModel::Nullable state;