Skip to content

Commit

Permalink
GroupDataProvider: PersistentStorageDelegate Initialization (#16079)
Browse files Browse the repository at this point in the history
* Group Data Provider: PersistentStorageDelegate passed as init() argument.

* Group Data Provider: PersistentStorageDelegate: Review comments applied.

* Remove storage dependency on GroupDataProvider.h

* restyled

* Fix comment typo.

* Group Data Provider initialization: Rebased.

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Dec 6, 2023
1 parent 7ded780 commit 3294526
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 59 deletions.
2 changes: 1 addition & 1 deletion src/app/InteractionModelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ uint32_t InteractionModelEngine::GetNumActiveWriteHandlers() const
}

void InteractionModelEngine::CloseTransactionsFromFabricIndex(FabricIndex aFabricIndex)
{
{
//
// Walk through all existing subscriptions and shut down those whose subscriber matches
// that which just came in.
Expand Down
4 changes: 2 additions & 2 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ Server::Server() :
.dnsCache = nullptr,
#endif
.devicePool = &mDevicePool,
}),
mGroupsProvider(mDeviceStorage)
})
{}

CHIP_ERROR Server::Init(AppDelegate * delegate, uint16_t secureServicePort, uint16_t unsecureServicePort,
Expand Down Expand Up @@ -141,6 +140,7 @@ CHIP_ERROR Server::Init(AppDelegate * delegate, uint16_t secureServicePort, uint
app::DnssdServer::Instance().SetCommissioningModeProvider(&mCommissioningWindowManager);

// Group data provider must be initialized after mDeviceStorage
mGroupsProvider.SetStorageDelegate(&mDeviceStorage);
err = mGroupsProvider.Init();
SuccessOrExit(err);
SetGroupDataProvider(&mGroupsProvider);
Expand Down
5 changes: 3 additions & 2 deletions src/credentials/GroupDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ class GroupDataProvider
uint16_t GetMaxGroupKeysPerFabric() { return mMaxGroupKeysPerFabric; }

/**
* Initialize the GroupDataProvider, including any persistent data store
* initialization. Must be called once before any other API succeeds.
* Initialize the GroupDataProvider, including possibly any persistent
* data store initialization done by the implementation. Must be called once
* before any other API succeeds.
*
* @retval #CHIP_ERROR_INCORRECT_STATE if called when already initialized.
* @retval #CHIP_NO_ERROR on success
Expand Down
Loading

0 comments on commit 3294526

Please sign in to comment.