From d947fae40c296739fc1548961c7220fead3b7d56 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 24 Oct 2023 13:18:10 -0400 Subject: [PATCH] Zap regen --- ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 4 +- .../rootnode_dimmablelight_bCwGYSDpoe.matter | 4 +- .../rootnode_thermostat_bm3fb8dhYi.matter | 4 +- .../placeholder/linux/apps/app1/config.matter | 4 +- .../placeholder/linux/apps/app2/config.matter | 4 +- examples/pump-app/pump-common/pump-app.matter | 4 +- .../silabs/data_model/pump-thread-app.matter | 4 +- .../silabs/data_model/pump-wifi-app.matter | 4 +- .../data_model/controller-clusters.matter | 4 +- .../chip/devicecontroller/ChipClusters.java | 28 +++- .../devicecontroller/ClusterInfoMapping.java | 42 ++++++ .../devicecontroller/ClusterReadMapping.java | 8 +- .../CHIPAttributeTLVValueDecoder.cpp | 34 +++-- .../zap-generated/CHIPClustersWrite-JNI.cpp | 24 ++- .../java/zap-generated/CHIPReadCallbacks.cpp | 142 ++++++++++++++++++ .../python/chip/clusters/Objects.py | 16 +- .../MTRAttributeTLVValueDecoder.mm | 16 +- .../CHIP/zap-generated/MTRBaseClusters.h | 16 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 34 +++-- .../zap-generated/attributes/Accessors.cpp | 64 ++++++-- .../zap-generated/attributes/Accessors.h | 8 +- .../zap-generated/cluster-objects.h | 18 +-- .../zap-generated/cluster/Commands.h | 12 +- .../cluster/logging/DataModelLogger.cpp | 4 +- .../zap-generated/cluster/Commands.h | 14 +- .../zap-generated/test/Commands.h | 18 ++- 26 files changed, 418 insertions(+), 116 deletions(-) diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 4a1eaf789ea786..46fb139b0e1363 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1465,8 +1465,8 @@ client cluster OccupancySensing = 1030 { attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32; attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33; attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34; - attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48; - attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49; + attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48; + attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49; attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 43531e46fe8b87..0e39567ce6ebcb 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1329,8 +1329,8 @@ client cluster OccupancySensing = 1030 { attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32; attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33; attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34; - attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48; - attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49; + attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48; + attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49; attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 4747fcac8d84b3..63f1760fbdb162 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1408,8 +1408,8 @@ client cluster OccupancySensing = 1030 { attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32; attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33; attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34; - attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48; - attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49; + attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48; + attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49; attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index bc62ad9ebc9c58..9f1e5b3f1460f9 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -5277,8 +5277,8 @@ server cluster OccupancySensing = 1030 { attribute access(write: manage) int16u ultrasonicOccupiedToUnoccupiedDelay = 32; attribute access(write: manage) int16u ultrasonicUnoccupiedToOccupiedDelay = 33; attribute access(write: manage) int8u ultrasonicUnoccupiedToOccupiedThreshold = 34; - attribute access(write: manage) int16u physicalContactOccupiedToUnoccupiedDelay = 48; - attribute access(write: manage) int16u physicalContactUnoccupiedToOccupiedDelay = 49; + attribute access(write: manage) nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48; + attribute access(write: manage) nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49; attribute access(write: manage) int8u physicalContactUnoccupiedToOccupiedThreshold = 50; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 689f75dbc008c8..93803b0abc027e 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -5236,8 +5236,8 @@ server cluster OccupancySensing = 1030 { attribute access(write: manage) int16u ultrasonicOccupiedToUnoccupiedDelay = 32; attribute access(write: manage) int16u ultrasonicUnoccupiedToOccupiedDelay = 33; attribute access(write: manage) int8u ultrasonicUnoccupiedToOccupiedThreshold = 34; - attribute access(write: manage) int16u physicalContactOccupiedToUnoccupiedDelay = 48; - attribute access(write: manage) int16u physicalContactUnoccupiedToOccupiedDelay = 49; + attribute access(write: manage) nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48; + attribute access(write: manage) nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49; attribute access(write: manage) int8u physicalContactUnoccupiedToOccupiedThreshold = 50; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 23649a4461e95b..397df9bb481ce8 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -1386,8 +1386,8 @@ client cluster OccupancySensing = 1030 { attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32; attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33; attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34; - attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48; - attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49; + attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48; + attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49; attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index 7a4f9d38022861..7122824b4835ef 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -1386,8 +1386,8 @@ client cluster OccupancySensing = 1030 { attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32; attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33; attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34; - attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48; - attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49; + attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48; + attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49; attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index 7a4f9d38022861..7122824b4835ef 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -1386,8 +1386,8 @@ client cluster OccupancySensing = 1030 { attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32; attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33; attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34; - attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48; - attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49; + attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48; + attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49; attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 3527172e57b436..67bcd6ca28f5e7 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -5188,8 +5188,8 @@ client cluster OccupancySensing = 1030 { attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32; attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33; attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34; - attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48; - attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49; + attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48; + attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49; attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 296065e6083551..64618d0b8806c1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -21675,6 +21675,18 @@ public OccupancySensingCluster(long devicePtr, int endpointId) { @Override public native long initWithDevice(long devicePtr, int endpointId); + public interface PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback { + void onSuccess(@Nullable Integer value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback { + void onSuccess(@Nullable Integer value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface GeneratedCommandListAttributeCallback { void onSuccess(List value); void onError(Exception ex); @@ -21838,7 +21850,7 @@ public void subscribeUltrasonicUnoccupiedToOccupiedThresholdAttribute( } public void readPhysicalContactOccupiedToUnoccupiedDelayAttribute( - IntegerAttributeCallback callback) { + PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback callback) { readPhysicalContactOccupiedToUnoccupiedDelayAttribute(chipClusterPtr, callback); } @@ -21851,12 +21863,12 @@ public void writePhysicalContactOccupiedToUnoccupiedDelayAttribute(DefaultCluste } public void subscribePhysicalContactOccupiedToUnoccupiedDelayAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback callback, int minInterval, int maxInterval) { subscribePhysicalContactOccupiedToUnoccupiedDelayAttribute(chipClusterPtr, callback, minInterval, maxInterval); } public void readPhysicalContactUnoccupiedToOccupiedDelayAttribute( - IntegerAttributeCallback callback) { + PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback callback) { readPhysicalContactUnoccupiedToOccupiedDelayAttribute(chipClusterPtr, callback); } @@ -21869,7 +21881,7 @@ public void writePhysicalContactUnoccupiedToOccupiedDelayAttribute(DefaultCluste } public void subscribePhysicalContactUnoccupiedToOccupiedDelayAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback callback, int minInterval, int maxInterval) { subscribePhysicalContactUnoccupiedToOccupiedDelayAttribute(chipClusterPtr, callback, minInterval, maxInterval); } @@ -21999,17 +22011,17 @@ public void subscribeClusterRevisionAttribute( private native void subscribeUltrasonicUnoccupiedToOccupiedThresholdAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readPhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + private native void readPhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback callback); private native void writePhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs); - private native void subscribePhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void subscribePhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback callback, int minInterval, int maxInterval); - private native void readPhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + private native void readPhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback callback); private native void writePhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs); - private native void subscribePhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void subscribePhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback callback, int minInterval, int maxInterval); private native void readPhysicalContactUnoccupiedToOccupiedThresholdAttribute(long chipClusterPtr, IntegerAttributeCallback callback); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 76d01c7ae688d1..898f147d4a478f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -11811,6 +11811,48 @@ public void onError(Exception ex) { } } + public static class DelegatedOccupancySensingClusterPhysicalContactOccupiedToUnoccupiedDelayAttributeCallback implements ChipClusters.OccupancySensingCluster.PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedOccupancySensingClusterPhysicalContactUnoccupiedToOccupiedDelayAttributeCallback implements ChipClusters.OccupancySensingCluster.PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedOccupancySensingClusterGeneratedCommandListAttributeCallback implements ChipClusters.OccupancySensingCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 43e73e97980866..09b70a1a9cf586 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -11743,10 +11743,10 @@ private static Map readOccupancySensingInteractionInfo( InteractionInfo readOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OccupancySensingCluster) cluster).readPhysicalContactOccupiedToUnoccupiedDelayAttribute( - (ChipClusters.IntegerAttributeCallback) callback + (ChipClusters.OccupancySensingCluster.PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + () -> new ClusterInfoMapping.DelegatedOccupancySensingClusterPhysicalContactOccupiedToUnoccupiedDelayAttributeCallback(), readOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayCommandParams ); result.put("readPhysicalContactOccupiedToUnoccupiedDelayAttribute", readOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayAttributeInteractionInfo); @@ -11754,10 +11754,10 @@ private static Map readOccupancySensingInteractionInfo( InteractionInfo readOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OccupancySensingCluster) cluster).readPhysicalContactUnoccupiedToOccupiedDelayAttribute( - (ChipClusters.IntegerAttributeCallback) callback + (ChipClusters.OccupancySensingCluster.PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + () -> new ClusterInfoMapping.DelegatedOccupancySensingClusterPhysicalContactUnoccupiedToOccupiedDelayAttributeCallback(), readOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayCommandParams ); result.put("readPhysicalContactUnoccupiedToOccupiedDelayAttribute", readOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayAttributeInteractionInfo); diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 40196587dc825b..05358ace92473c 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -23700,11 +23700,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } return value; } case Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: { @@ -23716,11 +23723,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } return value; } case Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: { diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 0dbbe20286896c..e9827e296ac18f 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -8306,8 +8306,16 @@ JNI_METHOD(void, OccupancySensingCluster, writePhysicalContactOccupiedToUnoccupi std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -8358,8 +8366,16 @@ JNI_METHOD(void, OccupancySensingCluster, writePhysicalContactUnoccupiedToOccupi std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 6fddee564cd0df..6753856a613981 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -36298,6 +36298,148 @@ void CHIPRelativeHumidityMeasurementAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayAttributeCallback:: + CHIPOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, + this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayAttributeCallback:: + ~CHIPOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + jint jnijavaValue = static_cast(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayAttributeCallback:: + CHIPOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, + this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayAttributeCallback:: + ~CHIPOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + jint jnijavaValue = static_cast(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + CHIPOccupancySensingGeneratedCommandListAttributeCallback::CHIPOccupancySensingGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 98a1a611ca54a5..02dbd3ef770d41 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -28361,8 +28361,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="ultrasonicOccupiedToUnoccupiedDelay", Tag=0x00000020, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="ultrasonicUnoccupiedToOccupiedDelay", Tag=0x00000021, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="ultrasonicUnoccupiedToOccupiedThreshold", Tag=0x00000022, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="physicalContactOccupiedToUnoccupiedDelay", Tag=0x00000030, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="physicalContactUnoccupiedToOccupiedDelay", Tag=0x00000031, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="physicalContactOccupiedToUnoccupiedDelay", Tag=0x00000030, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="physicalContactUnoccupiedToOccupiedDelay", Tag=0x00000031, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="physicalContactUnoccupiedToOccupiedThreshold", Tag=0x00000032, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), @@ -28381,8 +28381,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: ultrasonicOccupiedToUnoccupiedDelay: 'typing.Optional[uint]' = None ultrasonicUnoccupiedToOccupiedDelay: 'typing.Optional[uint]' = None ultrasonicUnoccupiedToOccupiedThreshold: 'typing.Optional[uint]' = None - physicalContactOccupiedToUnoccupiedDelay: 'typing.Optional[uint]' = None - physicalContactUnoccupiedToOccupiedDelay: 'typing.Optional[uint]' = None + physicalContactOccupiedToUnoccupiedDelay: 'typing.Union[None, Nullable, uint]' = None + physicalContactUnoccupiedToOccupiedDelay: 'typing.Union[None, Nullable, uint]' = None physicalContactUnoccupiedToOccupiedThreshold: 'typing.Optional[uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None @@ -28569,9 +28569,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class PhysicalContactUnoccupiedToOccupiedDelay(ClusterAttributeDescriptor): @@ -28585,9 +28585,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class PhysicalContactUnoccupiedToOccupiedThreshold(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index f02f0d8f61c62b..148a94174f94e2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -10299,8 +10299,12 @@ static id _Nullable DecodeAttributeValueForOccupancySensingCluster(AttributeId a if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: { @@ -10310,8 +10314,12 @@ static id _Nullable DecodeAttributeValueForOccupancySensingCluster(AttributeId a if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 996229a68b65d7..c676ba3fe26bc0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -9017,16 +9017,16 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + (void)readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributePhysicalContactOccupiedToUnoccupiedDelayWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); + (void)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributePhysicalContactUnoccupiedToOccupiedDelayWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -22408,8 +22408,8 @@ typedef NS_OPTIONS(uint8_t, MTRTestClusterSimpleBitmap) { + (void)readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithAttributeCache:endpoint:queue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:params:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nullable)value completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:params:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)subscribeAttributePhysicalContactOccupiedToUnoccupiedDelayWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler @@ -22417,8 +22417,8 @@ typedef NS_OPTIONS(uint8_t, MTRTestClusterSimpleBitmap) { + (void)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributePhysicalContactOccupiedToUnoccupiedDelayWithAttributeCache:endpoint:queue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:params:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nullable)value completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:params:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)subscribeAttributePhysicalContactUnoccupiedToOccupiedDelayWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index b62652b9d46429..2bf595570602fd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -76718,11 +76718,11 @@ - (void)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletion:(voi completion:completion]; } -- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion { - [self writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; + [self writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; } -- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion { // Make a copy of params before we go async. params = [params copy]; @@ -76744,7 +76744,12 @@ - (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumbe ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); @@ -76788,11 +76793,11 @@ - (void)readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletion:(voi completion:completion]; } -- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion { - [self writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; + [self writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; } -- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion { // Make a copy of params before we go async. params = [params copy]; @@ -76814,7 +76819,12 @@ - (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumbe ListFreer listFreer; using TypeInfo = OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); @@ -77508,11 +77518,11 @@ - (void)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletionHandl completionHandler(static_cast(value), error); }]; } -- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nullable)value completionHandler:(MTRStatusCompletion)completionHandler { [self writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:value params:nil completion:completionHandler]; } -- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler { [self writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:value params:params completion:completionHandler]; } @@ -77551,11 +77561,11 @@ - (void)readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletionHandl completionHandler(static_cast(value), error); }]; } -- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nullable)value completionHandler:(MTRStatusCompletion)completionHandler { [self writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:value params:nil completion:completionHandler]; } -- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler { [self writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:value params:params completion:completionHandler]; } diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 830fe37be6b173..12b6743295a440 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -19045,24 +19045,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace PhysicalContactOccupiedToUnoccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -19072,28 +19075,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace PhysicalContactOccupiedToUnoccupiedDelay namespace PhysicalContactUnoccupiedToOccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -19103,6 +19128,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace PhysicalContactUnoccupiedToOccupiedDelay namespace PhysicalContactUnoccupiedToOccupiedThreshold { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index a6a1ab0badbb75..17bb22496fbcb7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -3342,13 +3342,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace UltrasonicUnoccupiedToOccupiedThreshold namespace PhysicalContactOccupiedToUnoccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace PhysicalContactOccupiedToUnoccupiedDelay namespace PhysicalContactUnoccupiedToOccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace PhysicalContactUnoccupiedToOccupiedDelay namespace PhysicalContactUnoccupiedToOccupiedThreshold { 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 6161d06777ce7c..9476242116c45a 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 @@ -25531,9 +25531,9 @@ struct TypeInfo namespace PhysicalContactOccupiedToUnoccupiedDelay { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::OccupancySensing::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id; } @@ -25543,9 +25543,9 @@ struct TypeInfo namespace PhysicalContactUnoccupiedToOccupiedDelay { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::OccupancySensing::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id; } @@ -25625,10 +25625,8 @@ struct TypeInfo static_cast(0); Attributes::UltrasonicUnoccupiedToOccupiedThreshold::TypeInfo::DecodableType ultrasonicUnoccupiedToOccupiedThreshold = static_cast(0); - Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo::DecodableType physicalContactOccupiedToUnoccupiedDelay = - static_cast(0); - Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo::DecodableType physicalContactUnoccupiedToOccupiedDelay = - static_cast(0); + Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo::DecodableType physicalContactOccupiedToUnoccupiedDelay; + Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo::DecodableType physicalContactUnoccupiedToOccupiedDelay; Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::TypeInfo::DecodableType physicalContactUnoccupiedToOccupiedThreshold = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index e5073c18e6523d..47b4cf88e97db4 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -18350,12 +18350,12 @@ void registerClusterOccupancySensing(Commands & commands, CredentialIssuerComman make_unique>(Id, "ultrasonic-unoccupied-to-occupied-threshold", 0, UINT8_MAX, Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "physical-contact-occupied-to-unoccupied-delay", 0, UINT16_MAX, - Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "physical-contact-unoccupied-to-occupied-delay", 0, UINT16_MAX, - Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id, WriteCommandType::kWrite, - credsIssuerConfig), // + make_unique>>( + Id, "physical-contact-occupied-to-unoccupied-delay", 0, UINT16_MAX, + Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>>( + Id, "physical-contact-unoccupied-to-occupied-delay", 0, UINT16_MAX, + Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "physical-contact-unoccupied-to-occupied-threshold", 0, UINT8_MAX, Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id, WriteCommandType::kWrite, credsIssuerConfig), // 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 a0c839de546c59..88e8f053a8b96d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -10797,12 +10797,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("UltrasonicUnoccupiedToOccupiedThreshold", 1, value); } case OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: { - uint16_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PhysicalContactOccupiedToUnoccupiedDelay", 1, value); } case OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: { - uint16_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PhysicalContactUnoccupiedToOccupiedDelay", 1, value); } 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 591ad2209e8231..d197fee23fb168 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -102396,7 +102396,10 @@ class WriteOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public Wri __auto_type * params = [[MTRWriteParams alloc] init]; params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { @@ -102409,7 +102412,7 @@ class WriteOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public Wri } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public SubscribeAttribute { @@ -102519,7 +102522,10 @@ class WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public Wri __auto_type * params = [[MTRWriteParams alloc] init]; params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { @@ -102532,7 +102538,7 @@ class WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public Wri } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public SubscribeAttribute { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 7e1221dc650fd1..674a01ea262cc4 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -78865,9 +78865,12 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("physicalContactOccupiedToUnoccupiedDelay", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("physicalContactOccupiedToUnoccupiedDelay", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("physicalContactOccupiedToUnoccupiedDelay", [value unsignedShortValue], 65535U)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("physicalContactOccupiedToUnoccupiedDelay", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("physicalContactOccupiedToUnoccupiedDelay", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("physicalContactOccupiedToUnoccupiedDelay", [value unsignedShortValue], 65535U)); + } NextTest(); }]; @@ -78887,9 +78890,12 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("physicalContactUnoccupiedToOccupiedDelay", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("physicalContactUnoccupiedToOccupiedDelay", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("physicalContactUnoccupiedToOccupiedDelay", [value unsignedShortValue], 65535U)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("physicalContactUnoccupiedToOccupiedDelay", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("physicalContactUnoccupiedToOccupiedDelay", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("physicalContactUnoccupiedToOccupiedDelay", [value unsignedShortValue], 65535U)); + } NextTest(); }];