Skip to content

Commit 522c555

Browse files
Creation of the Camera AV User Level Management Cluster (#36770)
* Initial push of camera user settings cluster * Initial commit for AV User Settings cluster .xml and zap regen * First draft of Python TC for AVSUM 2.1 * Align attribute names to codegen * Cleanup based on test results * Fix step counts. Add step skip if no Feature Map entries. * Changing domain to Cameras * Correct the domain name * Remove draft TC from PR * Sync with master and regenerate zap * Adding zap gen for Darwin * Restyled by whitespace * Restyled by prettier-json * CChange struct field name from values -> presets * Rename of attribute to Settings to reflect the requested changes to the matching Spec PR. * New alchemy version of the XML following spec updates to normalize use of case in attribute and field names for acronyms. * Zap regen for Alchemy generated updated XML tracking Spec PR in flight * Restyled by whitespace * Restyled by prettier-json * Renumber struct field IDs Fix accidental backout of chime-server reference * Regen after sync with master * Restyled by whitespace * Restyled by prettier-json * Regenerate Zap following merge of master --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 0129a57 commit 522c555

File tree

58 files changed

+11917
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+11917
-2
lines changed

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ jobs:
111111
src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml \
112112
src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml \
113113
src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml \
114+
src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml \
114115
src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml \
115116
src/app/zap-templates/zcl/data-model/chip/chip-ota.xml \
116117
src/app/zap-templates/zcl/data-model/chip/chip-types.xml \

docs/ids_and_codes/zap_clusters.md

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Generally regenerate using one of:
131131
| 1296 | 0x510 | ContentAppObserver |
132132
| 1360 | 0x550 | ZoneManagement |
133133
| 1361 | 0x551 | CameraAvStreamManagement |
134+
| 1362 | 0x552 | CameraAvSettingsUserLevelManagement |
134135
| 1363 | 0x553 | WebRTCTransportProvider |
135136
| 1364 | 0x554 | WebRTCTransportRequestor |
136137
| 1366 | 0x556 | Chime |

scripts/rules.matterlint

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml";
1414
load "../src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml";
1515
load "../src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml";
1616
load "../src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml";
17+
load "../src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml";
1718
load "../src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml";
1819
load "../src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml";
1920
load "../src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
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+
XML generated by Alchemy; DO NOT EDIT.
19+
Source: src\app_clusters\CameraAVSettingsUserLevelManagement.adoc
20+
Parameters:
21+
Git: 1.4-444-g6d595e737
22+
-->
23+
<configurator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../zcl.xsd">
24+
<domain name="Cameras"/>
25+
<struct name="MPTZPresetStruct" apiMaturity="provisional">
26+
<cluster code="0x0552"/>
27+
<item fieldId="0" name="PresetID" type="int8u"/>
28+
<item fieldId="1" name="Name" type="char_string" length="32"/>
29+
<item fieldId="2" name="Settings" type="MPTZStruct"/>
30+
</struct>
31+
32+
<struct name="MPTZStruct" apiMaturity="provisional">
33+
<cluster code="0x0552"/>
34+
<item fieldId="0" name="Pan" type="int16s" optional="true" default="0" min="-180" max="180"/>
35+
<item fieldId="1" name="Tilt" type="int16s" optional="true" default="0" min="-180" max="180"/>
36+
<item fieldId="2" name="Zoom" type="int8u" optional="true" default="1" min="1"/>
37+
</struct>
38+
39+
<cluster apiMaturity="provisional">
40+
<domain>Cameras</domain>
41+
<name>Camera AV Settings User Level Management</name>
42+
<code>0x0552</code>
43+
<define>CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER</define>
44+
<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>
45+
<client init="false" tick="false">true</client>
46+
<features>
47+
<feature bit="0" code="DPTZ" name="DigitalPTZ" summary="Digital PTZ support">
48+
<optionalConform/>
49+
</feature>
50+
<feature bit="1" code="MPAN" name="MechanicalPan" summary="Mechanical Pan support">
51+
<optionalConform choice="a" more="true" min="1"/>
52+
</feature>
53+
<feature bit="2" code="MTILT" name="MechanicalTilt" summary="Mechanical Tilt support">
54+
<optionalConform choice="a" more="true" min="1"/>
55+
</feature>
56+
<feature bit="3" code="MZOOM" name="MechanicalZoom" summary="Mechanical Zoom support">
57+
<optionalConform choice="a" more="true" min="1"/>
58+
</feature>
59+
<feature bit="4" code="MPRESETS" name="MechanicalPresets" summary="Mechanical saved presets support">
60+
<optionalConform>
61+
<orTerm>
62+
<feature name="MPAN"/>
63+
<feature name="MTILT"/>
64+
<feature name="MZOOM"/>
65+
</orTerm>
66+
</optionalConform>
67+
</feature>
68+
</features>
69+
<server init="false" tick="false">true</server>
70+
<globalAttribute code="0xFFFD" side="either" value="1"/>
71+
<attribute code="0x0000" side="server" define="MPTZ" type="MPTZStruct" optional="true">
72+
<description>MPTZPosition</description>
73+
<mandatoryConform>
74+
<orTerm>
75+
<feature name="MPAN"/>
76+
<feature name="MTILT"/>
77+
<feature name="MZOOM"/>
78+
</orTerm>
79+
</mandatoryConform>
80+
</attribute>
81+
<attribute code="0x0001" side="server" define="MAX_PRESETS" type="int8u" optional="true" default="5">
82+
<description>MaxPresets</description>
83+
<mandatoryConform>
84+
<feature name="MPRESETS"/>
85+
</mandatoryConform>
86+
</attribute>
87+
<attribute code="0x0002" side="server" define="PRESET_MPTZ_TABLE" type="array" entryType="MPTZPresetStruct" optional="true">
88+
<description>MPTZPresets</description>
89+
<mandatoryConform>
90+
<feature name="MPRESETS"/>
91+
</mandatoryConform>
92+
</attribute>
93+
<attribute code="0x0003" side="server" define="MPTZ_RELATIVE_MOVE" type="array" optional="true" entryType="int16u">
94+
<description>DPTZRelativeMove</description>
95+
<mandatoryConform>
96+
<feature name="DPTZ"/>
97+
</mandatoryConform>
98+
</attribute>
99+
<attribute code="0x0004" side="server" define="DPTZ_RELATIVE_MOVE" type="int8u" optional="true" min="2" max="100" default="100">
100+
<description>ZoomMax</description>
101+
<mandatoryConform>
102+
<feature name="MZOOM"/>
103+
</mandatoryConform>
104+
</attribute>
105+
<attribute code="0x0005" side="server" define="TILT_MIN" type="int16s" min="-180" max="179" default="-90" optional="true">
106+
<description>TiltMin</description>
107+
<mandatoryConform>
108+
<feature name="MTILT"/>
109+
</mandatoryConform>
110+
</attribute>
111+
<attribute code="0x0006" side="server" define="TILT_MAX" type="int16s" min="-179" max="180" default="90" optional="true">
112+
<description>TiltMax</description>
113+
<mandatoryConform>
114+
<feature name="MTILT"/>
115+
</mandatoryConform>
116+
</attribute>
117+
<attribute code="0x0007" side="server" define="PAN_MIN" type="int16s" min="-180" max="179" default="-180" optional="true">
118+
<description>PanMin</description>
119+
<mandatoryConform>
120+
<feature name="MPAN"/>
121+
</mandatoryConform>
122+
</attribute>
123+
<attribute code="0x0008" side="server" define="PAN_MAX" type="int16s" min="-179" max="180" default="180" optional="true">
124+
<description>PanMax</description>
125+
<mandatoryConform>
126+
<feature name="MPAN"/>
127+
</mandatoryConform>
128+
</attribute>
129+
<command code="0x00" source="client" name="MPTZSetPosition" optional="true">
130+
<description>This command SHALL set the values for the pan, tilt, and zoom in the mechanical PTZ.</description>
131+
<arg id="0" name="Pan" type="int16s" optional="true"/>
132+
<arg id="1" name="Tilt" type="int16s" optional="true"/>
133+
<arg id="2" name="Zoom" type="int8u" optional="true" min="1" max="1"/>
134+
<mandatoryConform>
135+
<orTerm>
136+
<feature name="MPAN"/>
137+
<feature name="MTILT"/>
138+
<feature name="MZOOM"/>
139+
</orTerm>
140+
</mandatoryConform>
141+
</command>
142+
143+
<command code="0x01" source="client" name="MPTZRelativeMove" optional="true">
144+
<description>This command SHALL move the device by the delta values relative to the currently defined position.</description>
145+
<arg id="0" name="PanDelta" type="int16s" default="0" optional="true"/>
146+
<arg id="1" name="TiltDelta" type="int16s" default="0" optional="true"/>
147+
<arg id="2" name="ZoomDelta" type="int8s" default="0" optional="true"/>
148+
<optionalConform>
149+
<orTerm>
150+
<feature name="MPAN"/>
151+
<feature name="MTILT"/>
152+
<feature name="MZOOM"/>
153+
</orTerm>
154+
</optionalConform>
155+
</command>
156+
157+
<command code="0x02" source="client" name="MPTZMoveToPreset" optional="true">
158+
<description>This command SHALL move the camera to the positions specified by the Preset passed.</description>
159+
<arg id="0" name="PresetID" type="int8u"/>
160+
<mandatoryConform>
161+
<feature name="MPRESETS"/>
162+
</mandatoryConform>
163+
</command>
164+
165+
<command code="0x03" source="client" name="MPTZSavePreset" optional="true">
166+
<description>This command allows creating a new preset or updating the values of an existing one.</description>
167+
<arg id="0" name="PresetID" type="int8u" optional="true"/>
168+
<arg id="1" name="Name" type="char_string" length="32"/>
169+
<mandatoryConform>
170+
<feature name="MPRESETS"/>
171+
</mandatoryConform>
172+
</command>
173+
174+
<command code="0x04" source="client" name="MPTZRemovePreset" optional="true">
175+
<description>This command SHALL remove a preset entry from the PresetMptzTable.</description>
176+
<arg id="0" name="PresetID" type="int8u"/>
177+
<mandatoryConform>
178+
<feature name="MPRESETS"/>
179+
</mandatoryConform>
180+
</command>
181+
182+
<command code="0x05" source="client" name="DPTZSetViewport" optional="true">
183+
<description>This command allows for setting the digital viewport for a specific Video Stream.</description>
184+
<arg id="0" name="VideoStreamID" type="int16u"/>
185+
<arg id="1" name="Viewport" type="ViewportStruct"/>
186+
<mandatoryConform>
187+
<feature name="DPTZ"/>
188+
</mandatoryConform>
189+
</command>
190+
191+
<command code="0x06" source="client" name="DPTZRelativeMove" optional="true">
192+
<description>This command SHALL change the viewports location by the amount specified in a relative fashion.</description>
193+
<arg id="0" name="VideoStreamID" type="int16u"/>
194+
<arg id="1" name="DeltaX" type="int16s" optional="true" default="0"/>
195+
<arg id="2" name="DeltaY" type="int16s" optional="true" default="0"/>
196+
<arg id="3" name="ZoomDelta" type="int8s" optional="true" default="0" min="-100" max="100"/>
197+
<optionalConform>
198+
<feature name="DPTZ"/>
199+
</optionalConform>
200+
</command>
201+
202+
</cluster>
203+
</configurator>

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"boolean-state-configuration-cluster.xml",
2828
"actions-cluster.xml",
2929
"bridged-device-basic-information.xml",
30+
"camera-av-settings-user-level-management-cluster.xml",
3031
"camera-av-stream-management-cluster.xml",
3132
"chime-cluster.xml",
3233
"chip-ota.xml",
@@ -685,7 +686,8 @@
685686
"MicrophoneCapabilities",
686687
"SpeakerCapabilities",
687688
"Viewport"
688-
]
689+
],
690+
"Camera AV Settings User Level Management": ["MPTZPosition"]
689691
},
690692
"mandatoryDeviceTypes": "0x0016",
691693
"defaultReportingPolicy": "mandatory",

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"boolean-state-configuration-cluster.xml",
2323
"actions-cluster.xml",
2424
"bridged-device-basic-information.xml",
25+
"camera-av-settings-user-level-management-cluster.xml",
2526
"camera-av-stream-management-cluster.xml",
2627
"chime-cluster.xml",
2728
"chip-ota.xml",
@@ -679,7 +680,8 @@
679680
"MicrophoneCapabilities",
680681
"SpeakerCapabilities",
681682
"Viewport"
682-
]
683+
],
684+
"Camera AV Settings User Level Management": ["MPTZPosition"]
683685
},
684686
"mandatoryDeviceTypes": "0x0016",
685687
"defaultReportingPolicy": "mandatory",

