From 16a355cb10172871293817f2b4369a0e7b019822 Mon Sep 17 00:00:00 2001 From: Erwin Pan Date: Fri, 26 Aug 2022 01:47:42 +0800 Subject: [PATCH] Fix chef lock state not changed when lock / unlock (#22153) * 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 --- examples/chef/common/stubs.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 6fd7713bfdcfd2..7672a41ea9904d 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -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 & 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 */