From 41290898efce801de92dadb19102d72a7d9337c0 Mon Sep 17 00:00:00 2001 From: Jiacheng Guo Date: Tue, 22 Feb 2022 03:35:48 +0800 Subject: [PATCH] [binding] Make binding table an attribute (#14952) --- .../all-clusters-app.matter | 24 +- .../all-clusters-common/all-clusters-app.zap | 70 ++-- .../src/binding-handler.cpp | 11 +- examples/chip-tool/templates/tests.js | 1 + .../light-switch-app.matter | 24 +- .../light-switch-common/light-switch-app.zap | 67 ++-- .../thermostat-common/thermostat.matter | 24 +- .../thermostat-common/thermostat.zap | 68 ++-- examples/tv-app/linux/main.cpp | 2 +- examples/tv-app/tv-common/tv-app.matter | 48 +-- examples/tv-app/tv-common/tv-app.zap | 36 +- .../tv-casting-common/tv-casting-app.matter | 24 +- .../tv-casting-common/tv-casting-app.zap | 85 ++--- src/app/app-platform/ContentAppPlatform.cpp | 52 ++- src/app/app-platform/ContentAppPlatform.h | 13 +- src/app/chip_data_model.gni | 1 + src/app/clusters/bindings/BindingManager.cpp | 53 ++- src/app/clusters/bindings/BindingManager.h | 4 +- .../bindings/PendingNotificationMap.cpp | 37 +- .../bindings/PendingNotificationMap.h | 2 + src/app/clusters/bindings/bindings.cpp | 256 +++++++------ .../ias-zone-server/ias-zone-server.cpp | 35 +- src/app/tests/BUILD.gn | 17 + src/app/tests/TestBindingTable.cpp | 122 +++++++ src/app/tests/TestPendingNotificationMap.cpp | 147 ++++++++ src/app/tests/suites/TestBinding.yaml | 81 +++++ src/app/util/binding-table.cpp | 105 +++++- src/app/util/binding-table.h | 69 +++- src/app/util/mock/BUILD.gn | 6 + .../include/zap-generated/endpoint_config.h | 0 .../mock/include/zap-generated/gen_config.h | 20 ++ src/app/util/types_stub.h | 9 +- .../zcl/data-model/chip/binding-cluster.xml | 30 +- .../data_model/controller-clusters.matter | 26 +- .../data_model/controller-clusters.zap | 35 +- .../CHIPAttributeTLVValueDecoder.cpp | 98 +++++ .../java/zap-generated/CHIPCallbackTypes.h | 2 + .../zap-generated/CHIPClustersWrite-JNI.cpp | 121 +++++++ .../java/zap-generated/CHIPReadCallbacks.cpp | 144 ++++++++ .../java/zap-generated/CHIPReadCallbacks.h | 31 ++ .../chip/devicecontroller/ChipClusters.java | 90 ++--- .../chip/devicecontroller/ChipStructs.java | 44 +++ .../devicecontroller/ClusterInfoMapping.java | 88 ++--- .../devicecontroller/ClusterReadMapping.java | 13 + .../python/chip/clusters/CHIPClusters.py | 27 +- .../python/chip/clusters/Objects.py | 60 ++-- src/darwin/Framework/CHIP/templates/tests.js | 1 + .../CHIPAttributeTLVValueDecoder.mm | 47 +++ .../CHIP/zap-generated/CHIPCallbackBridge.mm | 60 ++++ .../CHIPCallbackBridge_internal.h | 28 ++ .../CHIP/zap-generated/CHIPClustersObjc.h | 10 +- .../CHIP/zap-generated/CHIPClustersObjc.mm | 100 ++++-- .../zap-generated/CHIPCommandPayloadsObjc.h | 16 - .../zap-generated/CHIPCommandPayloadsObjc.mm | 34 -- .../CHIP/zap-generated/CHIPStructsObjc.h | 9 + .../CHIP/zap-generated/CHIPStructsObjc.mm | 19 + .../Framework/CHIPTests/CHIPClustersTests.m | 172 +++++++++ .../zap-generated/IMClusterCommandHandler.cpp | 49 --- .../zap-generated/endpoint_config.h | 262 +++++++------- .../app-common/zap-generated/af-structs.h | 10 + .../app-common/zap-generated/attribute-id.h | 1 + .../app-common/zap-generated/callback.h | 10 - .../zap-generated/cluster-objects.cpp | 97 ++--- .../zap-generated/cluster-objects.h | 116 ++---- .../app-common/zap-generated/command-id.h | 4 - .../app-common/zap-generated/ids/Attributes.h | 4 + .../app-common/zap-generated/ids/Commands.h | 14 - .../zap-generated/cluster/Commands.h | 59 +-- .../cluster/ComplexArgumentParser.cpp | 47 +++ .../cluster/ComplexArgumentParser.h | 4 + .../cluster/logging/DataModelLogger.cpp | 53 +++ .../cluster/logging/DataModelLogger.h | 2 + .../chip-tool/zap-generated/test/Commands.h | 337 ++++++++++++++++++ .../zap-generated/CHIPClientCallbacks.h | 5 + .../zap-generated/IMClusterCommandHandler.cpp | 49 --- .../zap-generated/endpoint_config.h | 106 +++--- .../zap-generated/IMClusterCommandHandler.cpp | 49 --- .../zap-generated/endpoint_config.h | 101 +++--- .../zap-generated/CHIPClientCallbacks.h | 5 + .../zap-generated/IMClusterCommandHandler.cpp | 49 --- .../tv-app/zap-generated/endpoint_config.h | 177 +++++---- .../zap-generated/IMClusterCommandHandler.cpp | 49 --- .../zap-generated/endpoint_config.h | 194 +++++----- 83 files changed, 2974 insertions(+), 1697 deletions(-) create mode 100644 src/app/tests/TestBindingTable.cpp create mode 100644 src/app/tests/TestPendingNotificationMap.cpp create mode 100644 src/app/tests/suites/TestBinding.yaml create mode 100644 src/app/util/mock/include/zap-generated/endpoint_config.h create mode 100644 src/app/util/mock/include/zap-generated/gen_config.h diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index bf78250b179f99..9390d36634cc16 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -230,24 +230,16 @@ server cluster BinaryInputBasic = 15 { } server cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; + struct TargetStruct { + FABRIC_IDX fabricIndex = 0; + optional NODE_ID node = 1; + optional GROUP_ID group = 2; + optional ENDPOINT_NO endpoint = 3; + optional CLUSTER_ID cluster = 4; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute TargetStruct binding[] = 0; + readonly global attribute int16u clusterRevision = 65533; } server cluster BooleanState = 69 { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 765b3c31aa1782..30b994ae687f94 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -877,24 +877,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -922,6 +905,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8706,24 +8704,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -8751,6 +8732,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -21150,4 +21146,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp b/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp index 15ec992bdd7789..ab1b917a1c9738 100644 --- a/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp @@ -66,18 +66,19 @@ static void RegisterSwitchCommands() } #endif // defined(ENABLE_CHIP_SHELL) -static void BoundDeviceChangedHandler(const EmberBindingTableEntry * binding, chip::DeviceProxy * peer_device, void * context) +static void BoundDeviceChangedHandler(const EmberBindingTableEntry & binding, chip::DeviceProxy * peer_device, void * context) { using namespace chip; using namespace chip::app; - if (binding->type == EMBER_MULTICAST_BINDING) + if (binding.type == EMBER_MULTICAST_BINDING) { ChipLogError(NotSpecified, "Group binding is not supported now"); return; } - if (binding->type == EMBER_UNICAST_BINDING && binding->local == 1 && binding->clusterId == Clusters::OnOff::Id) + if (binding.type == EMBER_UNICAST_BINDING && binding.local == 1 && + (!binding.clusterId.HasValue() || binding.clusterId.Value() == Clusters::OnOff::Id)) { auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) { ChipLogProgress(NotSpecified, "OnOff command succeeds"); @@ -90,13 +91,13 @@ static void BoundDeviceChangedHandler(const EmberBindingTableEntry * binding, ch { Clusters::OnOff::Commands::On::Type onCommand; Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), - binding->remote, onCommand, onSuccess, onFailure); + binding.remote, onCommand, onSuccess, onFailure); } else { Clusters::OnOff::Commands::Off::Type offCommand; Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), - binding->remote, offCommand, onSuccess, onFailure); + binding.remote, offCommand, onSuccess, onFailure); } } } diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index 31b91ea89a547f..c0688f917737be 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -458,6 +458,7 @@ function getTests() 'TestOperationalCredentialsCluster', 'TestModeSelectCluster', 'TestSystemCommands', + 'TestBinding', ]; const SoftwareDiagnostics = [ diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index f6ab5aabc73165..a67a0e40a19d33 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -142,24 +142,16 @@ server cluster Basic = 40 { } server cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; + struct TargetStruct { + FABRIC_IDX fabricIndex = 0; + optional NODE_ID node = 1; + optional GROUP_ID group = 2; + optional ENDPOINT_NO endpoint = 3; + optional CLUSTER_ID cluster = 4; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute TargetStruct binding[] = 0; + readonly global attribute int16u clusterRevision = 65533; } client cluster ColorControl = 768 { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index 2661cf91fbb8d8..7566fd5b3bb5d9 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -936,24 +936,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], + "commands": [], "attributes": [] }, { @@ -965,6 +948,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -5939,22 +5937,6 @@ "side": "client", "enabled": 0, "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } ], "attributes": [ { @@ -5998,6 +5980,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -7067,4 +7064,4 @@ "deviceIdentifier": 259 } ] -} \ No newline at end of file +} diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index cdec11ee36ba90..6e3a632451f289 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -142,24 +142,16 @@ server cluster Basic = 40 { } server cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; + struct TargetStruct { + FABRIC_IDX fabricIndex = 0; + optional NODE_ID node = 1; + optional GROUP_ID group = 2; + optional ENDPOINT_NO endpoint = 3; + optional CLUSTER_ID cluster = 4; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute TargetStruct binding[] = 0; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index cf621206436545..c9069ef821d3f2 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -854,24 +854,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -899,6 +882,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8158,24 +8156,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -8203,6 +8184,21 @@ "enabled": 0, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, diff --git a/examples/tv-app/linux/main.cpp b/examples/tv-app/linux/main.cpp index 873eb3649de35b..32e0c9505f0c5f 100644 --- a/examples/tv-app/linux/main.cpp +++ b/examples/tv-app/linux/main.cpp @@ -135,7 +135,7 @@ class MyPostCommissioningListener : public PostCommissioningListener } /* Callback when command results in success */ - static void OnSuccessResponse(void * context, const chip::app::DataModel::NullObjectType &) + static void OnSuccessResponse(void * context) { ChipLogProgress(Controller, "OnSuccessResponse - Binding Add Successfully"); CommissionerDiscoveryController * cdc = GetCommissionerDiscoveryController(); diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 28e423cdada800..48e88b6b9486da 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -272,45 +272,29 @@ server cluster Basic = 40 { } client cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; + struct TargetStruct { + FABRIC_IDX fabricIndex = 0; + optional NODE_ID node = 1; + optional GROUP_ID group = 2; + optional ENDPOINT_NO endpoint = 3; + optional CLUSTER_ID cluster = 4; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute TargetStruct binding[] = 0; + readonly global attribute int16u clusterRevision = 65533; } server cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; + struct TargetStruct { + FABRIC_IDX fabricIndex = 0; + optional NODE_ID node = 1; + optional GROUP_ID group = 2; + optional ENDPOINT_NO endpoint = 3; + optional CLUSTER_ID cluster = 4; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute TargetStruct binding[] = 0; + readonly global attribute int16u clusterRevision = 65533; } server cluster Channel = 1284 { diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 7e4d0b22fddab2..f2d77a7fb96859 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -854,24 +854,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 1, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -899,6 +882,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -10917,4 +10915,4 @@ "deviceIdentifier": 36 } ] -} \ No newline at end of file +} diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index aaf5d938c0540a..6a6560e7c22ad9 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -271,24 +271,16 @@ server cluster BinaryInputBasic = 15 { } server cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; + struct TargetStruct { + FABRIC_IDX fabricIndex = 0; + optional NODE_ID node = 1; + optional GROUP_ID group = 2; + optional ENDPOINT_NO endpoint = 3; + optional CLUSTER_ID cluster = 4; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute TargetStruct binding[] = 0; + readonly global attribute int16u clusterRevision = 65533; } client cluster Channel = 1284 { diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index 7a1e01bd3e8c18..c14ceb4ad5e06d 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -854,41 +854,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "commands": [] }, { "name": "Binding", @@ -899,6 +865,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -7990,24 +7971,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -8035,6 +7999,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, diff --git a/src/app/app-platform/ContentAppPlatform.cpp b/src/app/app-platform/ContentAppPlatform.cpp index 3fadd8273562dd..cf67c13da95171 100644 --- a/src/app/app-platform/ContentAppPlatform.cpp +++ b/src/app/app-platform/ContentAppPlatform.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -387,24 +388,49 @@ uint32_t ContentAppPlatform::GetPincodeFromContentApp(uint16_t vendorId, uint16_ return (uint32_t) strtol(pinString.c_str(), &eptr, 10); } -CHIP_ERROR ContentAppPlatform::CreateBindingWithCallback(OperationalDeviceProxy * device, chip::EndpointId deviceEndpointId, - chip::NodeId bindingNodeId, chip::GroupId bindingGroupId, - chip::EndpointId bindingEndpointId, chip::ClusterId bindingClusterId, - CommandResponseSuccessCallback successCb, - CommandResponseFailureCallback failureCb) +CHIP_ERROR ContentAppPlatform::CreateBindingWithCallback(OperationalDeviceProxy * device, EndpointId deviceEndpointId, + NodeId bindingNodeId, GroupId bindingGroupId, EndpointId bindingEndpointId, + ClusterId bindingClusterId, + Controller::WriteResponseSuccessCallback successCb, + Controller::WriteResponseFailureCallback failureCb) { chip::Controller::BindingCluster cluster; cluster.Associate(device, deviceEndpointId); + Binding::Structs::TargetStruct::Type entries[1]; - Binding::Commands::Bind::Type request; - request.nodeId = bindingNodeId; - request.groupId = bindingGroupId; - request.endpointId = bindingEndpointId; - request.clusterId = bindingClusterId; - ReturnErrorOnFailure(cluster.InvokeCommand(request, this, successCb, failureCb)); + if (bindingNodeId != kUndefinedNodeId) + { + entries[0] = Binding::Structs::TargetStruct::Type{ + .fabricIndex = kUndefinedFabricIndex, + .node = MakeOptional(bindingNodeId), + .group = NullOptional, + .endpoint = MakeOptional(bindingEndpointId), + .cluster = MakeOptional(bindingClusterId), + }; + } + else + { + entries[0] = Binding::Structs::TargetStruct::Type{ + .fabricIndex = kUndefinedFabricIndex, + .node = NullOptional, + .group = MakeOptional(bindingGroupId), + .endpoint = NullOptional, + .cluster = MakeOptional(bindingClusterId), + }; + } + using BindingListTypeInfo = Binding::Attributes::Binding::TypeInfo; + BindingListTypeInfo::Type bindingList(entries); + CHIP_ERROR error = cluster.WriteAttribute(bindingList, nullptr, successCb, failureCb); + if (error == CHIP_NO_ERROR) + { + ChipLogDetail(Controller, "CreateBindingWithCallback: Sent write request, waiting for response"); + } + else + { + ChipLogError(Controller, "CreateBindingWithCallback: Failed to send write request: %" CHIP_ERROR_FORMAT, error.Format()); + } - ChipLogDetail(Controller, "CreateBindingWithCallback: Sent Bind command request, waiting for response"); - return CHIP_NO_ERROR; + return error; } } // namespace AppPlatform diff --git a/src/app/app-platform/ContentAppPlatform.h b/src/app/app-platform/ContentAppPlatform.h index 81a364c022df37..1a82ba0d33a4cb 100644 --- a/src/app/app-platform/ContentAppPlatform.h +++ b/src/app/app-platform/ContentAppPlatform.h @@ -127,16 +127,15 @@ class DLL_EXPORT ContentAppPlatform * @param[in] bindingGroupId The GroupId for the binding that will be created. * @param[in] bindingEndpointId The EndpointId for the binding that will be created. * @param[in] bindingClusterId The ClusterId for the binding that will be created. - * @param[in] onSuccessCallback The function to be called on success of adding the binding. - * @param[in] onFailureCallback The function to be called on failure of adding the binding. + * @param[in] successCb The function to be called on success of adding the binding. + * @param[in] failureCb The function to be called on failure of adding the binding. * * @return CHIP_ERROR CHIP_NO_ERROR on success, or corresponding error */ - CHIP_ERROR CreateBindingWithCallback(OperationalDeviceProxy * device, chip::EndpointId deviceEndpointId, - chip::NodeId bindingNodeId, chip::GroupId bindingGroupId, - chip::EndpointId bindingEndpointId, chip::ClusterId bindingClusterId, - CommandResponseSuccessCallback successCb, - CommandResponseFailureCallback failureCb); + CHIP_ERROR CreateBindingWithCallback(OperationalDeviceProxy * device, EndpointId deviceEndpointId, NodeId bindingNodeId, + GroupId bindingGroupId, EndpointId bindingEndpointId, ClusterId bindingClusterId, + Controller::WriteResponseSuccessCallback successCb, + Controller::WriteResponseFailureCallback failureCb); protected: // requires vendorApp to be in the catalog of the platform diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 109fa7dc85d0a0..7ce8594a8c5145 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -94,6 +94,7 @@ template("chip_data_model") { "${_app_root}/util/attribute-storage.cpp", "${_app_root}/util/attribute-table.cpp", "${_app_root}/util/binding-table.cpp", + "${_app_root}/util/binding-table.h", "${_app_root}/util/client-api.cpp", "${_app_root}/util/ember-compatibility-functions.cpp", "${_app_root}/util/ember-print.cpp", diff --git a/src/app/clusters/bindings/BindingManager.cpp b/src/app/clusters/bindings/BindingManager.cpp index a2817ca1576245..5af8d90c684b2e 100644 --- a/src/app/clusters/bindings/BindingManager.cpp +++ b/src/app/clusters/bindings/BindingManager.cpp @@ -25,14 +25,16 @@ class BindingFabricTableDelegate : public chip::FabricTableDelegate { void OnFabricDeletedFromStorage(chip::CompressedFabricId compressedFabricId, chip::FabricIndex fabricIndex) { - for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + auto iter = chip::BindingTable::GetInstance().begin(); + while (iter != chip::BindingTable::GetInstance().end()) { - EmberBindingTableEntry entry; - emberGetBinding(i, &entry); - if (entry.fabricIndex == fabricIndex) + if (iter->fabricIndex == fabricIndex) { - ChipLogProgress(Zcl, "Remove binding for fabric %d\n", entry.fabricIndex); - entry.type = EMBER_UNUSED_BINDING; + iter = chip::BindingTable::GetInstance().RemoveAt(iter); + } + else + { + ++iter; } } chip::BindingManager::GetInstance().FabricRemoved(compressedFabricId, fabricIndex); @@ -67,15 +69,13 @@ namespace chip { BindingManager BindingManager::sBindingManager; -CHIP_ERROR BindingManager::UnicastBindingCreated(const EmberBindingTableEntry & bindingEntry) +CHIP_ERROR BindingManager::UnicastBindingCreated(uint8_t fabricIndex, NodeId nodeId) { - return EstablishConnection(bindingEntry.fabricIndex, bindingEntry.nodeId); + return EstablishConnection(fabricIndex, nodeId); } CHIP_ERROR BindingManager::UnicastBindingRemoved(uint8_t bindingEntryId) { - EmberBindingTableEntry entry{}; - emberGetBinding(bindingEntryId, &entry); mPendingNotificationMap.RemoveEntry(bindingEntryId); return CHIP_NO_ERROR; } @@ -129,15 +129,14 @@ void BindingManager::HandleDeviceConnected(OperationalDeviceProxy * device) // iterator returns things by value anyway. for (PendingNotificationEntry pendingNotification : mPendingNotificationMap) { - EmberBindingTableEntry entry; - emberGetBinding(pendingNotification.mBindingEntryId, &entry); + EmberBindingTableEntry entry = BindingTable::GetInstance().GetAt(pendingNotification.mBindingEntryId); PeerId peer = PeerIdForNode(mAppServer->GetFabricTable(), entry.fabricIndex, entry.nodeId); if (device->GetPeerId() == peer) { fabricToRemove = entry.fabricIndex; nodeToRemove = entry.nodeId; - mBoundDeviceChangedHandler(&entry, device, pendingNotification.mContext); + mBoundDeviceChangedHandler(entry, device, pendingNotification.mContext); } } mPendingNotificationMap.RemoveAllEntriesForNode(fabricToRemove, nodeToRemove); @@ -166,33 +165,33 @@ CHIP_ERROR BindingManager::NotifyBoundClusterChanged(EndpointId endpoint, Cluste { VerifyOrReturnError(mAppServer != nullptr, CHIP_ERROR_INCORRECT_STATE); - for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + for (auto iter = BindingTable::GetInstance().begin(); iter != BindingTable::GetInstance().end(); ++iter) { - EmberBindingTableEntry entry; - - if (emberGetBinding(i, &entry) == EMBER_SUCCESS && entry.type != EMBER_UNUSED_BINDING && entry.local == endpoint && - entry.clusterId == cluster) + if (iter->local == endpoint && (!iter->clusterId.HasValue() || iter->clusterId.Value() == cluster)) { - if (entry.type == EMBER_UNICAST_BINDING) + if (iter->type == EMBER_UNICAST_BINDING) { - FabricInfo * fabricInfo = mAppServer->GetFabricTable().FindFabricWithIndex(entry.fabricIndex); + FabricInfo * fabricInfo = mAppServer->GetFabricTable().FindFabricWithIndex(iter->fabricIndex); VerifyOrReturnError(fabricInfo != nullptr, CHIP_ERROR_NOT_FOUND); - PeerId peer = fabricInfo->GetPeerIdForNode(entry.nodeId); + PeerId peer = fabricInfo->GetPeerIdForNode(iter->nodeId); OperationalDeviceProxy * peerDevice = mAppServer->GetCASESessionManager()->FindExistingSession(peer); - if (peerDevice != nullptr && mBoundDeviceChangedHandler) + if (peerDevice != nullptr && peerDevice->IsConnected() && mBoundDeviceChangedHandler) { // We already have an active connection - mBoundDeviceChangedHandler(&entry, peerDevice, context); + mBoundDeviceChangedHandler(*iter, peerDevice, context); } else { - mPendingNotificationMap.AddPendingNotification(i, context); - ReturnErrorOnFailure(EstablishConnection(entry.fabricIndex, entry.nodeId)); + mPendingNotificationMap.AddPendingNotification(iter.GetIndex(), context); + if (peerDevice == nullptr || !peerDevice->IsConnecting()) + { + ReturnErrorOnFailure(EstablishConnection(iter->fabricIndex, iter->nodeId)); + } } } - else if (entry.type == EMBER_MULTICAST_BINDING) + else if (iter->type == EMBER_MULTICAST_BINDING) { - mBoundDeviceChangedHandler(&entry, nullptr, context); + mBoundDeviceChangedHandler(*iter, nullptr, context); } } } diff --git a/src/app/clusters/bindings/BindingManager.h b/src/app/clusters/bindings/BindingManager.h index eb87864a127085..0fabe14ff2d5f0 100644 --- a/src/app/clusters/bindings/BindingManager.h +++ b/src/app/clusters/bindings/BindingManager.h @@ -36,7 +36,7 @@ namespace chip { * E.g. The application will send on/off commands to peer for the OnOff cluster. * */ -using BoundDeviceChangedHandler = void (*)(const EmberBindingTableEntry * binding, DeviceProxy * peer_device, void * context); +using BoundDeviceChangedHandler = void (*)(const EmberBindingTableEntry & binding, DeviceProxy * peer_device, void * context); /** * @@ -67,7 +67,7 @@ class BindingManager * Notifies the BindingManager that a new unicast binding is created. * */ - CHIP_ERROR UnicastBindingCreated(const EmberBindingTableEntry & bindingEntry); + CHIP_ERROR UnicastBindingCreated(uint8_t fabricIndex, NodeId nodeId); /* * Notifies the BindingManager that a unicast binding is about to be removed from the given index. diff --git a/src/app/clusters/bindings/PendingNotificationMap.cpp b/src/app/clusters/bindings/PendingNotificationMap.cpp index 49b48eb420c565..7c992677587532 100644 --- a/src/app/clusters/bindings/PendingNotificationMap.cpp +++ b/src/app/clusters/bindings/PendingNotificationMap.cpp @@ -31,31 +31,21 @@ CHIP_ERROR PendingNotificationMap::FindLRUConnectPeer(FabricIndex * fabric, Node // First, set up a way to easily track which entries correspond to the same peer. uint8_t bindingWithSamePeer[EMBER_BINDING_TABLE_SIZE]; - for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + for (auto iter = BindingTable::GetInstance().begin(); iter != BindingTable::GetInstance().end(); ++iter) { - EmberBindingTableEntry entry; - emberGetBinding(i, &entry); - if (entry.type != EMBER_UNICAST_BINDING) + if (iter->type != EMBER_UNICAST_BINDING) { continue; } - bool foundSamePeer = false; - for (uint8_t j = 0; j < i; j++) + for (auto checkIter = BindingTable::GetInstance().begin(); checkIter != BindingTable::GetInstance().end(); ++checkIter) { - EmberBindingTableEntry checkEntry; - emberGetBinding(j, &checkEntry); - if (checkEntry.type == EMBER_UNICAST_BINDING && checkEntry.fabricIndex == entry.fabricIndex && - checkEntry.nodeId == entry.nodeId) + if (checkIter->type == EMBER_UNICAST_BINDING && checkIter->fabricIndex == iter->fabricIndex && + checkIter->nodeId == iter->nodeId) { - foundSamePeer = true; - bindingWithSamePeer[i] = j; + bindingWithSamePeer[iter.GetIndex()] = checkIter.GetIndex(); break; } } - if (!foundSamePeer) - { - bindingWithSamePeer[i] = i; - } } uint16_t lastAppear[EMBER_BINDING_TABLE_SIZE]; @@ -81,10 +71,9 @@ CHIP_ERROR PendingNotificationMap::FindLRUConnectPeer(FabricIndex * fabric, Node } if (minLastAppearValue < UINT16_MAX) { - EmberBindingTableEntry entry; - emberGetBinding(lruBindingEntryIndex, &entry); - *fabric = entry.fabricIndex; - *node = entry.nodeId; + EmberBindingTableEntry entry = BindingTable::GetInstance().GetAt(static_cast(lruBindingEntryIndex)); + *fabric = entry.fabricIndex; + *node = entry.nodeId; return CHIP_NO_ERROR; } return CHIP_ERROR_NOT_FOUND; @@ -118,9 +107,7 @@ void PendingNotificationMap::RemoveAllEntriesForNode(FabricIndex fabric, NodeId uint8_t newEntryCount = 0; for (int i = 0; i < mNumEntries; i++) { - EmberBindingTableEntry entry; - emberGetBinding(mPendingBindingEntries[i], &entry); - + EmberBindingTableEntry entry = BindingTable::GetInstance().GetAt(mPendingBindingEntries[i]); if (entry.fabricIndex != fabric || entry.nodeId != node) { mPendingBindingEntries[newEntryCount] = mPendingBindingEntries[i]; @@ -136,9 +123,7 @@ void PendingNotificationMap::RemoveAllEntriesForFabric(FabricIndex fabric) uint8_t newEntryCount = 0; for (int i = 0; i < mNumEntries; i++) { - EmberBindingTableEntry entry; - emberGetBinding(mPendingBindingEntries[i], &entry); - + EmberBindingTableEntry entry = BindingTable::GetInstance().GetAt(mPendingBindingEntries[i]); if (entry.fabricIndex != fabric) { mPendingBindingEntries[newEntryCount] = mPendingBindingEntries[i]; diff --git a/src/app/clusters/bindings/PendingNotificationMap.h b/src/app/clusters/bindings/PendingNotificationMap.h index 8a9559cac9cefa..2b66fa7efa97fc 100644 --- a/src/app/clusters/bindings/PendingNotificationMap.h +++ b/src/app/clusters/bindings/PendingNotificationMap.h @@ -54,6 +54,8 @@ class PendingNotificationMap bool operator!=(const Iterator & rhs) { return mIndex != rhs.mIndex; } + bool operator==(const Iterator & rhs) { return mIndex == rhs.mIndex; } + private: PendingNotificationMap * mMap; int16_t mIndex; diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp index cfe7ea5f81e773..feaae3f95cc155 100644 --- a/src/app/clusters/bindings/bindings.cpp +++ b/src/app/clusters/bindings/bindings.cpp @@ -20,155 +20,203 @@ * @brief Implementation for the Binding Server Cluster ***************************************************************************/ -#include - #include +#include +#include #include -#include +#include #include +#include #include #include using namespace chip; -using namespace chip::app::Clusters::Binding; +using namespace chip::app; +using namespace chip::app::Clusters; +using TargetStructType = Binding::Structs::TargetStruct::Type; +using DecodableBindingListType = Binding::Attributes::Binding::TypeInfo::DecodableType; // TODO: add binding table to the persistent storage +namespace { -static EmberStatus getBindingIndex(EmberBindingTableEntry & newEntry, uint8_t * bindingIndex) +class BindingTableAccess : public AttributeAccessInterface { - EmberBindingTableEntry currentEntry; - for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) - { - emberGetBinding(i, ¤tEntry); - if (currentEntry.type != EMBER_UNUSED_BINDING && currentEntry == newEntry) - { - *bindingIndex = i; - return EMBER_SUCCESS; - } - } +public: + // Register for the Binding cluster on all endpoints. + BindingTableAccess() : AttributeAccessInterface(NullOptional, Binding::Id) {} + + CHIP_ERROR Read(const ConcreteReadAttributePath & path, AttributeValueEncoder & encoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & path, AttributeValueDecoder & decoder) override; + +private: + CHIP_ERROR ReadBindingTable(EndpointId endpoint, AttributeValueEncoder & encoder); + CHIP_ERROR WriteBindingTable(const ConcreteDataAttributePath & path, AttributeValueDecoder & decoder); +}; - return EMBER_NOT_FOUND; +BindingTableAccess gAttrAccess; + +bool IsValidBinding(const TargetStructType & entry) +{ + return (!entry.group.HasValue() && entry.endpoint.HasValue() && entry.node.HasValue()) || + (!entry.endpoint.HasValue() && !entry.node.HasValue() && entry.group.HasValue()); } -static EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex) +CHIP_ERROR CheckValidBindingList(const DecodableBindingListType & bindingList, FabricIndex accessingFabricIndex) { - EmberBindingTableEntry currentEntry; - for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + size_t listSize = 0; + auto iter = bindingList.begin(); + while (iter.Next()) { - emberGetBinding(i, ¤tEntry); - if (currentEntry.type == EMBER_UNUSED_BINDING) + VerifyOrReturnError(IsValidBinding(iter.GetValue()), CHIP_IM_GLOBAL_STATUS(ConstraintError)); + listSize++; + } + ReturnErrorOnFailure(iter.GetStatus()); + + // Check binding table size + uint8_t oldListSize = 0; + for (const auto & entry : BindingTable::GetInstance()) + { + if (entry.fabricIndex == accessingFabricIndex) { - *bindingIndex = i; - return EMBER_SUCCESS; + oldListSize++; } } - - return EMBER_NOT_FOUND; + ReturnErrorCodeIf(BindingTable::GetInstance().Size() - oldListSize + listSize > EMBER_BINDING_TABLE_SIZE, + CHIP_IM_GLOBAL_STATUS(ResourceExhausted)); + return CHIP_NO_ERROR; } -bool emberAfBindingClusterBindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - const Commands::Bind::DecodableType & commandData) +void AddBindingEntry(const TargetStructType & entry, EndpointId localEndpoint) { - NodeId nodeId = commandData.nodeId; - GroupId groupId = commandData.groupId; - ClusterId clusterId = commandData.clusterId; - EndpointId remoteEndpoint = commandData.endpointId; - EndpointId localEndpoint = commandPath.mEndpointId; - FabricIndex fabricIndex = commandObj->GetAccessingFabricIndex(); EmberBindingTableEntry bindingEntry; - ChipLogDetail(Zcl, "RX: BindCallback"); - - if ((groupId != 0 && nodeId != 0) || (groupId == 0 && nodeId == 0) || (groupId != 0 && remoteEndpoint != 0)) + if (entry.group.HasValue()) { - ChipLogError(Zcl, "Binding: Invalid request"); - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_MALFORMED_COMMAND); - return true; - } - - if (groupId) - { - bindingEntry = EmberBindingTableEntry::ForGroup(fabricIndex, groupId, localEndpoint, clusterId); + bindingEntry = EmberBindingTableEntry::ForGroup(entry.fabricIndex, entry.group.Value(), localEndpoint, entry.cluster); } else { - bindingEntry = EmberBindingTableEntry::ForNode(fabricIndex, nodeId, localEndpoint, remoteEndpoint, clusterId); - } - - uint8_t bindingIndex; - if (getBindingIndex(bindingEntry, &bindingIndex) != EMBER_NOT_FOUND) - { - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_DUPLICATE_EXISTS); - return true; - } - - if (getUnusedBindingIndex(&bindingIndex) != EMBER_SUCCESS) - { - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INSUFFICIENT_SPACE); - return true; - } - - emberSetBinding(bindingIndex, &bindingEntry); - if (nodeId) - { - CHIP_ERROR err = BindingManager::GetInstance().UnicastBindingCreated(bindingEntry); + bindingEntry = EmberBindingTableEntry::ForNode(entry.fabricIndex, entry.node.Value(), localEndpoint, entry.endpoint.Value(), + entry.cluster); + CHIP_ERROR err = BindingManager::GetInstance().UnicastBindingCreated(entry.fabricIndex, entry.node.Value()); if (err != CHIP_NO_ERROR) { ChipLogProgress( Zcl, "Binding: Failed to create session for unicast binding to device " ChipLogFormatX64 ": %" CHIP_ERROR_FORMAT, - ChipLogValueX64(nodeId), err.Format()); + ChipLogValueX64(entry.node.Value()), err.Format()); } } - - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); - return true; + BindingTable::GetInstance().Add(bindingEntry); } -bool emberAfBindingClusterUnbindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - const Commands::Unbind::DecodableType & commandData) +CHIP_ERROR BindingTableAccess::Read(const ConcreteReadAttributePath & path, AttributeValueEncoder & encoder) { - NodeId nodeId = commandData.nodeId; - GroupId groupId = commandData.groupId; - ClusterId clusterId = commandData.clusterId; - EndpointId remoteEndpoint = commandData.endpointId; - EndpointId localEndpoint = commandPath.mEndpointId; - FabricIndex fabricIndex = commandObj->GetAccessingFabricIndex(); - EmberBindingTableEntry bindingEntry; - - ChipLogDetail(Zcl, "RX: UnbindCallback"); - - if ((groupId != 0 && nodeId != 0) || (groupId == 0 && nodeId == 0)) - { - ChipLogError(Zcl, "Binding: Invalid request"); - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_MALFORMED_COMMAND); - return true; - } - if (groupId) + switch (path.mAttributeId) { - bindingEntry = EmberBindingTableEntry::ForGroup(fabricIndex, groupId, localEndpoint, clusterId); + case Binding::Attributes::Binding::Id: + return ReadBindingTable(path.mEndpointId, encoder); + default: + break; } - else + return CHIP_NO_ERROR; +} + +CHIP_ERROR BindingTableAccess::ReadBindingTable(EndpointId endpoint, AttributeValueEncoder & encoder) +{ + return encoder.EncodeList([&](const auto & subEncoder) { + for (const EmberBindingTableEntry & entry : BindingTable::GetInstance()) + { + if (entry.type == EMBER_UNICAST_BINDING) + { + Binding::Structs::TargetStruct::Type value = { + .fabricIndex = entry.fabricIndex, + .node = MakeOptional(entry.nodeId), + .group = NullOptional, + .endpoint = MakeOptional(entry.remote), + .cluster = entry.clusterId, + }; + ReturnErrorOnFailure(subEncoder.Encode(value)); + } + else if (entry.type == EMBER_MULTICAST_BINDING) + { + Binding::Structs::TargetStruct::Type value = { + .fabricIndex = entry.fabricIndex, + .node = NullOptional, + .group = MakeOptional(entry.groupId), + .endpoint = NullOptional, + .cluster = entry.clusterId, + }; + ReturnErrorOnFailure(subEncoder.Encode(value)); + } + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR BindingTableAccess::Write(const ConcreteDataAttributePath & path, AttributeValueDecoder & decoder) +{ + switch (path.mAttributeId) { - bindingEntry = EmberBindingTableEntry::ForNode(fabricIndex, nodeId, localEndpoint, remoteEndpoint, clusterId); + case Binding::Attributes::Binding::Id: + return WriteBindingTable(path, decoder); + default: + break; } + return CHIP_NO_ERROR; +} - uint8_t bindingIndex; - if (getBindingIndex(bindingEntry, &bindingIndex) != EMBER_SUCCESS) +CHIP_ERROR BindingTableAccess::WriteBindingTable(const ConcreteDataAttributePath & path, AttributeValueDecoder & decoder) +{ + FabricIndex accessingFabricIndex = decoder.AccessingFabricIndex(); + if (!path.IsListOperation() || path.mListOp == ConcreteDataAttributePath::ListOperation::ReplaceAll) { - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_NOT_FOUND); - return true; - } + DecodableBindingListType newBindingList; - CHIP_ERROR err = BindingManager::GetInstance().UnicastBindingRemoved(bindingIndex); - if (err != CHIP_NO_ERROR) + ReturnErrorOnFailure(decoder.Decode(newBindingList)); + ReturnErrorOnFailure(CheckValidBindingList(newBindingList, accessingFabricIndex)); + + // Clear all entries for the current accessing fabric + auto bindingTableIter = BindingTable::GetInstance().begin(); + while (bindingTableIter != BindingTable::GetInstance().end()) + { + if (bindingTableIter->fabricIndex == accessingFabricIndex) + { + if (bindingTableIter->type == EMBER_UNICAST_BINDING) + { + BindingManager::GetInstance().UnicastBindingRemoved(bindingTableIter.GetIndex()); + } + bindingTableIter = BindingTable::GetInstance().RemoveAt(bindingTableIter); + } + else + { + ++bindingTableIter; + } + } + + // Add new entries + auto iter = newBindingList.begin(); + while (iter.Next()) + { + AddBindingEntry(iter.GetValue(), path.mEndpointId); + } + return CHIP_NO_ERROR; + } + else if (path.mListOp == ConcreteDataAttributePath::ListOperation::AppendItem) { - ChipLogError(Zcl, "Binding: Failed to remove pending notification for unicast binding" ChipLogFormatX64 ": %s", - ChipLogValueX64(nodeId), err.AsString()); + TargetStructType target; + ReturnErrorOnFailure(decoder.Decode(target)); + if (!IsValidBinding(target)) + { + return CHIP_IM_GLOBAL_STATUS(ConstraintError); + } + AddBindingEntry(target, path.mEndpointId); + return CHIP_NO_ERROR; } - - emberDeleteBinding(bindingIndex); - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); - return true; + return CHIP_IM_GLOBAL_STATUS(UnsupportedWrite); } +} // namespace -void MatterBindingPluginServerInitCallback() {} +void MatterBindingPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gAttrAccess); +} diff --git a/src/app/clusters/ias-zone-server/ias-zone-server.cpp b/src/app/clusters/ias-zone-server/ias-zone-server.cpp index 70dfa889d56bee..00ffa3a5719399 100644 --- a/src/app/clusters/ias-zone-server/ias-zone-server.cpp +++ b/src/app/clusters/ias-zone-server/ias-zone-server.cpp @@ -226,7 +226,6 @@ MatterIasZoneClusterServerPreAttributeChangedCallback(const app::ConcreteAttribu uint8_t i; bool zeroAddress; EmberBindingTableEntry bindingEntry; - EmberBindingTableEntry currentBind; NodeId destNodeId; EndpointId endpoint = attributePath.mEndpointId; uint8_t ieeeAddress[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -249,38 +248,30 @@ MatterIasZoneClusterServerPreAttributeChangedCallback(const app::ConcreteAttribu // currently existing in the field. bindingEntry.type = EMBER_UNICAST_BINDING; bindingEntry.local = endpoint; - bindingEntry.clusterId = ZCL_IAS_ZONE_CLUSTER_ID; + bindingEntry.clusterId = MakeOptional(ZCL_IAS_ZONE_CLUSTER_ID); bindingEntry.remote = emberAfCurrentCommand()->apsFrame->sourceEndpoint; bindingEntry.nodeId = destNodeId; + bool foundSameEntry = false; // Cycle through the binding table until we find a valid entry that is not // being used, then use the created entry to make the bind. - for (i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + for (const auto & currentBind : BindingTable::GetInstance()) { - if (emberGetBinding(i, ¤tBind) != EMBER_SUCCESS) + // If the binding table entry created based on the response already exists + // do nothing. + if ((currentBind.local == bindingEntry.local) && (currentBind.clusterId == bindingEntry.clusterId) && + (currentBind.remote == bindingEntry.remote) && (currentBind.type == bindingEntry.type)) { - // break out of the loop to ensure that an error message still prints - break; - } - if (currentBind.type != EMBER_UNUSED_BINDING) - { - // If the binding table entry created based on the response already exists - // do nothing. - if ((currentBind.local == bindingEntry.local) && (currentBind.clusterId == bindingEntry.clusterId) && - (currentBind.remote == bindingEntry.remote) && (currentBind.type == bindingEntry.type)) - { - break; - } - // If this spot in the binding table already exists, move on to the next - continue; - } - else - { - emberSetBinding(i, &bindingEntry); + foundSameEntry = true; break; } } + if (!foundSameEntry) + { + BindingTable::GetInstance().Add(bindingEntry); + } + zeroAddress = true; emberAfReadServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID, (uint8_t *) ieeeAddress, 8); for (i = 0; i < 8; i++) diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index a365d8a109264b..b0fba14df582a9 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -38,6 +38,20 @@ static_library("helpers") { ] } +source_set("binding-test-srcs") { + sources = [ + "${chip_root}/src/app/clusters/bindings/PendingNotificationMap.cpp", + "${chip_root}/src/app/clusters/bindings/PendingNotificationMap.h", + "${chip_root}/src/app/util/binding-table.cpp", + "${chip_root}/src/app/util/binding-table.h", + ] + + public_deps = [ + "${chip_root}/src/app/util/mock:mock_ember", + "${chip_root}/src/lib/core", + ] +} + chip_test_suite("tests") { output_name = "libAppTests" @@ -45,6 +59,7 @@ chip_test_suite("tests") { "TestAttributePathExpandIterator.cpp", "TestAttributeValueDecoder.cpp", "TestAttributeValueEncoder.cpp", + "TestBindingTable.cpp", "TestBuilderParser.cpp", "TestClusterInfo.cpp", "TestCommandInteraction.cpp", @@ -55,6 +70,7 @@ chip_test_suite("tests") { "TestInteractionModelEngine.cpp", "TestMessageDef.cpp", "TestNumericAttributeTraits.cpp", + "TestPendingNotificationMap.cpp", "TestReadInteraction.cpp", "TestReportingEngine.cpp", "TestStatusIB.cpp", @@ -75,6 +91,7 @@ chip_test_suite("tests") { cflags = [ "-Wconversion" ] public_deps = [ + ":binding-test-srcs", "${chip_root}/src/app", "${chip_root}/src/app/common:cluster-objects", "${chip_root}/src/app/tests:helpers", diff --git a/src/app/tests/TestBindingTable.cpp b/src/app/tests/TestBindingTable.cpp new file mode 100644 index 00000000000000..5a72d4e1213a97 --- /dev/null +++ b/src/app/tests/TestBindingTable.cpp @@ -0,0 +1,122 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +using chip::BindingTable; +using chip::NullOptional; + +namespace { + +void TestEmptyBindingTable(nlTestSuite * aSuite, void * aContext) +{ + BindingTable table; + NL_TEST_ASSERT(aSuite, table.Size() == 0); + NL_TEST_ASSERT(aSuite, table.begin() == table.end()); +} + +void TestAdd(nlTestSuite * aSuite, void * aContext) +{ + BindingTable table; + + EmberBindingTableEntry unusedEntry; + unusedEntry.type = EMBER_UNUSED_BINDING; + NL_TEST_ASSERT(aSuite, table.Add(unusedEntry) == CHIP_ERROR_INVALID_ARGUMENT); + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + { + NL_TEST_ASSERT(aSuite, table.Add(EmberBindingTableEntry::ForNode(0, i, 0, 0, NullOptional)) == CHIP_NO_ERROR); + } + NL_TEST_ASSERT(aSuite, table.Add(EmberBindingTableEntry::ForNode(0, 0, 0, 0, NullOptional)) == CHIP_ERROR_NO_MEMORY); + NL_TEST_ASSERT(aSuite, table.Size() == EMBER_BINDING_TABLE_SIZE); + + auto iter = table.begin(); + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + { + NL_TEST_ASSERT(aSuite, iter != table.end()); + NL_TEST_ASSERT(aSuite, iter->nodeId == i); + NL_TEST_ASSERT(aSuite, iter.GetIndex() == i); + ++iter; + } + NL_TEST_ASSERT(aSuite, iter == table.end()); +} + +void TestRemoveThenAdd(nlTestSuite * aSuite, void * aContext) +{ + BindingTable table; + NL_TEST_ASSERT(aSuite, table.Add(EmberBindingTableEntry::ForNode(0, 0, 0, 0, NullOptional)) == CHIP_NO_ERROR); + auto iter = table.begin(); + NL_TEST_ASSERT(aSuite, table.RemoveAt(iter) == table.end()); + NL_TEST_ASSERT(aSuite, table.Size() == 0); + NL_TEST_ASSERT(aSuite, table.begin() == table.end()); + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + { + NL_TEST_ASSERT(aSuite, table.Add(EmberBindingTableEntry::ForNode(0, i, 0, 0, NullOptional)) == CHIP_NO_ERROR); + } + iter = table.begin(); + ++iter; + iter = table.RemoveAt(iter); + NL_TEST_ASSERT(aSuite, table.Size() == EMBER_BINDING_TABLE_SIZE - 1); + NL_TEST_ASSERT(aSuite, iter->nodeId == 2); + NL_TEST_ASSERT(aSuite, iter.GetIndex() == 2); + auto iterCheck = table.begin(); + ++iterCheck; + NL_TEST_ASSERT(aSuite, iter == iterCheck); + + NL_TEST_ASSERT(aSuite, table.Add(EmberBindingTableEntry::ForNode(0, 1, 0, 0, NullOptional)) == CHIP_NO_ERROR); + NL_TEST_ASSERT(aSuite, table.Size() == EMBER_BINDING_TABLE_SIZE); + iter = table.begin(); + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE - 1; i++) + { + ++iter; + } + NL_TEST_ASSERT(aSuite, iter->nodeId == 1); + NL_TEST_ASSERT(aSuite, iter.GetIndex() == 1); + ++iter; + NL_TEST_ASSERT(aSuite, iter == table.end()); + iter = table.begin(); + iter = table.RemoveAt(iter); + NL_TEST_ASSERT(aSuite, table.Size() == EMBER_BINDING_TABLE_SIZE - 1); + NL_TEST_ASSERT(aSuite, iter == table.begin()); + NL_TEST_ASSERT(aSuite, iter.GetIndex() == 2); + NL_TEST_ASSERT(aSuite, iter->nodeId == 2); + NL_TEST_ASSERT(aSuite, table.GetAt(0).type == EMBER_UNUSED_BINDING); +} + +} // namespace + +int TestBindingTable() +{ + static nlTest sTests[] = { + NL_TEST_DEF("TestEmptyBindingTable", TestEmptyBindingTable), + NL_TEST_DEF("TestAdd", TestAdd), + NL_TEST_DEF("TestRemoveThenAdd", TestRemoveThenAdd), + NL_TEST_SENTINEL(), + }; + + nlTestSuite theSuite = { + "BindingTable", + &sTests[0], + nullptr, + nullptr, + }; + nlTestRunner(&theSuite, nullptr); + return (nlTestRunnerStats(&theSuite)); +} + +CHIP_REGISTER_TEST_SUITE(TestBindingTable) diff --git a/src/app/tests/TestPendingNotificationMap.cpp b/src/app/tests/TestPendingNotificationMap.cpp new file mode 100644 index 00000000000000..7a5b730502e622 --- /dev/null +++ b/src/app/tests/TestPendingNotificationMap.cpp @@ -0,0 +1,147 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +using chip::BindingTable; +using chip::ClusterId; +using chip::FabricIndex; +using chip::MakeOptional; +using chip::NodeId; +using chip::NullOptional; +using chip::PendingNotificationEntry; +using chip::PendingNotificationMap; + +namespace { + +void ClearBindingTable(BindingTable & table) +{ + auto iter = table.begin(); + while (iter != table.end()) + { + iter = table.RemoveAt(iter); + } +} + +void CreateDefaultFullBindingTable(BindingTable & table) +{ + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + { + table.Add(EmberBindingTableEntry::ForNode(i / 10, i % 5, 0, 0, MakeOptional(i))); + } +} + +void TestEmptyMap(nlTestSuite * aSuite, void * aContext) +{ + PendingNotificationMap pendingMap; + NL_TEST_ASSERT(aSuite, pendingMap.begin() == pendingMap.end()); + FabricIndex fabricIndex; + NodeId node; + NL_TEST_ASSERT(aSuite, pendingMap.FindLRUConnectPeer(&fabricIndex, &node) == CHIP_ERROR_NOT_FOUND); +} + +void TestAddRemove(nlTestSuite * aSuite, void * aContext) +{ + PendingNotificationMap pendingMap; + ClearBindingTable(BindingTable::GetInstance()); + CreateDefaultFullBindingTable(BindingTable::GetInstance()); + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + { + pendingMap.AddPendingNotification(i, nullptr); + } + auto iter = pendingMap.begin(); + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + { + PendingNotificationEntry entry = *iter; + NL_TEST_ASSERT(aSuite, entry.mBindingEntryId == i); + ++iter; + } + NL_TEST_ASSERT(aSuite, iter == pendingMap.end()); + pendingMap.RemoveAllEntriesForNode(0, 0); + uint8_t expectedEntryIndecies[] = { 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; + iter = pendingMap.begin(); + for (uint8_t i = 0; i < sizeof(expectedEntryIndecies); i++) + { + PendingNotificationEntry entry = *iter; + NL_TEST_ASSERT(aSuite, entry.mBindingEntryId == expectedEntryIndecies[i]); + ++iter; + } + NL_TEST_ASSERT(aSuite, iter == pendingMap.end()); + pendingMap.RemoveAllEntriesForFabric(0); + iter = pendingMap.begin(); + for (uint8_t i = 0; i < 10; i++) + { + PendingNotificationEntry entry = *iter; + NL_TEST_ASSERT(aSuite, entry.mBindingEntryId == 10 + i); + ++iter; + } + NL_TEST_ASSERT(aSuite, iter == pendingMap.end()); + pendingMap.RemoveAllEntriesForFabric(1); + NL_TEST_ASSERT(aSuite, pendingMap.begin() == pendingMap.end()); +} + +void TestLRUEntry(nlTestSuite * aSuite, void * aContext) +{ + PendingNotificationMap pendingMap; + ClearBindingTable(BindingTable::GetInstance()); + CreateDefaultFullBindingTable(BindingTable::GetInstance()); + pendingMap.AddPendingNotification(0, nullptr); + pendingMap.AddPendingNotification(1, nullptr); + pendingMap.AddPendingNotification(5, nullptr); + pendingMap.AddPendingNotification(7, nullptr); + pendingMap.AddPendingNotification(11, nullptr); + + FabricIndex fabricIndex; + NodeId node; + + NL_TEST_ASSERT(aSuite, pendingMap.FindLRUConnectPeer(&fabricIndex, &node) == CHIP_NO_ERROR); + NL_TEST_ASSERT(aSuite, fabricIndex == 0 && node == 1); + + pendingMap.RemoveEntry(1); + NL_TEST_ASSERT(aSuite, pendingMap.FindLRUConnectPeer(&fabricIndex, &node) == CHIP_NO_ERROR); + NL_TEST_ASSERT(aSuite, fabricIndex == 0 && node == 0); + + pendingMap.RemoveAllEntriesForFabric(0); + NL_TEST_ASSERT(aSuite, pendingMap.FindLRUConnectPeer(&fabricIndex, &node) == CHIP_NO_ERROR); + NL_TEST_ASSERT(aSuite, fabricIndex == 1 && node == 1); +} + +} // namespace + +int TestPeindingNotificationMap() +{ + static nlTest sTests[] = { + NL_TEST_DEF("TestEmptyMap", TestEmptyMap), + NL_TEST_DEF("TestAddRemove", TestAddRemove), + NL_TEST_DEF("TestLRUEntry", TestLRUEntry), + NL_TEST_SENTINEL(), + }; + + nlTestSuite theSuite = { + "PendingNotificationMap", + &sTests[0], + nullptr, + nullptr, + }; + nlTestRunner(&theSuite, nullptr); + return (nlTestRunnerStats(&theSuite)); +} + +CHIP_REGISTER_TEST_SUITE(TestPeindingNotificationMap) diff --git a/src/app/tests/suites/TestBinding.yaml b/src/app/tests/suites/TestBinding.yaml new file mode 100644 index 00000000000000..992640b1c1581d --- /dev/null +++ b/src/app/tests/suites/TestBinding.yaml @@ -0,0 +1,81 @@ +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Binding Tests + +config: + nodeId: 0x12344321 + cluster: "Binding" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Write empty binding table" + command: "writeAttribute" + attribute: "binding" + arguments: + value: [] + + - label: "Read empty binding table" + command: "readAttribute" + attribute: "binding" + response: + value: [] + + - label: "Write invalid binding table" + command: "writeAttribute" + attribute: "binding" + arguments: + value: + [ + { FabricIndex: 0 }, + { + FabricIndex: 0, + Node: 1, + Group: 1, + Endpoint: 1, + Cluster: 6, + }, + ] + response: + error: CONSTRAINT_ERROR + + - label: "Write binding table" + command: "writeAttribute" + attribute: "binding" + arguments: + value: + [ + { FabricIndex: 0, Group: 1 }, + { FabricIndex: 0, Node: 1, Endpoint: 1, Cluster: 6 }, + { FabricIndex: 0, Node: 2, Endpoint: 1 }, + ] + + - label: "Read binding table" + command: "readAttribute" + attribute: "binding" + response: + value: + [ + { FabricIndex: 1, Group: 1 }, + { FabricIndex: 1, Node: 1, Endpoint: 1, Cluster: 6 }, + { FabricIndex: 1, Node: 2, Endpoint: 1 }, + ] diff --git a/src/app/util/binding-table.cpp b/src/app/util/binding-table.cpp index 82ba401c3dd9c8..1b3bf4a2000142 100644 --- a/src/app/util/binding-table.cpp +++ b/src/app/util/binding-table.cpp @@ -20,39 +20,110 @@ */ #include -#include -static EmberBindingTableEntry bindingTable[EMBER_BINDING_TABLE_SIZE]; +namespace chip { -EmberStatus emberGetBinding(uint8_t index, EmberBindingTableEntry * result) +BindingTable BindingTable::sInstance; + +BindingTable::BindingTable() +{ + memset(mNextIndex, EMBER_BINDING_TABLE_SIZE, sizeof(mNextIndex)); +} + +CHIP_ERROR BindingTable::Add(const EmberBindingTableEntry & entry) { - if (index >= EMBER_BINDING_TABLE_SIZE) + if (entry.type == EMBER_UNUSED_BINDING) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + uint8_t newIndex = GetNextAvaiableIndex(); + if (newIndex >= EMBER_BINDING_TABLE_SIZE) + { + return CHIP_ERROR_NO_MEMORY; + } + mBindingTable[newIndex] = entry; + if (mTail == EMBER_BINDING_TABLE_SIZE) + { + mTail = newIndex; + mHead = newIndex; + } + else { - return EMBER_BAD_ARGUMENT; + mNextIndex[mTail] = newIndex; + mTail = newIndex; } + mSize++; + return CHIP_NO_ERROR; +} - *result = bindingTable[index]; - return EMBER_SUCCESS; +const EmberBindingTableEntry & BindingTable::GetAt(uint8_t index) +{ + return mBindingTable[index]; } -EmberStatus emberSetBinding(uint8_t index, EmberBindingTableEntry * result) +BindingTable::Iterator BindingTable::RemoveAt(Iterator iter) { - if (index >= EMBER_BINDING_TABLE_SIZE) + if (iter.mTable != this || iter.mIndex == EMBER_BINDING_TABLE_SIZE) + { + return iter; + } + if (iter.mIndex == mTail) { - return EMBER_BAD_ARGUMENT; + mTail = iter.mPrevIndex; } + uint8_t next = mNextIndex[iter.mIndex]; + if (iter.mIndex != mHead) + { + mNextIndex[iter.mPrevIndex] = next; + } + else + { + mHead = next; + } + mBindingTable[iter.mIndex].type = EMBER_UNUSED_BINDING; + mNextIndex[iter.mIndex] = EMBER_BINDING_TABLE_SIZE; + mSize--; + iter.mIndex = next; + return iter; +} + +BindingTable::Iterator BindingTable::begin() +{ + Iterator iter; + iter.mTable = this; + iter.mPrevIndex = EMBER_BINDING_TABLE_SIZE; + iter.mIndex = mHead; + return iter; +} - bindingTable[index] = *result; - return EMBER_SUCCESS; +BindingTable::Iterator BindingTable::end() +{ + Iterator iter; + iter.mTable = this; + iter.mIndex = EMBER_BINDING_TABLE_SIZE; + return iter; } -EmberStatus emberDeleteBinding(uint8_t index) +uint8_t BindingTable::GetNextAvaiableIndex() { - if (index >= EMBER_BINDING_TABLE_SIZE) + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) { - return EMBER_BAD_ARGUMENT; + if (mBindingTable[i].type == EMBER_UNUSED_BINDING) + { + return i; + } } + return EMBER_BINDING_TABLE_SIZE; +} - bindingTable[index].type = EMBER_UNUSED_BINDING; - return EMBER_SUCCESS; +BindingTable::Iterator BindingTable::Iterator::operator++() +{ + if (mIndex != EMBER_BINDING_TABLE_SIZE) + { + mPrevIndex = mIndex; + mIndex = mTable->mNextIndex[mIndex]; + } + return *this; } + +} // namespace chip diff --git a/src/app/util/binding-table.h b/src/app/util/binding-table.h index 6b0abe2f957f34..948711d51b86da 100644 --- a/src/app/util/binding-table.h +++ b/src/app/util/binding-table.h @@ -23,8 +23,71 @@ #include -EmberStatus emberGetBinding(uint8_t index, EmberBindingTableEntry * result); +namespace chip { -EmberStatus emberSetBinding(uint8_t index, EmberBindingTableEntry * result); +class BindingTable +{ + friend class Iterator; -EmberStatus emberDeleteBinding(uint8_t index); +public: + BindingTable(); + + class Iterator + { + friend class BindingTable; + + public: + EmberBindingTableEntry & operator*() { return mTable->mBindingTable[mIndex]; } + + const EmberBindingTableEntry & operator*() const { return mTable->mBindingTable[mIndex]; } + + EmberBindingTableEntry * operator->() { return &(mTable->mBindingTable[mIndex]); } + + const EmberBindingTableEntry * operator->() const { return &(mTable->mBindingTable[mIndex]); } + + Iterator operator++(); + + bool operator==(const Iterator & rhs) { return mIndex == rhs.mIndex; } + + bool operator!=(const Iterator & rhs) { return mIndex != rhs.mIndex; } + + uint8_t GetIndex() { return mIndex; } + + private: + BindingTable * mTable; + uint8_t mPrevIndex; + uint8_t mIndex; + }; + + CHIP_ERROR Add(const EmberBindingTableEntry & entry); + + const EmberBindingTableEntry & GetAt(uint8_t index); + + // The RemoveAt function shares the same sematics as the std::list::remove. + // It returns the next iterator after removal and the old iterator is no loger valid. + Iterator RemoveAt(Iterator iter); + + // Returns the number of active entries in the binding table. + // *NOTE* The function does not return the capacity of the binding table. + uint8_t Size() { return mSize; } + + Iterator begin(); + + Iterator end(); + + static BindingTable & GetInstance() { return sInstance; } + +private: + static BindingTable sInstance; + + uint8_t GetNextAvaiableIndex(); + + EmberBindingTableEntry mBindingTable[EMBER_BINDING_TABLE_SIZE]; + uint8_t mNextIndex[EMBER_BINDING_TABLE_SIZE]; + + uint8_t mHead = EMBER_BINDING_TABLE_SIZE; + uint8_t mTail = EMBER_BINDING_TABLE_SIZE; + uint8_t mSize = 0; +}; + +} // namespace chip diff --git a/src/app/util/mock/BUILD.gn b/src/app/util/mock/BUILD.gn index 4ffcbf1c85034d..7d90c19512049a 100644 --- a/src/app/util/mock/BUILD.gn +++ b/src/app/util/mock/BUILD.gn @@ -14,6 +14,10 @@ import("//build_overrides/chip.gni") +config("mock_include") { + include_dirs = [ "include" ] +} + source_set("mock_ember") { sources = [ "attribute-storage.cpp" ] @@ -23,5 +27,7 @@ source_set("mock_ember") { "${chip_root}/src/lib/support", ] + public_configs = [ ":mock_include" ] + cflags = [ "-Wconversion" ] } diff --git a/src/app/util/mock/include/zap-generated/endpoint_config.h b/src/app/util/mock/include/zap-generated/endpoint_config.h new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/src/app/util/mock/include/zap-generated/gen_config.h b/src/app/util/mock/include/zap-generated/gen_config.h new file mode 100644 index 00000000000000..08d2d851b6b93d --- /dev/null +++ b/src/app/util/mock/include/zap-generated/gen_config.h @@ -0,0 +1,20 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#define EMBER_BINDING_TABLE_SIZE 20 diff --git a/src/app/util/types_stub.h b/src/app/util/types_stub.h index 4b32f4bf82f373..ca381d3f0fbfd5 100644 --- a/src/app/util/types_stub.h +++ b/src/app/util/types_stub.h @@ -46,6 +46,7 @@ #include // For EmberApsFrame #include +#include #include static_assert(sizeof(chip::NodeId) == sizeof(uint64_t), "Unexpected node if size"); @@ -498,7 +499,7 @@ struct EmberBindingTableEntry EmberBindingTableEntry() = default; static EmberBindingTableEntry ForNode(chip::FabricIndex fabric, chip::NodeId node, chip::EndpointId localEndpoint, - chip::EndpointId remoteEndpoint, chip::ClusterId cluster) + chip::EndpointId remoteEndpoint, chip::Optional cluster) { EmberBindingTableEntry entry = { .type = EMBER_UNICAST_BINDING, @@ -512,7 +513,7 @@ struct EmberBindingTableEntry } static EmberBindingTableEntry ForGroup(chip::FabricIndex fabric, chip::GroupId group, chip::EndpointId localEndpoint, - chip::ClusterId cluster) + chip::Optional cluster) { EmberBindingTableEntry entry = { .type = EMBER_MULTICAST_BINDING, @@ -526,7 +527,7 @@ struct EmberBindingTableEntry } /** The type of binding. */ - EmberBindingType type; + EmberBindingType type = EMBER_UNUSED_BINDING; chip::FabricIndex fabricIndex; /** The endpoint on the local node. */ @@ -538,7 +539,7 @@ struct EmberBindingTableEntry * that a binding can be used to to send messages with any cluster ID, not * just that listed in the binding. */ - chip::ClusterId clusterId; + chip::Optional clusterId; /** The endpoint on the remote node (specified by \c identifier). */ chip::EndpointId remote; /** A 64-bit destination identifier. This is either: diff --git a/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml index b7023d15ceb2b4..ede4f797947dec 100644 --- a/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml @@ -16,27 +16,23 @@ limitations under the License. --> + + + + + + + + + + General Binding 0x001e BINDING_CLUSTER - true - true The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. - - Add a binding - - - - - - - Remove a binding - - - - - + Binding - \ No newline at end of file + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 4d72fca838dbb3..40fc23aae4688d 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -320,27 +320,19 @@ client cluster BinaryInputBasic = 15 { } client cluster Binding = 30 { + struct TargetStruct { + FABRIC_IDX fabricIndex = 0; + optional NODE_ID node = 1; + optional GROUP_ID group = 2; + optional ENDPOINT_NO endpoint = 3; + optional CLUSTER_ID cluster = 4; + } + + attribute TargetStruct binding[] = 0; readonly global attribute command_id serverGeneratedCommandList[] = 65528; readonly global attribute command_id clientGeneratedCommandList[] = 65529; readonly global attribute attrib_id attributeList[] = 65531; readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; } client cluster BooleanState = 69 { diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 06ac8d9db737d7..e475e0503939b9 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1935,24 +1935,6 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 1, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], "attributes": [ { "name": "ClusterRevision", @@ -1980,6 +1962,21 @@ "enabled": 0, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ServerGeneratedCommandList", "code": 65528, @@ -17933,4 +17930,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index af52c8e4009a2a..503557a934fc15 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -1835,6 +1835,104 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR using namespace app::Clusters::Binding; switch (aPath.mAttributeId) { + case Attributes::Binding::Id: { + using TypeInfo = Attributes::Binding::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + jobject newElement_0_node; + if (!entry_0.node.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_node); + } + else + { + std::string newElement_0_nodeClassName = "java/lang/Long"; + std::string newElement_0_nodeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_nodeClassName.c_str(), + newElement_0_nodeCtorSignature.c_str(), + entry_0.node.Value(), newElement_0_node); + } + jobject newElement_0_group; + if (!entry_0.group.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_group); + } + else + { + std::string newElement_0_groupClassName = "java/lang/Integer"; + std::string newElement_0_groupCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupClassName.c_str(), + newElement_0_groupCtorSignature.c_str(), + entry_0.group.Value(), newElement_0_group); + } + jobject newElement_0_endpoint; + if (!entry_0.endpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_endpoint); + } + else + { + std::string newElement_0_endpointClassName = "java/lang/Integer"; + std::string newElement_0_endpointCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_endpointClassName.c_str(), + newElement_0_endpointCtorSignature.c_str(), + entry_0.endpoint.Value(), newElement_0_endpoint); + } + jobject newElement_0_cluster; + if (!entry_0.cluster.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_cluster); + } + else + { + std::string newElement_0_clusterClassName = "java/lang/Long"; + std::string newElement_0_clusterCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_clusterClassName.c_str(), + newElement_0_clusterCtorSignature.c_str(), + entry_0.cluster.Value(), newElement_0_cluster); + } + + jclass targetStructStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$BindingClusterTargetStruct", targetStructStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BindingClusterTargetStruct"); + return nullptr; + } + jmethodID targetStructStructCtor = env->GetMethodID( + targetStructStructClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (targetStructStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BindingClusterTargetStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(targetStructStructClass, targetStructStructCtor, newElement_0_fabricIndex, + newElement_0_node, newElement_0_group, newElement_0_endpoint, newElement_0_cluster); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } case Attributes::ServerGeneratedCommandList::Id: { using TypeInfo = Attributes::ServerGeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 06d60851de9a67..f5e5331691dd8d 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -196,6 +196,8 @@ typedef void (*CHIPBinaryInputBasicClusterAttributeListAttributeCallbackType)( typedef void (*CHIPBinaryInputBasicClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::BinaryInputBasic::Attributes::ClusterRevision::TypeInfo::DecodableArgType); +typedef void (*CHIPBindingClusterBindingAttributeCallbackType)( + void *, const chip::app::Clusters::Binding::Attributes::Binding::TypeInfo::DecodableType &); typedef void (*CHIPBindingClusterServerGeneratedCommandListAttributeCallbackType)( void *, const chip::app::Clusters::Binding::Attributes::ServerGeneratedCommandList::TypeInfo::DecodableType &); typedef void (*CHIPBindingClusterClientGeneratedCommandListAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 3c8d0f12261b35..9a72f7c7638fe6 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -582,6 +582,127 @@ JNI_METHOD(void, BinaryInputBasicCluster, writePresentValueAttribute) onFailure.release(); } +JNI_METHOD(void, BindingCluster, writeBindingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Binding::Attributes::Binding::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + jint valueSize; + chip::JniReferences::GetInstance().GetListSize(value, valueSize); + if (valueSize != 0) + { + auto * listHolder_0 = new ListHolder(valueSize); + listFreer.add(listHolder_0); + + for (size_t i_0 = 0; i_0 < static_cast(valueSize); ++i_0) + { + jobject element_0; + chip::JniReferences::GetInstance().GetListItem(value, i_0, element_0); + jobject element_0_fabricIndexItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "fabricIndex", "Ljava/lang/Integer;", + element_0_fabricIndexItem_1); + listHolder_0->mList[i_0].fabricIndex = + static_castmList[i_0].fabricIndex)>>( + chip::JniReferences::GetInstance().IntegerToPrimitive(element_0_fabricIndexItem_1)); + jobject element_0_nodeItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "node", "Ljava/util/Optional;", element_0_nodeItem_1); + if (element_0_nodeItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_nodeItem_1, optionalValue_2); + auto & definedValue_2 = listHolder_0->mList[i_0].node.Emplace(); + definedValue_2 = static_cast>( + chip::JniReferences::GetInstance().LongToPrimitive(optionalValue_2)); + } + jobject element_0_groupItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "group", "Ljava/util/Optional;", + element_0_groupItem_1); + if (element_0_groupItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_groupItem_1, optionalValue_2); + auto & definedValue_2 = listHolder_0->mList[i_0].group.Emplace(); + definedValue_2 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_2)); + } + jobject element_0_endpointItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "endpoint", "Ljava/util/Optional;", + element_0_endpointItem_1); + if (element_0_endpointItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_endpointItem_1, optionalValue_2); + auto & definedValue_2 = listHolder_0->mList[i_0].endpoint.Emplace(); + definedValue_2 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_2)); + } + jobject element_0_clusterItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "cluster", "Ljava/util/Optional;", + element_0_clusterItem_1); + if (element_0_clusterItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_clusterItem_1, optionalValue_2); + auto & definedValue_2 = listHolder_0->mList[i_0].cluster.Emplace(); + definedValue_2 = static_cast>( + chip::JniReferences::GetInstance().LongToPrimitive(optionalValue_2)); + } + } + cppValue = ListType_0(listHolder_0->mList, valueSize); + } + else + { + cppValue = ListType_0(); + } + } + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + BindingCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, BridgedDeviceBasicCluster, writeNodeLabelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 644dbdc20e57fb..f3b617c9b23161 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -3243,6 +3243,150 @@ void CHIPBinaryInputBasicAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPBindingBindingAttributeCallback::CHIPBindingBindingAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPBindingBindingAttributeCallback::~CHIPBindingBindingAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBindingBindingAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + jobject newElement_0_node; + if (!entry_0.node.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_node); + } + else + { + std::string newElement_0_nodeClassName = "java/lang/Long"; + std::string newElement_0_nodeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_nodeClassName.c_str(), + newElement_0_nodeCtorSignature.c_str(), + entry_0.node.Value(), newElement_0_node); + } + jobject newElement_0_group; + if (!entry_0.group.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_group); + } + else + { + std::string newElement_0_groupClassName = "java/lang/Integer"; + std::string newElement_0_groupCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupClassName.c_str(), + newElement_0_groupCtorSignature.c_str(), + entry_0.group.Value(), newElement_0_group); + } + jobject newElement_0_endpoint; + if (!entry_0.endpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_endpoint); + } + else + { + std::string newElement_0_endpointClassName = "java/lang/Integer"; + std::string newElement_0_endpointCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_endpointClassName.c_str(), + newElement_0_endpointCtorSignature.c_str(), + entry_0.endpoint.Value(), newElement_0_endpoint); + } + jobject newElement_0_cluster; + if (!entry_0.cluster.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_cluster); + } + else + { + std::string newElement_0_clusterClassName = "java/lang/Long"; + std::string newElement_0_clusterCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_clusterClassName.c_str(), + newElement_0_clusterCtorSignature.c_str(), + entry_0.cluster.Value(), newElement_0_cluster); + } + + jclass targetStructStructClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$BindingClusterTargetStruct", + targetStructStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BindingClusterTargetStruct"); + return; + } + jmethodID targetStructStructCtor = env->GetMethodID( + targetStructStructClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (targetStructStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BindingClusterTargetStruct constructor"); + return; + } + + newElement_0 = env->NewObject(targetStructStructClass, targetStructStructCtor, newElement_0_fabricIndex, newElement_0_node, + newElement_0_group, newElement_0_endpoint, newElement_0_cluster); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPBindingServerGeneratedCommandListAttributeCallback::CHIPBindingServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index a57a82229707aa..91a6483049aac6 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -1416,6 +1416,37 @@ class CHIPBinaryInputBasicAttributeListAttributeCallback bool keepAlive; }; +class CHIPBindingBindingAttributeCallback : public chip::Callback::Callback +{ +public: + CHIPBindingBindingAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBindingBindingAttributeCallback(); + + static void maybeDestroy(CHIPBindingBindingAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPBindingServerGeneratedCommandListAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 03fc0aed962f3a..915339e22dee42 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -2157,63 +2157,14 @@ public BindingCluster(long devicePtr, int endpointId) { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void bind( - DefaultClusterCallback callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId) { - bind(chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId, null); - } + public interface BindingAttributeCallback { + void onSuccess(List valueList); - public void bind( - DefaultClusterCallback callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId, - int timedInvokeTimeoutMs) { - bind(chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId, timedInvokeTimeoutMs); - } - - public void unbind( - DefaultClusterCallback callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId) { - unbind(chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId, null); - } + void onError(Exception ex); - public void unbind( - DefaultClusterCallback callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId, - int timedInvokeTimeoutMs) { - unbind( - chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId, timedInvokeTimeoutMs); + default void onSubscriptionEstablished() {} } - private native void bind( - long chipClusterPtr, - DefaultClusterCallback Callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId, - @Nullable Integer timedInvokeTimeoutMs); - - private native void unbind( - long chipClusterPtr, - DefaultClusterCallback Callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId, - @Nullable Integer timedInvokeTimeoutMs); - public interface ServerGeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -2238,6 +2189,27 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished() {} } + public void readBindingAttribute(BindingAttributeCallback callback) { + readBindingAttribute(chipClusterPtr, callback); + } + + public void writeBindingAttribute( + DefaultClusterCallback callback, ArrayList value) { + writeBindingAttribute(chipClusterPtr, callback, value, null); + } + + public void writeBindingAttribute( + DefaultClusterCallback callback, + ArrayList value, + int timedWriteTimeoutMs) { + writeBindingAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeBindingAttribute( + BindingAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBindingAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readServerGeneratedCommandListAttribute( ServerGeneratedCommandListAttributeCallback callback) { readServerGeneratedCommandListAttribute(chipClusterPtr, callback); @@ -2278,6 +2250,18 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + private native void readBindingAttribute( + long chipClusterPtr, BindingAttributeCallback callback); + + private native void writeBindingAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + ArrayList value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeBindingAttribute( + long chipClusterPtr, BindingAttributeCallback callback, int minInterval, int maxInterval); + private native void readServerGeneratedCommandListAttribute( long chipClusterPtr, ServerGeneratedCommandListAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index aa8473880b5958..0ccc267a6bf46f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -225,6 +225,50 @@ public String toString() { } } + public static class BindingClusterTargetStruct { + public Integer fabricIndex; + public Optional node; + public Optional group; + public Optional endpoint; + public Optional cluster; + + public BindingClusterTargetStruct( + Integer fabricIndex, + Optional node, + Optional group, + Optional endpoint, + Optional cluster) { + this.fabricIndex = fabricIndex; + this.node = node; + this.group = group; + this.endpoint = endpoint; + this.cluster = cluster; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("BindingClusterTargetStruct {\n"); + output.append("\tfabricIndex: "); + output.append(fabricIndex); + output.append("\n"); + output.append("\tnode: "); + output.append(node); + output.append("\n"); + output.append("\tgroup: "); + output.append(group); + output.append("\n"); + output.append("\tendpoint: "); + output.append(endpoint); + output.append("\n"); + output.append("\tcluster: "); + output.append(cluster); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + public static class BridgedActionsClusterActionStruct { public Integer actionID; public String name; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index a5432c8a24ca8b..677c71e608c04e 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -1052,6 +1052,30 @@ public void onError(Exception ex) { } } + public static class DelegatedBindingClusterBindingAttributeCallback + implements ChipClusters.BindingCluster.BindingAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedBindingClusterServerGeneratedCommandListAttributeCallback implements ChipClusters.BindingCluster.ServerGeneratedCommandListAttributeCallback, DelegatedClusterCallback { @@ -7732,70 +7756,6 @@ public Map> getCommandMap() { Map binaryInputBasicClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("binaryInputBasic", binaryInputBasicClusterInteractionInfoMap); Map bindingClusterInteractionInfoMap = new LinkedHashMap<>(); - Map bindingbindCommandParams = - new LinkedHashMap(); - CommandParameterInfo bindingbindnodeIdCommandParameterInfo = - new CommandParameterInfo("nodeId", Long.class); - bindingbindCommandParams.put("nodeId", bindingbindnodeIdCommandParameterInfo); - - CommandParameterInfo bindingbindgroupIdCommandParameterInfo = - new CommandParameterInfo("groupId", Integer.class); - bindingbindCommandParams.put("groupId", bindingbindgroupIdCommandParameterInfo); - - CommandParameterInfo bindingbindendpointIdCommandParameterInfo = - new CommandParameterInfo("endpointId", Integer.class); - bindingbindCommandParams.put("endpointId", bindingbindendpointIdCommandParameterInfo); - - CommandParameterInfo bindingbindclusterIdCommandParameterInfo = - new CommandParameterInfo("clusterId", Long.class); - bindingbindCommandParams.put("clusterId", bindingbindclusterIdCommandParameterInfo); - - InteractionInfo bindingbindInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BindingCluster) cluster) - .bind( - (DefaultClusterCallback) callback, - (Long) commandArguments.get("nodeId"), - (Integer) commandArguments.get("groupId"), - (Integer) commandArguments.get("endpointId"), - (Long) commandArguments.get("clusterId")); - }, - () -> new DelegatedDefaultClusterCallback(), - bindingbindCommandParams); - bindingClusterInteractionInfoMap.put("bind", bindingbindInteractionInfo); - Map bindingunbindCommandParams = - new LinkedHashMap(); - CommandParameterInfo bindingunbindnodeIdCommandParameterInfo = - new CommandParameterInfo("nodeId", Long.class); - bindingunbindCommandParams.put("nodeId", bindingunbindnodeIdCommandParameterInfo); - - CommandParameterInfo bindingunbindgroupIdCommandParameterInfo = - new CommandParameterInfo("groupId", Integer.class); - bindingunbindCommandParams.put("groupId", bindingunbindgroupIdCommandParameterInfo); - - CommandParameterInfo bindingunbindendpointIdCommandParameterInfo = - new CommandParameterInfo("endpointId", Integer.class); - bindingunbindCommandParams.put("endpointId", bindingunbindendpointIdCommandParameterInfo); - - CommandParameterInfo bindingunbindclusterIdCommandParameterInfo = - new CommandParameterInfo("clusterId", Long.class); - bindingunbindCommandParams.put("clusterId", bindingunbindclusterIdCommandParameterInfo); - - InteractionInfo bindingunbindInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BindingCluster) cluster) - .unbind( - (DefaultClusterCallback) callback, - (Long) commandArguments.get("nodeId"), - (Integer) commandArguments.get("groupId"), - (Integer) commandArguments.get("endpointId"), - (Long) commandArguments.get("clusterId")); - }, - () -> new DelegatedDefaultClusterCallback(), - bindingunbindCommandParams); - bindingClusterInteractionInfoMap.put("unbind", bindingunbindInteractionInfo); commandMap.put("binding", bindingClusterInteractionInfoMap); Map booleanStateClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("booleanState", booleanStateClusterInteractionInfoMap); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index fbe9d46b8a64c3..7aab754270cb32 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -1150,6 +1150,19 @@ public Map> getReadAttributeMap() { readBinaryInputBasicClusterRevisionAttributeInteractionInfo); readAttributeMap.put("binaryInputBasic", readBinaryInputBasicInteractionInfo); Map readBindingInteractionInfo = new LinkedHashMap<>(); + Map readBindingBindingCommandParams = + new LinkedHashMap(); + InteractionInfo readBindingBindingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BindingCluster) cluster) + .readBindingAttribute( + (ChipClusters.BindingCluster.BindingAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBindingClusterBindingAttributeCallback(), + readBindingBindingCommandParams); + readBindingInteractionInfo.put( + "readBindingAttribute", readBindingBindingAttributeInteractionInfo); Map readBindingServerGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readBindingServerGeneratedCommandListAttributeInteractionInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 5ecacb1dfeb239..26ab67ddb3ea87 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -686,28 +686,15 @@ class ChipClusters: "clusterName": "Binding", "clusterId": 0x0000001E, "commands": { - 0x00000000: { - "commandId": 0x00000000, - "commandName": "Bind", - "args": { - "nodeId": "int", - "groupId": "int", - "endpointId": "int", - "clusterId": "int", - }, - }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "Unbind", - "args": { - "nodeId": "int", - "groupId": "int", - "endpointId": "int", - "clusterId": "int", - }, - }, }, "attributes": { + 0x00000000: { + "attributeName": "Binding", + "attributeId": 0x00000000, + "type": "", + "reportable": True, + "writable": True, + }, 0x0000FFF8: { "attributeName": "ServerGeneratedCommandList", "attributeId": 0x0000FFF8, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index db2c02fb873c3a..85c73abc41a6be 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -5542,6 +5542,7 @@ class Binding(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ + ClusterObjectFieldDescriptor(Label="binding", Tag=0x00000000, Type=typing.List[Binding.Structs.TargetStruct]), ClusterObjectFieldDescriptor(Label="serverGeneratedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="clientGeneratedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -5549,6 +5550,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) + binding: 'typing.List[Binding.Structs.TargetStruct]' = None serverGeneratedCommandList: 'typing.List[uint]' = None clientGeneratedCommandList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None @@ -5556,52 +5558,46 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None - - class Commands: + class Structs: @dataclass - class Bind(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x001E - command_id: typing.ClassVar[int] = 0x0000 - is_client: typing.ClassVar[bool] = True - + class TargetStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="nodeId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="groupId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="endpointId", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterId", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="node", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="group", Tag=2, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="endpoint", Tag=3, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="cluster", Tag=4, Type=typing.Optional[uint]), ]) - nodeId: 'uint' = 0 - groupId: 'uint' = 0 - endpointId: 'uint' = 0 - clusterId: 'uint' = 0 + fabricIndex: 'uint' = 0 + node: 'typing.Optional[uint]' = None + group: 'typing.Optional[uint]' = None + endpoint: 'typing.Optional[uint]' = None + cluster: 'typing.Optional[uint]' = None + + + + class Attributes: @dataclass - class Unbind(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x001E - command_id: typing.ClassVar[int] = 0x0001 - is_client: typing.ClassVar[bool] = True + class Binding(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x001E @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="nodeId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="groupId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="endpointId", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterId", Tag=3, Type=uint), - ]) + def attribute_id(cls) -> int: + return 0x00000000 - nodeId: 'uint' = 0 - groupId: 'uint' = 0 - endpointId: 'uint' = 0 - clusterId: 'uint' = 0 + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[Binding.Structs.TargetStruct]) + value: 'typing.List[Binding.Structs.TargetStruct]' = field(default_factory=lambda: []) - class Attributes: @dataclass class ServerGeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/templates/tests.js b/src/darwin/Framework/CHIP/templates/tests.js index da562a55bf81c6..bf3dd71389f640 100644 --- a/src/darwin/Framework/CHIP/templates/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests.js @@ -230,6 +230,7 @@ function getTests() 'TestLogCommands', 'TestOperationalCredentialsCluster', 'TestModeSelectCluster', + 'TestBinding', ]; const SoftwareDiagnostics = [ diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index db50f742f9e3b5..b36a78528da32f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -1550,6 +1550,53 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader case Clusters::Binding::Id: { using namespace Clusters::Binding; switch (aPath.mAttributeId) { + case Attributes::Binding::Id: { + using TypeInfo = Attributes::Binding::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPBindingClusterTargetStruct * newElement_0; + newElement_0 = [CHIPBindingClusterTargetStruct new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + if (entry_0.node.HasValue()) { + newElement_0.node = [NSNumber numberWithUnsignedLongLong:entry_0.node.Value()]; + } else { + newElement_0.node = nil; + } + if (entry_0.group.HasValue()) { + newElement_0.group = [NSNumber numberWithUnsignedShort:entry_0.group.Value()]; + } else { + newElement_0.group = nil; + } + if (entry_0.endpoint.HasValue()) { + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint.Value()]; + } else { + newElement_0.endpoint = nil; + } + if (entry_0.cluster.HasValue()) { + newElement_0.cluster = [NSNumber numberWithUnsignedInt:entry_0.cluster.Value()]; + } else { + newElement_0.cluster = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } case Attributes::ServerGeneratedCommandList::Id: { using TypeInfo = Attributes::ServerGeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index ff4a5b7da33c43..cbc8cc92bbb3d9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -2123,6 +2123,66 @@ } } +void CHIPBindingBindingListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPBindingClusterTargetStruct * newElement_0; + newElement_0 = [CHIPBindingClusterTargetStruct new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + if (entry_0.node.HasValue()) { + newElement_0.node = [NSNumber numberWithUnsignedLongLong:entry_0.node.Value()]; + } else { + newElement_0.node = nil; + } + if (entry_0.group.HasValue()) { + newElement_0.group = [NSNumber numberWithUnsignedShort:entry_0.group.Value()]; + } else { + newElement_0.group = nil; + } + if (entry_0.endpoint.HasValue()) { + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint.Value()]; + } else { + newElement_0.endpoint = nil; + } + if (entry_0.cluster.HasValue()) { + newElement_0.cluster = [NSNumber numberWithUnsignedInt:entry_0.cluster.Value()]; + } else { + newElement_0.cluster = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPBindingBindingListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPBindingServerGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index 098a9167fa76ef..77d7ea5028015f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -2263,6 +2263,34 @@ class CHIPBinaryInputBasicAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPBindingBindingListAttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPBindingBindingListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn( + void * context, + const chip::app::DataModel::DecodableList & value); +}; + +class CHIPBindingBindingListAttributeCallbackSubscriptionBridge : public CHIPBindingBindingListAttributeCallbackBridge +{ +public: + CHIPBindingBindingListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPBindingBindingListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPBindingServerGeneratedCommandListListAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index e3748c3d234c6b..8b7cd08a2cd51a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -788,8 +788,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPBinding : CHIPCluster -- (void)bindWithParams:(CHIPBindingClusterBindParams *)params completionHandler:(StatusCompletion)completionHandler; -- (void)unbindWithParams:(CHIPBindingClusterUnbindParams *)params completionHandler:(StatusCompletion)completionHandler; +- (void)readAttributeBindingWithParams:(CHIPReadParams * _Nullable)params + completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeBindingWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeBindingWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPReadParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeServerGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index a3a99a5a31e814..69cc8eab82d42c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -3048,46 +3048,92 @@ @implementation CHIPBinding return &_cppCluster; } -- (void)bindWithParams:(CHIPBindingClusterBindParams *)params completionHandler:(StatusCompletion)completionHandler +- (void)readAttributeBindingWithParams:(CHIPReadParams * _Nullable)params + completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { - ListFreer listFreer; - Binding::Commands::Bind::Type request; - request.nodeId = params.nodeId.unsignedLongLongValue; - request.groupId = params.groupId.unsignedShortValue; - request.endpointId = params.endpointId.unsignedShortValue; - request.clusterId = params.clusterId.unsignedIntValue; + new CHIPBindingBindingListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Binding::Attributes::Binding::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue]); + }); +} - new CHIPCommandSuccessCallbackBridge( +- (void)writeAttributeBindingWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { + ^(id _Nullable ignored, NSError * _Nullable error) { completionHandler(error); }, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + ListFreer listFreer; + using TypeInfo = Binding::Attributes::Binding::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[CHIPBindingClusterTargetStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (CHIPBindingClusterTargetStruct *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + if (element_0.node != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].node.Emplace(); + definedValue_2 = element_0.node.unsignedLongLongValue; + } + if (element_0.group != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].group.Emplace(); + definedValue_2 = element_0.group.unsignedShortValue; + } + if (element_0.endpoint != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].endpoint.Emplace(); + definedValue_2 = element_0.endpoint.unsignedShortValue; + } + if (element_0.cluster != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].cluster.Emplace(); + definedValue_2 = element_0.cluster.unsignedIntValue; + } + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)unbindWithParams:(CHIPBindingClusterUnbindParams *)params completionHandler:(StatusCompletion)completionHandler +- (void)subscribeAttributeBindingWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPReadParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - ListFreer listFreer; - Binding::Commands::Unbind::Type request; - request.nodeId = params.nodeId.unsignedLongLongValue; - request.groupId = params.groupId.unsignedShortValue; - request.endpointId = params.endpointId.unsignedShortValue; - request.clusterId = params.clusterId.unsignedIntValue; - - new CHIPCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, + new CHIPBindingBindingListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + using TypeInfo = Binding::Attributes::Binding::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); - }); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPBindingBindingListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue]); + }, + subscriptionEstablishedHandler); } - (void)readAttributeServerGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h index 795ef8b46a807b..776f8bd92469bf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h @@ -470,22 +470,6 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPBindingClusterBindParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull nodeId; -@property (strong, nonatomic) NSNumber * _Nonnull groupId; -@property (strong, nonatomic) NSNumber * _Nonnull endpointId; -@property (strong, nonatomic) NSNumber * _Nonnull clusterId; -- (instancetype)init; -@end - -@interface CHIPBindingClusterUnbindParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull nodeId; -@property (strong, nonatomic) NSNumber * _Nonnull groupId; -@property (strong, nonatomic) NSNumber * _Nonnull endpointId; -@property (strong, nonatomic) NSNumber * _Nonnull clusterId; -- (instancetype)init; -@end - @interface CHIPPollControlClusterCheckInResponseParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull startFastPolling; @property (strong, nonatomic) NSNumber * _Nonnull fastPollTimeout; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm index 77a15cbbd14975..ac5de4d3bb9d51 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm @@ -978,40 +978,6 @@ - (instancetype)init } @end -@implementation CHIPBindingClusterBindParams -- (instancetype)init -{ - if (self = [super init]) { - - _nodeId = @(0); - - _groupId = @(0); - - _endpointId = @(0); - - _clusterId = @(0); - } - return self; -} -@end - -@implementation CHIPBindingClusterUnbindParams -- (instancetype)init -{ - if (self = [super init]) { - - _nodeId = @(0); - - _groupId = @(0); - - _endpointId = @(0); - - _clusterId = @(0); - } - return self; -} -@end - @implementation CHIPPollControlClusterCheckInResponseParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h index 653fa8a9e08f2b..298ecb7feda3c9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h @@ -61,6 +61,15 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPBindingClusterTargetStruct : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSNumber * _Nullable node; +@property (strong, nonatomic) NSNumber * _Nullable group; +@property (strong, nonatomic) NSNumber * _Nullable endpoint; +@property (strong, nonatomic) NSNumber * _Nullable cluster; +- (instancetype)init; +@end + @interface CHIPAccessControlClusterTarget : NSObject @property (strong, nonatomic) NSNumber * _Nullable cluster; @property (strong, nonatomic) NSNumber * _Nullable endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm index a239ca017d7e9b..14b6fe68d8342c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm @@ -100,6 +100,25 @@ - (instancetype)init } @end +@implementation CHIPBindingClusterTargetStruct +- (instancetype)init +{ + if (self = [super init]) { + + _fabricIndex = @(0); + + _node = nil; + + _group = nil; + + _endpoint = nil; + + _cluster = nil; + } + return self; +} +@end + @implementation CHIPAccessControlClusterTarget - (instancetype)init { diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 5bb52817a76d04..5dbe6e8e2e0d71 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -44792,6 +44792,178 @@ - (void)testSendClusterTestModeSelectCluster_000008_ChangeToMode [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestBinding_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestBinding_000001_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write empty binding table"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write empty binding table Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestBinding_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read empty binding table"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read empty binding table Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestBinding_000003_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write invalid binding table"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + + temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).group = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; + + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write invalid binding table Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestBinding_000004_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write binding table"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).group = [NSNumber numberWithUnsignedShort:1U]; + + temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; + + temp_0[2] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + ((CHIPBindingClusterTargetStruct *) temp_0[2]).node = [NSNumber numberWithUnsignedLongLong:2ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[2]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write binding table Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestBinding_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read binding table"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read binding table Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 3); + XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).group unsignedShortValue], 1U); + XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).node unsignedLongLongValue], 1ULL); + XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint unsignedShortValue], 1U); + XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster unsignedIntValue], 6UL); + XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).node unsignedLongLongValue], 2ULL); + XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_SWDIAG_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index c9e09b324529e0..ebcde4200d18d0 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -145,52 +145,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace BarrierControl -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace Binding - namespace ColorControl { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1853,9 +1807,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::BarrierControl::Id: Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::ColorControl::Id: Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 1ca79fd02fcf12..9c12ea0886bbad 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1441,7 +1441,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 627 +#define GENERATED_ATTRIBUTE_COUNT 629 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1463,6 +1463,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Binding */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ @@ -1807,6 +1809,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Binding */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ @@ -2474,11 +2478,6 @@ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */\ /* client_generated */ \ 0x00000000 /* AnnounceOtaProvider */, \ @@ -2625,11 +2624,6 @@ 0x00000006 /* StepWithOnOff */, \ 0x00000007 /* StopWithOnOff */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 1, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Mode Select (server) */\ /* client_generated */ \ 0x00000000 /* ChangeToMode */, \ @@ -2855,17 +2849,17 @@ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ .attributes = ZAP_ATTRIBUTE_INDEX(10), \ - .attributeCount = 1, \ + .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(11), \ + .attributes = ZAP_ATTRIBUTE_INDEX(12), \ .attributeCount = 3, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2876,7 +2870,7 @@ { \ /* Endpoint: 0, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(14), \ + .attributes = ZAP_ATTRIBUTE_INDEX(15), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2887,7 +2881,7 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2898,18 +2892,18 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ .clusterId = 0x0000002A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ .attributeCount = 5, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(39), \ + .attributes = ZAP_ATTRIBUTE_INDEX(40), \ .attributeCount = 3, \ .clusterSize = 292, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2920,7 +2914,7 @@ { \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ .clusterId = 0x0000002C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(42), \ + .attributes = ZAP_ATTRIBUTE_INDEX(43), \ .attributeCount = 4, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2931,7 +2925,7 @@ { \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ .clusterId = 0x0000002D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(46), \ + .attributes = ZAP_ATTRIBUTE_INDEX(47), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2942,7 +2936,7 @@ { \ /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ .clusterId = 0x0000002E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(49), \ + .attributes = ZAP_ATTRIBUTE_INDEX(50), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2953,40 +2947,40 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(51), \ + .attributes = ZAP_ATTRIBUTE_INDEX(52), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 20 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 10, \ .clusterSize = 60, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 31 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(67), \ + .attributes = ZAP_ATTRIBUTE_INDEX(68), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 42 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(67), \ + .attributes = ZAP_ATTRIBUTE_INDEX(68), \ .attributeCount = 9, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2997,84 +2991,84 @@ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(76), \ + .attributes = ZAP_ATTRIBUTE_INDEX(77), \ .attributeCount = 6, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 44 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 41 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(82), \ + .attributes = ZAP_ATTRIBUTE_INDEX(83), \ .attributeCount = 65, \ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 43 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(147), \ + .attributes = ZAP_ATTRIBUTE_INDEX(148), \ .attributeCount = 15, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 45 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(162), \ + .attributes = ZAP_ATTRIBUTE_INDEX(163), \ .attributeCount = 11, \ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 50 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 47 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(173), \ + .attributes = ZAP_ATTRIBUTE_INDEX(174), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 52 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 49 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(177), \ + .attributes = ZAP_ATTRIBUTE_INDEX(178), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 56 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 66 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ .clusterId = 0x0000003F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(184), \ + .attributes = ZAP_ATTRIBUTE_INDEX(185), \ .attributeCount = 5, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 71 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 76 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 68 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 73 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(189), \ + .attributes = ZAP_ATTRIBUTE_INDEX(190), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3085,7 +3079,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(191), \ + .attributes = ZAP_ATTRIBUTE_INDEX(192), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3096,7 +3090,7 @@ { \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(193), \ + .attributes = ZAP_ATTRIBUTE_INDEX(194), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3107,51 +3101,51 @@ { \ /* Endpoint: 1, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(197), \ + .attributes = ZAP_ATTRIBUTE_INDEX(198), \ .attributeCount = 3, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 79 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 83 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 76 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 80 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(200), \ + .attributes = ZAP_ATTRIBUTE_INDEX(201), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 85 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 92 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 82 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Scenes (server) */ \ .clusterId = 0x00000005, \ - .attributes = ZAP_ATTRIBUTE_INDEX(202), \ + .attributes = ZAP_ATTRIBUTE_INDEX(203), \ .attributeCount = 6, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayScenesServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 97 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 105 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 94 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 102 ) ,\ },\ { \ /* Endpoint: 1, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(208), \ + .attributes = ZAP_ATTRIBUTE_INDEX(209), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 112 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 109 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ .clusterId = 0x00000007, \ - .attributes = ZAP_ATTRIBUTE_INDEX(215), \ + .attributes = ZAP_ATTRIBUTE_INDEX(216), \ .attributeCount = 3, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3162,18 +3156,18 @@ { \ /* Endpoint: 1, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(218), \ + .attributes = ZAP_ATTRIBUTE_INDEX(219), \ .attributeCount = 16, \ .clusterSize = 27, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 119 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 116 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ .clusterId = 0x0000000F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(234), \ + .attributes = ZAP_ATTRIBUTE_INDEX(235), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3184,7 +3178,7 @@ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(238), \ + .attributes = ZAP_ATTRIBUTE_INDEX(239), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3195,18 +3189,18 @@ { \ /* Endpoint: 1, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(243), \ - .attributeCount = 1, \ + .attributes = ZAP_ATTRIBUTE_INDEX(244), \ + .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 128 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ .clusterId = 0x00000025, \ - .attributes = ZAP_ATTRIBUTE_INDEX(244), \ + .attributes = ZAP_ATTRIBUTE_INDEX(246), \ .attributeCount = 4, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3217,7 +3211,7 @@ { \ /* Endpoint: 1, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(248), \ + .attributes = ZAP_ATTRIBUTE_INDEX(250), \ .attributeCount = 11, \ .clusterSize = 88, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3228,7 +3222,7 @@ { \ /* Endpoint: 1, Cluster: Switch (server) */ \ .clusterId = 0x0000003B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(259), \ + .attributes = ZAP_ATTRIBUTE_INDEX(261), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3239,7 +3233,7 @@ { \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(264), \ + .attributes = ZAP_ATTRIBUTE_INDEX(266), \ .attributeCount = 2, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3250,7 +3244,7 @@ { \ /* Endpoint: 1, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(266), \ + .attributes = ZAP_ATTRIBUTE_INDEX(268), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3261,7 +3255,7 @@ { \ /* Endpoint: 1, Cluster: Boolean State (server) */ \ .clusterId = 0x00000045, \ - .attributes = ZAP_ATTRIBUTE_INDEX(268), \ + .attributes = ZAP_ATTRIBUTE_INDEX(270), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3272,51 +3266,51 @@ { \ /* Endpoint: 1, Cluster: Mode Select (server) */ \ .clusterId = 0x00000050, \ - .attributes = ZAP_ATTRIBUTE_INDEX(270), \ + .attributes = ZAP_ATTRIBUTE_INDEX(272), \ .attributeCount = 6, \ .clusterSize = 38, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 131 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 125 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ .clusterId = 0x00000101, \ - .attributes = ZAP_ATTRIBUTE_INDEX(276), \ + .attributes = ZAP_ATTRIBUTE_INDEX(278), \ .attributeCount = 32, \ .clusterSize = 54, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayDoorLockServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 133 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 127 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(308), \ + .attributes = ZAP_ATTRIBUTE_INDEX(310), \ .attributeCount = 20, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayWindowCoveringServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 142 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 136 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(328), \ + .attributes = ZAP_ATTRIBUTE_INDEX(330), \ .attributeCount = 5, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 150 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 144 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ .clusterId = 0x00000200, \ - .attributes = ZAP_ATTRIBUTE_INDEX(333), \ + .attributes = ZAP_ATTRIBUTE_INDEX(335), \ .attributeCount = 26, \ .clusterSize = 54, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3327,18 +3321,18 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(359), \ + .attributes = ZAP_ATTRIBUTE_INDEX(361), \ .attributeCount = 19, \ .clusterSize = 34, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 153 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 147 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(378), \ + .attributes = ZAP_ATTRIBUTE_INDEX(380), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3349,18 +3343,18 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(382), \ + .attributes = ZAP_ATTRIBUTE_INDEX(384), \ .attributeCount = 53, \ .clusterSize = 341, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 157 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 151 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(435), \ + .attributes = ZAP_ATTRIBUTE_INDEX(437), \ .attributeCount = 6, \ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3371,7 +3365,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(441), \ + .attributes = ZAP_ATTRIBUTE_INDEX(443), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3382,7 +3376,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(446), \ + .attributes = ZAP_ATTRIBUTE_INDEX(448), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3393,7 +3387,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(450), \ + .attributes = ZAP_ATTRIBUTE_INDEX(452), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3404,7 +3398,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(455), \ + .attributes = ZAP_ATTRIBUTE_INDEX(457), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3415,7 +3409,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(460), \ + .attributes = ZAP_ATTRIBUTE_INDEX(462), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3426,18 +3420,18 @@ { \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ .clusterId = 0x00000500, \ - .attributes = ZAP_ATTRIBUTE_INDEX(464), \ + .attributes = ZAP_ATTRIBUTE_INDEX(466), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ .functions = chipFuncArrayIasZoneServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 177 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 179 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 171 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 173 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(470), \ + .attributes = ZAP_ATTRIBUTE_INDEX(472), \ .attributeCount = 2, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3448,106 +3442,106 @@ { \ /* Endpoint: 1, Cluster: Channel (server) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(472), \ + .attributes = ZAP_ATTRIBUTE_INDEX(474), \ .attributeCount = 2, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 182 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 176 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(474), \ + .attributes = ZAP_ATTRIBUTE_INDEX(476), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 185 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 179 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(477), \ + .attributes = ZAP_ATTRIBUTE_INDEX(479), \ .attributeCount = 7, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 187 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 181 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Media Input (server) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(484), \ + .attributes = ZAP_ATTRIBUTE_INDEX(486), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 191 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 185 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(487), \ + .attributes = ZAP_ATTRIBUTE_INDEX(489), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 196 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 190 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(488), \ + .attributes = ZAP_ATTRIBUTE_INDEX(490), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 198 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 192 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(489), \ + .attributes = ZAP_ATTRIBUTE_INDEX(491), \ .attributeCount = 3, \ .clusterSize = 260, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 200 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 194 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(492), \ + .attributes = ZAP_ATTRIBUTE_INDEX(494), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 203 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 197 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(495), \ + .attributes = ZAP_ATTRIBUTE_INDEX(497), \ .attributeCount = 2, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 206 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 200 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(497), \ + .attributes = ZAP_ATTRIBUTE_INDEX(499), \ .attributeCount = 8, \ .clusterSize = 138, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3558,29 +3552,29 @@ { \ /* Endpoint: 1, Cluster: Account Login (server) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(505), \ + .attributes = ZAP_ATTRIBUTE_INDEX(507), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 208 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 202 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ .clusterId = 0x0000050F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(506), \ + .attributes = ZAP_ATTRIBUTE_INDEX(508), \ .attributeCount = 81, \ .clusterSize = 3285, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 210 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 229 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 204 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 223 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(587), \ + .attributes = ZAP_ATTRIBUTE_INDEX(589), \ .attributeCount = 12, \ .clusterSize = 28, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3591,29 +3585,29 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(599), \ + .attributes = ZAP_ATTRIBUTE_INDEX(601), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 238 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 245 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 232 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 239 ) ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(601), \ + .attributes = ZAP_ATTRIBUTE_INDEX(603), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 250 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 244 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(608), \ + .attributes = ZAP_ATTRIBUTE_INDEX(610), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3624,7 +3618,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(613), \ + .attributes = ZAP_ATTRIBUTE_INDEX(615), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3635,13 +3629,13 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(617), \ + .attributes = ZAP_ATTRIBUTE_INDEX(619), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 254 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 261 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 248 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 255 ) ,\ },\ } diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index 411d255412d9bc..8e1f3a9ed271bc 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -509,6 +509,16 @@ typedef struct _TargetInfo chip::CharSpan name; } TargetInfo; +// Struct for TargetStruct +typedef struct _TargetStruct +{ + chip::FabricIndex FabricIndex; + chip::NodeId Node; + chip::GroupId Group; + chip::EndpointId Endpoint; + chip::ClusterId Cluster; +} TargetStruct; + // Struct for TestFabricScoped typedef struct _TestFabricScoped { diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 75fc255f267f19..58799ddb656b52 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -252,6 +252,7 @@ // Client attributes // Server attributes +#define ZCL_BINDING_LIST_ATTRIBUTE_ID (0x0000) // Attribute ids for cluster: Access Control diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index ae377e07793964..894698b35ed230 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -13734,16 +13734,6 @@ bool emberAfApplianceControlClusterOverloadPauseCallback( bool emberAfApplianceControlClusterOverloadWarningCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ApplianceControl::Commands::OverloadWarning::DecodableType & commandData); -/** - * @brief Binding Cluster Bind Command callback (from client) - */ -bool emberAfBindingClusterBindCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Binding::Commands::Bind::DecodableType & commandData); -/** - * @brief Binding Cluster Unbind Command callback (from client) - */ -bool emberAfBindingClusterUnbindCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Binding::Commands::Unbind::DecodableType & commandData); /** * @brief Poll Control Cluster CheckIn Command callback (from server) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 08c6152f25a059..17d347f9a611c6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -4437,63 +4437,30 @@ namespace Events { } // namespace Descriptor namespace Binding { - -namespace Commands { -namespace Bind { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +namespace Structs { +namespace TargetStruct { +CHIP_ERROR Type::EncodeForWrite(TLV::TLVWriter & writer, TLV::Tag tag) const { - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNodeId)), nodeId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupId)), groupId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEndpointId)), endpointId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kClusterId)), clusterId)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; + return DoEncode(writer, tag, NullOptional); } -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +CHIP_ERROR Type::EncodeForRead(TLV::TLVWriter & writer, TLV::Tag tag, FabricIndex accessingFabricIndex) const { - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNodeId): - ReturnErrorOnFailure(DataModel::Decode(reader, nodeId)); - break; - case to_underlying(Fields::kGroupId): - ReturnErrorOnFailure(DataModel::Decode(reader, groupId)); - break; - case to_underlying(Fields::kEndpointId): - ReturnErrorOnFailure(DataModel::Decode(reader, endpointId)); - break; - case to_underlying(Fields::kClusterId): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterId)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; + return DoEncode(writer, tag, MakeOptional(accessingFabricIndex)); } -} // namespace Bind. -namespace Unbind { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const + +CHIP_ERROR Type::DoEncode(TLV::TLVWriter & writer, TLV::Tag tag, const Optional & accessingFabricIndex) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNodeId)), nodeId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupId)), groupId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEndpointId)), endpointId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kClusterId)), clusterId)); + if (accessingFabricIndex.HasValue()) + { + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); + } + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNode)), node)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroup)), group)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEndpoint)), endpoint)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCluster)), cluster)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -4503,23 +4470,27 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNodeId): - ReturnErrorOnFailure(DataModel::Decode(reader, nodeId)); + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); break; - case to_underlying(Fields::kGroupId): - ReturnErrorOnFailure(DataModel::Decode(reader, groupId)); + case to_underlying(Fields::kNode): + ReturnErrorOnFailure(DataModel::Decode(reader, node)); break; - case to_underlying(Fields::kEndpointId): - ReturnErrorOnFailure(DataModel::Decode(reader, endpointId)); + case to_underlying(Fields::kGroup): + ReturnErrorOnFailure(DataModel::Decode(reader, group)); break; - case to_underlying(Fields::kClusterId): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterId)); + case to_underlying(Fields::kEndpoint): + ReturnErrorOnFailure(DataModel::Decode(reader, endpoint)); + break; + case to_underlying(Fields::kCluster): + ReturnErrorOnFailure(DataModel::Decode(reader, cluster)); break; default: break; @@ -4528,9 +4499,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; } -} // namespace Unbind. + +} // namespace TargetStruct +} // namespace Structs + +namespace Commands { } // namespace Commands namespace Attributes { @@ -4538,6 +4514,9 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { + case Attributes::Binding::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, binding)); + break; case Attributes::ServerGeneratedCommandList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, serverGeneratedCommandList)); break; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 814a15c4ea759e..4015a094c8b901 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -6656,108 +6656,61 @@ struct TypeInfo } // namespace Descriptor namespace Binding { -namespace Commands { -// Forward-declarations so we can reference these later. - -namespace Bind { -struct Type; -struct DecodableType; -} // namespace Bind - -namespace Unbind { -struct Type; -struct DecodableType; -} // namespace Unbind - -} // namespace Commands - -namespace Commands { -namespace Bind { +namespace Structs { +namespace TargetStruct { enum class Fields { - kNodeId = 0, - kGroupId = 1, - kEndpointId = 2, - kClusterId = 3, + kFabricIndex = 0, + kNode = 1, + kGroup = 2, + kEndpoint = 3, + kCluster = 4, }; struct Type { public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::Bind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } + chip::FabricIndex fabricIndex = static_cast(0); + Optional node; + Optional group; + Optional endpoint; + Optional cluster; - chip::NodeId nodeId = static_cast(0); - chip::GroupId groupId = static_cast(0); - chip::EndpointId endpointId = static_cast(0); - chip::ClusterId clusterId = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + static constexpr bool kIsFabricScoped = true; - using ResponseType = DataModel::NullObjectType; + auto GetFabricIndex() const { return fabricIndex; } - static constexpr bool MustUseTimedInvoke() { return false; } -}; + void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::Bind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } + CHIP_ERROR EncodeForWrite(TLV::TLVWriter & writer, TLV::Tag tag) const; + CHIP_ERROR EncodeForRead(TLV::TLVWriter & writer, TLV::Tag tag, FabricIndex accessingFabricIndex) const; - chip::NodeId nodeId = static_cast(0); - chip::GroupId groupId = static_cast(0); - chip::EndpointId endpointId = static_cast(0); - chip::ClusterId clusterId = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace Bind -namespace Unbind { -enum class Fields -{ - kNodeId = 0, - kGroupId = 1, - kEndpointId = 2, - kClusterId = 3, +private: + CHIP_ERROR DoEncode(TLV::TLVWriter & writer, TLV::Tag tag, const Optional & accessingFabricIndex) const; }; -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::Unbind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } - - chip::NodeId nodeId = static_cast(0); - chip::GroupId groupId = static_cast(0); - chip::EndpointId endpointId = static_cast(0); - chip::ClusterId clusterId = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +using DecodableType = Type; - using ResponseType = DataModel::NullObjectType; +} // namespace TargetStruct +} // namespace Structs - static constexpr bool MustUseTimedInvoke() { return false; } -}; +namespace Attributes { -struct DecodableType +namespace Binding { +struct TypeInfo { -public: - static constexpr CommandId GetCommandId() { return Commands::Unbind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; - chip::NodeId nodeId = static_cast(0); - chip::GroupId groupId = static_cast(0); - chip::EndpointId endpointId = static_cast(0); - chip::ClusterId clusterId = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); + static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Binding::Id; } + static constexpr bool MustUseTimedWrite() { return false; } }; -}; // namespace Unbind -} // namespace Commands - -namespace Attributes { - +} // namespace Binding namespace ServerGeneratedCommandList { struct TypeInfo { @@ -6827,6 +6780,7 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + Attributes::Binding::TypeInfo::DecodableType binding; Attributes::ServerGeneratedCommandList::TypeInfo::DecodableType serverGeneratedCommandList; Attributes::ClientGeneratedCommandList::TypeInfo::DecodableType clientGeneratedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index 1946eec0273c4e..cec0fa7a545b96 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -130,10 +130,6 @@ #define ZCL_OVERLOAD_PAUSE_COMMAND_ID (0x04) #define ZCL_OVERLOAD_WARNING_COMMAND_ID (0x05) -// Commands for cluster: Binding -#define ZCL_BIND_COMMAND_ID (0x00) -#define ZCL_UNBIND_COMMAND_ID (0x01) - // Commands for cluster: Poll Control #define ZCL_CHECK_IN_COMMAND_ID (0x00) #define ZCL_CHECK_IN_RESPONSE_COMMAND_ID (0x00) diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index fcf1700c35288c..4c66e427f3223f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -956,6 +956,10 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace Binding { namespace Attributes { +namespace Binding { +static constexpr AttributeId Id = 0x00000000; +} // namespace Binding + namespace ServerGeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::ServerGeneratedCommandList::Id; } // namespace ServerGeneratedCommandList diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 516000027bfcb3..525740d29f0179 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -403,20 +403,6 @@ static constexpr CommandId Id = 0x00000005; } // namespace Commands } // namespace ApplianceControl -namespace Binding { -namespace Commands { - -namespace Bind { -static constexpr CommandId Id = 0x00000000; -} // namespace Bind - -namespace Unbind { -static constexpr CommandId Id = 0x00000001; -} // namespace Unbind - -} // namespace Commands -} // namespace Binding - namespace PollControl { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 56315ead7061e6..a8a3f2c0c5d14e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -3507,10 +3507,9 @@ class ApplianceControlOverloadWarning : public ClusterCommand | Cluster Binding | 0x001E | |------------------------------------------------------------------------------| | Commands: | | -| * Bind | 0x00 | -| * Unbind | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | +| * Binding | 0x0000 | | * ServerGeneratedCommandList | 0xFFF8 | | * ClientGeneratedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -3520,56 +3519,27 @@ class ApplianceControlOverloadWarning : public ClusterCommand | Events: | | \*----------------------------------------------------------------------------*/ -/* - * Command Bind - */ -class BindingBind : public ClusterCommand +class WriteBindingBinding : public WriteAttribute { public: - BindingBind(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("bind", credsIssuerConfig) - { - AddArgument("NodeId", 0, UINT64_MAX, &mRequest.nodeId); - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("EndpointId", 0, UINT16_MAX, &mRequest.endpointId); - AddArgument("ClusterId", 0, UINT32_MAX, &mRequest.clusterId); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + WriteBindingBinding(CredentialIssuerCommands * credsIssuerConfig) : + WriteAttribute("Binding", credsIssuerConfig), mComplex(&mValue) { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return ClusterCommand::SendCommand(device, endpointId, 0x0000001E, 0x00000000, mRequest); + AddArgument("attr-name", "binding"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); } -private: - chip::app::Clusters::Binding::Commands::Bind::Type mRequest; -}; - -/* - * Command Unbind - */ -class BindingUnbind : public ClusterCommand -{ -public: - BindingUnbind(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("unbind", credsIssuerConfig) - { - AddArgument("NodeId", 0, UINT64_MAX, &mRequest.nodeId); - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("EndpointId", 0, UINT16_MAX, &mRequest.endpointId); - AddArgument("ClusterId", 0, UINT32_MAX, &mRequest.clusterId); - ClusterCommand::AddArguments(); - } + ~WriteBindingBinding() {} CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return ClusterCommand::SendCommand(device, endpointId, 0x0000001E, 0x00000001, mRequest); + return WriteAttribute::SendCommand(device, endpointId, 0x0000001E, 0x00000000, mValue); } private: - chip::app::Clusters::Binding::Commands::Unbind::Type mRequest; + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; }; /*----------------------------------------------------------------------------*\ @@ -16860,12 +16830,11 @@ void registerClusterBinding(Commands & commands, CredentialIssuerCommands * cred // Commands // make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // // // Attributes // - make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "binding", Attributes::Binding::Id, credsIssuerConfig), // make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, @@ -16874,7 +16843,9 @@ void registerClusterBinding(Commands & commands, CredentialIssuerCommands * cred make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // + make_unique(Id, "binding", Attributes::Binding::Id, credsIssuerConfig), // make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 38b8a541c8b160..1216983efce78b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -1881,6 +1881,53 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::TargetNavigator::Struc ComplexArgumentParser::Finalize(request.identifier); ComplexArgumentParser::Finalize(request.name); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Binding::Structs::TargetStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("TargetStruct.fabricIndex", "fabricIndex", value.isMember("fabricIndex"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "fabricIndex"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.fabricIndex, value["fabricIndex"])); + + if (value.isMember("node")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "node"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.node, value["node"])); + } + + if (value.isMember("group")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "group"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.group, value["group"])); + } + + if (value.isMember("endpoint")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "endpoint"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.endpoint, value["endpoint"])); + } + + if (value.isMember("cluster")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "cluster"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.cluster, value["cluster"])); + } + + return CHIP_NO_ERROR; +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Binding::Structs::TargetStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.fabricIndex); + ComplexArgumentParser::Finalize(request.node); + ComplexArgumentParser::Finalize(request.group); + ComplexArgumentParser::Finalize(request.endpoint); + ComplexArgumentParser::Finalize(request.cluster); +} CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::TestCluster::Structs::TestFabricScoped::Type & request, Json::Value & value) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index cc593f2433f75b..5294f82ce3f3dc 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -219,6 +219,10 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::TargetNavigator Json::Value & value); static void Finalize(chip::app::Clusters::TargetNavigator::Structs::TargetInfo::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Binding::Structs::TargetStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Binding::Structs::TargetStruct::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::TestCluster::Structs::TestFabricScoped::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 8a5b2a6bc71039..42df4077a540b6 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2037,6 +2037,54 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Binding::Structs::TargetStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Node", indent + 1, value.node); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Node'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Group", indent + 1, value.group); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Group'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Endpoint", indent + 1, value.endpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Endpoint'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Cluster", indent + 1, value.cluster); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Cluster'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::TestCluster::Structs::TestFabricScoped::DecodableType & value) { @@ -4700,6 +4748,11 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Binding::Id: { switch (path.mAttributeId) { + case Binding::Attributes::Binding::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Binding", 1, value); + } case Binding::Attributes::ServerGeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 73b442a5b3df82..43535c9d3e1008 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -119,6 +119,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::AccessControl::Structs::Target::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TargetNavigator::Structs::TargetInfo::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Binding::Structs::TargetStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TestCluster::Structs::TestFabricScoped::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index c8754dc98cfd8d..05cc44eaa02d07 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -172,6 +172,7 @@ class TestList : public Command printf("TestOperationalCredentialsCluster\n"); printf("TestModeSelectCluster\n"); printf("TestSystemCommands\n"); + printf("TestBinding\n"); printf("Test_TC_SWDIAG_1_1\n"); printf("Test_TC_SWDIAG_2_1\n"); printf("Test_TC_SWDIAG_3_1\n"); @@ -83669,6 +83670,341 @@ class TestSystemCommands : public TestCommand } }; +class TestBinding : public TestCommand +{ +public: + TestBinding(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestBinding", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~TestBinding() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestBinding\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestBinding\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Write empty binding table\n"); + err = TestWriteEmptyBindingTable_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read empty binding table\n"); + err = TestReadEmptyBindingTable_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Write invalid binding table\n"); + err = TestWriteInvalidBindingTable_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Write binding table\n"); + err = TestWriteBindingTable_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read binding table\n"); + err = TestReadBindingTable_5(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2( + void * context, + const chip::app::DataModel::DecodableList & binding) + { + (static_cast(context))->OnSuccessResponse_2(binding); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5( + void * context, + const chip::app::DataModel::DecodableList & binding) + { + (static_cast(context))->OnSuccessResponse_5(binding); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestWriteEmptyBindingTable_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BindingClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + chip::app::DataModel::List bindingArgument; + + bindingArgument = chip::app::DataModel::List(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + bindingArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR TestReadEmptyBindingTable_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BindingClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2( + const chip::app::DataModel::DecodableList & binding) + { + { + auto iter_0 = binding.begin(); + VerifyOrReturn(CheckNoMoreListItems("binding", iter_0, 0)); + } + + NextTest(); + } + + CHIP_ERROR TestWriteInvalidBindingTable_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BindingClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + chip::app::DataModel::List bindingArgument; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].fabricIndex = 0; + + listHolder_0->mList[1].fabricIndex = 0; + listHolder_0->mList[1].node.Emplace(); + listHolder_0->mList[1].node.Value() = 1ULL; + listHolder_0->mList[1].group.Emplace(); + listHolder_0->mList[1].group.Value() = 1U; + listHolder_0->mList[1].endpoint.Emplace(); + listHolder_0->mList[1].endpoint.Value() = 1U; + listHolder_0->mList[1].cluster.Emplace(); + listHolder_0->mList[1].cluster.Value() = 6UL; + + bindingArgument = + chip::app::DataModel::List(listHolder_0->mList, 2); + } + + ReturnErrorOnFailure(cluster.WriteAttribute( + bindingArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_3() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteBindingTable_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BindingClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + chip::app::DataModel::List bindingArgument; + + { + auto * listHolder_0 = new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].fabricIndex = 0; + listHolder_0->mList[0].group.Emplace(); + listHolder_0->mList[0].group.Value() = 1U; + + listHolder_0->mList[1].fabricIndex = 0; + listHolder_0->mList[1].node.Emplace(); + listHolder_0->mList[1].node.Value() = 1ULL; + listHolder_0->mList[1].endpoint.Emplace(); + listHolder_0->mList[1].endpoint.Value() = 1U; + listHolder_0->mList[1].cluster.Emplace(); + listHolder_0->mList[1].cluster.Value() = 6UL; + + listHolder_0->mList[2].fabricIndex = 0; + listHolder_0->mList[2].node.Emplace(); + listHolder_0->mList[2].node.Value() = 2ULL; + listHolder_0->mList[2].endpoint.Emplace(); + listHolder_0->mList[2].endpoint.Value() = 1U; + + bindingArgument = + chip::app::DataModel::List(listHolder_0->mList, 3); + } + + ReturnErrorOnFailure(cluster.WriteAttribute( + bindingArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestReadBindingTable_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BindingClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_5( + const chip::app::DataModel::DecodableList & binding) + { + { + auto iter_0 = binding.begin(); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 0)); + VerifyOrReturn(CheckValue("binding[0].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValuePresent("binding[0].group", iter_0.GetValue().group)); + VerifyOrReturn(CheckValue("binding[0].group.Value()", iter_0.GetValue().group.Value(), 1U)); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 1)); + VerifyOrReturn(CheckValue("binding[1].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValuePresent("binding[1].node", iter_0.GetValue().node)); + VerifyOrReturn(CheckValue("binding[1].node.Value()", iter_0.GetValue().node.Value(), 1ULL)); + VerifyOrReturn(CheckValuePresent("binding[1].endpoint", iter_0.GetValue().endpoint)); + VerifyOrReturn(CheckValue("binding[1].endpoint.Value()", iter_0.GetValue().endpoint.Value(), 1U)); + VerifyOrReturn(CheckValuePresent("binding[1].cluster", iter_0.GetValue().cluster)); + VerifyOrReturn(CheckValue("binding[1].cluster.Value()", iter_0.GetValue().cluster.Value(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("binding", iter_0, 2)); + VerifyOrReturn(CheckValue("binding[2].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValuePresent("binding[2].node", iter_0.GetValue().node)); + VerifyOrReturn(CheckValue("binding[2].node.Value()", iter_0.GetValue().node.Value(), 2ULL)); + VerifyOrReturn(CheckValuePresent("binding[2].endpoint", iter_0.GetValue().endpoint)); + VerifyOrReturn(CheckValue("binding[2].endpoint.Value()", iter_0.GetValue().endpoint.Value(), 1U)); + VerifyOrReturn(CheckNoMoreListItems("binding", iter_0, 3)); + } + + NextTest(); + } +}; + class Test_TC_SWDIAG_1_1 : public TestCommand { public: @@ -106041,6 +106377,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index 3b9a7e5157fb68..e7e04746a55604 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -190,6 +190,11 @@ void BinaryInputBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReade chip::Callback::Cancelable * onFailureCallback); typedef void (*BinaryInputBasicAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void BindingClusterBindingListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BindingBindingListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); void BindingClusterServerGeneratedCommandListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/light-switch-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/light-switch-app/zap-generated/IMClusterCommandHandler.cpp index ba95d7a6441c2b..daf9ad6e9d5aad 100644 --- a/zzz_generated/light-switch-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/light-switch-app/zap-generated/IMClusterCommandHandler.cpp @@ -99,52 +99,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace AdministratorCommissioning -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace Binding - namespace DiagnosticLogs { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -687,9 +641,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::AdministratorCommissioning::Id: Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::DiagnosticLogs::Id: Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/light-switch-app/zap-generated/endpoint_config.h b/zzz_generated/light-switch-app/zap-generated/endpoint_config.h index 39be399eebdc55..1e5ba76a58f6ba 100644 --- a/zzz_generated/light-switch-app/zap-generated/endpoint_config.h +++ b/zzz_generated/light-switch-app/zap-generated/endpoint_config.h @@ -512,7 +512,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 185 +#define GENERATED_ATTRIBUTE_COUNT 187 #define GENERATED_ATTRIBUTES \ { \ \ @@ -524,6 +524,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Binding */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ @@ -773,6 +775,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Binding */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ } @@ -797,11 +801,6 @@ // clang-format off #define GENERATED_COMMANDS { \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */\ /* client_generated */ \ 0x00000000 /* AnnounceOtaProvider */, \ @@ -882,11 +881,6 @@ /* server_generated */ \ 0x00000000 /* IdentifyQueryResponse */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 1, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ } // clang-format on @@ -911,17 +905,17 @@ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ .attributes = ZAP_ATTRIBUTE_INDEX(5), \ - .attributeCount = 1, \ + .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(6), \ + .attributes = ZAP_ATTRIBUTE_INDEX(7), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -932,7 +926,7 @@ { \ /* Endpoint: 0, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(10), \ + .attributes = ZAP_ATTRIBUTE_INDEX(11), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -943,7 +937,7 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(30), \ + .attributes = ZAP_ATTRIBUTE_INDEX(31), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -954,18 +948,18 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ .clusterId = 0x0000002A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(30), \ + .attributes = ZAP_ATTRIBUTE_INDEX(31), \ .attributeCount = 5, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(35), \ + .attributes = ZAP_ATTRIBUTE_INDEX(36), \ .attributeCount = 2, \ .clusterSize = 36, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -976,40 +970,40 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(37), \ + .attributes = ZAP_ATTRIBUTE_INDEX(38), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 5 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 9 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 2 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 6 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(43), \ + .attributes = ZAP_ATTRIBUTE_INDEX(44), \ .attributeCount = 10, \ .clusterSize = 48, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 19 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 9 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 16 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(53), \ + .attributes = ZAP_ATTRIBUTE_INDEX(54), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 22 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 19 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(53), \ + .attributes = ZAP_ATTRIBUTE_INDEX(54), \ .attributeCount = 9, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1020,51 +1014,51 @@ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(62), \ + .attributes = ZAP_ATTRIBUTE_INDEX(63), \ .attributeCount = 6, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 24 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(68), \ + .attributes = ZAP_ATTRIBUTE_INDEX(69), \ .attributeCount = 65, \ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 26 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(133), \ + .attributes = ZAP_ATTRIBUTE_INDEX(134), \ .attributeCount = 15, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(148), \ + .attributes = ZAP_ATTRIBUTE_INDEX(149), \ .attributeCount = 11, \ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 27 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Switch (server) */ \ .clusterId = 0x0000003B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(159), \ + .attributes = ZAP_ATTRIBUTE_INDEX(160), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1075,29 +1069,29 @@ { \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(159), \ + .attributes = ZAP_ATTRIBUTE_INDEX(160), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 29 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(163), \ + .attributes = ZAP_ATTRIBUTE_INDEX(164), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 33 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 43 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(170), \ + .attributes = ZAP_ATTRIBUTE_INDEX(171), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1108,7 +1102,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(172), \ + .attributes = ZAP_ATTRIBUTE_INDEX(173), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1119,7 +1113,7 @@ { \ /* Endpoint: 1, Cluster: Identify (client) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(174), \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1130,18 +1124,18 @@ { \ /* Endpoint: 1, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(174), \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 51 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 52 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Groups (client) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(178), \ + .attributes = ZAP_ATTRIBUTE_INDEX(179), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1152,7 +1146,7 @@ { \ /* Endpoint: 1, Cluster: Scenes (client) */ \ .clusterId = 0x00000005, \ - .attributes = ZAP_ATTRIBUTE_INDEX(178), \ + .attributes = ZAP_ATTRIBUTE_INDEX(179), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1163,7 +1157,7 @@ { \ /* Endpoint: 1, Cluster: On/Off (client) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(178), \ + .attributes = ZAP_ATTRIBUTE_INDEX(179), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1174,7 +1168,7 @@ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(178), \ + .attributes = ZAP_ATTRIBUTE_INDEX(179), \ .attributeCount = 6, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1185,18 +1179,18 @@ { \ /* Endpoint: 1, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(184), \ - .attributeCount = 1, \ + .attributes = ZAP_ATTRIBUTE_INDEX(185), \ + .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 57 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Color Control (client) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(185), \ + .attributes = ZAP_ATTRIBUTE_INDEX(187), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ diff --git a/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp index 701b969e786373..2430d91869ab5d 100644 --- a/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp @@ -99,52 +99,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace AdministratorCommissioning -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace Binding - namespace DiagnosticLogs { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -795,9 +749,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::AdministratorCommissioning::Id: Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::DiagnosticLogs::Id: Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index 3862bb34384c32..dcdada3663c99e 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -631,7 +631,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 233 +#define GENERATED_ATTRIBUTE_COUNT 234 #define GENERATED_ATTRIBUTES \ { \ \ @@ -648,6 +648,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Binding */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ @@ -1032,11 +1034,6 @@ /* server_generated */ \ 0x00000000 /* IdentifyQueryResponse */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */\ /* client_generated */ \ 0x00000000 /* QueryImage */, \ @@ -1193,17 +1190,17 @@ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ .attributes = ZAP_ATTRIBUTE_INDEX(7), \ - .attributeCount = 1, \ + .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 5 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(8), \ + .attributes = ZAP_ATTRIBUTE_INDEX(9), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1214,7 +1211,7 @@ { \ /* Endpoint: 0, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(12), \ + .attributes = ZAP_ATTRIBUTE_INDEX(13), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1225,18 +1222,18 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(32), \ + .attributes = ZAP_ATTRIBUTE_INDEX(33), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 8 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 5 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 9 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(33), \ + .attributes = ZAP_ATTRIBUTE_INDEX(34), \ .attributeCount = 3, \ .clusterSize = 38, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1247,7 +1244,7 @@ { \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ .clusterId = 0x0000002C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(36), \ + .attributes = ZAP_ATTRIBUTE_INDEX(37), \ .attributeCount = 4, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1258,7 +1255,7 @@ { \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ .clusterId = 0x0000002D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(40), \ + .attributes = ZAP_ATTRIBUTE_INDEX(41), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1269,40 +1266,40 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(43), \ + .attributes = ZAP_ATTRIBUTE_INDEX(44), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 20 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 17 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(49), \ + .attributes = ZAP_ATTRIBUTE_INDEX(50), \ .attributeCount = 10, \ .clusterSize = 60, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 20 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 27 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(59), \ + .attributes = ZAP_ATTRIBUTE_INDEX(60), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 33 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(59), \ + .attributes = ZAP_ATTRIBUTE_INDEX(60), \ .attributeCount = 9, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1313,18 +1310,18 @@ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(68), \ + .attributes = ZAP_ATTRIBUTE_INDEX(69), \ .attributeCount = 6, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(74), \ + .attributes = ZAP_ATTRIBUTE_INDEX(75), \ .attributeCount = 65, \ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1335,7 +1332,7 @@ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(139), \ + .attributes = ZAP_ATTRIBUTE_INDEX(140), \ .attributeCount = 15, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1346,40 +1343,40 @@ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(154), \ + .attributes = ZAP_ATTRIBUTE_INDEX(155), \ .attributeCount = 11, \ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 37 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 34 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(165), \ + .attributes = ZAP_ATTRIBUTE_INDEX(166), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(169), \ + .attributes = ZAP_ATTRIBUTE_INDEX(170), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 43 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 40 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 50 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ .clusterId = 0x0000003F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(176), \ + .attributes = ZAP_ATTRIBUTE_INDEX(177), \ .attributeCount = 3, \ .clusterSize = 510, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1390,7 +1387,7 @@ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(179), \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1401,7 +1398,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1412,7 +1409,7 @@ { \ /* Endpoint: 1, Cluster: Identify (client) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(183), \ + .attributes = ZAP_ATTRIBUTE_INDEX(184), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1423,40 +1420,40 @@ { \ /* Endpoint: 1, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(183), \ + .attributes = ZAP_ATTRIBUTE_INDEX(184), \ .attributeCount = 3, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 61 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(186), \ + .attributes = ZAP_ATTRIBUTE_INDEX(187), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 70 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 60 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 67 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Scenes (server) */ \ .clusterId = 0x00000005, \ - .attributes = ZAP_ATTRIBUTE_INDEX(188), \ + .attributes = ZAP_ATTRIBUTE_INDEX(189), \ .attributeCount = 6, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayScenesServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 75 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 83 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 72 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 80 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(194), \ + .attributes = ZAP_ATTRIBUTE_INDEX(195), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1467,12 +1464,12 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(214), \ + .attributes = ZAP_ATTRIBUTE_INDEX(215), \ .attributeCount = 19, \ .clusterSize = 34, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 90 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 87 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ } diff --git a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h index 79ed9e6cd56dfc..984e885f8a37e1 100644 --- a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h @@ -31,6 +31,11 @@ #include // List specific responses +void BindingClusterBindingListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BindingBindingListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); void NetworkCommissioningClusterNetworksListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp index 68ec5f113e37d2..d840c181baa6d9 100644 --- a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp @@ -255,52 +255,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace AudioOutput -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace Binding - namespace Channel { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1226,9 +1180,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::AudioOutput::Id: Clusters::AudioOutput::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::Channel::Id: Clusters::Channel::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index 313154d22bebef..ed2c451966fc46 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -980,7 +980,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 294 +#define GENERATED_ATTRIBUTE_COUNT 295 #define GENERATED_ATTRIBUTES \ { \ \ @@ -992,6 +992,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Binding */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ @@ -1450,11 +1452,6 @@ // clang-format off #define GENERATED_COMMANDS { \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */\ /* client_generated */ \ 0x00000000 /* QueryImage */, \ @@ -1679,17 +1676,17 @@ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ .attributes = ZAP_ATTRIBUTE_INDEX(5), \ - .attributeCount = 1, \ + .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(6), \ + .attributes = ZAP_ATTRIBUTE_INDEX(7), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1700,7 +1697,7 @@ { \ /* Endpoint: 0, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(10), \ + .attributes = ZAP_ATTRIBUTE_INDEX(11), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1711,18 +1708,18 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(30), \ + .attributes = ZAP_ATTRIBUTE_INDEX(31), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 4 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(31), \ + .attributes = ZAP_ATTRIBUTE_INDEX(32), \ .attributeCount = 3, \ .clusterSize = 38, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1733,7 +1730,7 @@ { \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ .clusterId = 0x0000002C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ .attributeCount = 4, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1744,7 +1741,7 @@ { \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ .clusterId = 0x0000002D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(38), \ + .attributes = ZAP_ATTRIBUTE_INDEX(39), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1755,7 +1752,7 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (client) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(41), \ + .attributes = ZAP_ATTRIBUTE_INDEX(42), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1766,18 +1763,18 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(41), \ + .attributes = ZAP_ATTRIBUTE_INDEX(42), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 10 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (client) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(47), \ + .attributes = ZAP_ATTRIBUTE_INDEX(48), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1788,29 +1785,29 @@ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(47), \ + .attributes = ZAP_ATTRIBUTE_INDEX(48), \ .attributeCount = 10, \ .clusterSize = 60, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 26 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 29 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 26 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 9, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1821,18 +1818,18 @@ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(66), \ + .attributes = ZAP_ATTRIBUTE_INDEX(67), \ .attributeCount = 6, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 31 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(72), \ + .attributes = ZAP_ATTRIBUTE_INDEX(73), \ .attributeCount = 65, \ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1843,7 +1840,7 @@ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(137), \ + .attributes = ZAP_ATTRIBUTE_INDEX(138), \ .attributeCount = 15, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1854,29 +1851,29 @@ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(152), \ + .attributes = ZAP_ATTRIBUTE_INDEX(153), \ .attributeCount = 11, \ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 33 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(163), \ + .attributes = ZAP_ATTRIBUTE_INDEX(164), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(167), \ + .attributes = ZAP_ATTRIBUTE_INDEX(168), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1887,18 +1884,18 @@ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(167), \ + .attributes = ZAP_ATTRIBUTE_INDEX(168), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 49 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ .clusterId = 0x0000003F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(174), \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ .attributeCount = 3, \ .clusterSize = 510, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1909,7 +1906,7 @@ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(177), \ + .attributes = ZAP_ATTRIBUTE_INDEX(178), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1920,7 +1917,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(179), \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1931,7 +1928,7 @@ { \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1942,18 +1939,18 @@ { \ /* Endpoint: 1, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(185), \ + .attributes = ZAP_ATTRIBUTE_INDEX(186), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 54 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 51 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(187), \ + .attributes = ZAP_ATTRIBUTE_INDEX(188), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1964,7 +1961,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(192), \ + .attributes = ZAP_ATTRIBUTE_INDEX(193), \ .attributeCount = 2, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1975,106 +1972,106 @@ { \ /* Endpoint: 1, Cluster: Channel (server) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(194), \ + .attributes = ZAP_ATTRIBUTE_INDEX(195), \ .attributeCount = 4, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 62 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 59 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(198), \ + .attributes = ZAP_ATTRIBUTE_INDEX(199), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 64 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 66 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 61 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Media Input (server) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(201), \ + .attributes = ZAP_ATTRIBUTE_INDEX(202), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 68 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 65 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(204), \ + .attributes = ZAP_ATTRIBUTE_INDEX(205), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 73 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 70 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(205), \ + .attributes = ZAP_ATTRIBUTE_INDEX(206), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 75 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 72 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(206), \ + .attributes = ZAP_ATTRIBUTE_INDEX(207), \ .attributeCount = 3, \ .clusterSize = 260, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 77 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 80 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 74 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 77 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(209), \ + .attributes = ZAP_ATTRIBUTE_INDEX(210), \ .attributeCount = 3, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 82 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 86 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 79 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 83 ) ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(212), \ + .attributes = ZAP_ATTRIBUTE_INDEX(213), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 88 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 85 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(214), \ + .attributes = ZAP_ATTRIBUTE_INDEX(215), \ .attributeCount = 16, \ .clusterSize = 27, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 92 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(230), \ + .attributes = ZAP_ATTRIBUTE_INDEX(231), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2085,18 +2082,18 @@ { \ /* Endpoint: 2, Cluster: Audio Output (server) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(235), \ + .attributes = ZAP_ATTRIBUTE_INDEX(236), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 101 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 98 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 3, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(238), \ + .attributes = ZAP_ATTRIBUTE_INDEX(239), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2107,29 +2104,29 @@ { \ /* Endpoint: 3, Cluster: Media Playback (server) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(243), \ + .attributes = ZAP_ATTRIBUTE_INDEX(244), \ .attributeCount = 8, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 104 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 116 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 101 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 113 ) ,\ },\ { \ /* Endpoint: 3, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(251), \ + .attributes = ZAP_ATTRIBUTE_INDEX(252), \ .attributeCount = 3, \ .clusterSize = 260, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 118 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 121 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 115 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 118 ) ,\ },\ { \ /* Endpoint: 3, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(254), \ + .attributes = ZAP_ATTRIBUTE_INDEX(255), \ .attributeCount = 9, \ .clusterSize = 138, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2140,18 +2137,18 @@ { \ /* Endpoint: 3, Cluster: Account Login (server) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(263), \ + .attributes = ZAP_ATTRIBUTE_INDEX(264), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 123 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 127 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 120 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 124 ) ,\ },\ { \ /* Endpoint: 4, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(264), \ + .attributes = ZAP_ATTRIBUTE_INDEX(265), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2162,18 +2159,18 @@ { \ /* Endpoint: 4, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(269), \ + .attributes = ZAP_ATTRIBUTE_INDEX(270), \ .attributeCount = 3, \ .clusterSize = 260, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 129 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 132 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 126 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 129 ) ,\ },\ { \ /* Endpoint: 4, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(272), \ + .attributes = ZAP_ATTRIBUTE_INDEX(273), \ .attributeCount = 9, \ .clusterSize = 138, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2184,7 +2181,7 @@ { \ /* Endpoint: 5, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(281), \ + .attributes = ZAP_ATTRIBUTE_INDEX(282), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2195,7 +2192,7 @@ { \ /* Endpoint: 5, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(286), \ + .attributes = ZAP_ATTRIBUTE_INDEX(287), \ .attributeCount = 8, \ .clusterSize = 106, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ diff --git a/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp index 9e567bc39083ba..15a1bc859154a5 100644 --- a/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp @@ -145,52 +145,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace BarrierControl -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace Binding - namespace ColorControl { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1263,9 +1217,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::BarrierControl::Id: Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::ColorControl::Id: Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index 898d735af534d9..c9787faf5dbd69 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -843,7 +843,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 401 +#define GENERATED_ATTRIBUTE_COUNT 403 #define GENERATED_ATTRIBUTES \ { \ \ @@ -855,6 +855,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Binding */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ @@ -1178,6 +1180,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Binding */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Switch (server) */ \ @@ -1482,11 +1486,6 @@ // clang-format off #define GENERATED_COMMANDS { \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */\ /* client_generated */ \ 0x00000000 /* QueryImage */, \ @@ -1615,11 +1614,6 @@ 0x00000006 /* StepWithOnOff */, \ 0x00000007 /* StopWithOnOff */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 1, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Door Lock (server) */\ /* client_generated */ \ 0x00000000 /* LockDoor */, \ @@ -1711,17 +1705,17 @@ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ .attributes = ZAP_ATTRIBUTE_INDEX(5), \ - .attributeCount = 1, \ + .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(6), \ + .attributes = ZAP_ATTRIBUTE_INDEX(7), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1732,7 +1726,7 @@ { \ /* Endpoint: 0, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(10), \ + .attributes = ZAP_ATTRIBUTE_INDEX(11), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1743,18 +1737,18 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(30), \ + .attributes = ZAP_ATTRIBUTE_INDEX(31), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 4 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(31), \ + .attributes = ZAP_ATTRIBUTE_INDEX(32), \ .attributeCount = 3, \ .clusterSize = 38, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1765,7 +1759,7 @@ { \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ .clusterId = 0x0000002C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ .attributeCount = 4, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1776,7 +1770,7 @@ { \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ .clusterId = 0x0000002D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(38), \ + .attributes = ZAP_ATTRIBUTE_INDEX(39), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1787,40 +1781,40 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(41), \ + .attributes = ZAP_ATTRIBUTE_INDEX(42), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 10 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(47), \ + .attributes = ZAP_ATTRIBUTE_INDEX(48), \ .attributeCount = 10, \ .clusterSize = 60, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 22 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 9, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1831,18 +1825,18 @@ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(66), \ + .attributes = ZAP_ATTRIBUTE_INDEX(67), \ .attributeCount = 6, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 27 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(72), \ + .attributes = ZAP_ATTRIBUTE_INDEX(73), \ .attributeCount = 65, \ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1853,7 +1847,7 @@ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(137), \ + .attributes = ZAP_ATTRIBUTE_INDEX(138), \ .attributeCount = 15, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1864,40 +1858,40 @@ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(152), \ + .attributes = ZAP_ATTRIBUTE_INDEX(153), \ .attributeCount = 11, \ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 29 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(163), \ + .attributes = ZAP_ATTRIBUTE_INDEX(164), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 34 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 31 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(167), \ + .attributes = ZAP_ATTRIBUTE_INDEX(168), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 38 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 45 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ .clusterId = 0x0000003F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(174), \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ .attributeCount = 3, \ .clusterSize = 510, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1908,7 +1902,7 @@ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(177), \ + .attributes = ZAP_ATTRIBUTE_INDEX(178), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1919,7 +1913,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(179), \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1930,7 +1924,7 @@ { \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1941,62 +1935,62 @@ { \ /* Endpoint: 1, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(185), \ + .attributes = ZAP_ATTRIBUTE_INDEX(186), \ .attributeCount = 2, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 56 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 50 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(187), \ + .attributes = ZAP_ATTRIBUTE_INDEX(188), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 65 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 62 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Scenes (server) */ \ .clusterId = 0x00000005, \ - .attributes = ZAP_ATTRIBUTE_INDEX(189), \ + .attributes = ZAP_ATTRIBUTE_INDEX(190), \ .attributeCount = 6, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayScenesServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 70 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 78 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 67 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 75 ) ,\ },\ { \ /* Endpoint: 1, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(195), \ + .attributes = ZAP_ATTRIBUTE_INDEX(196), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 85 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 82 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(202), \ + .attributes = ZAP_ATTRIBUTE_INDEX(203), \ .attributeCount = 15, \ .clusterSize = 23, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 86 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ .clusterId = 0x0000000F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(217), \ + .attributes = ZAP_ATTRIBUTE_INDEX(218), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2007,7 +2001,7 @@ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(221), \ + .attributes = ZAP_ATTRIBUTE_INDEX(222), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2018,18 +2012,18 @@ { \ /* Endpoint: 1, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(226), \ - .attributeCount = 1, \ + .attributes = ZAP_ATTRIBUTE_INDEX(227), \ + .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 98 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Switch (server) */ \ .clusterId = 0x0000003B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(227), \ + .attributes = ZAP_ATTRIBUTE_INDEX(229), \ .attributeCount = 3, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2040,7 +2034,7 @@ { \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(230), \ + .attributes = ZAP_ATTRIBUTE_INDEX(232), \ .attributeCount = 2, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2051,62 +2045,62 @@ { \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ .clusterId = 0x00000101, \ - .attributes = ZAP_ATTRIBUTE_INDEX(232), \ + .attributes = ZAP_ATTRIBUTE_INDEX(234), \ .attributeCount = 28, \ .clusterSize = 46, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayDoorLockServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 101 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 95 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(260), \ + .attributes = ZAP_ATTRIBUTE_INDEX(262), \ .attributeCount = 19, \ .clusterSize = 31, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayWindowCoveringServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 110 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 104 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(279), \ + .attributes = ZAP_ATTRIBUTE_INDEX(281), \ .attributeCount = 5, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 114 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 108 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(284), \ + .attributes = ZAP_ATTRIBUTE_INDEX(286), \ .attributeCount = 10, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 117 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 111 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(294), \ + .attributes = ZAP_ATTRIBUTE_INDEX(296), \ .attributeCount = 51, \ .clusterSize = 337, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 121 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 115 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(345), \ + .attributes = ZAP_ATTRIBUTE_INDEX(347), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2117,7 +2111,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(349), \ + .attributes = ZAP_ATTRIBUTE_INDEX(351), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2128,7 +2122,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(353), \ + .attributes = ZAP_ATTRIBUTE_INDEX(355), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2139,7 +2133,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(357), \ + .attributes = ZAP_ATTRIBUTE_INDEX(359), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2150,18 +2144,18 @@ { \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ .clusterId = 0x00000500, \ - .attributes = ZAP_ATTRIBUTE_INDEX(361), \ + .attributes = ZAP_ATTRIBUTE_INDEX(363), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ .functions = chipFuncArrayIasZoneServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 136 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 138 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 130 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 132 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(367), \ + .attributes = ZAP_ATTRIBUTE_INDEX(369), \ .attributeCount = 2, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2172,7 +2166,7 @@ { \ /* Endpoint: 1, Cluster: Channel (client) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2183,7 +2177,7 @@ { \ /* Endpoint: 1, Cluster: Target Navigator (client) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2194,7 +2188,7 @@ { \ /* Endpoint: 1, Cluster: Media Playback (client) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2205,7 +2199,7 @@ { \ /* Endpoint: 1, Cluster: Media Input (client) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2216,7 +2210,7 @@ { \ /* Endpoint: 1, Cluster: Keypad Input (client) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2227,7 +2221,7 @@ { \ /* Endpoint: 1, Cluster: Content Launcher (client) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2238,7 +2232,7 @@ { \ /* Endpoint: 1, Cluster: Audio Output (client) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2249,7 +2243,7 @@ { \ /* Endpoint: 1, Cluster: Application Launcher (client) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2260,7 +2254,7 @@ { \ /* Endpoint: 1, Cluster: Application Basic (client) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2271,7 +2265,7 @@ { \ /* Endpoint: 1, Cluster: Account Login (client) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2282,29 +2276,29 @@ { \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ .clusterId = 0x0000050F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(371), \ .attributeCount = 21, \ .clusterSize = 1582, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 141 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 144 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 135 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 138 ) ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(390), \ + .attributes = ZAP_ATTRIBUTE_INDEX(392), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 146 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 140 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(392), \ + .attributes = ZAP_ATTRIBUTE_INDEX(394), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2315,7 +2309,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(397), \ + .attributes = ZAP_ATTRIBUTE_INDEX(399), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \