Skip to content

Commit

Permalink
Relocate the storage init configuration after server init in linux main
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed May 25, 2022
1 parent 12fba68 commit 4f20d48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/platform/linux/AppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,6 @@ int ChipLinuxAppInit(int argc, char * const argv[], OptionSet * customOptions)
SuccessOrExit(err);
DeviceLayer::SetCommissionableDataProvider(&gCommissionableDataProvider);

gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

err = chip::examples::InitConfigurationManager(reinterpret_cast<ConfigurationManagerImpl &>(ConfigurationMgr()),
LinuxDeviceOptions::GetInstance());
SuccessOrExit(err);
Expand Down Expand Up @@ -355,6 +352,9 @@ void ChipLinuxAppMainLoop()
// Init ZCL Data Model and CHIP App Server
Server::GetInstance().Init(initParams);

gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

// Now that the server has started and we are done with our startup logging,
// log our discovery/onboarding information again so it's not lost in the
// noise.
Expand Down

0 comments on commit 4f20d48

Please sign in to comment.