Skip to content

Commit

Permalink
Doesn't provide PIN to the unlock after unlatch when the pin length i…
Browse files Browse the repository at this point in the history
…s 0. (project-chip#36405)

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
lpbeliveau-silabs and andy31415 authored Nov 7, 2024
1 parent e3c6522 commit 9cd0070
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/lock-app/silabs/src/LockManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,11 @@ void LockManager::UnlockAfterUnlatch()
bool succes = false;
if (mUnlatchContext.mEndpointId != kInvalidEndpointId)
{
succes = setLockState(
mUnlatchContext.mEndpointId, mUnlatchContext.mFabricIdx, mUnlatchContext.mNodeId, DlLockState::kUnlocked,
MakeOptional(chip::ByteSpan(mUnlatchContext.mPinBuffer, mUnlatchContext.mPinLength)), mUnlatchContext.mErr);
Optional<chip::ByteSpan> pin = (mUnlatchContext.mPinLength)
? MakeOptional(chip::ByteSpan(mUnlatchContext.mPinBuffer, mUnlatchContext.mPinLength))
: Optional<chip::ByteSpan>::Missing();
succes = setLockState(mUnlatchContext.mEndpointId, mUnlatchContext.mFabricIdx, mUnlatchContext.mNodeId,
DlLockState::kUnlocked, pin, mUnlatchContext.mErr);
}

if (!succes)
Expand Down

0 comments on commit 9cd0070

Please sign in to comment.