From 12154321fd2befbada9469657f0c8f83fb96c6af Mon Sep 17 00:00:00 2001 From: Marc Mikolits Date: Thu, 27 Jul 2023 20:47:55 +0200 Subject: [PATCH] Updated emberAf callbacks to match the door-lock-server callbacks signature (#28328) * Updated emberAF callbacks to match the door-lock-server callbacks signature * add namespace for Nullable --- .../nrfconnect/main/ZclDoorLockCallbacks.cpp | 9 +++++++-- .../telink/src/ZclDoorLockCallbacks.cpp | 9 +++++++-- examples/chef/common/stubs.cpp | 10 ++++++++-- .../lock-app/cc13x2x7_26x2x7/src/ZclCallbacks.cpp | 9 +++++++-- examples/lock-app/cc13x4_26x4/src/ZclCallbacks.cpp | 9 +++++++-- examples/lock-app/genio/src/ZclCallbacks.cpp | 9 +++++++-- .../lock-app/infineon/cyw30739/src/ZclCallbacks.cpp | 9 +++++++-- examples/lock-app/infineon/psoc6/src/ZclCallbacks.cpp | 9 +++++++-- .../lock-app/lock-common/src/ZCLDoorLockCallbacks.cpp | 3 +++ examples/lock-app/nrfconnect/main/ZclCallbacks.cpp | 11 +++++++++-- .../lock-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp | 10 ++++++++-- examples/lock-app/qpg/src/ZclCallbacks.cpp | 9 +++++++-- examples/lock-app/silabs/src/ZclCallbacks.cpp | 3 +++ examples/lock-app/telink/src/ZclCallbacks.cpp | 11 +++++++++-- examples/platform/esp32/lock/ZclCallbacks.cpp | 11 ++++++++--- 15 files changed, 104 insertions(+), 27 deletions(-) diff --git a/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp b/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp index 068b990444b4f5..2d3a6e4e32f270 100644 --- a/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp +++ b/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp @@ -20,11 +20,14 @@ #include #include #include +#include +#include #include using namespace ::chip; using namespace ::chip::app::Clusters; using namespace ::chip::app::Clusters::DoorLock; +using ::chip::app::DataModel::Nullable; LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); @@ -32,13 +35,15 @@ LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); // to simulate DoorLock endpoint for All-Clusters-App example // without using kUser|kAccessSchedules|kRfidCredential|kPinCredential -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { return true; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { return true; diff --git a/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp b/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp index 068b990444b4f5..2d3a6e4e32f270 100644 --- a/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp +++ b/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp @@ -20,11 +20,14 @@ #include #include #include +#include +#include #include using namespace ::chip; using namespace ::chip::app::Clusters; using namespace ::chip::app::Clusters::DoorLock; +using ::chip::app::DataModel::Nullable; LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); @@ -32,13 +35,15 @@ LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); // to simulate DoorLock endpoint for All-Clusters-App example // without using kUser|kAccessSchedules|kRfidCredential|kPinCredential -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { return true; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { return true; diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 75b45cbb1b38bb..2d2b15ca93b4cd 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -1,6 +1,10 @@ #include #include +#include #include +#include + +using chip::app::DataModel::Nullable; // Include door lock callbacks only when the server is enabled #ifdef EMBER_AF_PLUGIN_DOOR_LOCK_SERVER @@ -188,14 +192,16 @@ class LockManager Endpoint endpoints[kNumEndpoints]; }; -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const chip::Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const chip::Optional & pinCode, chip::app::Clusters::DoorLock::OperationErrorEnum & err) { err = OperationErrorEnum::kUnspecified; return DoorLockServer::Instance().SetLockState(endpointId, DlLockState::kLocked); } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const chip::Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const chip::Optional & pinCode, chip::app::Clusters::DoorLock::OperationErrorEnum & err) { err = OperationErrorEnum::kUnspecified; diff --git a/examples/lock-app/cc13x2x7_26x2x7/src/ZclCallbacks.cpp b/examples/lock-app/cc13x2x7_26x2x7/src/ZclCallbacks.cpp index 0fb673f020c5c5..1777326dc4d017 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/src/ZclCallbacks.cpp +++ b/examples/lock-app/cc13x2x7_26x2x7/src/ZclCallbacks.cpp @@ -27,10 +27,13 @@ #include #include #include +#include +#include #include using namespace ::chip::app::Clusters; using namespace ::chip::DeviceLayer::Internal; +using ::chip::app::DataModel::Nullable; void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, uint8_t * value) @@ -56,7 +59,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & */ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) {} -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); @@ -68,7 +72,8 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const O return status; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Unlock Command endpoint=%d", endpointId); diff --git a/examples/lock-app/cc13x4_26x4/src/ZclCallbacks.cpp b/examples/lock-app/cc13x4_26x4/src/ZclCallbacks.cpp index 0fb673f020c5c5..1777326dc4d017 100644 --- a/examples/lock-app/cc13x4_26x4/src/ZclCallbacks.cpp +++ b/examples/lock-app/cc13x4_26x4/src/ZclCallbacks.cpp @@ -27,10 +27,13 @@ #include #include #include +#include +#include #include using namespace ::chip::app::Clusters; using namespace ::chip::DeviceLayer::Internal; +using ::chip::app::DataModel::Nullable; void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, uint8_t * value) @@ -56,7 +59,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & */ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) {} -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); @@ -68,7 +72,8 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const O return status; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Unlock Command endpoint=%d", endpointId); diff --git a/examples/lock-app/genio/src/ZclCallbacks.cpp b/examples/lock-app/genio/src/ZclCallbacks.cpp index 91a867bc38c25e..12688358f0feee 100644 --- a/examples/lock-app/genio/src/ZclCallbacks.cpp +++ b/examples/lock-app/genio/src/ZclCallbacks.cpp @@ -28,11 +28,14 @@ #include #include #include +#include +#include #include using namespace ::chip::app::Clusters; using namespace ::chip::DeviceLayer::Internal; using namespace ::chip::app::Clusters::DoorLock; +using ::chip::app::DataModel::Nullable; void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, uint8_t * value) @@ -100,7 +103,8 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) } } -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); @@ -112,7 +116,8 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const O return status; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Unlock Command endpoint=%d", endpointId); diff --git a/examples/lock-app/infineon/cyw30739/src/ZclCallbacks.cpp b/examples/lock-app/infineon/cyw30739/src/ZclCallbacks.cpp index 7d3eeed7bcf1b6..b8f581c21c9ead 100644 --- a/examples/lock-app/infineon/cyw30739/src/ZclCallbacks.cpp +++ b/examples/lock-app/infineon/cyw30739/src/ZclCallbacks.cpp @@ -19,6 +19,8 @@ #include "LockManager.h" #include +#include +#include #include #include #include @@ -26,6 +28,7 @@ using namespace chip; using namespace chip::app::Clusters; using namespace chip::DeviceLayer; +using chip::app::DataModel::Nullable; void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, uint8_t * value) @@ -40,7 +43,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & } } -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); @@ -52,7 +56,8 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const O return status; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Unlock Command endpoint=%d", endpointId); diff --git a/examples/lock-app/infineon/psoc6/src/ZclCallbacks.cpp b/examples/lock-app/infineon/psoc6/src/ZclCallbacks.cpp index 91936419d458a6..95b552324aaf38 100644 --- a/examples/lock-app/infineon/psoc6/src/ZclCallbacks.cpp +++ b/examples/lock-app/infineon/psoc6/src/ZclCallbacks.cpp @@ -28,11 +28,14 @@ #include #include #include +#include +#include #include using namespace ::chip; using namespace ::chip::app::Clusters; using namespace ::chip::DeviceLayer::Internal; +using ::chip::app::DataModel::Nullable; void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, uint8_t * value) @@ -58,7 +61,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & */ void emberAfOnOffClusterInitCallback(EndpointId endpoint) {} -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); @@ -70,7 +74,8 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const O return status; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Unlock Command endpoint=%d", endpointId); diff --git a/examples/lock-app/lock-common/src/ZCLDoorLockCallbacks.cpp b/examples/lock-app/lock-common/src/ZCLDoorLockCallbacks.cpp index 2b649db7443d42..2b0b8810f4ff6e 100644 --- a/examples/lock-app/lock-common/src/ZCLDoorLockCallbacks.cpp +++ b/examples/lock-app/lock-common/src/ZCLDoorLockCallbacks.cpp @@ -17,13 +17,16 @@ */ #include +#include #include +#include #include "LockManager.h" using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::DoorLock; +using chip::app::DataModel::Nullable; // App handles physical aspects of locking but not locking logic. That is it // should wait for door to be locked on lock command and return success) but // door lock server should check pin before even calling the lock-door diff --git a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp index 49cdbfb84e754a..624bac3c73e5aa 100644 --- a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp +++ b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp @@ -23,11 +23,14 @@ #include #include #include +#include +#include #include using namespace ::chip; using namespace ::chip::app::Clusters; using namespace ::chip::app::Clusters::DoorLock; +using ::chip::app::DataModel::Nullable; LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); @@ -75,7 +78,9 @@ bool emberAfPluginDoorLockSetCredential(EndpointId endpointId, uint16_t credenti return BoltLockMgr().SetCredential(credentialIndex, creator, modifier, credentialStatus, credentialType, secret); } -bool emberAfPluginDoorLockOnDoorLockCommand(EndpointId endpointId, const Optional & pinCode, OperationErrorEnum & err) +bool emberAfPluginDoorLockOnDoorLockCommand(EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, + OperationErrorEnum & err) { bool result = BoltLockMgr().ValidatePIN(pinCode, err); @@ -88,7 +93,9 @@ bool emberAfPluginDoorLockOnDoorLockCommand(EndpointId endpointId, const Optiona return result; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(EndpointId endpointId, const Optional & pinCode, OperationErrorEnum & err) +bool emberAfPluginDoorLockOnDoorUnlockCommand(EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, + OperationErrorEnum & err) { bool result = BoltLockMgr().ValidatePIN(pinCode, err); diff --git a/examples/lock-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp b/examples/lock-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp index 9033f40aaeff7e..b888db03861c7f 100644 --- a/examples/lock-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp +++ b/examples/lock-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp @@ -20,24 +20,30 @@ #include "AppTask.h" #include "BoltLockManager.h" +#include #include #include #include +#include #include #include +#include using namespace ::chip; using namespace ::chip::app::Clusters; using namespace ::chip::app::Clusters::DoorLock; +using ::chip::app::DataModel::Nullable; -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { return BoltLockMgr().InitiateAction(0, BoltLockManager::LOCK_ACTION); } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { return BoltLockMgr().InitiateAction(0, BoltLockManager::UNLOCK_ACTION); diff --git a/examples/lock-app/qpg/src/ZclCallbacks.cpp b/examples/lock-app/qpg/src/ZclCallbacks.cpp index 98942e62a4654a..25a06b533c5cad 100644 --- a/examples/lock-app/qpg/src/ZclCallbacks.cpp +++ b/examples/lock-app/qpg/src/ZclCallbacks.cpp @@ -23,12 +23,15 @@ #include #include #include +#include #include +#include #include using namespace ::chip; using namespace ::chip::app::Clusters; using namespace ::chip::app::Clusters::DoorLock; +using ::chip::app::DataModel::Nullable; void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t type, uint16_t size, uint8_t * value) { @@ -73,7 +76,8 @@ bool emberAfPluginDoorLockSetCredential(EndpointId endpointId, uint16_t credenti return BoltLockMgr().SetCredential(credentialIndex, creator, modifier, credentialStatus, credentialType, secret); } -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { bool returnValue = false; @@ -87,7 +91,8 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const O return returnValue; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { bool returnValue = false; diff --git a/examples/lock-app/silabs/src/ZclCallbacks.cpp b/examples/lock-app/silabs/src/ZclCallbacks.cpp index f0316cb78fe8fc..dc5d60915218ae 100644 --- a/examples/lock-app/silabs/src/ZclCallbacks.cpp +++ b/examples/lock-app/silabs/src/ZclCallbacks.cpp @@ -27,10 +27,13 @@ #include #include #include +#include +#include #include using namespace ::chip::app::Clusters; using namespace ::chip::DeviceLayer::Internal; +using ::chip::app::DataModel::Nullable; void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, uint8_t * value) diff --git a/examples/lock-app/telink/src/ZclCallbacks.cpp b/examples/lock-app/telink/src/ZclCallbacks.cpp index b304dc51e68cb5..327db43125a035 100644 --- a/examples/lock-app/telink/src/ZclCallbacks.cpp +++ b/examples/lock-app/telink/src/ZclCallbacks.cpp @@ -23,11 +23,14 @@ #include #include #include +#include +#include #include using namespace ::chip; using namespace ::chip::app::Clusters; using namespace ::chip::app::Clusters::DoorLock; +using ::chip::app::DataModel::Nullable; LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); @@ -75,7 +78,9 @@ bool emberAfPluginDoorLockSetCredential(EndpointId endpointId, uint16_t credenti return BoltLockMgr().SetCredential(credentialIndex, creator, modifier, credentialStatus, credentialType, secret); } -bool emberAfPluginDoorLockOnDoorLockCommand(EndpointId endpointId, const Optional & pinCode, OperationErrorEnum & err) +bool emberAfPluginDoorLockOnDoorLockCommand(EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, + OperationErrorEnum & err) { bool result = BoltLockMgr().ValidatePIN(pinCode, err); @@ -88,7 +93,9 @@ bool emberAfPluginDoorLockOnDoorLockCommand(EndpointId endpointId, const Optiona return result; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(EndpointId endpointId, const Optional & pinCode, OperationErrorEnum & err) +bool emberAfPluginDoorLockOnDoorUnlockCommand(EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, + OperationErrorEnum & err) { bool result = BoltLockMgr().ValidatePIN(pinCode, err); diff --git a/examples/platform/esp32/lock/ZclCallbacks.cpp b/examples/platform/esp32/lock/ZclCallbacks.cpp index 02c2a2a75f58a0..40ac8a4de76347 100644 --- a/examples/platform/esp32/lock/ZclCallbacks.cpp +++ b/examples/platform/esp32/lock/ZclCallbacks.cpp @@ -20,17 +20,20 @@ * This file implements the handler for data model messages. */ -//#include "AppConfig.h" +// #include "AppConfig.h" #include "BoltLockManager.h" #include #include #include #include +#include +#include #include using namespace ::chip::app::Clusters; using namespace ::chip::DeviceLayer::Internal; +using ::chip::app::DataModel::Nullable; /** @brief DoorLock Cluster Init * @@ -43,7 +46,8 @@ using namespace ::chip::DeviceLayer::Internal; */ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) {} -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); @@ -55,7 +59,8 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const O return status; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Unlock Command endpoint=%d", endpointId);