Skip to content

Commit 71f4926

Browse files
committed
Cleanup & fixing of type references so that ZAP generation works
1 parent f1a0907 commit 71f4926

9 files changed

+103
-104
lines changed

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

+8-5
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,26 @@ 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

25+
<bitmap name="WebRTCMetadataOptions" type="bitmap8">
26+
<cluster code="0x0553"/>
27+
<cluster code="0x0554"/>
28+
<field name="DataTLV" mask="0x01"/>
29+
</bitmap>
30+
2731
<!--
2832
These are test global items (no cluster attached) for testing only.
2933
Their usage is defined for UnitTestCluster only.
3034
-->
3135
<bitmap name="TestGlobalBitmap" type="bitmap32">
32-
<field mask="0x01" name="FirstBit" />
33-
<field mask="0x02" name="SecondBit" />
36+
<field mask="0x00000001" name="FirstBit"/>
37+
<field mask="0x00000002" name="SecondBit"/>
3438
</bitmap>
35-
3639
</configurator>

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

+15-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,21 @@ TODO: Make these structures global rather than defining them for each cluster.
3028
<item name="RollbackWrite" value="0x02"/>
3129
</enum>
3230

31+
<enum name="StreamTypeEnum" type="enum8">
32+
<cluster code="0x0553"/>
33+
<cluster code="0x0554"/>
34+
<item name="Internal" value="0x00"/>
35+
<item name="Recording" value="0x01"/>
36+
<item name="Analysis" value="0x02"/>
37+
<item name="LiveView" value="0x03"/>
38+
</enum>
39+
40+
<enum name="ThreeLevelAutoEnum" type="enum8">
41+
<item name="Low" value="0x00"/>
42+
<item name="Medium" value="0x01"/>
43+
<item name="High" value="0x02"/>
44+
<item name="Automatic" value="0x03"/>
45+
</enum>
3346
<!--
3447
These are test global items (no cluster attached) for testing only.
3548
Their usage is defined for UnitTestCluster only.

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

+21-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717

1818
<configurator>
1919
<domain name="CHIP"/>
20-
2120
<struct name="AtomicAttributeStatusStruct">
2221
<item fieldId="0" name="AttributeID" type="attrib_id" />
2322
<item fieldId="1" name="StatusCode" type="status"/>
@@ -30,20 +29,37 @@ limitations under the License.
3029
</struct>
3130

3231
<struct name="WebRTCSessionStruct" apiMaturity="provisional">
33-
<item fieldId="1" name="ID" type="WebRTCSessionID"/>
32+
<cluster code="0x0553"/>
33+
<cluster code="0x0554"/>
34+
<item fieldId="1" name="ID" type="int16u"/>
3435
<item fieldId="2" name="PeerNodeId" type="node_id"/>
3536
<item fieldId="3" name="PeerFabricIndex" type="fabric_idx"/>
3637
<item fieldId="4" name="StreamType" type="StreamTypeEnum" min="0x00" max="0x03"/>
37-
<item fieldId="5" name="VideoStreamID" type="VideoStreamID" isNullable="true"/>
38-
<item fieldId="6" name="AudioStreamID" type="AudioStreamID" isNullable="true"/>
38+
<item fieldId="5" name="VideoStreamID" type="int16u" isNullable="true"/>
39+
<item fieldId="6" name="AudioStreamID" type="int16u" isNullable="true"/>
3940
<item fieldId="7" name="MetadataOptions" type="WebRTCMetadataOptions" default="0x00" min="0x00" max="0x01"/>
4041
</struct>
4142

