Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go back to using the storage key 1.0 used for group fabric info. #24163

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/credentials/GroupDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ using GroupEndpoint = GroupDataProvider::GroupEndpoint;
using EpochKey = GroupDataProvider::EpochKey;
using KeySet = GroupDataProvider::KeySet;
using GroupSession = GroupDataProvider::GroupSession;
using FabricList = CommonPersistentData::FabricList;

struct FabricList : public CommonPersistentData::FabricList
{
CHIP_ERROR UpdateKey(StorageKeyName & key) override
{
key = DefaultStorageKeyAllocator::GroupFabricList();
return CHIP_NO_ERROR;
}
};

constexpr size_t kPersistentBufferMax = 128;

Expand Down
7 changes: 2 additions & 5 deletions src/lib/support/CommonPersistentData.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,8 @@ struct StoredDataList : public PersistentData<kMaxSerializedSize>
constexpr size_t kPersistentFabricBufferMax = 32;
struct FabricList : StoredDataList<FabricIndex, kPersistentFabricBufferMax>
{
CHIP_ERROR UpdateKey(StorageKeyName & key) override
{
key = DefaultStorageKeyAllocator::FabricList();
return CHIP_NO_ERROR;
}
// Subclasses need to define UpdateKey to be whatever fabric list key they
// care about.

void Clear() override
{
Expand Down
4 changes: 1 addition & 3 deletions src/lib/support/DefaultStorageKeyAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ class DefaultStorageKeyAllocator
static StorageKeyName FabricMetadata(FabricIndex fabric) { return StorageKeyName::Formatted("f/%x/m", fabric); }
static StorageKeyName FabricOpKey(FabricIndex fabric) { return StorageKeyName::Formatted("f/%x/o", fabric); }

// Fabric List
static StorageKeyName FabricList() { return StorageKeyName::FromConst("g/fl"); }

// Fail-safe handling
static StorageKeyName FailSafeCommitMarkerKey() { return StorageKeyName::FromConst("g/fs/c"); }
static StorageKeyName FailSafeNetworkConfig() { return StorageKeyName::FromConst("g/fs/n"); }
Expand Down Expand Up @@ -147,6 +144,7 @@ class DefaultStorageKeyAllocator
// Group Data Provider

// List of fabric indices that have endpoint-to-group associations defined.
static StorageKeyName GroupFabricList() { return StorageKeyName::FromConst("g/gfl"); }
static StorageKeyName FabricGroups(chip::FabricIndex fabric) { return StorageKeyName::Formatted("f/%x/g", fabric); }
static StorageKeyName FabricGroup(chip::FabricIndex fabric, chip::GroupId group)
{
Expand Down