Skip to content

Commit

Permalink
Fix chef lock state not changed when lock / unlock (#22153)
Browse files Browse the repository at this point in the history
* Description
The current chef lock callback emberAfPluginDoorLockOnDoorLockCommand
actually does nothing but just return true. So when lock/unlock is
called, the state is not stored.

* Fix
Call DoorLockServer::SetLockState to save the lock state
  • Loading branch information
erwinpan1 authored Aug 25, 2022
1 parent dbd698c commit 16a355c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/chef/common/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const c
chip::app::Clusters::DoorLock::DlOperationError & err)
{
err = DlOperationError::kUnspecified;
return true;
// TBD: LockManager, check pinCode, ...
return DoorLockServer::Instance().SetLockState(endpointId, DlLockState::kLocked);
}

bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const chip::Optional<chip::ByteSpan> & pinCode,
chip::app::Clusters::DoorLock::DlOperationError & err)
{
err = DlOperationError::kUnspecified;
return true;
// TBD: LockManager, check pinCode, ...
return DoorLockServer::Instance().SetLockState(endpointId, DlLockState::kUnlocked);
}
#endif /* EMBER_AF_PLUGIN_DOOR_LOCK_SERVER */

0 comments on commit 16a355c

Please sign in to comment.