Skip to content

Commit

Permalink
Resolve issue when adding same index with different credential type.
Browse files Browse the repository at this point in the history
  • Loading branch information
krypton36 committed Dec 20, 2022
1 parent fb18595 commit 3353431
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/clusters/door-lock-server/door-lock-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2085,8 +2085,10 @@ DlStatus DoorLockServer::addCredentialToUser(chip::EndpointId endpointId, chip::

for (size_t i = 0; i < user.credentials.size(); ++i)
{
// appclusters, 5.2.4.40: user should not be already associated with given credentialIndex
if (user.credentials.data()[i].CredentialIndex == credential.CredentialIndex)
// appclusters, 5.6.3.2: This is the index of the specific credential used to authorize
// the lock operation in the list of credentials identified by CredentialType
if (user.credentials.data()[i].CredentialIndex == credential.CredentialIndex &&
user.credentials.data()[i].CredentialType == credential.CredentialType)
{
emberAfDoorLockClusterPrintln(
"[AddCredentialToUser] Unable to add credential to user: credential with this index is already associated "
Expand Down

0 comments on commit 3353431

Please sign in to comment.