Skip to content

Commit 6ff3e0a

Browse files
committed
make it possible to init time sync server with any persistent storage implementation
1 parent 47223b8 commit 6ff3e0a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app/clusters/time-synchronization-server/time-synchronization-server.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ void TimeSynchronizationServer::AttemptToGetTime()
435435
}
436436
}
437437

438-
void TimeSynchronizationServer::Init()
438+
void TimeSynchronizationServer::Init(PersistentStorageDelegate & persistentStorage)
439439
{
440-
mTimeSyncDataProvider.Init(Server::GetInstance().GetPersistentStorage());
440+
mTimeSyncDataProvider.Init(persistentStorage);
441441

442442
Structs::TrustedTimeSourceStruct::Type tts;
443443
if (mTimeSyncDataProvider.LoadTrustedTimeSource(tts) == CHIP_NO_ERROR)
@@ -1324,6 +1324,6 @@ bool emberAfTimeSynchronizationClusterSetDefaultNTPCallback(
13241324

13251325
void MatterTimeSynchronizationPluginServerInitCallback()
13261326
{
1327-
TimeSynchronizationServer::Instance().Init();
1327+
TimeSynchronizationServer::Instance().Init(Server::GetInstance().GetPersistentStorage());
13281328
registerAttributeAccessOverride(&gAttrAccess);
13291329
}

src/app/clusters/time-synchronization-server/time-synchronization-server.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class TimeSynchronizationServer : public FabricTable::Delegate
6666
{
6767
public:
6868
TimeSynchronizationServer();
69-
void Init();
69+
void Init(PersistentStorageDelegate & persistentStorage);
7070
void Shutdown();
7171

7272
static TimeSynchronizationServer & Instance(void);

0 commit comments

Comments
 (0)