Skip to content

Commit 6ded420

Browse files
committed
General updates needed for camera spec
1 parent ae41431 commit 6ded420

File tree

2 files changed

+101
-30
lines changed

2 files changed

+101
-30
lines changed

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
-->
17-
1817
<!--
1918
TODO: Make these structures global rather than defining them for each cluster.
2019
This depends on the ability to define global structs via XML tags.
2120
see: https://github.com/project-chip/connectedhomeip/issues/29818
2221
-->
23-
2422
<configurator>
2523
<domain name="CHIP"/>
2624

@@ -30,6 +28,12 @@ TODO: Make these structures global rather than defining them for each cluster.
3028
<item name="RollbackWrite" value="0x02"/>
3129
</enum>
3230

31+
<enum name="ThreeLevelAutoEnum" type="enum8">
32+
<item name="Low" value="0x00"/>
33+
<item name="Medium" value="0x01"/>
34+
<item name="High" value="0x02"/>
35+
<item name="Automatic" value="0x03"/>
36+
</enum>
3337
<!--
3438
These are test global items (no cluster attached) for testing only.
3539
Their usage is defined for UnitTestCluster only.

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

+95-28
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ This schema describes the format of the XML files, that describe the ZCL specifi
88
(c) Copyright 2012, 2021, Silicon Laboratories Inc.
99
</xs:documentation>
1010
</xs:annotation>
11+
<xs:simpleType name="integerWithHex">
12+
<xs:restriction base="xs:string">
13+
<xs:pattern value="[-+]?(0x[0-9A-Fa-f]+|[0-9]+)"/>
14+
</xs:restriction>
15+
</xs:simpleType>
1116
<xs:complexType name="access">
1217
<xs:attribute name="op" type="xs:string"/>
1318
<xs:attribute name="role" type="xs:string"/>
@@ -18,14 +23,20 @@ This schema describes the format of the XML files, that describe the ZCL specifi
1823
<xs:attribute name="id" use="required" type="xs:string"/>
1924
<xs:attribute name="name" use="required" type="xs:string"/>
2025
<xs:attribute name="type" use="required" type="xs:string"/>
21-
<xs:attribute name="array" use="optional" type="xs:boolean"/>
22-
<xs:attribute name="isNullable" use="optional" type="xs:boolean"/>
26+
<xs:attribute name="array" type="xs:boolean"/>
27+
<xs:attribute name="isNullable" type="xs:boolean"/>
28+
<xs:attribute name="optional" type="xs:boolean" default="false"/>
29+
<xs:attribute name="min" type="integerWithHex"/>
30+
<xs:attribute name="max" type="integerWithHex"/>
2331
</xs:complexType>
2432
<xs:complexType name="tag">
2533
<xs:attribute name="name" use="required" type="xs:string"/>
2634
<xs:attribute name="description" use="required" type="xs:string"/>
2735
</xs:complexType>
2836
<xs:complexType name="arg">
37+
<xs:attribute name="id" type="integerWithHex" />
38+
<xs:attribute name="min" type="integerWithHex"/>
39+
<xs:attribute name="max" type="integerWithHex"/>
2940
<xs:attribute name="arrayLength" type="xs:boolean"/>
3041
<xs:attribute name="array" type="xs:boolean"/>
3142
<xs:attribute name="default" type="xs:string"/>
@@ -36,9 +47,9 @@ This schema describes the format of the XML files, that describe the ZCL specifi
3647
<xs:attribute name="type" use="required"/>
3748
<xs:attribute name="length" type="xs:int"/>
3849
<xs:attribute name="presentIf" type="xs:string"/>
39-
<xs:attribute name="optional" type="xs:integer"/>
40-
<xs:attribute name="fieldId" type="xs:integer"/>
41-
<xs:attribute name="countArg" type="xs:string" use="optional"/>
50+
<xs:attribute name="optional" type="xs:boolean"/>
51+
<xs:attribute name="fieldId" type="integerWithHex"/>
52+
<xs:attribute name="countArg" type="xs:string" />
4253
<xs:attribute name="isNullable" type="xs:boolean"/>
4354
</xs:complexType>
4455
<xs:complexType name="clusterRef">
@@ -51,12 +62,17 @@ This schema describes the format of the XML files, that describe the ZCL specifi
5162
<xs:attribute name="value" type="xs:string"/>
5263
<xs:attribute name="array" type="xs:boolean"/>
5364
<xs:attribute name="enum" type="xs:boolean"/>
54-
<xs:attribute name="fieldId" type="xs:integer"/>
65+
<xs:attribute name="fieldId" type="integerWithHex"/>
66+
<xs:attribute name="min" type="integerWithHex"/>
67+
<xs:attribute name="max" type="integerWithHex"/>
68+
<xs:attribute name="length" type="integerWithHex"/>
69+
<xs:attribute name="default" type="xs:string"/>
5570
<xs:attribute name="isNullable" type="xs:boolean"/>
71+
<xs:attribute name="optional" type="xs:boolean" default="false"/>
5672
</xs:complexType>
5773
<xs:complexType name="featureBit" mixed="true">
5874
<xs:attribute name="tag" use="required" type="xs:string"/>
59-
<xs:attribute name="bit" use="required" type="xs:integer"/>
75+
<xs:attribute name="bit" use="required" type="integerWithHex"/>
6076
</xs:complexType>
6177
<xs:element name="cli">
6278
<xs:complexType>
@@ -134,6 +150,11 @@ This schema describes the format of the XML files, that describe the ZCL specifi
134150
</xs:choice>
135151
</xs:sequence>
136152
</xs:complexType>
153+
154+
<xs:unique name="structNameKey">
155+
<xs:selector xpath="./struct|enum" />
156+
<xs:field xpath="@name" />
157+
</xs:unique>
137158
</xs:element>
138159
<xs:element name="deviceType">
139160
<xs:complexType>
@@ -231,7 +252,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi
231252
<xs:attribute name="id" use="required" type="xs:string"/>
232253
<xs:attribute name="name" use="required" type="xs:string"/>
233254
<xs:attribute name="description" use="required" type="xs:string"/>
234-
<xs:attribute name="size" type="xs:integer"/>
255+
<xs:attribute name="size" type="integerWithHex"/>
235256
<xs:attribute name="discrete" type="xs:boolean"/>
236257
<xs:attribute name="signed" type="xs:boolean"/>
237258
<xs:attribute name="string" type="xs:boolean"/>
@@ -244,8 +265,12 @@ This schema describes the format of the XML files, that describe the ZCL specifi
244265
<xs:element name="bitmap">
245266
<xs:complexType>
246267
<xs:sequence>
247-
<xs:element minOccurs="0" maxOccurs="unbounded" name="cluster"/>
248-
<xs:element minOccurs="1" maxOccurs="unbounded" ref="field"/>
268+
<xs:element minOccurs="0" maxOccurs="unbounded" name="cluster">
269+
<xs:complexType>
270+
<xs:attribute name="code" type="integerWithHex"/>
271+
</xs:complexType>
272+
</xs:element>
273+
<xs:element maxOccurs="unbounded" ref="field"/>
249274
</xs:sequence>
250275
<xs:attribute name="name" use="required" type="xs:string"/>
251276
<xs:attribute name="type" use="required" type="xs:string"/>
@@ -256,7 +281,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi
256281
<xs:attribute name="mask" use="required" type="xs:string"/>
257282
<xs:attribute name="name" use="required" type="xs:string"/>
258283
<xs:attribute name="introducedIn" type="zclSpecVersion"/>
259-
<xs:attribute name="fieldId" type="xs:integer"/>
284+
<xs:attribute name="fieldId" type="integerWithHex"/>
260285
</xs:complexType>
261286
</xs:element>
262287
<xs:element name="globalAttribute">
@@ -269,9 +294,16 @@ This schema describes the format of the XML files, that describe the ZCL specifi
269294
<xs:attribute name="value" use="required" type="xs:string"/>
270295
</xs:complexType>
271296
</xs:element>
297+
<xs:element name="optionalConform">
298+
<xs:complexType>
299+
<xs:attribute name="choice" type="xs:string"/>
300+
<xs:attribute name="more" type="xs:boolean"/>
301+
<xs:attribute name="min" type="integerWithHex"/>
302+
</xs:complexType>
303+
</xs:element>
272304
<xs:element name="cluster">
273305
<xs:complexType>
274-
<xs:sequence>
306+
<xs:choice maxOccurs="unbounded">
275307
<xs:element ref="name"/>
276308
<xs:element ref="domain"/>
277309
<xs:element ref="description"/>
@@ -285,10 +317,28 @@ This schema describes the format of the XML files, that describe the ZCL specifi
285317
<xs:element minOccurs="0" maxOccurs="unbounded" ref="attribute"/>
286318
<xs:element minOccurs="0" maxOccurs="unbounded" ref="command"/>
287319
<xs:element minOccurs="0" maxOccurs="unbounded" ref="event"/>
288-
</xs:sequence>
320+
<xs:element minOccurs="0" name="features">
321+
<xs:complexType>
322+
<xs:sequence>
323+
<xs:element maxOccurs="unbounded" name="feature">
324+
<xs:complexType>
325+
<xs:choice>
326+
<xs:element ref="optionalConform"/>
327+
</xs:choice>
328+
<xs:attribute name="bit" use="required" type="integerWithHex" />
329+
<xs:attribute name="code" use="required" type="xs:string" />
330+
<xs:attribute name="name" type="xs:string" />
331+
<xs:attribute name="summary" type="xs:string" />
332+
</xs:complexType>
333+
</xs:element>
334+
</xs:sequence>
335+
</xs:complexType>
336+
</xs:element>
337+
</xs:choice>
289338
<xs:attribute name="introducedIn" type="xs:string"/>
290339
<xs:attribute name="manufacturerCode" type="zclCode"/>
291340
<xs:attribute name="singleton" type="xs:boolean"/>
341+
<xs:attribute name="apiMaturity" type = "zclApiMaturity" />
292342
</xs:complexType>
293343
</xs:element>
294344
<xs:element name="code" type="zclCode"/>
@@ -342,8 +392,9 @@ This schema describes the format of the XML files, that describe the ZCL specifi
342392
<xs:element minOccurs="0" maxOccurs="unbounded" name="cluster" type="clusterRef"/>
343393
<xs:element minOccurs="0" maxOccurs="unbounded" name="item" type="item"/>
344394
</xs:sequence>
345-
<xs:attribute name="length" type="xs:integer"/>
395+
<xs:attribute name="length" type="integerWithHex"/>
346396
<xs:attribute name="name" use="required" type="xs:string"/>
397+
<xs:attribute name="apiMaturity" type = "zclApiMaturity" />
347398
</xs:complexType>
348399
</xs:element>
349400
<xs:element name="callback">
@@ -377,34 +428,41 @@ This schema describes the format of the XML files, that describe the ZCL specifi
377428
<xs:element name="name" type="xs:string"/>
378429
<xs:element name="tag" type="tag"/>
379430
<xs:element name="domain">
380-
<xs:complexType mixed="true">
381-
<xs:sequence>
382-
<xs:element minOccurs="0" maxOccurs="unbounded" ref="older"/>
383-
</xs:sequence>
384-
<xs:attribute name="dependsOn" type="zclSpecVersion"/>
385-
<xs:attribute name="name"/>
386-
<xs:attribute name="spec" type="zclSpecVersion"/>
387-
<xs:attribute name="certifiable" type="xs:boolean"/>
431+
<xs:complexType>
432+
<!-- TODO: Remove the string extension once all XML files properly use
433+
name attribute instead of putting the name in the content -->
434+
<xs:complexContent>
435+
<xs:extension base="xs:string" >
436+
<xs:sequence>
437+
<xs:element minOccurs="0" ref="older"/>
438+
</xs:sequence>
439+
<xs:attribute name="dependsOn" type="zclSpecVersion"/>
440+
<xs:attribute name="name" type="xs:string" />
441+
<xs:attribute name="spec" type="zclSpecVersion"/>
442+
<xs:attribute name="certifiable" type="xs:boolean"/>
443+
</xs:extension>
444+
</xs:complexContent>
388445
</xs:complexType>
389446
</xs:element>
390447
<xs:element name="older">
391448
<xs:complexType>
392-
<xs:attribute name="dependsOn" use="optional" type="xs:string"/>
449+
<xs:attribute name="dependsOn" type="xs:string"/>
393450
<xs:attribute name="spec" use="required" type="xs:string"/>
394451
<xs:attribute name="certifiable" type="xs:boolean"/>
395452
</xs:complexType>
396453
</xs:element>
397454
<xs:element name="event">
398455
<xs:complexType>
399-
<xs:sequence>
400-
<xs:element ref="description"/>
456+
<xs:choice maxOccurs="unbounded">
457+
<xs:element ref="description" />
401458
<xs:element minOccurs="0" maxOccurs="unbounded" name="access" type="access"/>
402459
<xs:element minOccurs="0" maxOccurs="unbounded" name="field" type="eventField"/>
403-
</xs:sequence>
460+
</xs:choice>
404461
<xs:attribute name="code" type="xs:string"/>
405462
<xs:attribute name="name" type="xs:string"/>
406463
<xs:attribute name="side" use="required" type="zclSide"/>
407464
<xs:attribute name="priority" type="xs:string"/>
465+
<xs:attribute name="optional" type="xs:boolean" default="false"/>
408466
</xs:complexType>
409467
</xs:element>
410468
<xs:element name="command">
@@ -440,21 +498,22 @@ This schema describes the format of the XML files, that describe the ZCL specifi
440498
<xs:attribute name="default"/>
441499
<xs:attribute name="define" use="required" type="zclAttributeDefine"/>
442500
<xs:attribute name="introducedIn" type="zclSpecVersion"/>
443-
<xs:attribute name="length" type="xs:integer"/>
501+
<xs:attribute name="length" type="integerWithHex"/>
444502
<xs:attribute name="manufacturerCode" type="zclCode"/>
445503
<xs:attribute name="max" type="xs:anySimpleType"/>
446504
<xs:attribute name="min" type="xs:anySimpleType"/>
447505
<xs:attribute name="reportMaxInterval" type="xs:anySimpleType"/>
448506
<xs:attribute name="reportMinInterval" type="xs:anySimpleType"/>
449507
<xs:attribute name="reportableChange" type="xs:anySimpleType"/>
450-
<xs:attribute name="optional" use="required" type="xs:boolean"/>
508+
<xs:attribute name="optional" type="xs:boolean" default="false"/>
451509
<xs:attribute name="side" use="required" type="zclSide"/>
452510
<xs:attribute name="type" use="required" type="xs:string"/>
453511
<xs:attribute name="readable" type="xs:boolean"/>
454512
<xs:attribute name="writable" type="xs:boolean"/>
455513
<xs:attribute name="reportable" type="xs:boolean"/>
456514
<xs:attribute name="array" type="xs:boolean"/>
457515
<xs:attribute name="isNullable" type="xs:boolean"/>
516+
<xs:attribute name="entryType" type="xs:string" />
458517
</xs:complexType>
459518
</xs:element>
460519
<xs:element name="description">
@@ -489,6 +548,14 @@ This schema describes the format of the XML files, that describe the ZCL specifi
489548
<xs:enumeration value="either"/>
490549
</xs:restriction>
491550
</xs:simpleType>
551+
<xs:simpleType name="zclApiMaturity">
552+
<xs:restriction base="xs:string">
553+
<xs:enumeration value="stable"/>
554+
<xs:enumeration value="provisional"/>
555+
<xs:enumeration value="internal"/>
556+
<xs:enumeration value="deprecated"/>
557+
</xs:restriction>
558+
</xs:simpleType>
492559
<xs:element name="mapping">
493560
<xs:complexType>
494561
<xs:attribute name="code" type="xs:string"/>

0 commit comments

Comments
 (0)