blob: 7672a41ea9904db94612901ea3e6333f8c12c0ab [file] [log] [blame]
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/callback.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/command-id.h>
// Include door lock callbacks only when the server is enabled
#ifdef EMBER_AF_PLUGIN_DOOR_LOCK_SERVER
#include <app/clusters/door-lock-server/door-lock-server.h>
bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const chip::Optional<chip::ByteSpan> & pinCode,
chip::app::Clusters::DoorLock::DlOperationError & err)
{
err = DlOperationError::kUnspecified;
// 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;
// TBD: LockManager, check pinCode, ...
return DoorLockServer::Instance().SetLockState(endpointId, DlLockState::kUnlocked);
}
#endif /* EMBER_AF_PLUGIN_DOOR_LOCK_SERVER */