43+
<struct name="ICEServerStruct" apiMaturity="provisional">
44+
<cluster code="0x0553"/>
45+
<cluster code="0x0554"/>
46+
<item fieldId="1" name="urls" array="true" type="char_string"/>
47+
<item fieldId="2" name="username" type="char_string" optional="true"/>
48+
<item fieldId="3" name="credential" type="char_string" optional="true"/>
49+
<item fieldId="4" name="CAID" type="int16u" optional="true"/>
50+
</struct>
51+
52+
<struct name="PerStreamStruct" apiMaturity="provisional">
53+
<cluster code="0x0551"/>
54+
<cluster code="0x0552"/>
55+
<item fieldId="0" name="StreamID" type="int16u"/>
56+
<item fieldId="1" name="OnOff" type="boolean"/>
57+
</struct>
4258
<!--
4359
These are test global items (no cluster attached) for testing only.
4460
Their usage is defined for UnitTestCluster only.
4561
-->
46-
62+
4763
<struct name="TestGlobalStruct">
4864
<item fieldId="0" name="Name" type="char_string" length="128" isNullable="false" optional="false"/>
4965
<item fieldId="1" name="MyBitmap" type="TestGlobalBitmap" isNullable="true" optional="false"/>

src/app/zap-templates/zcl/data-model/draft/camera-av-settings-user-level-management-cluster.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
3535
<name>Camera AV Settings User Level Management</name>
3636
<code>0x0552</code>
3737
<define>CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER</define>
38-
<description/>
38+
<description>This cluster provides an interface into controls associated with the operation of a device that provides pan, tilt, and zoom functions, either mechanically, or against a digital image.</description>
3939
<client init="false" tick="false">true</client>
4040
<features>
4141
<feature bit="0" code="MPTZ" name="MechanicalPTZ" summary="Mechanical PTZ supported">
@@ -71,13 +71,13 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
7171

7272
<command code="0x03" source="client" name="DptzSetViewport" optional="true">
7373
<description>This command SHALL set the viewport in the digital PTZ for a specific Video Stream.</description>
74-
<arg id="0" name="VideoStreamID" type="VideoStreamID"/>
74+
<arg id="0" name="VideoStreamID" type="int16u"/>
7575
<arg id="1" name="Viewport" type="ViewportStruct"/>
7676
</command>
7777

7878
<command code="0x04" source="client" name="DptzRelativeMove" optional="true">
7979
<description>This command SHALL change the viewports location by the amount specified in a relative fashion.</description>
80-
<arg id="0" name="VideoStreamID" type="VideoStreamID"/>
80+
<arg id="0" name="VideoStreamID" type="int16u"/>
8181
<arg id="1" name="Pan" type="int16s" default="0"/>
8282
<arg id="2" name="Tilt" type="int16s" default="0"/>
8383
<arg id="3" name="Zoom" type="int8s" default="0" min="-100" max="100"/>

src/app/zap-templates/zcl/data-model/draft/camera-av-stream-management-cluster.xml

+17-23
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
7676

7777
<struct name="AudioStreamStruct" apiMaturity="provisional">
7878
<cluster code="0x0551"/>
79-
<item fieldId="0" name="AudioStreamID" type="AudioStreamID"/>
79+
<item fieldId="0" name="AudioStreamID" type="int16u"/>
8080
<item fieldId="1" name="StreamType" type="StreamTypeEnum" min="0x00" max="0x03"/>
8181
<item fieldId="2" name="AudioCodec" type="AudioCodecEnum" min="0x00" max="0x01"/>
8282
<item fieldId="3" name="ChannelCount" type="int8u"/>
@@ -86,13 +86,6 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
8686
<item fieldId="7" name="ReferenceCount" type="int8u"/>
8787
</struct>
8888

89-
<struct name="PerStreamStruct" apiMaturity="provisional">
90-
<cluster code="0x0551"/>
91-
<cluster code="0x0552"/>
92-
<item fieldId="0" name="StreamID" type="unit8"/>
93-
<item fieldId="1" name="OnOff" type="boolean"/>
94-
</struct>
95-
9689
<struct name="RateDistortionTradeOffPointsStruct" apiMaturity="provisional">
9790
<cluster code="0x0551"/>
9891
<item fieldId="0" name="Codec" type="VideoCodecEnum" min="0x00" max="0x03"/>
@@ -109,7 +102,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
109102

110103
<struct name="SnapshotStreamStruct" apiMaturity="provisional">
111104
<cluster code="0x0551"/>
112-
<item fieldId="0" name="SnapshotStreamID" type="SnapshotStreamID"/>
105+
<item fieldId="0" name="SnapshotStreamID" type="int16u"/>
113106
<item fieldId="1" name="ImageCodec" type="ImageCodecEnum" min="0x00" max="0x00"/>
114107
<item fieldId="2" name="FrameRate" type="int16u"/>
115108
<item fieldId="3" name="BitRate" type="int32u"/>
@@ -130,7 +123,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
130123

