Skip to content

Commit 83da16e

Browse files
committed
Move atomic enum to global-enums.xml, actually
1 parent d21d712 commit 83da16e

File tree

8 files changed

+91
-18
lines changed

8 files changed

+91
-18
lines changed

.github/workflows/tests.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ jobs:
9191
--no-print \
9292
--log-level info \
9393
src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \
94+
src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml \
95+
src/app/zap-templates/zcl/data-model/chip/global-enums.xml \
9496
src/app/zap-templates/zcl/data-model/chip/global-structs.xml \
9597
src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml \
9698
src/app/zap-templates/zcl/data-model/chip/access-control-definitions.xml \

scripts/rules.matterlint

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ load "../src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml"
4343
load "../src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml";
4444
load "../src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml";
4545
load "../src/app/zap-templates/zcl/data-model/chip/global-attributes.xml";
46+
load "../src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml";
47+
load "../src/app/zap-templates/zcl/data-model/chip/global-enums.xml";
4648
load "../src/app/zap-templates/zcl/data-model/chip/global-structs.xml";
4749
load "../src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml";
4850
load "../src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml";

src/app/zap-templates/zcl/data-model/all.xml

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
<xi:include href="chip/general-commissioning-cluster.xml" />
4747
<xi:include href="chip/general-diagnostics-cluster.xml" />
4848
<xi:include href="chip/global-attributes.xml" />
49+
<xi:include href="chip/global-bitmaps.xml" />
50+
<xi:include href="chip/global-enums.xml" />
4951
<xi:include href="chip/global-structs.xml" />
5052
<xi:include href="chip/groups-cluster.xml" />
5153
<xi:include href="chip/group-key-mgmt-cluster.xml" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2024 Project CHIP Authors
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<!--
19+
TODO: Make these structures global rather than defining them for each cluster.
20+
This depends on the ability to define global structs via XML tags.
21+
see: https://github.com/project-chip/connectedhomeip/issues/29818
22+
-->
23+
24+
<configurator>
25+
<domain name="CHIP"/>
26+
27+
<!--
28+
These are test global items (no cluster attached) for testing only.
29+
Their usage is defined for UnitTestCluster only.
30+
-->
31+
<bitmap name="TestGlobalBitmap" type="bitmap32">
32+
<field mask="0x01" name="FirstBit" />
33+
<field mask="0x02" name="SecondBit" />
34+
</bitmap>
35+
36+
</configurator>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2024 Project CHIP Authors
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<!--
19+
TODO: Make these structures global rather than defining them for each cluster.
20+
This depends on the ability to define global structs via XML tags.
21+
see: https://github.com/project-chip/connectedhomeip/issues/29818
22+
-->
23+
24+
<configurator>
25+
<domain name="CHIP"/>
26+
27+
<enum name="AtomicRequestTypeEnum" type="enum8">
28+
<cluster code="0x0201"/>
29+
<item name="BeginWrite" value="0x00"/>
30+
<item name="CommitWrite" value="0x01"/>
31+
<item name="RollbackWrite" value="0x02"/>
32+
</enum>
33+
34+
<!--
35+
These are test global items (no cluster attached) for testing only.
36+
Their usage is defined for UnitTestCluster only.
37+
-->
38+
<enum name="TestGlobalEnum" type="enum8">
39+
<item name="SomeValue" value="0x00"/>
40+
<item name="SomeOtherValue" value="0x01"/>
41+
<item name="FinalValue" value="0x02"/>
42+
</enum>
43+
44+
</configurator>

src/app/zap-templates/zcl/data-model/chip/global-structs.xml

+1-18
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ TODO: Make these structures global rather than defining them for each cluster.
2424
<configurator>
2525
<domain name="CHIP"/>
2626

27-
<enum name="AtomicRequestTypeEnum" type="enum8">
28-
<cluster code="0x0201"/>
29-
<item name="BeginWrite" value="0x00"/>
30-
<item name="CommitWrite" value="0x01"/>
31-
<item name="RollbackWrite" value="0x02"/>
32-
</enum>
33-
3427
<struct name="AtomicAttributeStatusStruct">
3528
<cluster code="0x0201"/>
3629
<item fieldId="0" name="AttributeID" type="attrib_id" optional="true"/>
@@ -50,17 +43,7 @@ TODO: Make these structures global rather than defining them for each cluster.
5043
These are test global items (no cluster attached) for testing only.
5144
Their usage is defined for UnitTestCluster only.
5245
-->
53-
<bitmap name="TestGlobalBitmap" type="bitmap32">
54-
<field mask="0x01" name="FirstBit" />
55-
<field mask="0x02" name="SecondBit" />
56-
</bitmap>
57-
58-
<enum name="TestGlobalEnum" type="enum8">
59-
<item name="SomeValue" value="0x00"/>
60-
<item name="SomeOtherValue" value="0x01"/>
61-
<item name="FinalValue" value="0x02"/>
62-
</enum>
63-
46+
6447
<struct name="TestGlobalStruct">
6548
<item fieldId="0" name="Name" type="char_string" length="128" isNullable="false" optional="false"/>
6649
<item fieldId="1" name="MyBitmap" type="TestGlobalBitmap" isNullable="true" optional="false"/>

src/app/zap-templates/zcl/zcl-with-test-extensions.json

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
"general-commissioning-cluster.xml",
6363
"general-diagnostics-cluster.xml",
6464
"global-attributes.xml",
65+
"global-bitmaps.xml",
66+
"global-enums.xml",
6567
"global-structs.xml",
6668
"groups-cluster.xml",
6769
"group-key-mgmt-cluster.xml",

src/app/zap-templates/zcl/zcl.json

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
"general-commissioning-cluster.xml",
6161
"general-diagnostics-cluster.xml",
6262
"global-attributes.xml",
63+
"global-bitmaps.xml",
64+
"global-enums.xml",
6365
"global-structs.xml",
6466
"groups-cluster.xml",
6567
"group-key-mgmt-cluster.xml",

0 commit comments

Comments
 (0)