Skip to content

Commit a31cfe8

Browse files
committed
Rename FailSafeCommitMarkerKey to FabricTableCommitMarkerKey
Commit marker was moved from FailSafeContext to FabricTable in #20010, however name of the key wasn't changed and it's misleading. This commit changes the name of the method returning commit marker key, but keeps the key name for backward compatibility. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
1 parent 50aa1d3 commit a31cfe8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/credentials/FabricTable.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ CHIP_ERROR FabricTable::StoreCommitMarker(const CommitMarker & commitMarker)
14661466
const auto markerContextTLVLength = writer.GetLengthWritten();
14671467
VerifyOrReturnError(CanCastTo<uint16_t>(markerContextTLVLength), CHIP_ERROR_BUFFER_TOO_SMALL);
14681468

1469-
return mStorage->SyncSetKeyValue(DefaultStorageKeyAllocator::FailSafeCommitMarkerKey().KeyName(), tlvBuf,
1469+
return mStorage->SyncSetKeyValue(DefaultStorageKeyAllocator::FabricTableCommitMarkerKey().KeyName(), tlvBuf,
14701470
static_cast<uint16_t>(markerContextTLVLength));
14711471
}
14721472

@@ -1475,7 +1475,7 @@ CHIP_ERROR FabricTable::GetCommitMarker(CommitMarker & outCommitMarker)
14751475
uint8_t tlvBuf[CommitMarkerContextTLVMaxSize()];
14761476
uint16_t tlvSize = sizeof(tlvBuf);
14771477
ReturnErrorOnFailure(
1478-
mStorage->SyncGetKeyValue(DefaultStorageKeyAllocator::FailSafeCommitMarkerKey().KeyName(), tlvBuf, tlvSize));
1478+
mStorage->SyncGetKeyValue(DefaultStorageKeyAllocator::FabricTableCommitMarkerKey().KeyName(), tlvBuf, tlvSize));
14791479

14801480
// If buffer was too small, we won't reach here.
14811481
TLV::ContiguousBufferTLVReader reader;
@@ -1499,7 +1499,7 @@ CHIP_ERROR FabricTable::GetCommitMarker(CommitMarker & outCommitMarker)
14991499

15001500
void FabricTable::ClearCommitMarker()
15011501
{
1502-
mStorage->SyncDeleteKeyValue(DefaultStorageKeyAllocator::FailSafeCommitMarkerKey().KeyName());
1502+
mStorage->SyncDeleteKeyValue(DefaultStorageKeyAllocator::FabricTableCommitMarkerKey().KeyName());
15031503
}
15041504

15051505
bool FabricTable::HasOperationalKeyForFabric(FabricIndex fabricIndex) const

src/lib/support/DefaultStorageKeyAllocator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class DefaultStorageKeyAllocator
103103
static StorageKeyName FabricOpKey(FabricIndex fabric) { return StorageKeyName::Formatted("f/%x/o", fabric); }
104104

105105
// Fail-safe handling
106-
static StorageKeyName FailSafeCommitMarkerKey() { return StorageKeyName::FromConst("g/fs/c"); }
106+
static StorageKeyName FabricTableCommitMarkerKey() { return StorageKeyName::FromConst("g/fs/c"); }
107107
static StorageKeyName FailSafeNetworkConfig() { return StorageKeyName::FromConst("g/fs/n"); }
108108

109109
// LastKnownGoodTime

0 commit comments

Comments
 (0)