131124
<struct name="VideoStreamStruct" apiMaturity="provisional">
132125
<cluster code="0x0551"/>
133-
<item fieldId="0" name="VideoStreamID" type="VideoStreamID"/>
126+
<item fieldId="0" name="VideoStreamID" type="int16u"/>
134127
<item fieldId="1" name="StreamType" type="StreamTypeEnum" min="0x00" max="0x03"/>
135128
<item fieldId="2" name="VideoCodec" type="VideoCodecEnum" min="0x00" max="0x03"/>
136129
<item fieldId="3" name="MinFrameRate" type="int16u"/>
@@ -153,12 +146,13 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
153146
<item fieldId="3" name="Y2" type="int16u" default="0"/>
154147
</struct>
155148

156-
<cluster>
149+
<cluster apiMaturity="provisional">
157150
<domain name="General"/>
158151
<name>Camera AV Stream Management</name>
159152
<code>0x0551</code>
160153
<define>CAMERA_AV_STREAM_MANAGEMENT_CLUSTER</define>
161-
<description/>
154+
<description>This cluster is used to allow clients to manage, control, and configure various
155+
audio, video, and snapshot streams on a camera.</description>
162156
<client init="false" tick="false">true</client>
163157
<features>
164158
<feature bit="0" code="PRIV" name="Privacy" summary="Privacy supported">
@@ -427,13 +421,13 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
427421

428422
<command code="0x01" source="server" name="AudioStreamAllocateResponse" optional="true" disableDefaultResponse="true">
429423
<description>This command SHALL be sent by the camera in response to the AudioStreamAllocate command, carrying the newly allocated audio stream identifier.</description>
430-
<arg id="0" name="AudioStreamID" type="AudioStreamID"/>
424+
<arg id="0" name="AudioStreamID" type="int16u"/>
431425
</command>
432426

433427
<command code="0x02" source="client" name="AudioStreamDeallocate" optional="true">
434428
<description>This command SHALL deallocate an audio stream on the camera, corresponding to the given audio stream identifier.</description>
435429
<access op="invoke" privilege="administer"/>
436-
<arg id="0" name="AudioStreamID" type="AudioStreamID"/>
430+
<arg id="0" name="AudioStreamID" type="int16u"/>
437431
</command>
438432

439433
<command code="0x03" source="client" name="VideoStreamAllocate" optional="true" response="VideoStreamAllocateResponse">
@@ -453,20 +447,20 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
453447

454448
<command code="0x04" source="server" name="VideoStreamAllocateResponse" optional="true" disableDefaultResponse="true">
455449
<description>This command SHALL be sent by the camera in response to the VideoStreamAllocate command, carrying the newly allocated video stream identifier.</description>
456-
<arg id="0" name="VideoStreamID" type="VideoStreamID"/>
450+
<arg id="0" name="VideoStreamID" type="int16u"/>
457451
</command>
458452

459453
<command code="0x05" source="client" name="VideoStreamModify" optional="true">
460454
<description>This command SHALL be used to modify the resolution of a stream specified by the VideoStreamID.</description>
461455
<access op="invoke" privilege="administer"/>
462-
<arg id="0" name="VideoStreamID" type="VideoStreamID"/>
456+
<arg id="0" name="VideoStreamID" type="int16u"/>
463457
<arg id="1" name="Resolution" type="DimensionStruct"/>
464458
</command>
465459

466460
<command code="0x06" source="client" name="VideoStreamDeallocate" optional="true">
467461
<description>This command SHALL deallocate a video stream on the camera, corresponding to the given video stream identifier.</description>
468462
<access op="invoke" privilege="administer"/>
469-
<arg id="0" name="VideoStreamID" type="VideoStreamID"/>
463+
<arg id="0" name="VideoStreamID" type="int16u"/>
470464
</command>
471465

472466
<command code="0x07" source="client" name="SnapshotStreamAllocate" optional="true" response="SnapshotStreamAllocateResponse">
@@ -482,13 +476,13 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
482476

