Skip to content

Commit 13b2c84

Browse files
committedSep 20, 2024
Update TODO
1 parent 3fc73db commit 13b2c84

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed
 

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

+40-15
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"/>
@@ -20,12 +25,18 @@ This schema describes the format of the XML files, that describe the ZCL specifi
2025
<xs:attribute name="type" use="required" type="xs:string"/>
2126
<xs:attribute name="array" type="xs:boolean"/>
2227
<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,8 +47,8 @@ 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"/>
50+
<xs:attribute name="optional" type="integerWithHex"/>
51+
<xs:attribute name="fieldId" type="integerWithHex"/>
4152
<xs:attribute name="countArg" type="xs:string" />
4253
<xs:attribute name="isNullable" type="xs:boolean"/>
4354
</xs:complexType>
@@ -51,12 +62,15 @@ 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="default" type="xs:string"/>
5569
<xs:attribute name="isNullable" type="xs:boolean"/>
5670
</xs:complexType>
5771
<xs:complexType name="featureBit" mixed="true">
5872
<xs:attribute name="tag" use="required" type="xs:string"/>
59-
<xs:attribute name="bit" use="required" type="xs:integer"/>
73+
<xs:attribute name="bit" use="required" type="integerWithHex"/>
6074
</xs:complexType>
6175
<xs:element name="cli">
6276
<xs:complexType>
@@ -134,6 +148,15 @@ This schema describes the format of the XML files, that describe the ZCL specifi
134148
</xs:choice>
135149
</xs:sequence>
136150
</xs:complexType>
151+
152+
<xs:unique name="structNameKey">
153+
<xs:selector xpath="./struct|enum" />
154+
<xs:field xpath="@name" />
155+
</xs:unique>
156+
<xs:keyref name="attributeEntryTypeStructRef" refer="structNameKey">
157+
<xs:selector xpath="./cluster/attribute" />
158+
<xs:field xpath="@entryType" />
159+
</xs:keyref>
137160
</xs:element>
138161
<xs:element name="deviceType">
139162
<xs:complexType>
@@ -231,7 +254,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi
231254
<xs:attribute name="id" use="required" type="xs:string"/>
232255
<xs:attribute name="name" use="required" type="xs:string"/>
233256
<xs:attribute name="description" use="required" type="xs:string"/>
234-
<xs:attribute name="size" type="xs:integer"/>
257+
<xs:attribute name="size" type="integerWithHex"/>
235258
<xs:attribute name="discrete" type="xs:boolean"/>
236259
<xs:attribute name="signed" type="xs:boolean"/>
237260
<xs:attribute name="string" type="xs:boolean"/>
@@ -256,7 +279,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi
256279
<xs:attribute name="mask" use="required" type="xs:string"/>
257280
<xs:attribute name="name" use="required" type="xs:string"/>
258281
<xs:attribute name="introducedIn" type="zclSpecVersion"/>
259-
<xs:attribute name="fieldId" type="xs:integer"/>
282+
<xs:attribute name="fieldId" type="integerWithHex"/>
260283
</xs:complexType>
261284
</xs:element>
262285
<xs:element name="globalAttribute">
@@ -277,7 +300,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi
277300
</xs:element>
278301
<xs:element name="cluster">
279302
<xs:complexType>
280-
<xs:sequence>
303+
<xs:choice maxOccurs="unbounded">
281304
<xs:element ref="name"/>
282305
<xs:element ref="domain"/>
283306
<xs:element ref="description"/>
@@ -299,7 +322,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi
299322
<xs:choice>
300323
<xs:element ref="optionalConform"/>
301324
</xs:choice>
302-
<xs:attribute name="bit" use="required" type="xs:integer" />
325+
<xs:attribute name="bit" use="required" type="integerWithHex" />
303326
<xs:attribute name="code" use="required" type="xs:string" />
304327
<xs:attribute name="name" type="xs:string" />
305328
<xs:attribute name="summary" type="xs:string" />
@@ -308,7 +331,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi
308331
</xs:sequence>
309332
</xs:complexType>
310333
</xs:element>
311-
</xs:sequence>
334+
</xs:choice>
312335
<xs:attribute name="introducedIn" type="xs:string"/>
313336
<xs:attribute name="manufacturerCode" type="zclCode"/>
314337
<xs:attribute name="singleton" type="xs:boolean"/>
@@ -366,7 +389,7 @@ This schema describes the format of the XML files, that describe the ZCL specifi
366389
<xs:element minOccurs="0" maxOccurs="unbounded" name="cluster" type="clusterRef"/>
367390
<xs:element minOccurs="0" maxOccurs="unbounded" name="item" type="item"/>
368391
</xs:sequence>
369-
<xs:attribute name="length" type="xs:integer"/>
392+
<xs:attribute name="length" type="integerWithHex"/>
370393
<xs:attribute name="name" use="required" type="xs:string"/>
371394
<xs:attribute name="apiMaturity" type = "zclApiMaturity" />
372395
</xs:complexType>
@@ -427,15 +450,16 @@ This schema describes the format of the XML files, that describe the ZCL specifi
427450
</xs:element>
428451
<xs:element name="event">
429452
<xs:complexType>
430-
<xs:sequence>
431-
<xs:element ref="description"/>
453+
<xs:choice maxOccurs="unbounded">
454+
<xs:element ref="description" minOccurs="1" maxOccurs="1"/>
432455
<xs:element minOccurs="0" maxOccurs="unbounded" name="access" type="access"/>
433456
<xs:element minOccurs="0" maxOccurs="unbounded" name="field" type="eventField"/>
434-
</xs:sequence>
457+
</xs:choice>
435458
<xs:attribute name="code" type="xs:string"/>
436459
<xs:attribute name="name" type="xs:string"/>
437460
<xs:attribute name="side" use="required" type="zclSide"/>
438461
<xs:attribute name="priority" type="xs:string"/>
462+
<xs:attribute name="optional" type="xs:boolean" default="false"/>
439463
</xs:complexType>
440464
</xs:element>
441465
<xs:element name="command">
@@ -471,21 +495,22 @@ This schema describes the format of the XML files, that describe the ZCL specifi
471495
<xs:attribute name="default"/>
472496
<xs:attribute name="define" use="required" type="zclAttributeDefine"/>
473497
<xs:attribute name="introducedIn" type="zclSpecVersion"/>
474-
<xs:attribute name="length" type="xs:integer"/>
498+
<xs:attribute name="length" type="integerWithHex"/>
475499
<xs:attribute name="manufacturerCode" type="zclCode"/>
476500
<xs:attribute name="max" type="xs:anySimpleType"/>
477501
<xs:attribute name="min" type="xs:anySimpleType"/>
478502
<xs:attribute name="reportMaxInterval" type="xs:anySimpleType"/>
479503
<xs:attribute name="reportMinInterval" type="xs:anySimpleType"/>
480504
<xs:attribute name="reportableChange" type="xs:anySimpleType"/>
481-
<xs:attribute name="optional" use="required" type="xs:boolean"/>
505+
<xs:attribute name="optional" type="xs:boolean" default="false"/>
482506
<xs:attribute name="side" use="required" type="zclSide"/>
483507
<xs:attribute name="type" use="required" type="xs:string"/>
484508
<xs:attribute name="readable" type="xs:boolean"/>
485509
<xs:attribute name="writable" type="xs:boolean"/>
486510
<xs:attribute name="reportable" type="xs:boolean"/>
487511
<xs:attribute name="array" type="xs:boolean"/>
488512
<xs:attribute name="isNullable" type="xs:boolean"/>
513+
<xs:attribute name="entryType" type="xs:string" />
489514
</xs:complexType>
490515
</xs:element>
491516
<xs:element name="description">

0 commit comments

Comments
 (0)