Skip to content

Commit 30d20a9

Browse files
gmarcosbrestyled-commits
authored andcommitted
Camera zone management cluster (project-chip#35879)
* Generated using ./alchemy zap --attribute="in-progress" ... ZoneManagement.adoc * Generated using ./alchemy zap --attribute="in-progress" ... ZoneManagement.adoc * Re-generated using ./scripts/tools/zap_regen_all.py after merge * Restyled by whitespace * Restyled by prettier-json * Re-generated using ./scripts/tools/zap_regen_all.py after update to python generation --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 738e387 commit 30d20a9

File tree

67 files changed

+10960
-4
lines changed

Some content is hidden

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

67 files changed

+10960
-4
lines changed

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ jobs:
210210
src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \
211211
src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml \
212212
src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml \
213+
src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml \
213214
"
214215
- name: Build Apps
215216
run: |

docs/zap_clusters.md

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ Generally regenerate using one of:
129129
| 1294 | 0x50E | AccountLogin |
130130
| 1295 | 0x50F | ContentControl |
131131
| 1296 | 0x510 | ContentAppObserver |
132+
| 1360 | 0x550 | ZoneManagement |
132133
| 1363 | 0x553 | WebRTCTransportProvider |
133134
| 1364 | 0x554 | WebRTCTransportRequestor |
134135
| 1366 | 0x556 | Chime |

scripts/rules.matterlint

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.x
120120
load "../src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml";
121121
load "../src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml";
122122
load "../src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml";
123+
load "../src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml";
123124

124125
all endpoints {
125126
// These attributes follow a different code path and do not have to be
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
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/ZoneManagement.adoc
20+
Parameters: in-progress
21+
Git: 0.9-fall2024-302-gebc8548b3
22+
-->
23+
<configurator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../zcl.xsd">
24+
<domain name="Measurement &amp; Sensing"/>
25+
<enum name="StatusCodeEnum" type="enum8">
26+
<cluster code="0x0550"/>
27+
<item name="ZoneNotFound" value="0x02"/>
28+
<item name="ZoneInUse" value="0x03"/>
29+
</enum>
30+
31+
<enum name="ZoneEventStoppedReasonEnum" type="enum8">
32+
<cluster code="0x0550"/>
33+
<item name="ActionStopped" value="0x00"/>
34+
<item name="Timeout" value="0x01"/>
35+
</enum>
36+
37+
<enum name="ZoneEventTriggeredReasonEnum" type="enum8">
38+
<cluster code="0x0550"/>
39+
<item name="Motion" value="0x00"/>
40+
</enum>
41+
42+
<enum name="ZoneSourceEnum" type="enum8">
43+
<cluster code="0x0550"/>
44+
<item name="Mfg" value="0x00"/>
45+
<item name="User" value="0x01"/>
46+
</enum>
47+
48+
<enum name="ZoneTypeEnum" type="enum8">
49+
<cluster code="0x0550"/>
50+
<item name="TwoDCARTZone" value="0x00"/>
51+
</enum>
52+
53+
<enum name="ZoneUseEnum" type="enum8">
54+
<cluster code="0x0550"/>
55+
<item name="Motion" value="0x00"/>
56+
<item name="Privacy" value="0x01"/>
57+
<item name="Focus" value="0x02"/>
58+
</enum>
59+
60+
<struct name="TwoDCartesianVertexStruct" apiMaturity="provisional">
61+
<cluster code="0x0550"/>
62+
<item fieldId="0" name="X" type="int16u" default="0"/>
63+
<item fieldId="1" name="Y" type="int16u" default="0"/>
64+
</struct>
65+
66+
<struct name="TwoDCartesianZoneStruct" apiMaturity="provisional">
67+
<cluster code="0x0550"/>
68+
<item fieldId="0" name="Name" type="char_string" length="16"/>
69+
<item fieldId="1" name="Use" type="ZoneUseEnum" min="0x00" max="0x02"/>
70+
<item fieldId="2" name="Vertices" array="true" type="TwoDCartesianVertexStruct" length="12" minLength="3"/>
71+
<item fieldId="3" name="Color" type="char_string" optional="true" length="9" minLength="7"/>
72+
</struct>
73+
74+
<struct name="ZoneInformationStruct" apiMaturity="provisional">
75+
<cluster code="0x0550"/>
76+
<item fieldId="0" name="ZoneID" type="int16u"/>
77+
<item fieldId="1" name="ZoneType" type="ZoneTypeEnum" min="0x00" max="0x00"/>
78+
<item fieldId="2" name="ZoneSource" type="ZoneSourceEnum" min="0x00" max="0x01"/>
79+
</struct>
80+
81+
<struct name="ZoneTriggeringTimeControlStruct" apiMaturity="provisional">
82+
<cluster code="0x0550"/>
83+
<item fieldId="0" name="InitialDuration" type="int16u" default="10"/>
84+
<item fieldId="1" name="AugmentationDuration" type="int16u" default="5"/>
85+
<item fieldId="2" name="MaxDuration" type="elapsed_s" default="30"/>
86+
<item fieldId="3" name="BlindDuration" type="int16u" default="30"/>
87+
</struct>
88+
89+
<cluster apiMaturity="provisional">
90+
<domain name="Measurement &amp; Sensing"/>
91+
<name>Zone Management</name>
92+
<code>0x0550</code>
93+
<define>ZONE_MANAGEMENT_CLUSTER</define>
94+
<description>This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined.</description>
95+
<client init="false" tick="false">true</client>
96+
<features>
97+
<feature bit="0" code="TWODCART" name="TwoDimensionalCartesianZone" summary="Devices support Two Dimensional Cartesian Zones">
98+
<mandatoryConform/>
99+
</feature>
100+
</features>
101+
<server init="false" tick="false">true</server>
102+
<globalAttribute code="0xFFFD" side="either" value="1"/>
103+
<attribute code="0x0000" side="server" define="SUPPORTED_ZONE_SOURCES" type="array" entryType="ZoneSourceEnum">SupportedZoneSources</attribute>
104+
<attribute code="0x0001" side="server" define="ZONES" type="array" entryType="ZoneInformationStruct" optional="true">Zones</attribute>
105+
<attribute code="0x0002" side="server" define="TIME_CONTROL" type="array" entryType="ZoneTriggeringTimeControlStruct" writable="true">TimeControl</attribute>
106+
<attribute code="0x0003" side="server" define="SENSITIVITY" type="int8u" min="1" max="10" default="5" writable="true">Sensitivity</attribute>
107+
<command code="0x00" source="client" name="CreateTwoDCartesianZone" optional="true" response="CreateTwoDCartesianZoneResponse">
108+
<description>This command SHALL create and store a TwoD Cartesian Zone.</description>
109+
<access op="invoke" privilege="manage"/>
110+
<arg id="0" name="Zone" type="TwoDCartesianZoneStruct"/>
111+
</command>
112+
113+
<command code="0x01" source="server" name="CreateTwoDCartesianZoneResponse" optional="true">
114+
<description/>
115+
<arg id="0" name="ZoneID" type="int16u"/>
116+
</command>
117+
118+
<command code="0x02" source="client" name="UpdateTwoDCartesianZone" optional="true">
119+
<description>The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone.</description>
120+
<access op="invoke" privilege="manage"/>
121+
<arg id="0" name="ZoneID" type="int16u"/>
122+
<arg id="1" name="Zone" type="TwoDCartesianZoneStruct"/>
123+
</command>
124+
125+
<command code="0x03" source="client" name="GetTwoDCartesianZone" optional="true" response="GetTwoDCartesianZoneResponse">
126+
<description>The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID.</description>
127+
<access op="invoke" privilege="manage"/>
128+
<arg id="0" name="ZoneID" type="int16u" optional="true" isNullable="true"/>
129+
</command>
130+
131+
<command code="0x04" source="server" name="GetTwoDCartesianZoneResponse" optional="true" disableDefaultResponse="true">
132+
<description>This command SHALL be generated in response to a GetTwoDCartesianZone command.</description>
133+
<arg id="0" name="Zones" array="true" type="TwoDCartesianZoneStruct"/>
134+
</command>
135+
136+
<command code="0x05" source="client" name="RemoveZone" optional="false">
137+
<description>This command SHALL remove the Zone mapped to the passed in ZoneID.</description>
138+
<access op="invoke" privilege="manage"/>
139+
<arg id="0" name="ZoneID" type="int16u"/>
140+
</command>
141+
142+
<event code="0x0000" name="ZoneTriggered" priority="info" side="server">
143+
<field id="0" name="Zones" array="true" type="int16u"/>
144+
<field id="1" name="Reason" type="ZoneEventTriggeredReasonEnum" min="0x00" max="0x00"/>
145+
<description>This event SHALL be generated when a Zone is first triggered.</description>
146+
</event>
147+
148+
<event code="0x0001" name="ZoneStopped" priority="info" side="server">
149+
<field id="0" name="Zones" array="true" type="int16u"/>
150+
<field id="1" name="Reason" type="ZoneEventStoppedReasonEnum" min="0x00" max="0x01"/>
151+
<description>This event SHALL be generated when either when the TriggerDetectedDuration value is exceeded by the TimeSinceInitialTrigger value or when the MaxDuration value is exceeded by the TimeSinceInitialTrigger value as described in ZoneTriggeringTimeControlStruct.</description>
152+
</event>
153+
154+
</cluster>
155+
</configurator>

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@
140140
"sample-mei-cluster.xml",
141141
"types/door-lock.xml",
142142
"types/occupancy-sensing.xml",
143-
"types/thermostat-user-interface-configuration.xml"
143+
"types/thermostat-user-interface-configuration.xml",
144+
"zone-management-cluster.xml"
144145
],
145146
"manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml",
146147
"options": {

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@
134134
"sample-mei-cluster.xml",
135135
"types/door-lock.xml",
136136
"types/occupancy-sensing.xml",
137-
"types/thermostat-user-interface-configuration.xml"
137+
"types/thermostat-user-interface-configuration.xml",
138+
"zone-management-cluster.xml"
138139
],
139140
"manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml",
140141
"options": {

src/app/zap_cluster_list.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@
134134
"WEB_RTC_PROVIDER_CLUSTER": [],
135135
"WEBRTC_REQUESTOR_CLUSTER": [],
136136
"WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [],
137-
"WINDOW_COVERING_CLUSTER": []
137+
"WINDOW_COVERING_CLUSTER": [],
138+
"ZONE_MANAGEMENT_CLUSTER": []
138139
},
139140
"ServerDirectories": {
140141
"ACCESS_CONTROL_CLUSTER": ["access-control-server"],
@@ -318,6 +319,7 @@
318319
"WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"],
319320
"WINDOW_COVERING_CLUSTER": ["window-covering-server"],
320321
"WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"],
321-
"WATER_HEATER_MODE_CLUSTER": ["mode-base-server"]
322+
"WATER_HEATER_MODE_CLUSTER": ["mode-base-server"],
323+
"ZONE_MANAGEMENT_CLUSTER": []
322324
}
323325
}

