Skip to content

Commit

Permalink
[linux] Set DeviceInfoProvider before Server::Init to setup the stora…
Browse files Browse the repository at this point in the history
…ge of DeviceInfoProvider properly. (project-chip#21803)
  • Loading branch information
yufengwangca authored and isiu-apple committed Sep 16, 2022
1 parent 9690dff commit 1e11dd6
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 @@ -315,12 +315,12 @@ void ChipLinuxAppMainLoop()
initParams.testEventTriggerDelegate = &testEventTriggerDelegate;
#endif

// We need to set DeviceInfoProvider before Server::Init to setup the storage of DeviceInfoProvider properly.
DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

// 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 1e11dd6

Please sign in to comment.