483477
<command code="0x08" source="server" name="SnapshotStreamAllocateResponse" optional="true" disableDefaultResponse="true">
484478
<description>This command SHALL be sent by the device in response to the SnapshotStreamAllocate command, carrying the newly allocated snapshot stream identifier.</description>
485-
<arg id="0" name="SnapshotStreamID" type="SnapshotStreamID"/>
479+
<arg id="0" name="SnapshotStreamID" type="int16u"/>
486480
</command>
487481

488482
<command code="0x09" source="client" name="SnapshotStreamDeallocate" optional="true">
489483
<description>This command SHALL deallocate an snapshot stream on the camera, corresponding to the given snapshot stream identifier.</description>
490484
<access op="invoke" privilege="administer"/>
491-
<arg id="0" name="SnapshotStreamID" type="SnapshotStreamID"/>
485+
<arg id="0" name="SnapshotStreamID" type="int16u"/>
492486
</command>
493487

494488
<command code="0x0A" source="client" name="SetStreamPriority" optional="false">
@@ -499,7 +493,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
499493
<command code="0x0B" source="client" name="CaptureSnapshot" optional="true">
500494
<description>This command SHALL return a Snapshot from the camera.</description>
501495
<access op="invoke" privilege="administer"/>
502-
<arg id="0" name="SnapshotStreamID" type="SnapshotStreamID"/>
496+
<arg id="0" name="SnapshotStreamID" type="int16u"/>
503497
<arg id="1" name="RequestedResolution" type="DimensionStruct"/>
504498
</command>
505499

@@ -531,7 +525,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
531525
</command>
532526

533527
<event code="0x0000" name="VideoStreamChanged" priority="info" side="server" optional="true">
534-
<field id="0" name="VideoStreamID" type="VideoStreamID"/>
528+
<field id="0" name="VideoStreamID" type="int16u"/>
535529
<field id="1" name="StreamType" type="StreamTypeEnum" optional="true" min="0x00" max="0x03"/>
536530
<field id="2" name="VideoCodec" type="VideoCodecEnum" optional="true" min="0x00" max="0x03"/>
537531
<field id="3" name="MinFrameRate" type="int16u" optional="true"/>
@@ -546,7 +540,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
546540
</event>
547541

548542
<event code="0x0001" name="AudioStreamChanged" priority="info" side="server" optional="true">
549-
<field id="0" name="AudioStreamID" type="AudioStreamID"/>
543+
<field id="0" name="AudioStreamID" type="int16u"/>
550544
<field id="1" name="StreamType" type="StreamTypeEnum" optional="true" min="0x00" max="0x03"/>
551545
<field id="2" name="AudioCodec" type="AudioCodecEnum" optional="true" min="0x00" max="0x01"/>
552546
<field id="3" name="ChannelCount" type="int8u" optional="true"/>
@@ -557,7 +551,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
557551
</event>
558552

559553
<event code="0x0002" name="SnapshotStreamChanged" priority="info" side="server" optional="true">
560-
<field id="0" name="SnapshotStreamID" type="SnapshotStreamID"/>
554+
<field id="0" name="SnapshotStreamID" type="int16u"/>
561555
<field id="1" name="ImageCodec" type="ImageCodecEnum" optional="true" min="0x00" max="0x00"/>
562556
<field id="2" name="FrameRate" type="int16u" optional="true"/>
563557
<field id="3" name="BitRate" type="int32u" optional="true"/>

src/app/zap-templates/zcl/data-model/draft/chime-cluster.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
2828
<item fieldId="1" name="Name" type="char_string" length="48"/>
2929
</struct>
3030

31-
<cluster>
31+
<cluster apiMaturity="provisional">
3232
<domain name="General"/>
3333
<name>Chime</name>
3434
<code>0x0556</code>
3535
<define>CHIME_CLUSTER</define>
36-
<description/>
36+
<description>This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell.</description>
3737
<client init="false" tick="false">true</client>
3838
<server init="false" tick="false">true</server>
3939
<globalAttribute code="0xFFFD" side="either" value="1"/>

0 commit comments

Comments
 (0)