diff --git a/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml index 27a947b5610015..32e9a4b18ad4b0 100644 --- a/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml @@ -18,7 +18,7 @@ limitations under the License. XML generated by Alchemy; DO NOT EDIT. Source: src/app_clusters/ZoneManagement.adoc Parameters: in-progress -Git: 0.9-fall2024-302-gebc8548b3 +Git: 1.4-282-gad46b0990 --> @@ -78,12 +78,13 @@ Git: 0.9-fall2024-302-gebc8548b3 - + + @@ -94,16 +95,19 @@ Git: 0.9-fall2024-302-gebc8548b3 This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. true - - + + + + + true SupportedZoneSources Zones - TimeControl - Sensitivity + Triggers + Sensitivity This command SHALL create and store a TwoD Cartesian Zone. @@ -148,7 +152,7 @@ Git: 0.9-fall2024-302-gebc8548b3 - 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. + 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. diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 9e788d02825831..95f102ce08c545 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9443,6 +9443,7 @@ provisional cluster ZoneManagement = 1360 { bitmap Feature : bitmap32 { kTwoDimensionalCartesianZone = 0x1; + kPerZoneSensitivity = 0x2; } struct TwoDCartesianVertexStruct { @@ -9463,11 +9464,12 @@ provisional cluster ZoneManagement = 1360 { ZoneSourceEnum zoneSource = 2; } - struct ZoneTriggeringTimeControlStruct { + struct ZoneTriggerControlStruct { int16u initialDuration = 0; int16u augmentationDuration = 1; elapsed_s maxDuration = 2; int16u blindDuration = 3; + optional int8u sensitivity = 4; } info event ZoneTriggered = 0 { @@ -9482,8 +9484,8 @@ provisional cluster ZoneManagement = 1360 { readonly attribute ZoneSourceEnum supportedZoneSources[] = 0; readonly attribute optional ZoneInformationStruct zones[] = 1; - attribute ZoneTriggeringTimeControlStruct timeControl[] = 2; - attribute int8u sensitivity = 3; + attribute ZoneTriggerControlStruct triggers[] = 2; + attribute optional int8u sensitivity = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index a01affadc9c807..a37be0ed915865 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -59283,7 +59283,7 @@ public static class ZoneManagementCluster extends BaseChipCluster { private static final long SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID = 0L; private static final long ZONES_ATTRIBUTE_ID = 1L; - private static final long TIME_CONTROL_ATTRIBUTE_ID = 2L; + private static final long TRIGGERS_ATTRIBUTE_ID = 2L; private static final long SENSITIVITY_ATTRIBUTE_ID = 3L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; @@ -59422,8 +59422,8 @@ public interface ZonesAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } - public interface TimeControlAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public interface TriggersAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { @@ -59494,39 +59494,39 @@ public void onSuccess(byte[] tlv) { }, ZONES_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readTimeControlAttribute( - TimeControlAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID); + public void readTriggersAttribute( + TriggersAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TRIGGERS_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, TIME_CONTROL_ATTRIBUTE_ID, true); + }, TRIGGERS_ATTRIBUTE_ID, true); } - public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList value) { - writeTimeControlAttribute(callback, value, 0); + public void writeTriggersAttribute(DefaultClusterCallback callback, ArrayList value) { + writeTriggersAttribute(callback, value, 0); } - public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList value, int timedWriteTimeoutMs) { + public void writeTriggersAttribute(DefaultClusterCallback callback, ArrayList value, int timedWriteTimeoutMs) { BaseTLVType tlvValue = ArrayType.generateArrayType(value, (elementvalue) -> elementvalue.encodeTlv()); - writeAttribute(new WriteAttributesCallbackImpl(callback), TIME_CONTROL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + writeAttribute(new WriteAttributesCallbackImpl(callback), TRIGGERS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); } - public void subscribeTimeControlAttribute( - TimeControlAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID); + public void subscribeTriggersAttribute( + TriggersAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TRIGGERS_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, TIME_CONTROL_ATTRIBUTE_ID, minInterval, maxInterval); + }, TRIGGERS_ATTRIBUTE_ID, minInterval, maxInterval); } public void readSensitivityAttribute( diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index b3fcd6df3bfde3..bbb319ba5334ab 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -12952,26 +12952,30 @@ public String toString() { return output.toString(); } } -public static class ZoneManagementClusterZoneTriggeringTimeControlStruct { +public static class ZoneManagementClusterZoneTriggerControlStruct { public Integer initialDuration; public Integer augmentationDuration; public Long maxDuration; public Integer blindDuration; + public Optional sensitivity; private static final long INITIAL_DURATION_ID = 0L; private static final long AUGMENTATION_DURATION_ID = 1L; private static final long MAX_DURATION_ID = 2L; private static final long BLIND_DURATION_ID = 3L; + private static final long SENSITIVITY_ID = 4L; - public ZoneManagementClusterZoneTriggeringTimeControlStruct( + public ZoneManagementClusterZoneTriggerControlStruct( Integer initialDuration, Integer augmentationDuration, Long maxDuration, - Integer blindDuration + Integer blindDuration, + Optional sensitivity ) { this.initialDuration = initialDuration; this.augmentationDuration = augmentationDuration; this.maxDuration = maxDuration; this.blindDuration = blindDuration; + this.sensitivity = sensitivity; } public StructType encodeTlv() { @@ -12980,11 +12984,12 @@ public StructType encodeTlv() { values.add(new StructElement(AUGMENTATION_DURATION_ID, new UIntType(augmentationDuration))); values.add(new StructElement(MAX_DURATION_ID, new UIntType(maxDuration))); values.add(new StructElement(BLIND_DURATION_ID, new UIntType(blindDuration))); + values.add(new StructElement(SENSITIVITY_ID, sensitivity.map((nonOptionalsensitivity) -> new UIntType(nonOptionalsensitivity)).orElse(new EmptyType()))); return new StructType(values); } - public static ZoneManagementClusterZoneTriggeringTimeControlStruct decodeTlv(BaseTLVType tlvValue) { + public static ZoneManagementClusterZoneTriggerControlStruct decodeTlv(BaseTLVType tlvValue) { if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } @@ -12992,6 +12997,7 @@ public static ZoneManagementClusterZoneTriggeringTimeControlStruct decodeTlv(Bas Integer augmentationDuration = null; Long maxDuration = null; Integer blindDuration = null; + Optional sensitivity = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == INITIAL_DURATION_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -13013,20 +13019,26 @@ public static ZoneManagementClusterZoneTriggeringTimeControlStruct decodeTlv(Bas UIntType castingValue = element.value(UIntType.class); blindDuration = castingValue.value(Integer.class); } + } else if (element.contextTagNum() == SENSITIVITY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sensitivity = Optional.of(castingValue.value(Integer.class)); + } } } - return new ZoneManagementClusterZoneTriggeringTimeControlStruct( + return new ZoneManagementClusterZoneTriggerControlStruct( initialDuration, augmentationDuration, maxDuration, - blindDuration + blindDuration, + sensitivity ); } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n"); + output.append("ZoneManagementClusterZoneTriggerControlStruct {\n"); output.append("\tinitialDuration: "); output.append(initialDuration); output.append("\n"); @@ -13039,6 +13051,9 @@ public String toString() { output.append("\tblindDuration: "); output.append(blindDuration); output.append("\n"); + output.append("\tsensitivity: "); + output.append(sensitivity); + output.append("\n"); output.append("}\n"); return output.toString(); } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 79e891ade9fba4..0f40fb5c326ba0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -16897,7 +16897,7 @@ public long getID() { public enum Attribute { SupportedZoneSources(0L), Zones(1L), - TimeControl(2L), + Triggers(2L), Sensitivity(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index ecc943e44d4dba..d60e57afa2496e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -19955,7 +19955,7 @@ public void onError(Exception ex) { } } - public static class DelegatedZoneManagementClusterTimeControlAttributeCallback implements ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterTriggersAttributeCallback implements ChipClusters.ZoneManagementCluster.TriggersAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -19963,9 +19963,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index f9f500b6cfac4d..eb1dcbafc176d5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -18204,17 +18204,17 @@ private static Map readZoneManagementInteractionInfo() readZoneManagementZonesCommandParams ); result.put("readZonesAttribute", readZoneManagementZonesAttributeInteractionInfo); - Map readZoneManagementTimeControlCommandParams = new LinkedHashMap(); - InteractionInfo readZoneManagementTimeControlAttributeInteractionInfo = new InteractionInfo( + Map readZoneManagementTriggersCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementTriggersAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ZoneManagementCluster) cluster).readTimeControlAttribute( - (ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback) callback + ((ChipClusters.ZoneManagementCluster) cluster).readTriggersAttribute( + (ChipClusters.ZoneManagementCluster.TriggersAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedZoneManagementClusterTimeControlAttributeCallback(), - readZoneManagementTimeControlCommandParams + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterTriggersAttributeCallback(), + readZoneManagementTriggersCommandParams ); - result.put("readTimeControlAttribute", readZoneManagementTimeControlAttributeInteractionInfo); + result.put("readTriggersAttribute", readZoneManagementTriggersAttributeInteractionInfo); Map readZoneManagementSensitivityCommandParams = new LinkedHashMap(); InteractionInfo readZoneManagementSensitivityAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 2aed70a3dcf4d6..a4fcda9f9bfcc0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -176,7 +176,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt", - "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggerControlStruct.kt", ] eventstructs_sources = [ diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggerControlStruct.kt similarity index 74% rename from src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt rename to src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggerControlStruct.kt index 3e55171ac8c1dc..76a8cbaf112a55 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggerControlStruct.kt @@ -17,23 +17,26 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import java.util.Optional import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class ZoneManagementClusterZoneTriggeringTimeControlStruct( +class ZoneManagementClusterZoneTriggerControlStruct( val initialDuration: UInt, val augmentationDuration: UInt, val maxDuration: ULong, val blindDuration: UInt, + val sensitivity: Optional, ) { override fun toString(): String = buildString { - append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n") + append("ZoneManagementClusterZoneTriggerControlStruct {\n") append("\tinitialDuration : $initialDuration\n") append("\taugmentationDuration : $augmentationDuration\n") append("\tmaxDuration : $maxDuration\n") append("\tblindDuration : $blindDuration\n") + append("\tsensitivity : $sensitivity\n") append("}\n") } @@ -44,6 +47,10 @@ class ZoneManagementClusterZoneTriggeringTimeControlStruct( put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration) put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration) + if (sensitivity.isPresent) { + val optsensitivity = sensitivity.get() + put(ContextSpecificTag(TAG_SENSITIVITY), optsensitivity) + } endStructure() } } @@ -53,24 +60,29 @@ class ZoneManagementClusterZoneTriggeringTimeControlStruct( private const val TAG_AUGMENTATION_DURATION = 1 private const val TAG_MAX_DURATION = 2 private const val TAG_BLIND_DURATION = 3 + private const val TAG_SENSITIVITY = 4 - fun fromTlv( - tlvTag: Tag, - tlvReader: TlvReader, - ): ZoneManagementClusterZoneTriggeringTimeControlStruct { + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneTriggerControlStruct { tlvReader.enterStructure(tlvTag) val initialDuration = tlvReader.getUInt(ContextSpecificTag(TAG_INITIAL_DURATION)) val augmentationDuration = tlvReader.getUInt(ContextSpecificTag(TAG_AUGMENTATION_DURATION)) val maxDuration = tlvReader.getULong(ContextSpecificTag(TAG_MAX_DURATION)) val blindDuration = tlvReader.getUInt(ContextSpecificTag(TAG_BLIND_DURATION)) + val sensitivity = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SENSITIVITY))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_SENSITIVITY))) + } else { + Optional.empty() + } tlvReader.exitContainer() - return ZoneManagementClusterZoneTriggeringTimeControlStruct( + return ZoneManagementClusterZoneTriggerControlStruct( initialDuration, augmentationDuration, maxDuration, blindDuration, + sensitivity, ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt index c51fe6eaf0da23..9a85fdba030a1b 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt @@ -72,15 +72,15 @@ class ZoneManagementCluster( object SubscriptionEstablished : ZonesAttributeSubscriptionState() } - class TimeControlAttribute(val value: List) + class TriggersAttribute(val value: List) - sealed class TimeControlAttributeSubscriptionState { - data class Success(val value: List) : - TimeControlAttributeSubscriptionState() + sealed class TriggersAttributeSubscriptionState { + data class Success(val value: List) : + TriggersAttributeSubscriptionState() - data class Error(val exception: Exception) : TimeControlAttributeSubscriptionState() + data class Error(val exception: Exception) : TriggersAttributeSubscriptionState() - object SubscriptionEstablished : TimeControlAttributeSubscriptionState() + object SubscriptionEstablished : TriggersAttributeSubscriptionState() } class GeneratedCommandListAttribute(val value: List) @@ -473,7 +473,7 @@ class ZoneManagementCluster( } } - suspend fun readTimeControlAttribute(): TimeControlAttribute { + suspend fun readTriggersAttribute(): TriggersAttribute { val ATTRIBUTE_ID: UInt = 2u val attributePath = @@ -495,24 +495,24 @@ class ZoneManagementCluster( it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Timecontrol attribute not found in response" } + requireNotNull(attributeData) { "Triggers attribute not found in response" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { + val decodedValue: List = + buildList { tlvReader.enterArray(AnonymousTag) while (!tlvReader.isEndOfContainer()) { - add(ZoneManagementClusterZoneTriggeringTimeControlStruct.fromTlv(AnonymousTag, tlvReader)) + add(ZoneManagementClusterZoneTriggerControlStruct.fromTlv(AnonymousTag, tlvReader)) } tlvReader.exitContainer() } - return TimeControlAttribute(decodedValue) + return TriggersAttribute(decodedValue) } - suspend fun writeTimeControlAttribute( - value: List, + suspend fun writeTriggersAttribute( + value: List, timedWriteTimeout: Duration? = null, ) { val ATTRIBUTE_ID: UInt = 2u @@ -558,10 +558,10 @@ class ZoneManagementCluster( } } - suspend fun subscribeTimeControlAttribute( + suspend fun subscribeTriggersAttribute( minInterval: Int, maxInterval: Int, - ): Flow { + ): Flow { val ATTRIBUTE_ID: UInt = 2u val attributePaths = listOf( @@ -580,7 +580,7 @@ class ZoneManagementCluster( when (subscriptionState) { is SubscriptionState.SubscriptionErrorNotification -> { emit( - TimeControlAttributeSubscriptionState.Error( + TriggersAttributeSubscriptionState.Error( Exception( "Subscription terminated with error code: ${subscriptionState.terminationCause}" ) @@ -593,34 +593,29 @@ class ZoneManagementCluster( .filterIsInstance() .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Timecontrol attribute not found in Node State update" } + requireNotNull(attributeData) { "Triggers attribute not found in Node State update" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { + val decodedValue: List = + buildList { tlvReader.enterArray(AnonymousTag) while (!tlvReader.isEndOfContainer()) { - add( - ZoneManagementClusterZoneTriggeringTimeControlStruct.fromTlv( - AnonymousTag, - tlvReader, - ) - ) + add(ZoneManagementClusterZoneTriggerControlStruct.fromTlv(AnonymousTag, tlvReader)) } tlvReader.exitContainer() } - emit(TimeControlAttributeSubscriptionState.Success(decodedValue)) + emit(TriggersAttributeSubscriptionState.Success(decodedValue)) } SubscriptionState.SubscriptionEstablished -> { - emit(TimeControlAttributeSubscriptionState.SubscriptionEstablished) + emit(TriggersAttributeSubscriptionState.SubscriptionEstablished) } } } } - suspend fun readSensitivityAttribute(): UByte { + suspend fun readSensitivityAttribute(): UByte? { val ATTRIBUTE_ID: UInt = 3u val attributePath = @@ -646,7 +641,12 @@ class ZoneManagementCluster( // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } return decodedValue } @@ -730,9 +730,14 @@ class ZoneManagementCluster( // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } - emit(UByteSubscriptionState.Success(decodedValue)) + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } } SubscriptionState.SubscriptionEstablished -> { emit(UByteSubscriptionState.SubscriptionEstablished) diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index 15406011f71772..b09fc7b799e316 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -176,7 +176,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt", - "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggerControlStruct.kt", ] matter_eventstructs_sources = [ diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggerControlStruct.kt similarity index 74% rename from src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt rename to src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggerControlStruct.kt index 8978d74256a2c9..0927427722f34c 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggerControlStruct.kt @@ -16,24 +16,27 @@ */ package matter.controller.cluster.structs +import java.util.Optional import matter.controller.cluster.* import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class ZoneManagementClusterZoneTriggeringTimeControlStruct( +class ZoneManagementClusterZoneTriggerControlStruct( val initialDuration: UShort, val augmentationDuration: UShort, val maxDuration: UInt, val blindDuration: UShort, + val sensitivity: Optional, ) { override fun toString(): String = buildString { - append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n") + append("ZoneManagementClusterZoneTriggerControlStruct {\n") append("\tinitialDuration : $initialDuration\n") append("\taugmentationDuration : $augmentationDuration\n") append("\tmaxDuration : $maxDuration\n") append("\tblindDuration : $blindDuration\n") + append("\tsensitivity : $sensitivity\n") append("}\n") } @@ -44,6 +47,10 @@ class ZoneManagementClusterZoneTriggeringTimeControlStruct( put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration) put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration) + if (sensitivity.isPresent) { + val optsensitivity = sensitivity.get() + put(ContextSpecificTag(TAG_SENSITIVITY), optsensitivity) + } endStructure() } } @@ -53,24 +60,29 @@ class ZoneManagementClusterZoneTriggeringTimeControlStruct( private const val TAG_AUGMENTATION_DURATION = 1 private const val TAG_MAX_DURATION = 2 private const val TAG_BLIND_DURATION = 3 + private const val TAG_SENSITIVITY = 4 - fun fromTlv( - tlvTag: Tag, - tlvReader: TlvReader, - ): ZoneManagementClusterZoneTriggeringTimeControlStruct { + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneTriggerControlStruct { tlvReader.enterStructure(tlvTag) val initialDuration = tlvReader.getUShort(ContextSpecificTag(TAG_INITIAL_DURATION)) val augmentationDuration = tlvReader.getUShort(ContextSpecificTag(TAG_AUGMENTATION_DURATION)) val maxDuration = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_DURATION)) val blindDuration = tlvReader.getUShort(ContextSpecificTag(TAG_BLIND_DURATION)) + val sensitivity = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SENSITIVITY))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_SENSITIVITY))) + } else { + Optional.empty() + } tlvReader.exitContainer() - return ZoneManagementClusterZoneTriggeringTimeControlStruct( + return ZoneManagementClusterZoneTriggerControlStruct( initialDuration, augmentationDuration, maxDuration, blindDuration, + sensitivity, ) } } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index b07c63d480f6d6..d307822772fe53 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -39628,8 +39628,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } - case Attributes::TimeControl::Id: { - using TypeInfo = Attributes::TimeControl::TypeInfo; + case Attributes::Triggers::Id: { + using TypeInfo = Attributes::Triggers::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -39672,34 +39672,50 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_blindDurationClassName.c_str(), newElement_0_blindDurationCtorSignature.c_str(), jninewElement_0_blindDuration, newElement_0_blindDuration); + jobject newElement_0_sensitivity; + if (!entry_0.sensitivity.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_sensitivity); + } + else + { + jobject newElement_0_sensitivityInsideOptional; + std::string newElement_0_sensitivityInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_sensitivityInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_sensitivityInsideOptional = static_cast(entry_0.sensitivity.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_sensitivityInsideOptionalClassName.c_str(), + newElement_0_sensitivityInsideOptionalCtorSignature.c_str(), jninewElement_0_sensitivityInsideOptional, + newElement_0_sensitivityInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_sensitivityInsideOptional, + newElement_0_sensitivity); + } { - jclass zoneTriggeringTimeControlStructStructClass_1; + jclass zoneTriggerControlStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct", - zoneTriggeringTimeControlStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$ZoneManagementClusterZoneTriggerControlStruct", + zoneTriggerControlStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ZoneManagementClusterZoneTriggerControlStruct"); return nullptr; } - jmethodID zoneTriggeringTimeControlStructStructCtor_1; + jmethodID zoneTriggerControlStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( - env, zoneTriggeringTimeControlStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V", - &zoneTriggeringTimeControlStructStructCtor_1); - if (err != CHIP_NO_ERROR || zoneTriggeringTimeControlStructStructCtor_1 == nullptr) + env, zoneTriggerControlStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/util/Optional;)V", + &zoneTriggerControlStructStructCtor_1); + if (err != CHIP_NO_ERROR || zoneTriggerControlStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ZoneManagementClusterZoneTriggerControlStruct constructor"); return nullptr; } - newElement_0 = - env->NewObject(zoneTriggeringTimeControlStructStructClass_1, zoneTriggeringTimeControlStructStructCtor_1, - newElement_0_initialDuration, newElement_0_augmentationDuration, newElement_0_maxDuration, - newElement_0_blindDuration); + newElement_0 = env->NewObject(zoneTriggerControlStructStructClass_1, zoneTriggerControlStructStructCtor_1, + newElement_0_initialDuration, newElement_0_augmentationDuration, + newElement_0_maxDuration, newElement_0_blindDuration, newElement_0_sensitivity); } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index ba02cdeb026fd5..ac906271d32e02 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -12339,7 +12339,7 @@ class ChipClusters: "reportable": True, }, 0x00000002: { - "attributeName": "TimeControl", + "attributeName": "Triggers", "attributeId": 0x00000002, "type": "", "reportable": True, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 8774535b1a2a7f..c9a162ac0b5af8 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -44337,8 +44337,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="supportedZoneSources", Tag=0x00000000, Type=typing.List[ZoneManagement.Enums.ZoneSourceEnum]), ClusterObjectFieldDescriptor(Label="zones", Tag=0x00000001, Type=typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]]), - ClusterObjectFieldDescriptor(Label="timeControl", Tag=0x00000002, Type=typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]), - ClusterObjectFieldDescriptor(Label="sensitivity", Tag=0x00000003, Type=uint), + ClusterObjectFieldDescriptor(Label="triggers", Tag=0x00000002, Type=typing.List[ZoneManagement.Structs.ZoneTriggerControlStruct]), + ClusterObjectFieldDescriptor(Label="sensitivity", Tag=0x00000003, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -44348,8 +44348,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: supportedZoneSources: typing.List[ZoneManagement.Enums.ZoneSourceEnum] = field(default_factory=lambda: []) zones: typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]] = None - timeControl: typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct] = field(default_factory=lambda: []) - sensitivity: uint = 0 + triggers: typing.List[ZoneManagement.Structs.ZoneTriggerControlStruct] = field(default_factory=lambda: []) + sensitivity: typing.Optional[uint] = None generatedCommandList: typing.List[uint] = field(default_factory=lambda: []) acceptedCommandList: typing.List[uint] = field(default_factory=lambda: []) attributeList: typing.List[uint] = field(default_factory=lambda: []) @@ -44413,6 +44413,7 @@ class ZoneUseEnum(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kTwoDimensionalCartesianZone = 0x1 + kPerZoneSensitivity = 0x2 class Structs: @dataclass @@ -44461,7 +44462,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: zoneSource: 'ZoneManagement.Enums.ZoneSourceEnum' = 0 @dataclass - class ZoneTriggeringTimeControlStruct(ClusterObject): + class ZoneTriggerControlStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -44470,12 +44471,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="augmentationDuration", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="maxDuration", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="blindDuration", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="sensitivity", Tag=4, Type=typing.Optional[uint]), ]) initialDuration: 'uint' = 0 augmentationDuration: 'uint' = 0 maxDuration: 'uint' = 0 blindDuration: 'uint' = 0 + sensitivity: 'typing.Optional[uint]' = None class Commands: @dataclass @@ -44610,7 +44613,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]] = None @dataclass - class TimeControl(ClusterAttributeDescriptor): + class Triggers(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x00000550 @@ -44621,9 +44624,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[ZoneManagement.Structs.ZoneTriggerControlStruct]) - value: typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct] = field(default_factory=lambda: []) + value: typing.List[ZoneManagement.Structs.ZoneTriggerControlStruct] = field(default_factory=lambda: []) @dataclass class Sensitivity(ClusterAttributeDescriptor): @@ -44637,9 +44640,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - value: uint = 0 + value: typing.Optional[uint] = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index c544b8ade33851..3f55a10f842d97 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5565,7 +5565,7 @@ static BOOL AttributeIsSpecifiedInZoneManagementCluster(AttributeId aAttributeId case Attributes::Zones::Id: { return YES; } - case Attributes::TimeControl::Id: { + case Attributes::Triggers::Id: { return YES; } case Attributes::Sensitivity::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 0eacdb19363f28..571793a7edb0f8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -16853,8 +16853,8 @@ static id _Nullable DecodeAttributeValueForZoneManagementCluster(AttributeId aAt } return value; } - case Attributes::TimeControl::Id: { - using TypeInfo = Attributes::TimeControl::TypeInfo; + case Attributes::Triggers::Id: { + using TypeInfo = Attributes::Triggers::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16866,12 +16866,17 @@ static id _Nullable DecodeAttributeValueForZoneManagementCluster(AttributeId aAt auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRZoneManagementClusterZoneTriggeringTimeControlStruct * newElement_0; - newElement_0 = [MTRZoneManagementClusterZoneTriggeringTimeControlStruct new]; + MTRZoneManagementClusterZoneTriggerControlStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterZoneTriggerControlStruct new]; newElement_0.initialDuration = [NSNumber numberWithUnsignedShort:entry_0.initialDuration]; newElement_0.augmentationDuration = [NSNumber numberWithUnsignedShort:entry_0.augmentationDuration]; newElement_0.maxDuration = [NSNumber numberWithUnsignedInt:entry_0.maxDuration]; newElement_0.blindDuration = [NSNumber numberWithUnsignedShort:entry_0.blindDuration]; + if (entry_0.sensitivity.HasValue()) { + newElement_0.sensitivity = [NSNumber numberWithUnsignedChar:entry_0.sensitivity.Value()]; + } else { + newElement_0.sensitivity = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index edf7ad201ce259..92212cc373fd2f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14074,13 +14074,13 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeZonesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeTimeControlWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeTimeControlWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeTimeControlWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeTriggersWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTriggersWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTriggersWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTriggersWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTriggersWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeSensitivityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; @@ -20094,6 +20094,7 @@ typedef NS_ENUM(uint8_t, MTRZoneManagementZoneUse) { typedef NS_OPTIONS(uint32_t, MTRZoneManagementFeature) { MTRZoneManagementFeatureTwoDimensionalCartesianZone MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRZoneManagementFeaturePerZoneSensitivity MTR_PROVISIONALLY_AVAILABLE = 0x2, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementAudioCodec) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 0d13ca47be3c6d..07e00f7088e73b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -97778,9 +97778,9 @@ + (void)readAttributeZonesWithClusterStateCache:(MTRClusterStateCacheContainer * completion:completion]; } -- (void)readAttributeTimeControlWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeTriggersWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::Triggers::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -97789,11 +97789,11 @@ - (void)readAttributeTimeControlWithCompletion:(void (^)(NSArray * _Nullable val completion:completion]; } -- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion +- (void)writeAttributeTriggersWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion { - [self writeAttributeTimeControlWithValue:(NSArray * _Nonnull) value params:nil completion:completion]; + [self writeAttributeTriggersWithValue:(NSArray * _Nonnull) value params:nil completion:completion]; } -- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +- (void)writeAttributeTriggersWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion { // Make a copy of params before we go async. params = [params copy]; @@ -97808,7 +97808,7 @@ - (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value params:(MTR } ListFreer listFreer; - using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::Triggers::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -97820,15 +97820,19 @@ - (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value params:(MTR } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if ( ! [value[i_0] isKindOfClass: [MTRZoneManagementClusterZoneTriggeringTimeControlStruct class]] ) { + if ( ! [value[i_0] isKindOfClass: [MTRZoneManagementClusterZoneTriggerControlStruct class]] ) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (MTRZoneManagementClusterZoneTriggeringTimeControlStruct *)value[i_0]; + auto element_0 = (MTRZoneManagementClusterZoneTriggerControlStruct *)value[i_0]; listHolder_0->mList[i_0].initialDuration = element_0.initialDuration.unsignedShortValue; listHolder_0->mList[i_0].augmentationDuration = element_0.augmentationDuration.unsignedShortValue; listHolder_0->mList[i_0].maxDuration = element_0.maxDuration.unsignedIntValue; listHolder_0->mList[i_0].blindDuration = element_0.blindDuration.unsignedShortValue; + if (element_0.sensitivity != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].sensitivity.Emplace(); + definedValue_2 = element_0.sensitivity.unsignedCharValue; + } } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -97841,11 +97845,11 @@ - (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value params:(MTR std::move(*bridge).DispatchAction(self.device); } -- (void)subscribeAttributeTimeControlWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeTriggersWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::Triggers::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -97855,9 +97859,9 @@ - (void)subscribeAttributeTimeControlWithParams:(MTRSubscribeParams * _Nonnull)p subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeTimeControlWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeTriggersWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::Triggers::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index e1f194c9916d15..7587e25a241fc0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -4626,7 +4626,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { // Cluster ZoneManagement attributes MTRAttributeIDTypeClusterZoneManagementAttributeSupportedZoneSourcesID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterZoneManagementAttributeZonesID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterZoneManagementAttributeTriggersID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, MTRAttributeIDTypeClusterZoneManagementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterZoneManagementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 18d0151955242e..0791fc4952832b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -7688,8 +7688,8 @@ result = @"Zones"; break; - case MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID: - result = @"TimeControl"; + case MTRAttributeIDTypeClusterZoneManagementAttributeTriggersID: + result = @"Triggers"; break; case MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 7c7c93d027a715..4c28d0ddd343da 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6592,9 +6592,9 @@ MTR_PROVISIONALLY_AVAILABLE - (NSDictionary * _Nullable)readAttributeZonesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeTimeControlWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeTriggersWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTriggersWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTriggersWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeSensitivityWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (void)writeAttributeSensitivityWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 656983754cae96..500aa41148ae4e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -19012,20 +19012,20 @@ - (void)removeZoneWithParams:(MTRZoneManagementClusterRemoveZoneParams *)params return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeZonesID) params:params]; } -- (NSDictionary * _Nullable)readAttributeTimeControlWithParams:(MTRReadParams * _Nullable)params +- (NSDictionary * _Nullable)readAttributeTriggersWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID) params:params]; + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeTriggersID) params:params]; } -- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +- (void)writeAttributeTriggersWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs { - [self writeAttributeTimeControlWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; + [self writeAttributeTriggersWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; } -- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +- (void)writeAttributeTriggersWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params { NSNumber * timedWriteTimeout = params.timedWriteTimeout; - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeTriggersID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } - (NSDictionary * _Nullable)readAttributeSensitivityWithParams:(MTRReadParams * _Nullable)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 02d36a82d710b9..9f679a7a305e8d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2139,11 +2139,12 @@ MTR_PROVISIONALLY_AVAILABLE @end MTR_PROVISIONALLY_AVAILABLE -@interface MTRZoneManagementClusterZoneTriggeringTimeControlStruct : NSObject +@interface MTRZoneManagementClusterZoneTriggerControlStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull initialDuration MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull augmentationDuration MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull maxDuration MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull blindDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable sensitivity MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index e38df789310a97..ddc22861202fc1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -8867,7 +8867,7 @@ - (NSString *)description @end -@implementation MTRZoneManagementClusterZoneTriggeringTimeControlStruct +@implementation MTRZoneManagementClusterZoneTriggerControlStruct - (instancetype)init { if (self = [super init]) { @@ -8879,25 +8879,28 @@ - (instancetype)init _maxDuration = @(0); _blindDuration = @(0); + + _sensitivity = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRZoneManagementClusterZoneTriggeringTimeControlStruct alloc] init]; + auto other = [[MTRZoneManagementClusterZoneTriggerControlStruct alloc] init]; other.initialDuration = self.initialDuration; other.augmentationDuration = self.augmentationDuration; other.maxDuration = self.maxDuration; other.blindDuration = self.blindDuration; + other.sensitivity = self.sensitivity; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: initialDuration:%@; augmentationDuration:%@; maxDuration:%@; blindDuration:%@; >", NSStringFromClass([self class]), _initialDuration, _augmentationDuration, _maxDuration, _blindDuration]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: initialDuration:%@; augmentationDuration:%@; maxDuration:%@; blindDuration:%@; sensitivity:%@; >", NSStringFromClass([self class]), _initialDuration, _augmentationDuration, _maxDuration, _blindDuration, _sensitivity]; return descriptionString; } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index adeaf3bf12b4f6..aae67302e404a0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -5526,6 +5526,7 @@ enum class ZoneUseEnum : uint8_t enum class Feature : uint32_t { kTwoDimensionalCartesianZone = 0x1, + kPerZoneSensitivity = 0x2, }; } // namespace ZoneManagement diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 5a4f042e4c492a..f2c2ea2ef58377 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -28541,7 +28541,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace ZoneInformationStruct -namespace ZoneTriggeringTimeControlStruct { +namespace ZoneTriggerControlStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; @@ -28549,6 +28549,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const encoder.Encode(to_underlying(Fields::kAugmentationDuration), augmentationDuration); encoder.Encode(to_underlying(Fields::kMaxDuration), maxDuration); encoder.Encode(to_underlying(Fields::kBlindDuration), blindDuration); + encoder.Encode(to_underlying(Fields::kSensitivity), sensitivity); return encoder.Finalize(); } @@ -28582,6 +28583,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, blindDuration); } + else if (__context_tag == to_underlying(Fields::kSensitivity)) + { + err = DataModel::Decode(reader, sensitivity); + } else { } @@ -28590,7 +28595,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace ZoneTriggeringTimeControlStruct +} // namespace ZoneTriggerControlStruct } // namespace Structs namespace Commands { @@ -28814,8 +28819,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, supportedZoneSources); case Attributes::Zones::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, zones); - case Attributes::TimeControl::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, timeControl); + case Attributes::Triggers::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, triggers); case Attributes::Sensitivity::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, sensitivity); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index d4b3d9c7eebe09..35e26825283dad 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -40482,13 +40482,14 @@ struct Type using DecodableType = Type; } // namespace ZoneInformationStruct -namespace ZoneTriggeringTimeControlStruct { +namespace ZoneTriggerControlStruct { enum class Fields : uint8_t { kInitialDuration = 0, kAugmentationDuration = 1, kMaxDuration = 2, kBlindDuration = 3, + kSensitivity = 4, }; struct Type @@ -40498,6 +40499,7 @@ struct Type uint16_t augmentationDuration = static_cast(0); uint32_t maxDuration = static_cast(0); uint16_t blindDuration = static_cast(0); + Optional sensitivity; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -40508,7 +40510,7 @@ struct Type using DecodableType = Type; -} // namespace ZoneTriggeringTimeControlStruct +} // namespace ZoneTriggerControlStruct } // namespace Structs namespace Commands { @@ -40772,21 +40774,20 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace Zones -namespace TimeControl { +namespace Triggers { struct TypeInfo { - using Type = - chip::app::DataModel::List; - using DecodableType = chip::app::DataModel::DecodableList< - chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType>; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType> &; + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggerControlStruct::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::TimeControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Triggers::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace TimeControl +} // namespace Triggers namespace Sensitivity { struct TypeInfo { @@ -40840,7 +40841,7 @@ struct TypeInfo Attributes::SupportedZoneSources::TypeInfo::DecodableType supportedZoneSources; Attributes::Zones::TypeInfo::DecodableType zones; - Attributes::TimeControl::TypeInfo::DecodableType timeControl; + Attributes::Triggers::TypeInfo::DecodableType triggers; Attributes::Sensitivity::TypeInfo::DecodableType sensitivity = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 91a52d7c96404f..e0fa3a25fdaf2a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -6832,9 +6832,9 @@ namespace Zones { static constexpr AttributeId Id = 0x00000001; } // namespace Zones -namespace TimeControl { +namespace Triggers { static constexpr AttributeId Id = 0x00000002; -} // namespace TimeControl +} // namespace Triggers namespace Sensitivity { static constexpr AttributeId Id = 0x00000003; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index ad706028cc4d52..3fca8853155172 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -13540,7 +13540,7 @@ class ContentAppObserverContentAppMessage : public ClusterCommand | Attributes: | | | * SupportedZoneSources | 0x0000 | | * Zones | 0x0001 | -| * TimeControl | 0x0002 | +| * Triggers | 0x0002 | | * Sensitivity | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | @@ -26675,7 +26675,7 @@ void registerClusterZoneManagement(Commands & commands, CredentialIssuerCommands make_unique(Id, credsIssuerConfig), // make_unique(Id, "supported-zone-sources", Attributes::SupportedZoneSources::Id, credsIssuerConfig), // make_unique(Id, "zones", Attributes::Zones::Id, credsIssuerConfig), // - make_unique(Id, "time-control", Attributes::TimeControl::Id, credsIssuerConfig), // + make_unique(Id, "triggers", Attributes::Triggers::Id, credsIssuerConfig), // make_unique(Id, "sensitivity", Attributes::Sensitivity::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // @@ -26690,8 +26690,8 @@ void registerClusterZoneManagement(Commands & commands, CredentialIssuerCommands chip::app::DataModel::List>>( Id, "zones", Attributes::Zones::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( - Id, "time-control", Attributes::TimeControl::Id, WriteCommandType::kWrite, credsIssuerConfig), // + chip::app::DataModel::List>>( + Id, "triggers", Attributes::Triggers::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "sensitivity", 0, UINT8_MAX, Attributes::Sensitivity::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>>( @@ -26708,7 +26708,7 @@ void registerClusterZoneManagement(Commands & commands, CredentialIssuerCommands make_unique(Id, credsIssuerConfig), // make_unique(Id, "supported-zone-sources", Attributes::SupportedZoneSources::Id, credsIssuerConfig), // make_unique(Id, "zones", Attributes::Zones::Id, credsIssuerConfig), // - make_unique(Id, "time-control", Attributes::TimeControl::Id, credsIssuerConfig), // + make_unique(Id, "triggers", Attributes::Triggers::Id, credsIssuerConfig), // make_unique(Id, "sensitivity", Attributes::Sensitivity::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 670d306354f37f..0c3abfbc83a89d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -5939,23 +5939,22 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Struct ComplexArgumentParser::Finalize(request.zoneSource); } -CHIP_ERROR -ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request, - Json::Value & value) +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggerControlStruct::Type & request, + Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); // Copy to track which members we already processed. Json::Value valueCopy(value); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.initialDuration", - "initialDuration", value.isMember("initialDuration"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.augmentationDuration", + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggerControlStruct.initialDuration", "initialDuration", + value.isMember("initialDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggerControlStruct.augmentationDuration", "augmentationDuration", value.isMember("augmentationDuration"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.maxDuration", "maxDuration", + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggerControlStruct.maxDuration", "maxDuration", value.isMember("maxDuration"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.blindDuration", "blindDuration", + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggerControlStruct.blindDuration", "blindDuration", value.isMember("blindDuration"))); char labelWithMember[kMaxLabelLength]; @@ -5976,15 +5975,23 @@ ComplexArgumentParser::Setup(const char * label, ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.blindDuration, value["blindDuration"])); valueCopy.removeMember("blindDuration"); + if (value.isMember("sensitivity")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "sensitivity"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.sensitivity, value["sensitivity"])); + } + valueCopy.removeMember("sensitivity"); + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } -void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneTriggerControlStruct::Type & request) { ComplexArgumentParser::Finalize(request.initialDuration); ComplexArgumentParser::Finalize(request.augmentationDuration); ComplexArgumentParser::Finalize(request.maxDuration); ComplexArgumentParser::Finalize(request.blindDuration); + ComplexArgumentParser::Finalize(request.sensitivity); } CHIP_ERROR diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 38b3aee08f9859..869fcb855a142a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -688,11 +688,10 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ZoneManagement: static void Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::Type & request); -static CHIP_ERROR Setup(const char * label, - chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request, +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ZoneManagement::Structs::ZoneTriggerControlStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request); +static void Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneTriggerControlStruct::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type & request, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index d3991b2e80d7c0..6fb87819ce70df 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -5246,9 +5246,9 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue( - const char * label, size_t indent, - const chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneTriggerControlStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -5283,6 +5283,14 @@ CHIP_ERROR DataModelLogger::LogValue( return err; } } + { + CHIP_ERROR err = LogValue("Sensitivity", indent + 1, value.sensitivity); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Sensitivity'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; @@ -18438,12 +18446,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Zones", 1, value); } - case ZoneManagement::Attributes::TimeControl::Id: { + case ZoneManagement::Attributes::Triggers::Id: { chip::app::DataModel::DecodableList< - chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType> + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggerControlStruct::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TimeControl", 1, value); + return DataModelLogger::LogValue("Triggers", 1, value); } case ZoneManagement::Attributes::Sensitivity::Id: { uint8_t value; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index c9833ccb6c8d7f..dd53dfabc6a6eb 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -422,9 +422,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::DecodableType & value); -static CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneTriggerControlStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index ef977d65e231ed..753378db6fa9e7 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -4148,8 +4148,8 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "SupportedZoneSources"; case chip::app::Clusters::ZoneManagement::Attributes::Zones::Id: return "Zones"; - case chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id: - return "TimeControl"; + case chip::app::Clusters::ZoneManagement::Attributes::Triggers::Id: + return "Triggers"; case chip::app::Clusters::ZoneManagement::Attributes::Sensitivity::Id: return "Sensitivity"; case chip::app::Clusters::ZoneManagement::Attributes::GeneratedCommandList::Id: diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 3fc4c8f49d10a7..6e8b57d2d8baab 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -149469,7 +149469,7 @@ class SubscribeAttributeContentAppObserverClusterRevision : public SubscribeAttr | Attributes: | | | * SupportedZoneSources | 0x0000 | | * Zones | 0x0001 | -| * TimeControl | 0x0002 | +| * Triggers | 0x0002 | | * Sensitivity | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | @@ -149934,34 +149934,34 @@ class SubscribeAttributeZoneManagementZones : public SubscribeAttribute { #if MTR_ENABLE_PROVISIONAL /* - * Attribute TimeControl + * Attribute Triggers */ -class ReadZoneManagementTimeControl : public ReadAttribute { +class ReadZoneManagementTriggers : public ReadAttribute { public: - ReadZoneManagementTimeControl() - : ReadAttribute("time-control") + ReadZoneManagementTriggers() + : ReadAttribute("triggers") { } - ~ReadZoneManagementTimeControl() + ~ReadZoneManagementTriggers() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Triggers::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeTimeControlWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ZoneManagement.TimeControl response %@", [value description]); + [cluster readAttributeTriggersWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.Triggers response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("ZoneManagement TimeControl read Error", error); + LogNSError("ZoneManagement Triggers read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -149970,25 +149970,25 @@ class ReadZoneManagementTimeControl : public ReadAttribute { } }; -class WriteZoneManagementTimeControl : public WriteAttribute { +class WriteZoneManagementTriggers : public WriteAttribute { public: - WriteZoneManagementTimeControl() - : WriteAttribute("time-control") + WriteZoneManagementTriggers() + : WriteAttribute("triggers") , mComplex(&mValue) { - AddArgument("attr-name", "time-control"); + AddArgument("attr-name", "triggers"); AddArgument("attr-value", &mComplex); WriteAttribute::AddArguments(); } - ~WriteZoneManagementTimeControl() + ~WriteZoneManagementTriggers() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Triggers::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); @@ -150000,20 +150000,25 @@ class WriteZoneManagementTimeControl : public WriteAttribute { { // Scope for our temporary variables auto * array_0 = [NSMutableArray new]; for (auto & entry_0 : mValue) { - MTRZoneManagementClusterZoneTriggeringTimeControlStruct * newElement_0; - newElement_0 = [MTRZoneManagementClusterZoneTriggeringTimeControlStruct new]; + MTRZoneManagementClusterZoneTriggerControlStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterZoneTriggerControlStruct new]; newElement_0.initialDuration = [NSNumber numberWithUnsignedShort:entry_0.initialDuration]; newElement_0.augmentationDuration = [NSNumber numberWithUnsignedShort:entry_0.augmentationDuration]; newElement_0.maxDuration = [NSNumber numberWithUnsignedInt:entry_0.maxDuration]; newElement_0.blindDuration = [NSNumber numberWithUnsignedShort:entry_0.blindDuration]; + if (entry_0.sensitivity.HasValue()) { + newElement_0.sensitivity = [NSNumber numberWithUnsignedChar:entry_0.sensitivity.Value()]; + } else { + newElement_0.sensitivity = nil; + } [array_0 addObject:newElement_0]; } value = array_0; } - [cluster writeAttributeTimeControlWithValue:value params:params completion:^(NSError * _Nullable error) { + [cluster writeAttributeTriggersWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { - LogNSError("ZoneManagement TimeControl write Error", error); + LogNSError("ZoneManagement Triggers write Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -150022,25 +150027,25 @@ class WriteZoneManagementTimeControl : public WriteAttribute { } private: - chip::app::DataModel::List mValue; - TypedComplexArgument> mComplex; + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; }; -class SubscribeAttributeZoneManagementTimeControl : public SubscribeAttribute { +class SubscribeAttributeZoneManagementTriggers : public SubscribeAttribute { public: - SubscribeAttributeZoneManagementTimeControl() - : SubscribeAttribute("time-control") + SubscribeAttributeZoneManagementTriggers() + : SubscribeAttribute("triggers") { } - ~SubscribeAttributeZoneManagementTimeControl() + ~SubscribeAttributeZoneManagementTriggers() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Triggers::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); @@ -150055,10 +150060,10 @@ class SubscribeAttributeZoneManagementTimeControl : public SubscribeAttribute { if (mAutoResubscribe.HasValue()) { params.resubscribeAutomatically = mAutoResubscribe.Value(); } - [cluster subscribeAttributeTimeControlWithParams:params + [cluster subscribeAttributeTriggersWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ZoneManagement.TimeControl response %@", [value description]); + NSLog(@"ZoneManagement.Triggers response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -181149,9 +181154,9 @@ void registerClusterZoneManagement(Commands & commands) make_unique(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), //