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. (#36405)

Co-authored-by: Andrei Litvin <andy314@gmail.com>
  • Loading branch information
2 people authored and pull[bot] committed Feb 20, 2025
1 parent 64d8e06 commit 3827691
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 3827691

Please sign in to comment.