From 906e68adfd7f12a7d51d76a93c64029754659682 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 14 Dec 2020 11:19:04 +0100 Subject: [PATCH] Add custom ZCL extensions inside src/app/zap-templates This PR introduces a folder inside `src/app/zap-templates` to host custom ZCL extensions such as the `MfgSpecificPing` command introduced in #4127 as well as a `Binding Cluster` from #4156. The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec defines `bindings` has an `RW` attribute but an issue has been opened since it does not look very convenient (see https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/627) The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`. Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json` since the former is a superset of the later. --- .../all-clusters-common/gen/attribute-id.h | 10 + .../gen/client-command-macro.h | 26 +++ .../all-clusters-common/gen/cluster-id.h | 3 + .../all-clusters-common/gen/command-id.h | 4 + .../all-clusters-common/gen/print-cluster.h | 7 + .../lighting-common/gen/attribute-id.h | 10 + .../gen/client-command-macro.h | 26 +++ .../lighting-common/gen/cluster-id.h | 3 + .../lighting-common/gen/command-id.h | 4 + .../lighting-common/gen/print-cluster.h | 7 + .../lock-app/lock-common/gen/attribute-id.h | 10 + .../lock-common/gen/client-command-macro.h | 26 +++ .../lock-app/lock-common/gen/cluster-id.h | 3 + .../lock-app/lock-common/gen/command-id.h | 4 + .../lock-app/lock-common/gen/print-cluster.h | 7 + .../esp32/main/gen/attribute-id.h | 10 + .../esp32/main/gen/client-command-macro.h | 26 +++ .../esp32/main/gen/cluster-id.h | 3 + .../esp32/main/gen/command-id.h | 4 + .../esp32/main/gen/print-cluster.h | 7 + scripts/tools/zap_configure.sh | 3 +- scripts/tools/zap_generate.sh | 3 +- scripts/tools/zap_generate_chip.sh | 3 +- src/app/zap-templates/zcl/binding-cluster.xml | 42 ++++ src/app/zap-templates/zcl/chip-devices.xml | 191 ++++++++++++++++++ .../zap-templates/zcl/clusters-extensions.xml | 24 +++ src/app/zap-templates/zcl/zcl.json | 48 +++++ 27 files changed, 511 insertions(+), 3 deletions(-) create mode 100644 src/app/zap-templates/zcl/binding-cluster.xml create mode 100644 src/app/zap-templates/zcl/chip-devices.xml create mode 100644 src/app/zap-templates/zcl/clusters-extensions.xml create mode 100644 src/app/zap-templates/zcl/zcl.json diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h b/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h index 8e35a7980d4be4..2c4182a54375a2 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h +++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h @@ -4466,6 +4466,16 @@ #define ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID (0xFFFD) #define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE) +// Attribute ids for cluster: Binding + +// Client attributes +#define ZCL_CLUSTER_REVISION_CLIENT_ATTRIBUTE_ID (0xFFFD) +#define ZCL_REPORTING_STATUS_CLIENT_ATTRIBUTE_ID (0xFFFE) + +// Server attributes +#define ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID (0xFFFD) +#define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE) + // Attribute ids for cluster: Sample Mfg Specific Cluster // Client attributes diff --git a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h index 61b4a6e19d91c6..a07740a411ac40 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h +++ b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h @@ -5662,6 +5662,32 @@ ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID, "uuuub", startIndex, total, startIndex, count, \ endpointInformationRecordList, endpointInformationRecordListLen); +/** @brief Command description for Bind + * + * Command: Bind + * @param nodeId INT64U + * @param groupId INT16U + * @param endpointId INT8U + * @param clusterId CLUSTER_ID + */ +#define emberAfFillCommandBindingClusterBind(nodeId, groupId, endpointId, clusterId) \ + emberAfFillExternalBuffer(mask, \ + \ + ZCL_BIND_COMMAND_ID, "uuuu", nodeId, groupId, endpointId, clusterId); + +/** @brief Command description for Unbind + * + * Command: Unbind + * @param nodeId INT64U + * @param groupId INT16U + * @param endpointId INT8U + * @param clusterId CLUSTER_ID + */ +#define emberAfFillCommandBindingClusterUnbind(nodeId, groupId, endpointId, clusterId) \ + emberAfFillExternalBuffer(mask, \ + \ + ZCL_UNBIND_COMMAND_ID, "uuuu", nodeId, groupId, endpointId, clusterId); + /** @brief Command description for CommandOne * * Command: CommandOne diff --git a/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h b/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h index e52db3604816ec..4db65e9cad99d0 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h +++ b/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h @@ -330,6 +330,9 @@ // Definitions for cluster: ZLL Commissioning #define ZCL_ZLL_COMMISSIONING_CLUSTER_ID (0x1000) +// Definitions for cluster: Binding +#define ZCL_BINDING_CLUSTER_ID (0xF000) + // Definitions for cluster: Sample Mfg Specific Cluster #define ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID (0xFC00) diff --git a/examples/all-clusters-app/all-clusters-common/gen/command-id.h b/examples/all-clusters-app/all-clusters-common/gen/command-id.h index 1cdcdcea1441e7..42dcc0e89c71f5 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/command-id.h +++ b/examples/all-clusters-app/all-clusters-common/gen/command-id.h @@ -683,6 +683,10 @@ #define ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID (0x42) #define ZCL_GET_ENDPOINT_LIST_RESPONSE_COMMAND_ID (0x42) +// Commands for cluster: Binding +#define ZCL_BIND_COMMAND_ID (0x00) +#define ZCL_UNBIND_COMMAND_ID (0x01) + // Commands for cluster: Sample Mfg Specific Cluster #define ZCL_COMMAND_ONE_COMMAND_ID (0x00) diff --git a/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h b/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h index 776e55544c7cd4..7155ccf0294122 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h +++ b/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h @@ -714,6 +714,12 @@ #define CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER #endif +#if defined(ZCL_USING_BINDING_CLUSTER_SERVER) || defined(ZCL_USING_BINDING_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { ZCL_BINDING_CLUSTER_ID, 61440, "Binding" }, +#else +#define CHIP_PRINTCLUSTER_BINDING_CLUSTER +#endif + #if defined(ZCL_USING_SAMPLE_MFG_SPECIFIC_CLUSTER_SERVER) || defined(ZCL_USING_SAMPLE_MFG_SPECIFIC_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER { ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID, 64512, "Sample Mfg Specific Cluster" }, #else @@ -850,6 +856,7 @@ CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ CHIP_PRINTCLUSTER_DIAGNOSTICS_CLUSTER \ CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER \ + CHIP_PRINTCLUSTER_BINDING_CLUSTER \ CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER \ CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER_2 \ CHIP_PRINTCLUSTER_OTA_CONFIGURATION_CLUSTER \ diff --git a/examples/lighting-app/lighting-common/gen/attribute-id.h b/examples/lighting-app/lighting-common/gen/attribute-id.h index 8e35a7980d4be4..2c4182a54375a2 100644 --- a/examples/lighting-app/lighting-common/gen/attribute-id.h +++ b/examples/lighting-app/lighting-common/gen/attribute-id.h @@ -4466,6 +4466,16 @@ #define ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID (0xFFFD) #define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE) +// Attribute ids for cluster: Binding + +// Client attributes +#define ZCL_CLUSTER_REVISION_CLIENT_ATTRIBUTE_ID (0xFFFD) +#define ZCL_REPORTING_STATUS_CLIENT_ATTRIBUTE_ID (0xFFFE) + +// Server attributes +#define ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID (0xFFFD) +#define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE) + // Attribute ids for cluster: Sample Mfg Specific Cluster // Client attributes diff --git a/examples/lighting-app/lighting-common/gen/client-command-macro.h b/examples/lighting-app/lighting-common/gen/client-command-macro.h index 61b4a6e19d91c6..a07740a411ac40 100644 --- a/examples/lighting-app/lighting-common/gen/client-command-macro.h +++ b/examples/lighting-app/lighting-common/gen/client-command-macro.h @@ -5662,6 +5662,32 @@ ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID, "uuuub", startIndex, total, startIndex, count, \ endpointInformationRecordList, endpointInformationRecordListLen); +/** @brief Command description for Bind + * + * Command: Bind + * @param nodeId INT64U + * @param groupId INT16U + * @param endpointId INT8U + * @param clusterId CLUSTER_ID + */ +#define emberAfFillCommandBindingClusterBind(nodeId, groupId, endpointId, clusterId) \ + emberAfFillExternalBuffer(mask, \ + \ + ZCL_BIND_COMMAND_ID, "uuuu", nodeId, groupId, endpointId, clusterId); + +/** @brief Command description for Unbind + * + * Command: Unbind + * @param nodeId INT64U + * @param groupId INT16U + * @param endpointId INT8U + * @param clusterId CLUSTER_ID + */ +#define emberAfFillCommandBindingClusterUnbind(nodeId, groupId, endpointId, clusterId) \ + emberAfFillExternalBuffer(mask, \ + \ + ZCL_UNBIND_COMMAND_ID, "uuuu", nodeId, groupId, endpointId, clusterId); + /** @brief Command description for CommandOne * * Command: CommandOne diff --git a/examples/lighting-app/lighting-common/gen/cluster-id.h b/examples/lighting-app/lighting-common/gen/cluster-id.h index e52db3604816ec..4db65e9cad99d0 100644 --- a/examples/lighting-app/lighting-common/gen/cluster-id.h +++ b/examples/lighting-app/lighting-common/gen/cluster-id.h @@ -330,6 +330,9 @@ // Definitions for cluster: ZLL Commissioning #define ZCL_ZLL_COMMISSIONING_CLUSTER_ID (0x1000) +// Definitions for cluster: Binding +#define ZCL_BINDING_CLUSTER_ID (0xF000) + // Definitions for cluster: Sample Mfg Specific Cluster #define ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID (0xFC00) diff --git a/examples/lighting-app/lighting-common/gen/command-id.h b/examples/lighting-app/lighting-common/gen/command-id.h index 1cdcdcea1441e7..42dcc0e89c71f5 100644 --- a/examples/lighting-app/lighting-common/gen/command-id.h +++ b/examples/lighting-app/lighting-common/gen/command-id.h @@ -683,6 +683,10 @@ #define ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID (0x42) #define ZCL_GET_ENDPOINT_LIST_RESPONSE_COMMAND_ID (0x42) +// Commands for cluster: Binding +#define ZCL_BIND_COMMAND_ID (0x00) +#define ZCL_UNBIND_COMMAND_ID (0x01) + // Commands for cluster: Sample Mfg Specific Cluster #define ZCL_COMMAND_ONE_COMMAND_ID (0x00) diff --git a/examples/lighting-app/lighting-common/gen/print-cluster.h b/examples/lighting-app/lighting-common/gen/print-cluster.h index 776e55544c7cd4..7155ccf0294122 100644 --- a/examples/lighting-app/lighting-common/gen/print-cluster.h +++ b/examples/lighting-app/lighting-common/gen/print-cluster.h @@ -714,6 +714,12 @@ #define CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER #endif +#if defined(ZCL_USING_BINDING_CLUSTER_SERVER) || defined(ZCL_USING_BINDING_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { ZCL_BINDING_CLUSTER_ID, 61440, "Binding" }, +#else +#define CHIP_PRINTCLUSTER_BINDING_CLUSTER +#endif + #if defined(ZCL_USING_SAMPLE_MFG_SPECIFIC_CLUSTER_SERVER) || defined(ZCL_USING_SAMPLE_MFG_SPECIFIC_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER { ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID, 64512, "Sample Mfg Specific Cluster" }, #else @@ -850,6 +856,7 @@ CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ CHIP_PRINTCLUSTER_DIAGNOSTICS_CLUSTER \ CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER \ + CHIP_PRINTCLUSTER_BINDING_CLUSTER \ CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER \ CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER_2 \ CHIP_PRINTCLUSTER_OTA_CONFIGURATION_CLUSTER \ diff --git a/examples/lock-app/lock-common/gen/attribute-id.h b/examples/lock-app/lock-common/gen/attribute-id.h index 8e35a7980d4be4..2c4182a54375a2 100644 --- a/examples/lock-app/lock-common/gen/attribute-id.h +++ b/examples/lock-app/lock-common/gen/attribute-id.h @@ -4466,6 +4466,16 @@ #define ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID (0xFFFD) #define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE) +// Attribute ids for cluster: Binding + +// Client attributes +#define ZCL_CLUSTER_REVISION_CLIENT_ATTRIBUTE_ID (0xFFFD) +#define ZCL_REPORTING_STATUS_CLIENT_ATTRIBUTE_ID (0xFFFE) + +// Server attributes +#define ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID (0xFFFD) +#define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE) + // Attribute ids for cluster: Sample Mfg Specific Cluster // Client attributes diff --git a/examples/lock-app/lock-common/gen/client-command-macro.h b/examples/lock-app/lock-common/gen/client-command-macro.h index 61b4a6e19d91c6..a07740a411ac40 100644 --- a/examples/lock-app/lock-common/gen/client-command-macro.h +++ b/examples/lock-app/lock-common/gen/client-command-macro.h @@ -5662,6 +5662,32 @@ ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID, "uuuub", startIndex, total, startIndex, count, \ endpointInformationRecordList, endpointInformationRecordListLen); +/** @brief Command description for Bind + * + * Command: Bind + * @param nodeId INT64U + * @param groupId INT16U + * @param endpointId INT8U + * @param clusterId CLUSTER_ID + */ +#define emberAfFillCommandBindingClusterBind(nodeId, groupId, endpointId, clusterId) \ + emberAfFillExternalBuffer(mask, \ + \ + ZCL_BIND_COMMAND_ID, "uuuu", nodeId, groupId, endpointId, clusterId); + +/** @brief Command description for Unbind + * + * Command: Unbind + * @param nodeId INT64U + * @param groupId INT16U + * @param endpointId INT8U + * @param clusterId CLUSTER_ID + */ +#define emberAfFillCommandBindingClusterUnbind(nodeId, groupId, endpointId, clusterId) \ + emberAfFillExternalBuffer(mask, \ + \ + ZCL_UNBIND_COMMAND_ID, "uuuu", nodeId, groupId, endpointId, clusterId); + /** @brief Command description for CommandOne * * Command: CommandOne diff --git a/examples/lock-app/lock-common/gen/cluster-id.h b/examples/lock-app/lock-common/gen/cluster-id.h index e52db3604816ec..4db65e9cad99d0 100644 --- a/examples/lock-app/lock-common/gen/cluster-id.h +++ b/examples/lock-app/lock-common/gen/cluster-id.h @@ -330,6 +330,9 @@ // Definitions for cluster: ZLL Commissioning #define ZCL_ZLL_COMMISSIONING_CLUSTER_ID (0x1000) +// Definitions for cluster: Binding +#define ZCL_BINDING_CLUSTER_ID (0xF000) + // Definitions for cluster: Sample Mfg Specific Cluster #define ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID (0xFC00) diff --git a/examples/lock-app/lock-common/gen/command-id.h b/examples/lock-app/lock-common/gen/command-id.h index 1cdcdcea1441e7..42dcc0e89c71f5 100644 --- a/examples/lock-app/lock-common/gen/command-id.h +++ b/examples/lock-app/lock-common/gen/command-id.h @@ -683,6 +683,10 @@ #define ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID (0x42) #define ZCL_GET_ENDPOINT_LIST_RESPONSE_COMMAND_ID (0x42) +// Commands for cluster: Binding +#define ZCL_BIND_COMMAND_ID (0x00) +#define ZCL_UNBIND_COMMAND_ID (0x01) + // Commands for cluster: Sample Mfg Specific Cluster #define ZCL_COMMAND_ONE_COMMAND_ID (0x00) diff --git a/examples/lock-app/lock-common/gen/print-cluster.h b/examples/lock-app/lock-common/gen/print-cluster.h index 776e55544c7cd4..7155ccf0294122 100644 --- a/examples/lock-app/lock-common/gen/print-cluster.h +++ b/examples/lock-app/lock-common/gen/print-cluster.h @@ -714,6 +714,12 @@ #define CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER #endif +#if defined(ZCL_USING_BINDING_CLUSTER_SERVER) || defined(ZCL_USING_BINDING_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { ZCL_BINDING_CLUSTER_ID, 61440, "Binding" }, +#else +#define CHIP_PRINTCLUSTER_BINDING_CLUSTER +#endif + #if defined(ZCL_USING_SAMPLE_MFG_SPECIFIC_CLUSTER_SERVER) || defined(ZCL_USING_SAMPLE_MFG_SPECIFIC_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER { ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID, 64512, "Sample Mfg Specific Cluster" }, #else @@ -850,6 +856,7 @@ CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ CHIP_PRINTCLUSTER_DIAGNOSTICS_CLUSTER \ CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER \ + CHIP_PRINTCLUSTER_BINDING_CLUSTER \ CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER \ CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER_2 \ CHIP_PRINTCLUSTER_OTA_CONFIGURATION_CLUSTER \ diff --git a/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h b/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h index 8e35a7980d4be4..2c4182a54375a2 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h +++ b/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h @@ -4466,6 +4466,16 @@ #define ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID (0xFFFD) #define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE) +// Attribute ids for cluster: Binding + +// Client attributes +#define ZCL_CLUSTER_REVISION_CLIENT_ATTRIBUTE_ID (0xFFFD) +#define ZCL_REPORTING_STATUS_CLIENT_ATTRIBUTE_ID (0xFFFE) + +// Server attributes +#define ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID (0xFFFD) +#define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE) + // Attribute ids for cluster: Sample Mfg Specific Cluster // Client attributes diff --git a/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h b/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h index 61b4a6e19d91c6..a07740a411ac40 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h +++ b/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h @@ -5662,6 +5662,32 @@ ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID, "uuuub", startIndex, total, startIndex, count, \ endpointInformationRecordList, endpointInformationRecordListLen); +/** @brief Command description for Bind + * + * Command: Bind + * @param nodeId INT64U + * @param groupId INT16U + * @param endpointId INT8U + * @param clusterId CLUSTER_ID + */ +#define emberAfFillCommandBindingClusterBind(nodeId, groupId, endpointId, clusterId) \ + emberAfFillExternalBuffer(mask, \ + \ + ZCL_BIND_COMMAND_ID, "uuuu", nodeId, groupId, endpointId, clusterId); + +/** @brief Command description for Unbind + * + * Command: Unbind + * @param nodeId INT64U + * @param groupId INT16U + * @param endpointId INT8U + * @param clusterId CLUSTER_ID + */ +#define emberAfFillCommandBindingClusterUnbind(nodeId, groupId, endpointId, clusterId) \ + emberAfFillExternalBuffer(mask, \ + \ + ZCL_UNBIND_COMMAND_ID, "uuuu", nodeId, groupId, endpointId, clusterId); + /** @brief Command description for CommandOne * * Command: CommandOne diff --git a/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h b/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h index e52db3604816ec..4db65e9cad99d0 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h +++ b/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h @@ -330,6 +330,9 @@ // Definitions for cluster: ZLL Commissioning #define ZCL_ZLL_COMMISSIONING_CLUSTER_ID (0x1000) +// Definitions for cluster: Binding +#define ZCL_BINDING_CLUSTER_ID (0xF000) + // Definitions for cluster: Sample Mfg Specific Cluster #define ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID (0xFC00) diff --git a/examples/temperature-measurement-app/esp32/main/gen/command-id.h b/examples/temperature-measurement-app/esp32/main/gen/command-id.h index 1cdcdcea1441e7..42dcc0e89c71f5 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/command-id.h +++ b/examples/temperature-measurement-app/esp32/main/gen/command-id.h @@ -683,6 +683,10 @@ #define ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID (0x42) #define ZCL_GET_ENDPOINT_LIST_RESPONSE_COMMAND_ID (0x42) +// Commands for cluster: Binding +#define ZCL_BIND_COMMAND_ID (0x00) +#define ZCL_UNBIND_COMMAND_ID (0x01) + // Commands for cluster: Sample Mfg Specific Cluster #define ZCL_COMMAND_ONE_COMMAND_ID (0x00) diff --git a/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h b/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h index 776e55544c7cd4..7155ccf0294122 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h +++ b/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h @@ -714,6 +714,12 @@ #define CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER #endif +#if defined(ZCL_USING_BINDING_CLUSTER_SERVER) || defined(ZCL_USING_BINDING_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { ZCL_BINDING_CLUSTER_ID, 61440, "Binding" }, +#else +#define CHIP_PRINTCLUSTER_BINDING_CLUSTER +#endif + #if defined(ZCL_USING_SAMPLE_MFG_SPECIFIC_CLUSTER_SERVER) || defined(ZCL_USING_SAMPLE_MFG_SPECIFIC_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER { ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID, 64512, "Sample Mfg Specific Cluster" }, #else @@ -850,6 +856,7 @@ CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ CHIP_PRINTCLUSTER_DIAGNOSTICS_CLUSTER \ CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER \ + CHIP_PRINTCLUSTER_BINDING_CLUSTER \ CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER \ CHIP_PRINTCLUSTER_SAMPLE_MFG_SPECIFIC_CLUSTER_2 \ CHIP_PRINTCLUSTER_OTA_CONFIGURATION_CLUSTER \ diff --git a/scripts/tools/zap_configure.sh b/scripts/tools/zap_configure.sh index eed5cab06befab..57d23a64db0b87 100755 --- a/scripts/tools/zap_configure.sh +++ b/scripts/tools/zap_configure.sh @@ -16,6 +16,7 @@ # limitations under the License. # +ZAP_TEMPLATES=$PWD/src/app/zap-templates cd ./third_party/zap/repo/ -node ./src-script/zap-start.js --logToStdout --gen ../../../src/app/zap-templates/app-templates.json +node ./src-script/zap-start.js --logToStdout -z "$ZAP_TEMPLATES"/zcl/zcl.json --gen "$ZAP_TEMPLATES"/app-templates.json diff --git a/scripts/tools/zap_generate.sh b/scripts/tools/zap_generate.sh index f336e355cfdc65..0df32448785e1b 100755 --- a/scripts/tools/zap_generate.sh +++ b/scripts/tools/zap_generate.sh @@ -31,8 +31,9 @@ if [ ! -d "$OUTPUT_DIRECTORY" ]; then mkdir -p "$OUTPUT_DIRECTORY" fi +ZAP_TEMPLATES=$PWD/src/app/zap-templates cd ./third_party/zap/repo/ -node ./src-script/zap-generate.js -z ./zcl-builtin/silabs/zcl.json -g ../../../src/app/zap-templates/app-templates.json -i "$FILE_PATH" -o "$OUTPUT_DIRECTORY" +node ./src-script/zap-generate.js -z "$ZAP_TEMPLATES"/zcl/zcl.json -g "$ZAP_TEMPLATES"/app-templates.json -i "$FILE_PATH" -o "$OUTPUT_DIRECTORY" # Check if clang-format is available if command -v clang-format &>/dev/null; then diff --git a/scripts/tools/zap_generate_chip.sh b/scripts/tools/zap_generate_chip.sh index 12275cc859840e..af9334fa43afe0 100755 --- a/scripts/tools/zap_generate_chip.sh +++ b/scripts/tools/zap_generate_chip.sh @@ -16,5 +16,6 @@ # limitations under the License. # +ZAP_TEMPLATES=$PWD/src/app/zap-templates cd ./third_party/zap/repo/ -node ./src-script/zap-generate.js -z ./zcl-builtin/silabs/zcl.json -g ../../../src/app/zap-templates/chip-templates.json -i ../../../examples/all-clusters-app/all-clusters-common/all-clusters-app.zap -o ../../../ +node ./src-script/zap-generate.js -z "$ZAP_TEMPLATES"/zcl/zcl.json -g "$ZAP_TEMPLATES"/chip-templates.json -i ../../../examples/all-clusters-app/all-clusters-common/all-clusters-app.zap -o ../../../ diff --git a/src/app/zap-templates/zcl/binding-cluster.xml b/src/app/zap-templates/zcl/binding-cluster.xml new file mode 100644 index 00000000000000..dad3c794b0d4c8 --- /dev/null +++ b/src/app/zap-templates/zcl/binding-cluster.xml @@ -0,0 +1,42 @@ + + + + + + General + Binding + 0xF000 + 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 + + + + + + + diff --git a/src/app/zap-templates/zcl/chip-devices.xml b/src/app/zap-templates/zcl/chip-devices.xml new file mode 100644 index 00000000000000..0f5d7041582dfc --- /dev/null +++ b/src/app/zap-templates/zcl/chip-devices.xml @@ -0,0 +1,191 @@ + + + + + CHIP-All-Clusters-Server + CHIP + CHIP all-clusters-app server example + 0x0103 + 0x0000 + + + VERSION + POWER_SOURCE + ResetToFactoryDefaults + MfgSpecificPing + + + BarrierControlGoToPercent + BarrierControlStop + + + COLOR_CONTROL_CURRENT_HUE + COLOR_CONTROL_CURRENT_SATURATION + COLOR_CONTROL_REMAINING_TIME + COLOR_CONTROL_CURRENT_X + COLOR_CONTROL_CURRENT_Y + COLOR_CONTROL_DRIFT_COMPENSATION + COLOR_CONTROL_COMPENSATION_TEXT + COLOR_CONTROL_COLOR_TEMPERATURE + COLOR_CONTROL_COLOR_MODE + COLOR_CONTROL_OPTIONS + COLOR_CONTROL_NUMBER_OF_PRIMARIES + COLOR_CONTROL_PRIMARY_1_X + COLOR_CONTROL_PRIMARY_1_Y + COLOR_CONTROL_PRIMARY_1_INTENSITY + COLOR_CONTROL_PRIMARY_2_X + COLOR_CONTROL_PRIMARY_2_Y + COLOR_CONTROL_PRIMARY_2_INTENSITY + COLOR_CONTROL_PRIMARY_3_X + COLOR_CONTROL_PRIMARY_3_Y + COLOR_CONTROL_PRIMARY_3_INTENSITY + COLOR_CONTROL_PRIMARY_4_X + COLOR_CONTROL_PRIMARY_4_Y + COLOR_CONTROL_PRIMARY_4_INTENSITY + COLOR_CONTROL_PRIMARY_5_X + COLOR_CONTROL_PRIMARY_5_Y + COLOR_CONTROL_PRIMARY_5_INTENSITY + COLOR_CONTROL_PRIMARY_6_X + COLOR_CONTROL_PRIMARY_6_Y + COLOR_CONTROL_PRIMARY_6_INTENSITY + COLOR_CONTROL_WHITE_POINT_X + COLOR_CONTROL_WHITE_POINT_Y + COLOR_CONTROL_COLOR_POINT_R_X + COLOR_CONTROL_COLOR_POINT_R_Y + COLOR_CONTROL_COLOR_POINT_R_INTENSITY + COLOR_CONTROL_COLOR_POINT_G_X + COLOR_CONTROL_COLOR_POINT_G_Y + COLOR_CONTROL_COLOR_POINT_G_INTENSITY + COLOR_CONTROL_COLOR_POINT_B_X + COLOR_CONTROL_COLOR_POINT_B_Y + COLOR_CONTROL_COLOR_POINT_B_INTENSITY + COLOR_CONTROL_TEMPERATURE_LEVEL_MIN_MIREDS + START_UP_COLOR_TEMPERATURE_MIREDS + COLOR_CONTROL_ENHANCED_CURRENT_HUE + COLOR_CONTROL_ENHANCED_COLOR_MODE + COLOR_CONTROL_COLOR_LOOP_ACTIVE + COLOR_CONTROL_COLOR_LOOP_DIRECTION + COLOR_CONTROL_COLOR_LOOP_TIME + COLOR_CONTROL_COLOR_START_ENHANCED_HUE + COLOR_CONTROL_COLOR_STORED_ENHANCED_HUE + COLOR_CONTROL_COLOR_CAPABILITIES + COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MIN + COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MAX + MoveToHue + MoveHue + StepHue + MoveToSaturation + MoveSaturation + StepSaturation + MoveToHueAndSaturation + MoveToColor + MoveColor + StepColor + MoveToColorTemperature + MoveColorTemperature + StepColorTemperature + StopMoveStep + + + LockDoor + UnlockDoor + Toggle + UnlockWithTimeout + GetLogRecord + SetPin + GetPin + ClearPin + ClearAllPins + SetWeekdaySchedule + GetWeekdaySchedule + ClearWeekdaySchedule + SetYearDaySchedule + GetYearDaySchedule + ClearYearDaySchedule + SetHolidaySchedule + GetHolidaySchedule + ClearHolidaySchedule + SetUserType + GetUserType + SetRfid + GetRfid + ClearRfid + ClearAllRfids + + + GROUP_NAME_SUPPORT + AddGroup + AddGroupResponse + ViewGroup + ViewGroupResponse + GetGroupMembership + GetGroupMembershipResponse + RemoveGroup + RemoveGroupResponse + RemoveAllGroups + AddGroupIfIdentifying + + + ZoneEnrollResponse + + + IDENTIFY_TIME + Identify + IdentifyQuery + + + CURRENT_LEVEL + MoveToLevel + Move + Step + Stop + MoveToLevelWithOnOff + MoveWithOnOff + StepWithOnOff + StopWithOnOff + + + ON_OFF + Off + On + Toggle + + + SCENE_COUNT + CURRENT_SCENE + CURRENT_GROUP + SCENE_VALID + SCENE_NAME_SUPPORT + AddScene + AddSceneResponse + ViewScene + ViewSceneResponse + RemoveScene + RemoveSceneResponse + RemoveAllScenes + RemoveAllScenesResponse + StoreScene + StoreSceneResponse + RecallScene + GetSceneMembership + GetSceneMembershipResponse + + + + + + diff --git a/src/app/zap-templates/zcl/clusters-extensions.xml b/src/app/zap-templates/zcl/clusters-extensions.xml new file mode 100644 index 00000000000000..eff6e76f56fc5c --- /dev/null +++ b/src/app/zap-templates/zcl/clusters-extensions.xml @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json new file mode 100644 index 00000000000000..dc01f1f5a36d62 --- /dev/null +++ b/src/app/zap-templates/zcl/zcl.json @@ -0,0 +1,48 @@ +{ + "version": "ZCL Test Data", + "xmlRoot": [".", "../../../../third_party/zap/repo/zcl-builtin/silabs/"], + "xmlFile": [ + "binding-cluster.xml", + "clusters-extensions.xml", + "chip-devices.xml", + "types.xml", + "general.xml", + "ha.xml", + "ha-devices.xml", + "cba.xml", + "cba-devices.xml", + "ota.xml", + "ami.xml", + "ami-devices.xml", + "zll.xml", + "zll-devices.xml", + "ta.xml", + "ta-devices.xml", + "hc.xml", + "hc-devices.xml", + "green-power.xml", + "green-power-devices.xml", + "silabs.xml", + "lo-devices.xml", + "wwah-silabs.xml", + "wwah-silabs-devices.xml", + "sample-extensions.xml" + ], + + "manufacturersXml": "../shared/manufacturers.xml", + "options": { + "text": { + "defaultResponsePolicy": ["Always", "Conditional", "Never"] + }, + "bool": ["commandDiscovery"] + }, + "defaults": { + "text": { + "manufacturerCodes": "0x1002", + "defaultResponsePolicy": "always" + }, + "bool": { + "commandDiscovery": true + } + } +}