Skip to content

Commit 59d7388

Browse files
Update camera zone cluster to latest spec docs (#36411)
* Generated using ./alchemy zap --attribute="in-progress" ... ZoneManagement.adoc * Generated using ./scripts/tools/zap_regen_all.py * Remove renamed file * Restyled by whitespace * Restyled by prettier-json * Remove renamed file * Remove choice for single element --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent b20d8ae commit 59d7388

36 files changed

+349
-241
lines changed

src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml

+11-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limitations under the License.
1818
XML generated by Alchemy; DO NOT EDIT.
1919
Source: src/app_clusters/ZoneManagement.adoc
2020
Parameters: in-progress
21-
Git: 0.9-fall2024-302-gebc8548b3
21+
Git: 1.4-282-gad46b0990
2222
-->
2323
<configurator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../zcl.xsd">
2424
<domain name="Measurement &amp; Sensing"/>
@@ -78,12 +78,13 @@ Git: 0.9-fall2024-302-gebc8548b3
7878
<item fieldId="2" name="ZoneSource" type="ZoneSourceEnum" min="0x00" max="0x01"/>
7979
</struct>
8080

81-
<struct name="ZoneTriggeringTimeControlStruct" apiMaturity="provisional">
81+
<struct name="ZoneTriggerControlStruct" apiMaturity="provisional">
8282
<cluster code="0x0550"/>
8383
<item fieldId="0" name="InitialDuration" type="int16u" default="10"/>
8484
<item fieldId="1" name="AugmentationDuration" type="int16u" default="5"/>
8585
<item fieldId="2" name="MaxDuration" type="elapsed_s" default="30"/>
8686
<item fieldId="3" name="BlindDuration" type="int16u" default="30"/>
87+
<item fieldId="4" name="Sensitivity" type="int8u" optional="true" default="5" min="1" max="10"/>
8788
</struct>
8889

8990
<cluster apiMaturity="provisional">
@@ -94,16 +95,19 @@ Git: 0.9-fall2024-302-gebc8548b3
9495
<description>This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined.</description>
9596
<client init="false" tick="false">true</client>
9697
<features>
97-
<feature bit="0" code="TWODCART" name="TwoDimensionalCartesianZone" summary="Devices support Two Dimensional Cartesian Zones">
98-
<mandatoryConform/>
98+
<feature bit="0" code="TWODCART" name="TwoDimensionalCartesianZone" summary="Support Two Dimensional Cartesian Zones">
99+
<optionalConform/>
100+
</feature>
101+
<feature bit="1" code="PERZONESENS" name="PerZoneSensitivity" summary="Supports a sensitivity value per Zone">
102+
<optionalConform/>
99103
</feature>
100104
</features>
101105
<server init="false" tick="false">true</server>
102106
<globalAttribute code="0xFFFD" side="either" value="1"/>
103107
<attribute code="0x0000" side="server" define="SUPPORTED_ZONE_SOURCES" type="array" entryType="ZoneSourceEnum">SupportedZoneSources</attribute>
104108
<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>
109+
<attribute code="0x0002" side="server" define="TIME_CONTROL" type="array" entryType="ZoneTriggerControlStruct" writable="true">Triggers</attribute>
110+
<attribute code="0x0003" side="server" define="SENSITIVITY" type="int8u" min="1" max="10" default="5" writable="true" optional="true">Sensitivity</attribute>
107111
<command code="0x00" source="client" name="CreateTwoDCartesianZone" optional="true" response="CreateTwoDCartesianZoneResponse">
108112
<description>This command SHALL create and store a TwoD Cartesian Zone.</description>
109113
<access op="invoke" privilege="manage"/>
@@ -148,7 +152,7 @@ Git: 0.9-fall2024-302-gebc8548b3
148152
<event code="0x0001" name="ZoneStopped" priority="info" side="server">
149153
<field id="0" name="Zones" array="true" type="int16u"/>
150154
<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>
155+
<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 ZoneTriggerControlStruct.</description>
152156
</event>
153157

154158
</cluster>

src/controller/data_model/controller-clusters.matter

+5-3
Original file line numberDiff line numberDiff line change
@@ -9443,6 +9443,7 @@ provisional cluster ZoneManagement = 1360 {
94439443

94449444
bitmap Feature : bitmap32 {
94459445
kTwoDimensionalCartesianZone = 0x1;
9446+
kPerZoneSensitivity = 0x2;
94469447
}
94479448

94489449
struct TwoDCartesianVertexStruct {
@@ -9463,11 +9464,12 @@ provisional cluster ZoneManagement = 1360 {
94639464
ZoneSourceEnum zoneSource = 2;
94649465
}
94659466

9466-
struct ZoneTriggeringTimeControlStruct {
9467+
struct ZoneTriggerControlStruct {
94679468
int16u initialDuration = 0;
94689469
int16u augmentationDuration = 1;
94699470
elapsed_s maxDuration = 2;
94709471
int16u blindDuration = 3;
9472+
optional int8u sensitivity = 4;
94719473
}
94729474

94739475
info event ZoneTriggered = 0 {
@@ -9482,8 +9484,8 @@ provisional cluster ZoneManagement = 1360 {
94829484

94839485
readonly attribute ZoneSourceEnum supportedZoneSources[] = 0;
94849486
readonly attribute optional ZoneInformationStruct zones[] = 1;
9485-
attribute ZoneTriggeringTimeControlStruct timeControl[] = 2;
9486-
attribute int8u sensitivity = 3;
9487+
attribute ZoneTriggerControlStruct triggers[] = 2;
9488+
attribute optional int8u sensitivity = 3;
94879489
readonly attribute command_id generatedCommandList[] = 65528;
94889490
readonly attribute command_id acceptedCommandList[] = 65529;
94899491
readonly attribute event_id eventList[] = 65530;

src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java

+17-17
Original file line numberDiff line numberDiff line change
@@ -59283,7 +59283,7 @@ public static class ZoneManagementCluster extends BaseChipCluster {
5928359283

5928459284
private static final long SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID = 0L;
5928559285
private static final long ZONES_ATTRIBUTE_ID = 1L;
59286-
private static final long TIME_CONTROL_ATTRIBUTE_ID = 2L;
59286+
private static final long TRIGGERS_ATTRIBUTE_ID = 2L;
5928759287
private static final long SENSITIVITY_ATTRIBUTE_ID = 3L;
5928859288
private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L;
5928959289
private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L;
@@ -59422,8 +59422,8 @@ public interface ZonesAttributeCallback extends BaseAttributeCallback {
5942259422
void onSuccess(List<ChipStructs.ZoneManagementClusterZoneInformationStruct> value);
5942359423
}
5942459424

59425-
public interface TimeControlAttributeCallback extends BaseAttributeCallback {
59426-
void onSuccess(List<ChipStructs.ZoneManagementClusterZoneTriggeringTimeControlStruct> value);
59425+
public interface TriggersAttributeCallback extends BaseAttributeCallback {
59426+
void onSuccess(List<ChipStructs.ZoneManagementClusterZoneTriggerControlStruct> value);
5942759427
}
5942859428

5942959429
public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -59494,39 +59494,39 @@ public void onSuccess(byte[] tlv) {
5949459494
}, ZONES_ATTRIBUTE_ID, minInterval, maxInterval);
5949559495
}
5949659496

59497-
public void readTimeControlAttribute(
59498-
TimeControlAttributeCallback callback) {
59499-
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID);
59497+
public void readTriggersAttribute(
59498+
TriggersAttributeCallback callback) {
59499+
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TRIGGERS_ATTRIBUTE_ID);
5950059500

5950159501
readAttribute(new ReportCallbackImpl(callback, path) {
5950259502
@Override
5950359503
public void onSuccess(byte[] tlv) {
59504-
List<ChipStructs.ZoneManagementClusterZoneTriggeringTimeControlStruct> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
59504+
List<ChipStructs.ZoneManagementClusterZoneTriggerControlStruct> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
5950559505
callback.onSuccess(value);
5950659506
}
59507-
}, TIME_CONTROL_ATTRIBUTE_ID, true);
59507+
}, TRIGGERS_ATTRIBUTE_ID, true);
5950859508
}
5950959509

59510-
public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList<ChipStructs.ZoneManagementClusterZoneTriggeringTimeControlStruct> value) {
59511-
writeTimeControlAttribute(callback, value, 0);
59510+
public void writeTriggersAttribute(DefaultClusterCallback callback, ArrayList<ChipStructs.ZoneManagementClusterZoneTriggerControlStruct> value) {
59511+
writeTriggersAttribute(callback, value, 0);
5951259512
}
5951359513

59514-
public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList<ChipStructs.ZoneManagementClusterZoneTriggeringTimeControlStruct> value, int timedWriteTimeoutMs) {
59514+
public void writeTriggersAttribute(DefaultClusterCallback callback, ArrayList<ChipStructs.ZoneManagementClusterZoneTriggerControlStruct> value, int timedWriteTimeoutMs) {
5951559515
BaseTLVType tlvValue = ArrayType.generateArrayType(value, (elementvalue) -> elementvalue.encodeTlv());
59516-
writeAttribute(new WriteAttributesCallbackImpl(callback), TIME_CONTROL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
59516+
writeAttribute(new WriteAttributesCallbackImpl(callback), TRIGGERS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
5951759517
}
5951859518

59519-
public void subscribeTimeControlAttribute(
59520-
TimeControlAttributeCallback callback, int minInterval, int maxInterval) {
59521-
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID);
59519+
public void subscribeTriggersAttribute(
59520+
TriggersAttributeCallback callback, int minInterval, int maxInterval) {
59521+
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TRIGGERS_ATTRIBUTE_ID);
5952259522

5952359523
subscribeAttribute(new ReportCallbackImpl(callback, path) {
5952459524
@Override
5952559525
public void onSuccess(byte[] tlv) {
59526-
List<ChipStructs.ZoneManagementClusterZoneTriggeringTimeControlStruct> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
59526+
List<ChipStructs.ZoneManagementClusterZoneTriggerControlStruct> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
5952759527
callback.onSuccess(value);
5952859528
}
59529-
}, TIME_CONTROL_ATTRIBUTE_ID, minInterval, maxInterval);
59529+
}, TRIGGERS_ATTRIBUTE_ID, minInterval, maxInterval);
5953059530
}
5953159531

5953259532
public void readSensitivityAttribute(

src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java

+22-7
Original file line numberDiff line numberDiff line change
@@ -12952,26 +12952,30 @@ public String toString() {
1295212952
return output.toString();
1295312953
}
1295412954
}
12955-
public static class ZoneManagementClusterZoneTriggeringTimeControlStruct {
12955+
public static class ZoneManagementClusterZoneTriggerControlStruct {
1295612956
public Integer initialDuration;
1295712957
public Integer augmentationDuration;
1295812958
public Long maxDuration;
1295912959
public Integer blindDuration;
12960+
public Optional<Integer> sensitivity;
1296012961
private static final long INITIAL_DURATION_ID = 0L;
1296112962
private static final long AUGMENTATION_DURATION_ID = 1L;
1296212963
private static final long MAX_DURATION_ID = 2L;
1296312964
private static final long BLIND_DURATION_ID = 3L;
12965+
private static final long SENSITIVITY_ID = 4L;
1296412966

12965-
public ZoneManagementClusterZoneTriggeringTimeControlStruct(
12967+
public ZoneManagementClusterZoneTriggerControlStruct(
1296612968
Integer initialDuration,
1296712969
Integer augmentationDuration,
1296812970
Long maxDuration,
12969-
Integer blindDuration
12971+
Integer blindDuration,
12972+
Optional<Integer> sensitivity
1297012973
) {
1297112974
this.initialDuration = initialDuration;
1297212975
this.augmentationDuration = augmentationDuration;
1297312976
this.maxDuration = maxDuration;
1297412977
this.blindDuration = blindDuration;
12978+
this.sensitivity = sensitivity;
1297512979
}
1297612980

1297712981
public StructType encodeTlv() {
@@ -12980,18 +12984,20 @@ public StructType encodeTlv() {
1298012984
values.add(new StructElement(AUGMENTATION_DURATION_ID, new UIntType(augmentationDuration)));
1298112985
values.add(new StructElement(MAX_DURATION_ID, new UIntType(maxDuration)));
1298212986
values.add(new StructElement(BLIND_DURATION_ID, new UIntType(blindDuration)));
12987+
values.add(new StructElement(SENSITIVITY_ID, sensitivity.<BaseTLVType>map((nonOptionalsensitivity) -> new UIntType(nonOptionalsensitivity)).orElse(new EmptyType())));
1298312988

1298412989
return new StructType(values);
1298512990
}
1298612991

12987-
public static ZoneManagementClusterZoneTriggeringTimeControlStruct decodeTlv(BaseTLVType tlvValue) {
12992+
public static ZoneManagementClusterZoneTriggerControlStruct decodeTlv(BaseTLVType tlvValue) {
1298812993
if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
1298912994
return null;
1299012995
}
1299112996
Integer initialDuration = null;
1299212997
Integer augmentationDuration = null;
1299312998
Long maxDuration = null;
1299412999
Integer blindDuration = null;
13000+
Optional<Integer> sensitivity = Optional.empty();
1299513001
for (StructElement element: ((StructType)tlvValue).value()) {
1299613002
if (element.contextTagNum() == INITIAL_DURATION_ID) {
1299713003
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
@@ -13013,20 +13019,26 @@ public static ZoneManagementClusterZoneTriggeringTimeControlStruct decodeTlv(Bas
1301313019
UIntType castingValue = element.value(UIntType.class);
1301413020
blindDuration = castingValue.value(Integer.class);
1301513021
}
13022+
} else if (element.contextTagNum() == SENSITIVITY_ID) {
13023+
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
13024+
UIntType castingValue = element.value(UIntType.class);
13025+
sensitivity = Optional.of(castingValue.value(Integer.class));
13026+
}
1301613027
}
1301713028
}
13018-
return new ZoneManagementClusterZoneTriggeringTimeControlStruct(
13029+
return new ZoneManagementClusterZoneTriggerControlStruct(
1301913030
initialDuration,
1302013031
augmentationDuration,
1302113032
maxDuration,
13022-
blindDuration
13033+
blindDuration,
13034+
sensitivity
1302313035
);
1302413036
}
1302513037

1302613038
@Override
1302713039
public String toString() {
1302813040
StringBuilder output = new StringBuilder();
13029-
output.append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n");
13041+
output.append("ZoneManagementClusterZoneTriggerControlStruct {\n");
1303013042
output.append("\tinitialDuration: ");
1303113043
output.append(initialDuration);
1303213044
output.append("\n");
@@ -13039,6 +13051,9 @@ public String toString() {
1303913051
output.append("\tblindDuration: ");
1304013052
output.append(blindDuration);
1304113053
output.append("\n");
13054+
output.append("\tsensitivity: ");
13055+
output.append(sensitivity);
13056+
output.append("\n");
1304213057
output.append("}\n");
1304313058
return output.toString();
1304413059
}

src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16897,7 +16897,7 @@ public long getID() {
1689716897
public enum Attribute {
1689816898
SupportedZoneSources(0L),
1689916899
Zones(1L),
16900-
TimeControl(2L),
16900+
Triggers(2L),
1690116901
Sensitivity(3L),
1690216902
GeneratedCommandList(65528L),
1690316903
AcceptedCommandList(65529L),

src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -19955,17 +19955,17 @@ public void onError(Exception ex) {
1995519955
}
1995619956
}
1995719957

19958-
public static class DelegatedZoneManagementClusterTimeControlAttributeCallback implements ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback, DelegatedClusterCallback {
19958+
public static class DelegatedZoneManagementClusterTriggersAttributeCallback implements ChipClusters.ZoneManagementCluster.TriggersAttributeCallback, DelegatedClusterCallback {
1995919959
private ClusterCommandCallback callback;
1996019960
@Override
1996119961
public void setCallbackDelegate(ClusterCommandCallback callback) {
1996219962
this.callback = callback;
1996319963
}
1996419964

1996519965
@Override
19966-
public void onSuccess(List<ChipStructs.ZoneManagementClusterZoneTriggeringTimeControlStruct> valueList) {
19966+
public void onSuccess(List<ChipStructs.ZoneManagementClusterZoneTriggerControlStruct> valueList) {
1996719967
Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
19968-
CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<ChipStructs.ZoneManagementClusterZoneTriggeringTimeControlStruct>");
19968+
CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<ChipStructs.ZoneManagementClusterZoneTriggerControlStruct>");
1996919969
responseValues.put(commandResponseInfo, valueList);
1997019970
callback.onSuccess(responseValues);
1997119971
}

src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -18204,17 +18204,17 @@ private static Map<String, InteractionInfo> readZoneManagementInteractionInfo()
1820418204
readZoneManagementZonesCommandParams
1820518205
);
1820618206
result.put("readZonesAttribute", readZoneManagementZonesAttributeInteractionInfo);
18207-
Map<String, CommandParameterInfo> readZoneManagementTimeControlCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
18208-
InteractionInfo readZoneManagementTimeControlAttributeInteractionInfo = new InteractionInfo(
18207+
Map<String, CommandParameterInfo> readZoneManagementTriggersCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
18208+
InteractionInfo readZoneManagementTriggersAttributeInteractionInfo = new InteractionInfo(
1820918209
(cluster, callback, commandArguments) -> {
18210-
((ChipClusters.ZoneManagementCluster) cluster).readTimeControlAttribute(
18211-
(ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback) callback
18210+
((ChipClusters.ZoneManagementCluster) cluster).readTriggersAttribute(
18211+
(ChipClusters.ZoneManagementCluster.TriggersAttributeCallback) callback
1821218212
);
1821318213
},
18214-
() -> new ClusterInfoMapping.DelegatedZoneManagementClusterTimeControlAttributeCallback(),
18215-
readZoneManagementTimeControlCommandParams
18214+
() -> new ClusterInfoMapping.DelegatedZoneManagementClusterTriggersAttributeCallback(),
18215+
readZoneManagementTriggersCommandParams
1821618216
);
18217-
result.put("readTimeControlAttribute", readZoneManagementTimeControlAttributeInteractionInfo);
18217+
result.put("readTriggersAttribute", readZoneManagementTriggersAttributeInteractionInfo);
1821818218
Map<String, CommandParameterInfo> readZoneManagementSensitivityCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
1821918219
InteractionInfo readZoneManagementSensitivityAttributeInteractionInfo = new InteractionInfo(
1822018220
(cluster, callback, commandArguments) -> {

src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ structs_sources = [
176176
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt",
177177
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt",
178178
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt",
179-
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt",
179+
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggerControlStruct.kt",
180180
]
181181

182182
eventstructs_sources = [

0 commit comments

Comments
 (0)