Skip to content

Commit

Permalink
Creation of the Camera AV User Level Management Cluster (#36770)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
marktrayer and restyled-commits authored Jan 9, 2025
1 parent 0129a57 commit 522c555
Show file tree
Hide file tree
Showing 58 changed files with 11,917 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml \
src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/chip-ota.xml \
src/app/zap-templates/zcl/data-model/chip/chip-types.xml \
Expand Down
1 change: 1 addition & 0 deletions docs/ids_and_codes/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Generally regenerate using one of:
| 1296 | 0x510 | ContentAppObserver |
| 1360 | 0x550 | ZoneManagement |
| 1361 | 0x551 | CameraAvStreamManagement |
| 1362 | 0x552 | CameraAvSettingsUserLevelManagement |
| 1363 | 0x553 | WebRTCTransportProvider |
| 1364 | 0x554 | WebRTCTransportRequestor |
| 1366 | 0x556 | Chime |
Expand Down
1 change: 1 addition & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml";
load "../src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2024 Project CHIP Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
-->
<!--
XML generated by Alchemy; DO NOT EDIT.
Source: src\app_clusters\CameraAVSettingsUserLevelManagement.adoc
Parameters:
Git: 1.4-444-g6d595e737
-->
<configurator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../zcl.xsd">
<domain name="Cameras"/>
<struct name="MPTZPresetStruct" apiMaturity="provisional">
<cluster code="0x0552"/>
<item fieldId="0" name="PresetID" type="int8u"/>
<item fieldId="1" name="Name" type="char_string" length="32"/>
<item fieldId="2" name="Settings" type="MPTZStruct"/>
</struct>

<struct name="MPTZStruct" apiMaturity="provisional">
<cluster code="0x0552"/>
<item fieldId="0" name="Pan" type="int16s" optional="true" default="0" min="-180" max="180"/>
<item fieldId="1" name="Tilt" type="int16s" optional="true" default="0" min="-180" max="180"/>
<item fieldId="2" name="Zoom" type="int8u" optional="true" default="1" min="1"/>
</struct>

<cluster apiMaturity="provisional">
<domain>Cameras</domain>
<name>Camera AV Settings User Level Management</name>
<code>0x0552</code>
<define>CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER</define>
<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="DPTZ" name="DigitalPTZ" summary="Digital PTZ support">
<optionalConform/>
</feature>
<feature bit="1" code="MPAN" name="MechanicalPan" summary="Mechanical Pan support">
<optionalConform choice="a" more="true" min="1"/>
</feature>
<feature bit="2" code="MTILT" name="MechanicalTilt" summary="Mechanical Tilt support">
<optionalConform choice="a" more="true" min="1"/>
</feature>
<feature bit="3" code="MZOOM" name="MechanicalZoom" summary="Mechanical Zoom support">
<optionalConform choice="a" more="true" min="1"/>
</feature>
<feature bit="4" code="MPRESETS" name="MechanicalPresets" summary="Mechanical saved presets support">
<optionalConform>
<orTerm>
<feature name="MPAN"/>
<feature name="MTILT"/>
<feature name="MZOOM"/>
</orTerm>
</optionalConform>
</feature>
</features>
<server init="false" tick="false">true</server>
<globalAttribute code="0xFFFD" side="either" value="1"/>
<attribute code="0x0000" side="server" define="MPTZ" type="MPTZStruct" optional="true">
<description>MPTZPosition</description>
<mandatoryConform>
<orTerm>
<feature name="MPAN"/>
<feature name="MTILT"/>
<feature name="MZOOM"/>
</orTerm>
</mandatoryConform>
</attribute>
<attribute code="0x0001" side="server" define="MAX_PRESETS" type="int8u" optional="true" default="5">
<description>MaxPresets</description>
<mandatoryConform>
<feature name="MPRESETS"/>
</mandatoryConform>
</attribute>
<attribute code="0x0002" side="server" define="PRESET_MPTZ_TABLE" type="array" entryType="MPTZPresetStruct" optional="true">
<description>MPTZPresets</description>
<mandatoryConform>
<feature name="MPRESETS"/>
</mandatoryConform>
</attribute>
<attribute code="0x0003" side="server" define="MPTZ_RELATIVE_MOVE" type="array" optional="true" entryType="int16u">
<description>DPTZRelativeMove</description>
<mandatoryConform>
<feature name="DPTZ"/>
</mandatoryConform>
</attribute>
<attribute code="0x0004" side="server" define="DPTZ_RELATIVE_MOVE" type="int8u" optional="true" min="2" max="100" default="100">
<description>ZoomMax</description>
<mandatoryConform>
<feature name="MZOOM"/>
</mandatoryConform>
</attribute>
<attribute code="0x0005" side="server" define="TILT_MIN" type="int16s" min="-180" max="179" default="-90" optional="true">
<description>TiltMin</description>
<mandatoryConform>
<feature name="MTILT"/>
</mandatoryConform>
</attribute>
<attribute code="0x0006" side="server" define="TILT_MAX" type="int16s" min="-179" max="180" default="90" optional="true">
<description>TiltMax</description>
<mandatoryConform>
<feature name="MTILT"/>
</mandatoryConform>
</attribute>
<attribute code="0x0007" side="server" define="PAN_MIN" type="int16s" min="-180" max="179" default="-180" optional="true">
<description>PanMin</description>
<mandatoryConform>
<feature name="MPAN"/>
</mandatoryConform>
</attribute>
<attribute code="0x0008" side="server" define="PAN_MAX" type="int16s" min="-179" max="180" default="180" optional="true">
<description>PanMax</description>
<mandatoryConform>
<feature name="MPAN"/>
</mandatoryConform>
</attribute>
<command code="0x00" source="client" name="MPTZSetPosition" optional="true">
<description>This command SHALL set the values for the pan, tilt, and zoom in the mechanical PTZ.</description>
<arg id="0" name="Pan" type="int16s" optional="true"/>
<arg id="1" name="Tilt" type="int16s" optional="true"/>
<arg id="2" name="Zoom" type="int8u" optional="true" min="1" max="1"/>
<mandatoryConform>
<orTerm>
<feature name="MPAN"/>
<feature name="MTILT"/>
<feature name="MZOOM"/>
</orTerm>
</mandatoryConform>
</command>

<command code="0x01" source="client" name="MPTZRelativeMove" optional="true">
<description>This command SHALL move the device by the delta values relative to the currently defined position.</description>
<arg id="0" name="PanDelta" type="int16s" default="0" optional="true"/>
<arg id="1" name="TiltDelta" type="int16s" default="0" optional="true"/>
<arg id="2" name="ZoomDelta" type="int8s" default="0" optional="true"/>
<optionalConform>
<orTerm>
<feature name="MPAN"/>
<feature name="MTILT"/>
<feature name="MZOOM"/>
</orTerm>
</optionalConform>
</command>

<command code="0x02" source="client" name="MPTZMoveToPreset" optional="true">
<description>This command SHALL move the camera to the positions specified by the Preset passed.</description>
<arg id="0" name="PresetID" type="int8u"/>
<mandatoryConform>
<feature name="MPRESETS"/>
</mandatoryConform>
</command>

<command code="0x03" source="client" name="MPTZSavePreset" optional="true">
<description>This command allows creating a new preset or updating the values of an existing one.</description>
<arg id="0" name="PresetID" type="int8u" optional="true"/>
<arg id="1" name="Name" type="char_string" length="32"/>
<mandatoryConform>
<feature name="MPRESETS"/>
</mandatoryConform>
</command>

<command code="0x04" source="client" name="MPTZRemovePreset" optional="true">
<description>This command SHALL remove a preset entry from the PresetMptzTable.</description>
<arg id="0" name="PresetID" type="int8u"/>
<mandatoryConform>
<feature name="MPRESETS"/>
</mandatoryConform>
</command>

<command code="0x05" source="client" name="DPTZSetViewport" optional="true">
<description>This command allows for setting the digital viewport for a specific Video Stream.</description>
<arg id="0" name="VideoStreamID" type="int16u"/>
<arg id="1" name="Viewport" type="ViewportStruct"/>
<mandatoryConform>
<feature name="DPTZ"/>
</mandatoryConform>
</command>

<command code="0x06" 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="int16u"/>
<arg id="1" name="DeltaX" type="int16s" optional="true" default="0"/>
<arg id="2" name="DeltaY" type="int16s" optional="true" default="0"/>
<arg id="3" name="ZoomDelta" type="int8s" optional="true" default="0" min="-100" max="100"/>
<optionalConform>
<feature name="DPTZ"/>
</optionalConform>
</command>

</cluster>
</configurator>
4 changes: 3 additions & 1 deletion src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"boolean-state-configuration-cluster.xml",
"actions-cluster.xml",
"bridged-device-basic-information.xml",
"camera-av-settings-user-level-management-cluster.xml",
"camera-av-stream-management-cluster.xml",
"chime-cluster.xml",
"chip-ota.xml",
Expand Down Expand Up @@ -685,7 +686,8 @@
"MicrophoneCapabilities",
"SpeakerCapabilities",
"Viewport"
]
],
"Camera AV Settings User Level Management": ["MPTZPosition"]
},
"mandatoryDeviceTypes": "0x0016",
"defaultReportingPolicy": "mandatory",
Expand Down
4 changes: 3 additions & 1 deletion src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"boolean-state-configuration-cluster.xml",
"actions-cluster.xml",
"bridged-device-basic-information.xml",
"camera-av-settings-user-level-management-cluster.xml",
"camera-av-stream-management-cluster.xml",
"chime-cluster.xml",
"chip-ota.xml",
Expand Down Expand Up @@ -679,7 +680,8 @@
"MicrophoneCapabilities",
"SpeakerCapabilities",
"Viewport"
]
],
"Camera AV Settings User Level Management": ["MPTZPosition"]
},
"mandatoryDeviceTypes": "0x0016",
"defaultReportingPolicy": "mandatory",
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"BOOLEAN_STATE_CLUSTER": [],
"BOOLEAN_STATE_CONFIGURATION_CLUSTER": [],
"BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [],
"CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER": [],
"CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [],
"CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [],
"CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [],
Expand Down Expand Up @@ -163,6 +164,7 @@
"BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [
"bridged-device-basic-information-server"
],
"CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER": [],
"CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [],
"CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [
"concentration-measurement-server"
Expand Down
100 changes: 100 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -9837,6 +9837,106 @@ provisional cluster CameraAvStreamManagement = 1361 {
command CaptureSnapshot(CaptureSnapshotRequest): CaptureSnapshotResponse = 11;
}

