From 1458826b426f1d3bea4272aa50804939336c9014 Mon Sep 17 00:00:00 2001 From: Marc Lepage <67919234+mlepage-google@users.noreply.github.com> Date: Fri, 26 Nov 2021 08:38:46 -0500 Subject: [PATCH] Access control cluster xml (#12274) * Add access control cluster xml Issue #11204 * Zap regeneration * Update src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml Co-authored-by: Tennessee Carmel-Veilleux * Update src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml Co-authored-by: Tennessee Carmel-Veilleux * Update src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml Co-authored-by: Tennessee Carmel-Veilleux * Remove lengths from array attributes Apparently length is not required, which is good, because it can vary by implementation. * Remove ACL-cluster.xml from zcl.json Later will add its replacement (access-control-cluster.xml). * Fix duplicate attribute description in XML Introduced by a code review suggestion, fixed now. * Fix nullable attribute in XML Introduced by a code review suggestion, fixed now. * Fix fabric index type in xml s/fabric-idx/fabric_idx/g Silently generates the wrong code if it's wrong. Co-authored-by: Tennessee Carmel-Veilleux --- .../zcl/data-model/chip/ACL-cluster.xml | 38 ------ .../chip/access-control-cluster.xml | 83 +++++++++++++ .../zcl/data-model/chip/matter-devices.xml | 5 +- src/app/zap-templates/zcl/zcl.json | 1 - .../python/chip/clusters/Objects.py | 38 ------ .../app-common/zap-generated/attribute-id.h | 6 - .../app-common/zap-generated/callback.h | 112 ------------------ .../zap-generated/callbacks/PluginCallbacks.h | 2 - .../app-common/zap-generated/cluster-id.h | 3 - .../zap-generated/cluster-objects.cpp | 9 -- .../zap-generated/cluster-objects.h | 27 ----- .../app-common/zap-generated/ids/Attributes.h | 14 --- .../app-common/zap-generated/ids/Clusters.h | 3 - .../app-common/zap-generated/print-cluster.h | 7 -- 14 files changed, 87 insertions(+), 261 deletions(-) delete mode 100644 src/app/zap-templates/zcl/data-model/chip/ACL-cluster.xml create mode 100644 src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml diff --git a/src/app/zap-templates/zcl/data-model/chip/ACL-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/ACL-cluster.xml deleted file mode 100644 index 0197a4c53879a7..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/ACL-cluster.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - General - ACL - 0x001F - ACL_CLUSTER - true - true - The Access Control Cluster exposes a data model view of a Node’s Access Control List (ACL), which -codifies the rules used to manage and enforce Access Control for the Node’s endpoints and their -associated cluster instances. Access to this Access Control Cluster itself requires a special -Administer privilege level, such that only Nodes granted such privilege (hereafter termed -"Administrators") can manage the Access Control Cluster. - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml new file mode 100644 index 00000000000000..f060842a271e40 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + General + Access Control + 0x001F + ACCESS_CONTROL_CLUSTER + true + true + The Access Control Cluster exposes a data model view of a + Node’s Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node’s endpoints and their associated + cluster instances. + + + ACL + + + + + + Extension + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index 011a18cd539aec..36673e94130518 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -23,6 +23,10 @@ limitations under the License. 0x0103 0x0016 + + ACL + EXTENSION + INTERACTION_MODEL_VERSION VENDOR_NAME @@ -42,7 +46,6 @@ limitations under the License. CLIENT_LIST PARTS_LIST - diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index d47e96bdfc111e..4da0010d156f46 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -2,7 +2,6 @@ "version": "ZCL Test Data", "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/"], "xmlFile": [ - "ACL-cluster.xml", "account-login-cluster.xml", "administrator-commissioning-cluster.xml", "application-basic-cluster.xml", diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 4fe4dbaad24201..d3fb94a053361e 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -4506,44 +4506,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = None -@dataclass -class Acl(Cluster): - id: typing.ClassVar[int] = 0x001F - - class Attributes: - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x001F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0xFFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x001F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0xFFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = None - - @dataclass class PollControl(Cluster): id: typing.ClassVar[int] = 0x0020 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 ba8766cdf276f6..33ceff68320e10 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 @@ -242,12 +242,6 @@ #define ZCL_CLIENT_LIST_ATTRIBUTE_ID (0x0002) #define ZCL_PARTS_LIST_ATTRIBUTE_ID (0x0003) -// Attribute ids for cluster: ACL - -// Client attributes - -// Server attributes - // Attribute ids for cluster: Poll Control // Client attributes 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 97142ef5988a65..21b5cd2e03c26c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -158,14 +158,6 @@ void emberAfApplianceControlClusterInitCallback(chip::EndpointId endpoint); */ void emberAfDescriptorClusterInitCallback(chip::EndpointId endpoint); -/** @brief ACL Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfAclClusterInitCallback(chip::EndpointId endpoint); - /** @brief Poll Control Cluster Init * * Cluster Init @@ -2422,110 +2414,6 @@ void emberAfDescriptorClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfDescriptorClusterClientTickCallback(chip::EndpointId endpoint); -// -// ACL Cluster -// - -/** @brief ACL Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfAclClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief ACL Cluster Client Init - * - * Client Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfAclClusterClientInitCallback(chip::EndpointId endpoint); - -/** @brief ACL Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param attributePath Concrete attribute path that changed - */ -void MatterAclClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** @brief ACL Cluster Client Attribute Changed - * - * Client Attribute Changed - * - * @param attributePath Concrete attribute path that changed - */ -void MatterAclClusterClientAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** @brief ACL Cluster Server Message Sent - * - * Server Message Sent - * - * @param destination The destination to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfAclClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); - -/** @brief ACL Cluster Client Message Sent - * - * Client Message Sent - * - * @param destination The destination to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfAclClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); - -/** @brief ACL Cluster Server Pre Attribute Changed - * - * Server Pre Attribute Changed - * - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status -MatterAclClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** @brief ACL Cluster Client Pre Attribute Changed - * - * Client Pre Attribute Changed - * - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status -MatterAclClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** @brief ACL Cluster Server Tick - * - * Server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfAclClusterServerTickCallback(chip::EndpointId endpoint); - -/** @brief ACL Cluster Client Tick - * - * Client Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfAclClusterClientTickCallback(chip::EndpointId endpoint); - // // Poll Control Cluster // diff --git a/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h b/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h index cd72054883180d..ad33416064b5ca 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h +++ b/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h @@ -47,8 +47,6 @@ void __attribute__((weak)) MatterApplianceControlPluginClientInitCallback() {} void MatterApplianceControlPluginServerInitCallback(); void __attribute__((weak)) MatterDescriptorPluginClientInitCallback() {} void MatterDescriptorPluginServerInitCallback(); -void __attribute__((weak)) MatterAclPluginClientInitCallback() {} -void MatterAclPluginServerInitCallback(); void __attribute__((weak)) MatterPollControlPluginClientInitCallback() {} void MatterPollControlPluginServerInitCallback(); void __attribute__((weak)) MatterBridgedActionsPluginClientInitCallback() {} diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h index 634525c787c510..ff52968f2db772 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h @@ -64,9 +64,6 @@ static constexpr chip::ClusterId ZCL_APPLIANCE_CONTROL_CLUSTER_ID = 0x001B; // Definitions for cluster: Descriptor static constexpr chip::ClusterId ZCL_DESCRIPTOR_CLUSTER_ID = 0x001D; -// Definitions for cluster: ACL -static constexpr chip::ClusterId ZCL_ACL_CLUSTER_ID = 0x001F; - // Definitions for cluster: Poll Control static constexpr chip::ClusterId ZCL_POLL_CONTROL_CLUSTER_ID = 0x0020; 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 dd14d42c93595f..7c0406db412e5e 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 @@ -3720,15 +3720,6 @@ namespace Events { } // namespace Events } // namespace Descriptor -namespace Acl { - -namespace Commands { -} // namespace Commands - -namespace Events { -} // namespace Events - -} // namespace Acl namespace PollControl { namespace Commands { 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 c2c668cd97a4ac..07e18c24881d9f 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 @@ -5532,33 +5532,6 @@ struct TypeInfo } // namespace ClusterRevision } // namespace Attributes } // namespace Descriptor -namespace Acl { - -namespace Attributes { -namespace FeatureMap { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::Acl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::FeatureMap::Id; } -}; -} // namespace FeatureMap -namespace ClusterRevision { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::Acl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ClusterRevision::Id; } -}; -} // namespace ClusterRevision -} // namespace Attributes -} // namespace Acl namespace PollControl { namespace Commands { 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 e661d49ac0b1ac..f3a521bbd07341 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 @@ -763,20 +763,6 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace Descriptor -namespace Acl { -namespace Attributes { - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace Acl - namespace PollControl { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 18d3b0b9a0663b..bab79dfc4b85f7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -67,9 +67,6 @@ static constexpr ClusterId Id = 0x0000001B; namespace Descriptor { static constexpr ClusterId Id = 0x0000001D; } // namespace Descriptor -namespace Acl { -static constexpr ClusterId Id = 0x0000001F; -} // namespace Acl namespace PollControl { static constexpr ClusterId Id = 0x00000020; } // namespace PollControl diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index 119228d70e950c..3710086c58ea58 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -108,12 +108,6 @@ #define CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER #endif -#if defined(ZCL_USING_ACL_CLUSTER_SERVER) || defined(ZCL_USING_ACL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ACL_CLUSTER { ZCL_ACL_CLUSTER_ID, 31, "ACL" }, -#else -#define CHIP_PRINTCLUSTER_ACL_CLUSTER -#endif - #if defined(ZCL_USING_POLL_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_POLL_CONTROL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_POLL_CONTROL_CLUSTER { ZCL_POLL_CONTROL_CLUSTER_ID, 32, "Poll Control" }, #else @@ -798,7 +792,6 @@ CHIP_PRINTCLUSTER_POWER_PROFILE_CLUSTER \ CHIP_PRINTCLUSTER_APPLIANCE_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER \ - CHIP_PRINTCLUSTER_ACL_CLUSTER \ CHIP_PRINTCLUSTER_POLL_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_BRIDGED_ACTIONS_CLUSTER \ CHIP_PRINTCLUSTER_BASIC_CLUSTER \