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. (#21803)
  • Loading branch information
yufengwangca authored and pull[bot] committed Nov 17, 2023
1 parent 425f7ac commit 2607705
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 2607705

Please sign in to comment.