/** 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. */
provisional cluster CameraAvSettingsUserLevelManagement = 1362 {
revision 1;

bitmap Feature : bitmap32 {
kDigitalPTZ = 0x1;
kMechanicalPan = 0x2;
kMechanicalTilt = 0x4;
kMechanicalZoom = 0x8;
kMechanicalPresets = 0x10;
}

struct MPTZStruct {
optional int16s pan = 0;
optional int16s tilt = 1;
optional int8u zoom = 2;
}

struct MPTZPresetStruct {
int8u presetID = 0;
char_string<32> name = 1;
MPTZStruct settings = 2;
}

struct ViewportStruct {
int16u x1 = 0;
int16u y1 = 1;
int16u x2 = 2;
int16u y2 = 3;
}

readonly attribute optional MPTZStruct MPTZPosition = 0;
readonly attribute optional int8u maxPresets = 1;
readonly attribute optional MPTZPresetStruct MPTZPresets[] = 2;
readonly attribute optional int16u DPTZRelativeMove[] = 3;
readonly attribute optional int8u zoomMax = 4;
readonly attribute optional int16s tiltMin = 5;
readonly attribute optional int16s tiltMax = 6;
readonly attribute optional int16s panMin = 7;
readonly attribute optional int16s panMax = 8;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct MPTZSetPositionRequest {
optional int16s pan = 0;
optional int16s tilt = 1;
optional int8u zoom = 2;
}

request struct MPTZRelativeMoveRequest {
optional int16s panDelta = 0;
optional int16s tiltDelta = 1;
optional int8s zoomDelta = 2;
}

request struct MPTZMoveToPresetRequest {
int8u presetID = 0;
}

request struct MPTZSavePresetRequest {
optional int8u presetID = 0;
char_string<32> name = 1;
}

request struct MPTZRemovePresetRequest {
int8u presetID = 0;
}

request struct DPTZSetViewportRequest {
int16u videoStreamID = 0;
ViewportStruct viewport = 1;
}

request struct DPTZRelativeMoveRequest {
int16u videoStreamID = 0;
optional int16s deltaX = 1;
optional int16s deltaY = 2;
optional int8s zoomDelta = 3;
}

/** This command SHALL set the values for the pan, tilt, and zoom in the mechanical PTZ. */
command MPTZSetPosition(MPTZSetPositionRequest): DefaultSuccess = 0;
/** This command SHALL move the device by the delta values relative to the currently defined position. */
command MPTZRelativeMove(MPTZRelativeMoveRequest): DefaultSuccess = 1;
/** This command SHALL move the camera to the positions specified by the Preset passed. */
command MPTZMoveToPreset(MPTZMoveToPresetRequest): DefaultSuccess = 2;
/** This command allows creating a new preset or updating the values of an existing one. */
command MPTZSavePreset(MPTZSavePresetRequest): DefaultSuccess = 3;
/** This command SHALL remove a preset entry from the PresetMptzTable. */
command MPTZRemovePreset(MPTZRemovePresetRequest): DefaultSuccess = 4;
/** This command allows for setting the digital viewport for a specific Video Stream. */
command DPTZSetViewport(DPTZSetViewportRequest): DefaultSuccess = 5;
/** This command SHALL change the viewports location by the amount specified in a relative fashion. */
command DPTZRelativeMove(DPTZRelativeMoveRequest): DefaultSuccess = 6;
}

/** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */
provisional cluster WebRTCTransportProvider = 1363 {
revision 1;
Expand Down
Loading

0 comments on commit 522c555

Please sign in to comment.