Skip to content

Commit

Permalink
[cluster] Move Groups cluster to a dedicated file (#24716)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and pull[bot] committed Nov 17, 2023
1 parent 6cc70c2 commit 1009080
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 83 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \
src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml \
Expand Down
1 change: 1 addition & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml"
load "../src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/global-attributes.xml";
load "../src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml";
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/chiptest/yamltest_with_chip_repl_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def _StackShutDown():

# Some still-silabs clusters
_CLUSTER_XML_DIRECTORY_PATH + '/silabs/ha.xml', # For fan control
_CLUSTER_XML_DIRECTORY_PATH + '/silabs/general.xml', # For groups cluster
_CLUSTER_XML_DIRECTORY_PATH + '/silabs/general.xml', # For LevelControl cluster
])

# Parsing YAML test and setting up chip-repl yamltests runner.
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/data-model/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<xi:include href="chip/general-commissioning-cluster.xml" />
<xi:include href="chip/general-diagnostics-cluster.xml" />
<xi:include href="chip/global-attributes.xml" />
<xi:include href="chip/groups-cluster.xml" />
<xi:include href="chip/group-key-mgmt-cluster.xml" />
<xi:include href="chip/identify-cluster.xml" />
<xi:include href="chip/illuminance-measurement-cluster.xml" />
Expand Down
115 changes: 115 additions & 0 deletions src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2023 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.
-->
<configurator>
<domain name="General"/>

<cluster>
<name>Groups</name>
<domain>General</domain>
<description>Attributes and commands for group configuration and manipulation.</description>
<code>0x0004</code>
<define>GROUPS_CLUSTER</define>

<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>

<globalAttribute side="either" code="0xFFFD" value="4"/>

<attribute side="server" code="0x0000" define="GROUP_NAME_SUPPORT" type="BITMAP8" min="0x00" max="0x80" writable="false" optional="false">NameSupport</attribute>

<!-- NAME_SUPPORT -->
<command source="client" code="0x00" name="AddGroup" response="AddGroupResponse" isFabricScoped="true" optional="false" cli="zcl groups add">
<description>
Command description for AddGroup
</description>
<access op="invoke" role="manage"/>
<arg name="GroupID" type="group_id"/>
<arg name="GroupName" type="CHAR_STRING"/>
</command>

<command source="client" code="0x01" name="ViewGroup" response="ViewGroupResponse" isFabricScoped="true" optional="false" cli="zcl groups view">
<description>
Command description for ViewGroup
</description>
<arg name="GroupID" type="group_id"/>
</command>

<command source="client" code="0x02" name="GetGroupMembership" response="GetGroupMembershipResponse" cliFunctionName="zclGroupsGetCommand" isFabricScoped="true" optional="false" cli="zcl groups get">
<description>
Command description for GetGroupMembership
</description>
<arg name="GroupList" type="group_id" array="true"/>
</command>

<command source="client" code="0x03" name="RemoveGroup" response="RemoveGroupResponse" isFabricScoped="true" optional="false" cli="zcl groups remove">
<description>
Command description for RemoveGroup
</description>
<access op="invoke" role="manage"/>
<arg name="GroupID" type="group_id"/>
</command>

<command source="client" code="0x04" name="RemoveAllGroups" isFabricScoped="true" optional="false" cli="zcl groups rmall">
<description>
Command description for RemoveAllGroups
</description>
<access op="invoke" role="manage"/>
</command>

<command source="client" code="0x05" name="AddGroupIfIdentifying" isFabricScoped="true" optional="false" cli="zcl groups add-if-id">
<description>
Command description for AddGroupIfIdentifying
</description>
<access op="invoke" role="manage"/>
<arg name="GroupID" type="group_id"/>
<arg name="GroupName" type="CHAR_STRING"/>
</command>

<command source="server" code="0x00" name="AddGroupResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for AddGroupResponse
</description>
<arg name="Status" type="ENUM8"/>
<arg name="GroupID" type="group_id"/>
</command>

<command source="server" code="0x01" name="ViewGroupResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for ViewGroupResponse
</description>
<arg name="Status" type="ENUM8"/>
<arg name="GroupID" type="group_id"/>
<arg name="GroupName" type="CHAR_STRING"/>
</command>

<command source="server" code="0x02" name="GetGroupMembershipResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for GetGroupMembershipResponse
</description>
<arg name="Capacity" type="INT8U" isNullable="true"/>
<arg name="GroupList" type="group_id" array="true"/>
</command>