src/app/zap_cluster_list.json

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"BOOLEAN_STATE_CLUSTER": [],
1717
"BOOLEAN_STATE_CONFIGURATION_CLUSTER": [],
1818
"BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [],
19+
"CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER": [],
1920
"CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [],
2021
"CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [],
2122
"CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [],
@@ -163,6 +164,7 @@
163164
"BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [
164165
"bridged-device-basic-information-server"
165166
],
167+
"CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER": [],
166168
"CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [],
167169
"CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [
168170
"concentration-measurement-server"

src/controller/data_model/controller-clusters.matter

+100
Original file line numberDiff line numberDiff line change
@@ -9837,6 +9837,106 @@ provisional cluster CameraAvStreamManagement = 1361 {
98379837
command CaptureSnapshot(CaptureSnapshotRequest): CaptureSnapshotResponse = 11;
98389838
}
98399839

9840+
/** 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. */
9841+
provisional cluster CameraAvSettingsUserLevelManagement = 1362 {
9842+
revision 1;
9843+
9844+
bitmap Feature : bitmap32 {
9845+
kDigitalPTZ = 0x1;
9846+
kMechanicalPan = 0x2;
9847+
kMechanicalTilt = 0x4;
9848+
kMechanicalZoom = 0x8;
9849+
kMechanicalPresets = 0x10;
9850+
}
9851+
9852+
struct MPTZStruct {
9853+
optional int16s pan = 0;
9854+
optional int16s tilt = 1;
9855+
optional int8u zoom = 2;
9856+
}
9857+
9858+
struct MPTZPresetStruct {
9859+
int8u presetID = 0;
9860+
char_string<32> name = 1;
9861+
MPTZStruct settings = 2;
9862+
}
9863+
9864+
struct ViewportStruct {
9865+
int16u x1 = 0;
9866+
int16u y1 = 1;
9867+
int16u x2 = 2;
9868+
int16u y2 = 3;
9869+
}
9870+
9871+
readonly attribute optional MPTZStruct MPTZPosition = 0;
9872+
readonly attribute optional int8u maxPresets = 1;
9873+
readonly attribute optional MPTZPresetStruct MPTZPresets[] = 2;
9874+
readonly attribute optional int16u DPTZRelativeMove[] = 3;
9875+
readonly attribute optional int8u zoomMax = 4;
9876+
readonly attribute optional int16s tiltMin = 5;
9877+
readonly attribute optional int16s tiltMax = 6;
9878+
readonly attribute optional int16s panMin = 7;
9879+
readonly attribute optional int16s panMax = 8;
9880+
readonly attribute command_id generatedCommandList[] = 65528;
9881+
readonly attribute command_id acceptedCommandList[] = 65529;
9882+
readonly attribute event_id eventList[] = 65530;
9883+
readonly attribute attrib_id attributeList[] = 65531;
9884+
readonly attribute bitmap32 featureMap = 65532;
9885+
readonly attribute int16u clusterRevision = 65533;
9886+
9887+
request struct MPTZSetPositionRequest {
9888+
optional int16s pan = 0;
9889+
optional int16s tilt = 1;
9890+
optional int8u zoom = 2;
9891+
}
9892+
9893+
request struct MPTZRelativeMoveRequest {
9894+
optional int16s panDelta = 0;
9895+
optional int16s tiltDelta = 1;
9896+
optional int8s zoomDelta = 2;
9897+
}
9898+
9899+
request struct MPTZMoveToPresetRequest {
9900+
int8u presetID = 0;
9901+
}
9902+
9903+
request struct MPTZSavePresetRequest {
9904+
optional int8u presetID = 0;
9905+
char_string<32> name = 1;
9906+
}
9907+
9908+
request struct MPTZRemovePresetRequest {
9909+
int8u presetID = 0;
9910+
}
9911+
9912+
request struct DPTZSetViewportRequest {
9913+
int16u videoStreamID = 0;
9914+
ViewportStruct viewport = 1;
9915+
}
9916+
9917+
request struct DPTZRelativeMoveRequest {
9918+
int16u videoStreamID = 0;
9919+
optional int16s deltaX = 1;
9920+
optional int16s deltaY = 2;
9921+
optional int8s zoomDelta = 3;
9922+
}
9923+
9924+
/** This command SHALL set the values for the pan, tilt, and zoom in the mechanical PTZ. */
9925+
command MPTZSetPosition(MPTZSetPositionRequest): DefaultSuccess = 0;
9926+
/** This command SHALL move the device by the delta values relative to the currently defined position. */
9927+
command MPTZRelativeMove(MPTZRelativeMoveRequest): DefaultSuccess = 1;
9928+
/** This command SHALL move the camera to the positions specified by the Preset passed. */
9929+
command MPTZMoveToPreset(MPTZMoveToPresetRequest): DefaultSuccess = 2;
9930+
/** This command allows creating a new preset or updating the values of an existing one. */
9931+
command MPTZSavePreset(MPTZSavePresetRequest): DefaultSuccess = 3;
9932+
/** This command SHALL remove a preset entry from the PresetMptzTable. */
9933+
command MPTZRemovePreset(MPTZRemovePresetRequest): DefaultSuccess = 4;
9934+
/** This command allows for setting the digital viewport for a specific Video Stream. */
9935+
command DPTZSetViewport(DPTZSetViewportRequest): DefaultSuccess = 5;
9936+
/** This command SHALL change the viewports location by the amount specified in a relative fashion. */
9937+
command DPTZRelativeMove(DPTZRelativeMoveRequest): DefaultSuccess = 6;
9938+
}
9939+
98409940
/** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */
98419941
provisional cluster WebRTCTransportProvider = 1363 {
98429942
revision 1;

0 commit comments

Comments
 (0)