src/controller/data_model/controller-clusters.matter

+118
Original file line numberDiff line numberDiff line change
@@ -9416,6 +9416,124 @@ provisional cluster ContentAppObserver = 1296 {
94169416
command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0;
94179417
}
94189418

9419+
/** This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. */
9420+
provisional cluster ZoneManagement = 1360 {
9421+
revision 1;
9422+
9423+
enum StatusCodeEnum : enum8 {
9424+
kZoneNotFound = 2;
9425+
kZoneInUse = 3;
9426+
}
9427+
9428+
enum ZoneEventStoppedReasonEnum : enum8 {
9429+
kActionStopped = 0;
9430+
kTimeout = 1;
9431+
}
9432+
9433+
enum ZoneEventTriggeredReasonEnum : enum8 {
9434+
kMotion = 0;
9435+
}
9436+
9437+
enum ZoneSourceEnum : enum8 {
9438+
kMfg = 0;
9439+
kUser = 1;
9440+
}
9441+
9442+
enum ZoneTypeEnum : enum8 {
9443+
kTwoDCARTZone = 0;
9444+
}
9445+
9446+
enum ZoneUseEnum : enum8 {
9447+
kMotion = 0;
9448+
kPrivacy = 1;
9449+
kFocus = 2;
9450+
}
9451+
9452+
bitmap Feature : bitmap32 {
9453+
kTwoDimensionalCartesianZone = 0x1;
9454+
}
9455+
9456+
struct TwoDCartesianVertexStruct {
9457+
int16u x = 0;
9458+
int16u y = 1;
9459+
}
9460+
9461+
struct TwoDCartesianZoneStruct {
9462+
char_string<16> name = 0;
9463+
ZoneUseEnum use = 1;
9464+
TwoDCartesianVertexStruct vertices[] = 2;
9465+
optional char_string<9> color = 3;
9466+
}
9467+
9468+
struct ZoneInformationStruct {
9469+
int16u zoneID = 0;
9470+
ZoneTypeEnum zoneType = 1;
9471+
ZoneSourceEnum zoneSource = 2;
9472+
}
9473+
9474+
struct ZoneTriggeringTimeControlStruct {
9475+
int16u initialDuration = 0;
9476+
int16u augmentationDuration = 1;
9477+
elapsed_s maxDuration = 2;
9478+
int16u blindDuration = 3;
9479+
}
9480+
9481+
info event ZoneTriggered = 0 {
9482+
int16u zones[] = 0;
9483+
ZoneEventTriggeredReasonEnum reason = 1;
9484+
}
9485+
9486+
info event ZoneStopped = 1 {
9487+
int16u zones[] = 0;
9488+
ZoneEventStoppedReasonEnum reason = 1;
9489+
}
9490+
9491+
readonly attribute ZoneSourceEnum supportedZoneSources[] = 0;
9492+
readonly attribute optional ZoneInformationStruct zones[] = 1;
9493+
attribute ZoneTriggeringTimeControlStruct timeControl[] = 2;
9494+
attribute int8u sensitivity = 3;
9495+
readonly attribute command_id generatedCommandList[] = 65528;
9496+
readonly attribute command_id acceptedCommandList[] = 65529;
9497+
readonly attribute event_id eventList[] = 65530;
9498+
readonly attribute attrib_id attributeList[] = 65531;
9499+
readonly attribute bitmap32 featureMap = 65532;
9500+
readonly attribute int16u clusterRevision = 65533;
9501+
9502+
request struct CreateTwoDCartesianZoneRequest {
9503+
TwoDCartesianZoneStruct zone = 0;
9504+
}
9505+
9506+
response struct CreateTwoDCartesianZoneResponse = 1 {
9507+
int16u zoneID = 0;
9508+
}
9509+
9510+
request struct UpdateTwoDCartesianZoneRequest {
9511+
int16u zoneID = 0;
9512+
TwoDCartesianZoneStruct zone = 1;
9513+
}
9514+
9515+
request struct GetTwoDCartesianZoneRequest {
9516+
optional nullable int16u zoneID = 0;
9517+
}
9518+
9519+
response struct GetTwoDCartesianZoneResponse = 4 {
9520+
TwoDCartesianZoneStruct zones[] = 0;
9521+
}
9522+
9523+
request struct RemoveZoneRequest {
9524+
int16u zoneID = 0;
9525+
}
9526+
9527+
/** This command SHALL create and store a TwoD Cartesian Zone. */
9528+
command access(invoke: manage) CreateTwoDCartesianZone(CreateTwoDCartesianZoneRequest): CreateTwoDCartesianZoneResponse = 0;
9529+
/** The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone. */
9530+
command access(invoke: manage) UpdateTwoDCartesianZone(UpdateTwoDCartesianZoneRequest): DefaultSuccess = 2;
9531+
/** The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID. */
9532+
command access(invoke: manage) GetTwoDCartesianZone(GetTwoDCartesianZoneRequest): GetTwoDCartesianZoneResponse = 3;
9533+
/** This command SHALL remove the Zone mapped to the passed in ZoneID. */
9534+
command access(invoke: manage) RemoveZone(RemoveZoneRequest): DefaultSuccess = 5;
9535+
}
9536+
94199537
/** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */
94209538
provisional cluster WebRTCTransportProvider = 1363 {
94219539
revision 1;

0 commit comments

Comments
 (0)