Skip to content

Commit

Permalink
Add custom ZCL extensions inside src/app/zap-templates
Browse files Browse the repository at this point in the history
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 CHIP-Specifications/connectedhomeip-spec#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.
  • Loading branch information
vivien-apple committed Dec 14, 2020
1 parent 34d8115 commit 3fb0894
Show file tree
Hide file tree
Showing 26 changed files with 515 additions and 2 deletions.
10 changes: 10 additions & 0 deletions examples/all-clusters-app/all-clusters-common/gen/attribute-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -4467,6 +4467,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5663,6 +5663,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,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
Expand Down Expand Up @@ -851,6 +857,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 \
Expand Down
10 changes: 10 additions & 0 deletions examples/lighting-app/lighting-common/gen/attribute-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -4467,6 +4467,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
Expand Down
26 changes: 26 additions & 0 deletions examples/lighting-app/lighting-common/gen/client-command-macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -5663,6 +5663,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
Expand Down
3 changes: 3 additions & 0 deletions examples/lighting-app/lighting-common/gen/cluster-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,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)

Expand Down
5 changes: 5 additions & 0 deletions examples/lighting-app/lighting-common/gen/command-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

// Commands for cluster: Basic
#define ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID (0x00)
#define ZCL_MFG_SPECIFIC_PING_COMMAND_ID (0x00)

// Commands for cluster: Identify
#define ZCL_IDENTIFY_COMMAND_ID (0x00)
Expand Down Expand Up @@ -683,6 +684,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)

Expand Down
7 changes: 7 additions & 0 deletions examples/lighting-app/lighting-common/gen/print-cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,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
Expand Down Expand Up @@ -851,6 +857,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 \
Expand Down
10 changes: 10 additions & 0 deletions examples/lock-app/lock-common/gen/attribute-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -4467,6 +4467,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
Expand Down
26 changes: 26 additions & 0 deletions examples/lock-app/lock-common/gen/client-command-macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -5663,6 +5663,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
Expand Down
3 changes: 3 additions & 0 deletions examples/lock-app/lock-common/gen/cluster-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,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)

Expand Down
5 changes: 5 additions & 0 deletions examples/lock-app/lock-common/gen/command-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

// Commands for cluster: Basic
#define ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID (0x00)
#define ZCL_MFG_SPECIFIC_PING_COMMAND_ID (0x00)

// Commands for cluster: Identify
#define ZCL_IDENTIFY_COMMAND_ID (0x00)
Expand Down Expand Up @@ -683,6 +684,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)

Expand Down
7 changes: 7 additions & 0 deletions examples/lock-app/lock-common/gen/print-cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,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
Expand Down Expand Up @@ -851,6 +857,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 \
Expand Down
10 changes: 10 additions & 0 deletions examples/temperature-measurement-app/esp32/main/gen/attribute-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -4467,6 +4467,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5663,6 +5663,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

// Commands for cluster: Basic
#define ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID (0x00)
#define ZCL_MFG_SPECIFIC_PING_COMMAND_ID (0x00)

// Commands for cluster: Identify
#define ZCL_IDENTIFY_COMMAND_ID (0x00)
Expand Down Expand Up @@ -683,6 +684,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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,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
Expand Down Expand Up @@ -851,6 +857,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 \
Expand Down
Loading

0 comments on commit 3fb0894

Please sign in to comment.