diff --git a/src/app/zap-templates/templates/app/cluster-objects-src.zapt b/src/app/zap-templates/templates/app/cluster-objects-src.zapt index 8ae7efca79c57d..78b5c2e0dc4f44 100644 --- a/src/app/zap-templates/templates/app/cluster-objects-src.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects-src.zapt @@ -173,66 +173,32 @@ bool CommandNeedsTimedInvoke(ClusterId aCluster, CommandId aCommand) return false; } -// TODO(#20811): Actually generate the following based on ZAP metadata -// See https://github.com/project-chip/zap/issues/609 bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) { // Maybe it would be smaller code to codegen a table and walk over it? // Not sure. switch (aCluster) { - case Clusters::Groups::Id: { - switch (aCommand) - { - case Clusters::Groups::Commands::AddGroup::Id: - case Clusters::Groups::Commands::ViewGroup::Id: - case Clusters::Groups::Commands::GetGroupMembership::Id: - case Clusters::Groups::Commands::RemoveGroup::Id: - case Clusters::Groups::Commands::RemoveAllGroups::Id: - return true; - default: - return false; - } - } - case Clusters::GroupKeyManagement::Id: { - switch (aCommand) - { - case Clusters::GroupKeyManagement::Commands::KeySetWrite::Id: - case Clusters::GroupKeyManagement::Commands::KeySetRead::Id: - case Clusters::GroupKeyManagement::Commands::KeySetRemove::Id: - case Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Id: - return true; - default: - return false; - } - } - case Clusters::GeneralCommissioning::Id: { - switch (aCommand) - { - case Clusters::GeneralCommissioning::Commands::CommissioningComplete::Id: - return true; - default: - return false; - } - } - case Clusters::Scenes::Id: { - // Entire cluster is fabric-scoped. - return true; - } - case Clusters::OperationalCredentials::Id: { - switch (aCommand) - { - case Clusters::OperationalCredentials::Commands::UpdateNOC::Id: - case Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Id: - return true; - default: - return false; - } - } - default: - break; + {{#zcl_clusters}} + {{#zcl_commands}} + {{#first}} + case Clusters::{{asUpperCamelCase parent.name}}::Id: + { + switch (aCommand) { + {{/first}} + {{#if isFabricScoped}} + case Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Id: + return true; + {{/if}} + {{#last}} + default: + return false; + } + } + {{/last}} + {{/zcl_commands}} + {{/zcl_clusters}} } - return false; } diff --git a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml index 0d913e68dc9653..e67874d6bcd5dd 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml @@ -74,7 +74,7 @@ limitations under the License. - + Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. diff --git a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml index f278ce48644d30..3bfaeb980a6d32 100644 --- a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml @@ -65,13 +65,13 @@ limitations under the License. MaxGroupsPerFabric MaxGroupKeysPerFabric - + Revoke a Root Key from a Group - + Revoke a Root Key from a Group @@ -84,13 +84,13 @@ limitations under the License. - + Revoke a Root Key from a Group - + Return the list of Group Key Sets associated with the accessing fabric diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml index 7fe5aa904143fd..01c172b54172dc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml @@ -113,7 +113,7 @@ limitations under the License. - + Sender is requesting to update the node operational certificates. @@ -127,7 +127,7 @@ limitations under the License. - + This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index a7f8957b52f902..3653e5c1db6530 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -52,7 +52,7 @@ limitations under the License. NameSupport LastConfiguredBy - + Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' @@ -64,7 +64,7 @@ limitations under the License. - + Retrieves the requested scene entry from its Scene table. @@ -72,7 +72,7 @@ limitations under the License. - + Removes the requested scene entry, corresponding to the value of the GroupID field, from its Scene Table @@ -81,7 +81,7 @@ limitations under the License. - + Remove all scenes, corresponding to the value of the GroupID field, from its Scene Table @@ -89,7 +89,7 @@ limitations under the License. - + Adds the scene entry into its Scene Table along with all extension field sets corresponding to the current state of other clusters on the same endpoint @@ -98,7 +98,7 @@ limitations under the License. - + Set the attributes and corresponding state for each other cluster implemented on the endpoint accordingly to the resquested scene entry in the Scene Table @@ -107,14 +107,14 @@ limitations under the License. - + Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group - + Allows a scene to be added using a finer scene transition time than the AddScene command. @@ -124,14 +124,14 @@ limitations under the License. - + Allows a scene to be retrieved using a finer scene transition time than the ViewScene command - + Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. @@ -234,4 +234,4 @@ limitations under the License. - \ No newline at end of file + diff --git a/src/app/zap-templates/zcl/data-model/silabs/general.xml b/src/app/zap-templates/zcl/data-model/silabs/general.xml index d384934248d8eb..ea606941064b6c 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/general.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/general.xml @@ -100,7 +100,7 @@ limitations under the License. name support - + Command description for AddGroup @@ -108,32 +108,32 @@ limitations under the License. - + Command description for ViewGroup - + Command description for GetGroupMembership - + Command description for RemoveGroup - + Command description for RemoveAllGroups - + Command description for AddGroupIfIdentifying 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 6d5c4cb5cf654e..b7f9abcae5b4b8 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 @@ -20695,39 +20695,107 @@ bool CommandNeedsTimedInvoke(ClusterId aCluster, CommandId aCommand) return false; } -// TODO(#20811): Actually generate the following based on ZAP metadata -// See https://github.com/project-chip/zap/issues/609 bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) { // Maybe it would be smaller code to codegen a table and walk over it? // Not sure. switch (aCluster) { + case Clusters::Identify::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::Groups::Id: { switch (aCommand) { case Clusters::Groups::Commands::AddGroup::Id: + return true; case Clusters::Groups::Commands::ViewGroup::Id: + return true; case Clusters::Groups::Commands::GetGroupMembership::Id: + return true; case Clusters::Groups::Commands::RemoveGroup::Id: + return true; case Clusters::Groups::Commands::RemoveAllGroups::Id: return true; + case Clusters::Groups::Commands::AddGroupIfIdentifying::Id: + return true; default: return false; } } - case Clusters::GroupKeyManagement::Id: { + case Clusters::Scenes::Id: { switch (aCommand) { - case Clusters::GroupKeyManagement::Commands::KeySetWrite::Id: - case Clusters::GroupKeyManagement::Commands::KeySetRead::Id: - case Clusters::GroupKeyManagement::Commands::KeySetRemove::Id: - case Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Id: + case Clusters::Scenes::Commands::AddScene::Id: + return true; + case Clusters::Scenes::Commands::ViewScene::Id: + return true; + case Clusters::Scenes::Commands::RemoveScene::Id: + return true; + case Clusters::Scenes::Commands::RemoveAllScenes::Id: + return true; + case Clusters::Scenes::Commands::StoreScene::Id: + return true; + case Clusters::Scenes::Commands::RecallScene::Id: + return true; + case Clusters::Scenes::Commands::GetSceneMembership::Id: + return true; + case Clusters::Scenes::Commands::EnhancedAddScene::Id: + return true; + case Clusters::Scenes::Commands::EnhancedViewScene::Id: + return true; + case Clusters::Scenes::Commands::CopyScene::Id: return true; default: return false; } } + case Clusters::OnOff::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::LevelControl::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::BridgedActions::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::Basic::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::OtaSoftwareUpdateProvider::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::OtaSoftwareUpdateRequestor::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::GeneralCommissioning::Id: { switch (aCommand) { @@ -20737,24 +20805,215 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::Scenes::Id: { - // Entire cluster is fabric-scoped. - return true; + case Clusters::NetworkCommissioning::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::DiagnosticLogs::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::GeneralDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::SoftwareDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ThreadNetworkDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::WiFiNetworkDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::EthernetNetworkDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::AdministratorCommissioning::Id: { + switch (aCommand) + { + default: + return false; + } } case Clusters::OperationalCredentials::Id: { switch (aCommand) { case Clusters::OperationalCredentials::Commands::UpdateNOC::Id: + return true; case Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Id: return true; default: return false; } } - default: - break; + case Clusters::GroupKeyManagement::Id: { + switch (aCommand) + { + case Clusters::GroupKeyManagement::Commands::KeySetWrite::Id: + return true; + case Clusters::GroupKeyManagement::Commands::KeySetRead::Id: + return true; + case Clusters::GroupKeyManagement::Commands::KeySetRemove::Id: + return true; + case Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Id: + return true; + default: + return false; + } + } + case Clusters::ModeSelect::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::DoorLock::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::WindowCovering::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::BarrierControl::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::Thermostat::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ColorControl::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::Channel::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::TargetNavigator::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::MediaPlayback::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::MediaInput::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::LowPower::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::KeypadInput::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ContentLauncher::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::AudioOutput::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ApplicationLauncher::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::AccountLogin::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ElectricalMeasurement::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::TestCluster::Id: { + switch (aCommand) + { + default: + return false; + } + } } - return false; }