Skip to content

Commit

Permalink
Cleanup & fixing of type references so that ZAP generation works
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcosb committed Sep 24, 2024
1 parent f1a0907 commit 71f4926
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 104 deletions.
13 changes: 8 additions & 5 deletions src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,26 @@ 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.
-->

<!--
TODO: Make these structures global rather than defining them for each cluster.
This depends on the ability to define global structs via XML tags.
see: https://github.com/project-chip/connectedhomeip/issues/29818
-->

<configurator>
<domain name="CHIP"/>

<bitmap name="WebRTCMetadataOptions" type="bitmap8">
<cluster code="0x0553"/>
<cluster code="0x0554"/>
<field name="DataTLV" mask="0x01"/>
</bitmap>

<!--
These are test global items (no cluster attached) for testing only.
Their usage is defined for UnitTestCluster only.
-->
<bitmap name="TestGlobalBitmap" type="bitmap32">
<field mask="0x01" name="FirstBit" />
<field mask="0x02" name="SecondBit" />
<field mask="0x00000001" name="FirstBit"/>
<field mask="0x00000002" name="SecondBit"/>
</bitmap>

</configurator>
17 changes: 15 additions & 2 deletions src/app/zap-templates/zcl/data-model/chip/global-enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ 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.
-->

<!--
TODO: Make these structures global rather than defining them for each cluster.
This depends on the ability to define global structs via XML tags.
see: https://github.com/project-chip/connectedhomeip/issues/29818
-->

<configurator>
<domain name="CHIP"/>

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

<enum name="StreamTypeEnum" type="enum8">
<cluster code="0x0553"/>
<cluster code="0x0554"/>
<item name="Internal" value="0x00"/>
<item name="Recording" value="0x01"/>
<item name="Analysis" value="0x02"/>
<item name="LiveView" value="0x03"/>
</enum>

<enum name="ThreeLevelAutoEnum" type="enum8">
<item name="Low" value="0x00"/>
<item name="Medium" value="0x01"/>
<item name="High" value="0x02"/>
<item name="Automatic" value="0x03"/>
</enum>
<!--
These are test global items (no cluster attached) for testing only.
Their usage is defined for UnitTestCluster only.
Expand Down
26 changes: 21 additions & 5 deletions src/app/zap-templates/zcl/data-model/chip/global-structs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.

<configurator>
<domain name="CHIP"/>

<struct name="AtomicAttributeStatusStruct">
<item fieldId="0" name="AttributeID" type="attrib_id" />
<item fieldId="1" name="StatusCode" type="status"/>
Expand All @@ -30,20 +29,37 @@ limitations under the License.
</struct>

<struct name="WebRTCSessionStruct" apiMaturity="provisional">
<item fieldId="1" name="ID" type="WebRTCSessionID"/>
<cluster code="0x0553"/>
<cluster code="0x0554"/>
<item fieldId="1" name="ID" type="int16u"/>
<item fieldId="2" name="PeerNodeId" type="node_id"/>
<item fieldId="3" name="PeerFabricIndex" type="fabric_idx"/>
<item fieldId="4" name="StreamType" type="StreamTypeEnum" min="0x00" max="0x03"/>
<item fieldId="5" name="VideoStreamID" type="VideoStreamID" isNullable="true"/>
<item fieldId="6" name="AudioStreamID" type="AudioStreamID" isNullable="true"/>
<item fieldId="5" name="VideoStreamID" type="int16u" isNullable="true"/>
<item fieldId="6" name="AudioStreamID" type="int16u" isNullable="true"/>
<item fieldId="7" name="MetadataOptions" type="WebRTCMetadataOptions" default="0x00" min="0x00" max="0x01"/>
</struct>

<struct name="ICEServerStruct" apiMaturity="provisional">
<cluster code="0x0553"/>
<cluster code="0x0554"/>
<item fieldId="1" name="urls" array="true" type="char_string"/>
<item fieldId="2" name="username" type="char_string" optional="true"/>
<item fieldId="3" name="credential" type="char_string" optional="true"/>
<item fieldId="4" name="CAID" type="int16u" optional="true"/>
</struct>

<struct name="PerStreamStruct" apiMaturity="provisional">
<cluster code="0x0551"/>
<cluster code="0x0552"/>
<item fieldId="0" name="StreamID" type="int16u"/>
<item fieldId="1" name="OnOff" type="boolean"/>
</struct>
<!--
These are test global items (no cluster attached) for testing only.
Their usage is defined for UnitTestCluster only.
-->

<struct name="TestGlobalStruct">
<item fieldId="0" name="Name" type="char_string" length="128" isNullable="false" optional="false"/>
<item fieldId="1" name="MyBitmap" type="TestGlobalBitmap" isNullable="true" optional="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
<name>Camera AV Settings User Level Management</name>
<code>0x0552</code>
<define>CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER</define>
<description/>
<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>
<client init="false" tick="false">true</client>
<features>
<feature bit="0" code="MPTZ" name="MechanicalPTZ" summary="Mechanical PTZ supported">
Expand Down Expand Up @@ -71,13 +71,13 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty

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

<command code="0x04" source="client" name="DptzRelativeMove" optional="true">
<description>This command SHALL change the viewports location by the amount specified in a relative fashion.</description>
<arg id="0" name="VideoStreamID" type="VideoStreamID"/>
<arg id="0" name="VideoStreamID" type="int16u"/>
<arg id="1" name="Pan" type="int16s" default="0"/>
<arg id="2" name="Tilt" type="int16s" default="0"/>
<arg id="3" name="Zoom" type="int8s" default="0" min="-100" max="100"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty

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

<struct name="PerStreamStruct" apiMaturity="provisional">
<cluster code="0x0551"/>
<cluster code="0x0552"/>
<item fieldId="0" name="StreamID" type="unit8"/>
<item fieldId="1" name="OnOff" type="boolean"/>
</struct>

<struct name="RateDistortionTradeOffPointsStruct" apiMaturity="provisional">
<cluster code="0x0551"/>
<item fieldId="0" name="Codec" type="VideoCodecEnum" min="0x00" max="0x03"/>
Expand All @@ -109,7 +102,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty

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

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

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

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

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

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

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

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

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

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

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

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

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

Expand Down Expand Up @@ -531,7 +525,7 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
</command>

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

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

<event code="0x0002" name="SnapshotStreamChanged" priority="info" side="server" optional="true">
<field id="0" name="SnapshotStreamID" type="SnapshotStreamID"/>
<field id="0" name="SnapshotStreamID" type="int16u"/>
<field id="1" name="ImageCodec" type="ImageCodecEnum" optional="true" min="0x00" max="0x00"/>
<field id="2" name="FrameRate" type="int16u" optional="true"/>
<field id="3" name="BitRate" type="int32u" optional="true"/>
Expand Down
4 changes: 2 additions & 2 deletions src/app/zap-templates/zcl/data-model/draft/chime-cluster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Git: 0.7-fall2024-ncr-1155-g78ec59e8a-dirty
<item fieldId="1" name="Name" type="char_string" length="48"/>
</struct>

<cluster>
<cluster apiMaturity="provisional">
<domain name="General"/>
<name>Chime</name>
<code>0x0556</code>
<define>CHIME_CLUSTER</define>
<description/>
<description>This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell.</description>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<globalAttribute code="0xFFFD" side="either" value="1"/>
Expand Down
Loading

0 comments on commit 71f4926

Please sign in to comment.