<command source="server" code="0x03" name="RemoveGroupResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for RemoveGroupResponse
</description>
<arg name="Status" type="ENUM8"/>
<arg name="GroupID" type="group_id"/>
</command>
</cluster>
</configurator>
82 changes: 0 additions & 82 deletions src/app/zap-templates/zcl/data-model/silabs/general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,88 +26,6 @@ limitations under the License.
<older spec="ha-1.2-05-3520-29" dependsOn="zcl-1.0-07-5123-03" certifiable="true"/>
<older spec="ha-1.1-05-3520-27" dependsOn="zcl-1.0-07-5123-03" certifiable="true"/>
</domain>
<cluster>
<name>Groups</name>
<domain>General</domain>
<description>Attributes and commands for group configuration and manipulation.</description>
<code>0x0004</code>
<define>GROUPS_CLUSTER</define>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<globalAttribute side="either" code="0xFFFD" value="4"/>
<attribute side="server" code="0x0000" define="GROUP_NAME_SUPPORT" type="BITMAP8" min="0x00" max="0x80" writable="false" optional="false">NameSupport</attribute>
<!-- NAME_SUPPORT -->
<command source="client" code="0x00" name="AddGroup" response="AddGroupResponse" isFabricScoped="true" optional="false" cli="zcl groups add">
<description>
Command description for AddGroup
</description>
<arg name="GroupID" type="group_id"/>
<arg name="GroupName" type="CHAR_STRING"/>
<access op="invoke" role="manage"/>
</command>
<command source="client" code="0x01" name="ViewGroup" response="ViewGroupResponse" isFabricScoped="true" optional="false" cli="zcl groups view">
<description>
Command description for ViewGroup
</description>
<arg name="GroupID" type="group_id"/>
</command>
<command source="client" code="0x02" name="GetGroupMembership" response="GetGroupMembershipResponse" cliFunctionName="zclGroupsGetCommand" isFabricScoped="true" optional="false" cli="zcl groups get">
<description>
Command description for GetGroupMembership
</description>
<arg name="GroupList" type="group_id" array="true"/>
</command>
<command source="client" code="0x03" name="RemoveGroup" response="RemoveGroupResponse" isFabricScoped="true" optional="false" cli="zcl groups remove">
<description>
Command description for RemoveGroup
</description>
<arg name="GroupID" type="group_id"/>
<access op="invoke" role="manage"/>
</command>
<command source="client" code="0x04" name="RemoveAllGroups" isFabricScoped="true" optional="false" cli="zcl groups rmall">
<description>
Command description for RemoveAllGroups
</description>
<access op="invoke" role="manage"/>
</command>
<command source="client" code="0x05" name="AddGroupIfIdentifying" isFabricScoped="true" optional="false" cli="zcl groups add-if-id">
<description>
Command description for AddGroupIfIdentifying
</description>
<arg name="GroupID" type="group_id"/>
<arg name="GroupName" type="CHAR_STRING"/>
<access op="invoke" role="manage"/>
</command>
<command source="server" code="0x00" name="AddGroupResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for AddGroupResponse
</description>
<arg name="Status" type="ENUM8"/>
<arg name="GroupID" type="group_id"/>
</command>
<command source="server" code="0x01" name="ViewGroupResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for ViewGroupResponse
</description>
<arg name="Status" type="ENUM8"/>
<arg name="GroupID" type="group_id"/>
<arg name="GroupName" type="CHAR_STRING"/>
</command>
<command source="server" code="0x02" name="GetGroupMembershipResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for GetGroupMembershipResponse
</description>
<arg name="Capacity" type="INT8U" isNullable="true"/>
<arg name="GroupList" type="group_id" array="true"/>
</command>
<command source="server" code="0x03" name="RemoveGroupResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for RemoveGroupResponse
</description>
<arg name="Status" type="ENUM8"/>
<arg name="GroupID" type="group_id"/>
</command>
</cluster>
<cluster>
<name>On/off Switch Configuration</name>
<domain>General</domain>
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"general-commissioning-cluster.xml",
"general-diagnostics-cluster.xml",
"global-attributes.xml",
"groups-cluster.xml",
"group-key-mgmt-cluster.xml",
"identify-cluster.xml",
"illuminance-measurement-cluster.xml",
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"general-commissioning-cluster.xml",
"general-diagnostics-cluster.xml",
"global-attributes.xml",
"groups-cluster.xml",
"group-key-mgmt-cluster.xml",
"identify-cluster.xml",
"illuminance-measurement-cluster.xml",
Expand Down

0 comments on commit 1009080

Please sign in to comment.