@@ -145,32 +145,6 @@ CHIP_ERROR AccessManager<CRED_BIT_MASK>::GetCredentialUserId(uint16_t credential
145
145
return CHIP_ERROR_NOT_FOUND;
146
146
}
147
147
148
- #ifdef CONFIG_LOCK_LEAVE_FABRIC_CLEAR_CREDENTIAL
149
- template <CredentialsBits CRED_BIT_MASK> bool AccessManager<CRED_BIT_MASK>::ClearAllCredentialsFromFabric()
150
- {
151
- return mCredentials .ForEach ([](DoorLockData::Credential &credential, uint8_t credIdx) {
152
- /* At this point the door-lock-server already invalidated both mCreatedBy and mLastModifiedBy
153
- of all credentials assigned to the fabric which is currently being removed */
154
- if (credential.mInfo .mFields .mCreatedBy == kUndefinedFabricIndex &&
155
- credential.mInfo .mFields .mLastModifiedBy == kUndefinedFabricIndex &&
156
- credential.mSecret .mDataLength != 0 ) {
157
- return Instance ().ClearCredential (credential, credIdx);
158
- }
159
- return true ;
160
- });
161
- }
162
-
163
- template <CredentialsBits CRED_BIT_MASK>
164
- bool AccessManager<CRED_BIT_MASK>::ClearCredential(DoorLockData::Credential &credential, uint8_t credIdx)
165
- {
166
- credIdx++; /* DoSetCredential expects indexes starting from 1 */
167
- return DoSetCredential (credential, credIdx, kUndefinedFabricIndex , kUndefinedFabricIndex ,
168
- DlCredentialStatus::kAvailable ,
169
- static_cast <CredentialTypeEnum>(credential.mInfo .mFields .mCredentialType ),
170
- chip::ByteSpan ());
171
- }
172
- #endif
173
-
174
148
template <CredentialsBits CRED_BIT_MASK> void AccessManager<CRED_BIT_MASK>::LoadCredentialsFromPersistentStorage()
175
149
{
176
150
uint8_t credentialData[DoorLockData::Credential::RequiredBufferSize ()] = { 0 };
@@ -186,8 +160,8 @@ template <CredentialsBits CRED_BIT_MASK> void AccessManager<CRED_BIT_MASK>::Load
186
160
}
187
161
outSize = 0 ;
188
162
if (!AccessStorage::Instance ().Load (AccessStorage::Type::CredentialsIndexes,
189
- credentialIndexesSerialized,
190
- sizeof (credentialIndexesSerialized), outSize, type)) {
163
+ credentialIndexesSerialized, sizeof (credentialIndexesSerialized) ,
164
+ outSize, type)) {
191
165
LOG_INF (" No stored indexes for credential of type: %d" , type);
192
166
continue ;
193
167
}
@@ -203,8 +177,7 @@ template <CredentialsBits CRED_BIT_MASK> void AccessManager<CRED_BIT_MASK>::Load
203
177
uint16_t credentialIndex = credIndexes.mList .mIndexes [idx];
204
178
outSize = 0 ;
205
179
if (!AccessStorage::Instance ().Load (AccessStorage::Type::Credential, credentialData,
206
- sizeof (credentialData), outSize, type,
207
- credentialIndex)) {
180
+ sizeof (credentialData), outSize, type, credentialIndex)) {
208
181
LOG_ERR (" Cannot load credentials of type %d for index: %d" , static_cast <uint8_t >(type),
209
182
credentialIndex);
210
183
}
@@ -217,7 +190,7 @@ template <CredentialsBits CRED_BIT_MASK> void AccessManager<CRED_BIT_MASK>::Load
217
190
}
218
191
outSize = 0 ;
219
192
if (!AccessStorage::Instance ().Load (AccessStorage::Type::RequirePIN, &mRequirePINForRemoteOperation ,
220
- sizeof (mRequirePINForRemoteOperation ), outSize) ||
193
+ sizeof (mRequirePINForRemoteOperation ), outSize) ||
221
194
outSize != sizeof (mRequirePINForRemoteOperation )) {
222
195
LOG_DBG (" Cannot load RequirePINforRemoteOperation" );
223
196
}
0 commit comments