diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
index c9b875088fe7a0..9b2755b6c30801 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
@@ -2801,9 +2801,9 @@ server cluster TargetNavigator = 1285 {
}
server cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
readonly global attribute int16u clusterRevision = 65533;
}
diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter
index 2d54768ae91936..916fea9e0fc222 100644
--- a/examples/placeholder/linux/apps/app1/config.matter
+++ b/examples/placeholder/linux/apps/app1/config.matter
@@ -870,16 +870,16 @@ server cluster Scenes = 5 {
}
client cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}
server cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}
diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter
index 2d54768ae91936..916fea9e0fc222 100644
--- a/examples/placeholder/linux/apps/app2/config.matter
+++ b/examples/placeholder/linux/apps/app2/config.matter
@@ -870,16 +870,16 @@ server cluster Scenes = 5 {
}
client cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}
server cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}
diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter
index 8bd33ad6b1d3ac..dcec916f5a3e3a 100644
--- a/examples/pump-app/pump-common/pump-app.matter
+++ b/examples/pump-app/pump-common/pump-app.matter
@@ -1304,17 +1304,17 @@ server cluster SoftwareDiagnostics = 52 {
}
client cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
readonly global attribute int16u clusterRevision = 65533;
}
server cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
readonly global attribute int16u clusterRevision = 65533;
}
diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter
index 063a3d926bda8f..9877dda276a130 100644
--- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter
+++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter
@@ -976,9 +976,9 @@ server cluster SoftwareDiagnostics = 52 {
}
client cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}
diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter
index 7f60f034d13492..d8a7e2b2c8c86f 100644
--- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter
+++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter
@@ -611,9 +611,9 @@ server cluster SoftwareDiagnostics = 52 {
}
server cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}
diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
index 9e4800e978ced2..9aee7904ef9d0a 100644
--- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
+++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
@@ -2402,9 +2402,9 @@ client cluster TargetNavigator = 1285 {
}
server cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}
diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt
index 3ad6ad6e12ed96..5b236ed8da931a 100644
--- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt
+++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt
@@ -35,6 +35,8 @@ import kotlinx.coroutines.launch
private typealias ReadCallback = ChipClusters.IntegerAttributeCallback
private typealias PressureReadCallback =
ChipClusters.PressureMeasurementCluster.MeasuredValueAttributeCallback
+private typealias TemperatureReadCallback =
+ ChipClusters.TemperatureMeasurementCluster.MeasuredValueAttributeCallback
class SensorClientFragment : Fragment() {
private lateinit var scope: CoroutineScope
@@ -241,11 +243,11 @@ class SensorClientFragment : Fragment() {
private const val MAX_DATA_POINTS = 60
private val CLUSTERS = mapOf(
"Temperature" to mapOf(
- "read" to { device: Long, endpointId: Int, callback: ReadCallback ->
+ "read" to { device: Long, endpointId: Int, callback: TemperatureReadCallback ->
val cluster = ChipClusters.TemperatureMeasurementCluster(device, endpointId)
cluster.readMeasuredValueAttribute(callback)
},
- "subscribe" to { device: Long, endpointId: Int, callback: ReadCallback ->
+ "subscribe" to { device: Long, endpointId: Int, callback: TemperatureReadCallback ->
val cluster = ChipClusters.TemperatureMeasurementCluster(device, endpointId)
cluster.subscribeMeasuredValueAttribute(callback,
MIN_REFRESH_PERIOD_S,
diff --git a/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml
index d7c5a4c7d6d84c..c2ab5e882273ae 100644
--- a/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml
@@ -24,9 +24,9 @@ limitations under the License.
TEMP_MEASUREMENT_CLUSTER
true
true
- MeasuredValue
- MinMeasuredValue
- MaxMeasuredValue
+ MeasuredValue
+ MinMeasuredValue
+ MaxMeasuredValue
Tolerance
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index c4b3699d640e0f..d9402ed8ebb13f 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -3263,9 +3263,9 @@ client cluster TargetNavigator = 1285 {
}
client cluster TemperatureMeasurement = 1026 {
- readonly attribute int16s measuredValue = 0;
- readonly attribute int16s minMeasuredValue = 1;
- readonly attribute int16s maxMeasuredValue = 2;
+ readonly attribute nullable int16s measuredValue = 0;
+ readonly attribute nullable int16s minMeasuredValue = 1;
+ readonly attribute nullable int16s maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
readonly global attribute attrib_id attributeList[] = 65531;
readonly global attribute int16u clusterRevision = 65533;
diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
index fc3e3e343faa35..fd7be76f1564a3 100644
--- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
@@ -11379,10 +11379,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
return nullptr;
}
jobject value;
- std::string valueClassName = "java/lang/Integer";
- std::string valueCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
- cppValue, value);
+ if (cppValue.IsNull())
+ {
+ value = nullptr;
+ }
+ else
+ {
+ std::string valueClassName = "java/lang/Integer";
+ std::string valueCtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
+ cppValue.Value(), value);
+ }
return value;
}
case Attributes::MinMeasuredValue::Id: {
@@ -11394,10 +11401,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
return nullptr;
}
jobject value;
- std::string valueClassName = "java/lang/Integer";
- std::string valueCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
- cppValue, value);
+ if (cppValue.IsNull())
+ {
+ value = nullptr;
+ }
+ else
+ {
+ std::string valueClassName = "java/lang/Integer";
+ std::string valueCtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
+ cppValue.Value(), value);
+ }
return value;
}
case Attributes::MaxMeasuredValue::Id: {
@@ -11409,10 +11423,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
return nullptr;
}
jobject value;
- std::string valueClassName = "java/lang/Integer";
- std::string valueCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
- cppValue, value);
+ if (cppValue.IsNull())
+ {
+ value = nullptr;
+ }
+ else
+ {
+ std::string valueClassName = "java/lang/Integer";
+ std::string valueCtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
+ cppValue.Value(), value);
+ }
return value;
}
case Attributes::Tolerance::Id: {
diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp
index 18c4210b56e54b..e73b9aeca48d6a 100644
--- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp
+++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp
@@ -16894,6 +16894,207 @@ void CHIPTargetNavigatorAttributeListAttributeCallback::CallbackFn(
env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj);
}
+CHIPTemperatureMeasurementMeasuredValueAttributeCallback::CHIPTemperatureMeasurementMeasuredValueAttributeCallback(
+ 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");
+ }
+}
+
+CHIPTemperatureMeasurementMeasuredValueAttributeCallback::~CHIPTemperatureMeasurementMeasuredValueAttributeCallback()
+{
+ JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread();
+ if (env == nullptr)
+ {
+ ChipLogError(Zcl, "Could not delete global reference for Java callback");
+ return;
+ }
+ env->DeleteGlobalRef(javaCallbackRef);
+}
+
+void CHIPTemperatureMeasurementMeasuredValueAttributeCallback::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";
+ chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(),
+ value.Value(), javaValue);
+ }
+
+ env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue);
+}
+
+CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback::CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback(
+ 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");
+ }
+}
+
+CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback::~CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback()
+{
+ JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread();
+ if (env == nullptr)
+ {
+ ChipLogError(Zcl, "Could not delete global reference for Java callback");
+ return;
+ }
+ env->DeleteGlobalRef(javaCallbackRef);
+}
+
+void CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback::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";
+ chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(),
+ value.Value(), javaValue);
+ }
+
+ env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue);
+}
+
+CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback::CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback(
+ 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");
+ }
+}
+
+CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback::~CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback()
+{
+ JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread();
+ if (env == nullptr)
+ {
+ ChipLogError(Zcl, "Could not delete global reference for Java callback");
+ return;
+ }
+ env->DeleteGlobalRef(javaCallbackRef);
+}
+
+void CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback::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";
+ chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(),
+ value.Value(), javaValue);
+ }
+
+ env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue);
+}
+
CHIPTemperatureMeasurementAttributeListAttributeCallback::CHIPTemperatureMeasurementAttributeListAttributeCallback(
jobject javaCallback, bool keepAlive) :
chip::Callback::Callback(CallbackFn, this),
diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h
index c387557dba53c0..1bd5ff901f82a9 100644
--- a/src/controller/java/zap-generated/CHIPReadCallbacks.h
+++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h
@@ -6983,6 +6983,96 @@ class CHIPTargetNavigatorAttributeListAttributeCallback
bool keepAlive;
};
+class CHIPTemperatureMeasurementMeasuredValueAttributeCallback
+ : public chip::Callback::Callback
+{
+public:
+ CHIPTemperatureMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);
+
+ ~CHIPTemperatureMeasurementMeasuredValueAttributeCallback();
+
+ static void maybeDestroy(CHIPTemperatureMeasurementMeasuredValueAttributeCallback * callback)
+ {
+ if (!callback->keepAlive)
+ {
+ callback->Cancel();
+ chip::Platform::Delete(callback);
+ }
+ }
+
+ static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value);
+ static void OnSubscriptionEstablished(void * context)
+ {
+ CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
+ reinterpret_cast(context)->javaCallbackRef);
+ VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
+ };
+
+private:
+ jobject javaCallbackRef;
+ bool keepAlive;
+};
+
+class CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback
+ : public chip::Callback::Callback
+{
+public:
+ CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);
+
+ ~CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback();
+
+ static void maybeDestroy(CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback * callback)
+ {
+ if (!callback->keepAlive)
+ {
+ callback->Cancel();
+ chip::Platform::Delete(callback);
+ }
+ }
+
+ static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value);
+ static void OnSubscriptionEstablished(void * context)
+ {
+ CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
+ reinterpret_cast(context)->javaCallbackRef);
+ VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
+ };
+
+private:
+ jobject javaCallbackRef;
+ bool keepAlive;
+};
+
+class CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback
+ : public chip::Callback::Callback
+{
+public:
+ CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);
+
+ ~CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback();
+
+ static void maybeDestroy(CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback * callback)
+ {
+ if (!callback->keepAlive)
+ {
+ callback->Cancel();
+ chip::Platform::Delete(callback);
+ }
+ }
+
+ static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value);
+ static void OnSubscriptionEstablished(void * context)
+ {
+ CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
+ reinterpret_cast(context)->javaCallbackRef);
+ VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
+ };
+
+private:
+ jobject javaCallbackRef;
+ bool keepAlive;
+};
+
class CHIPTemperatureMeasurementAttributeListAttributeCallback
: public chip::Callback::Callback
{
diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java
index 5fe709566b1eb3..4dccdbf9cbde37 100644
--- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java
+++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java
@@ -15502,6 +15502,30 @@ public TemperatureMeasurementCluster(long devicePtr, int endpointId) {
@Override
public native long initWithDevice(long devicePtr, int endpointId);
+ public interface MeasuredValueAttributeCallback {
+ void onSuccess(@Nullable Integer value);
+
+ void onError(Exception ex);
+
+ default void onSubscriptionEstablished() {}
+ }
+
+ public interface MinMeasuredValueAttributeCallback {
+ void onSuccess(@Nullable Integer value);
+
+ void onError(Exception ex);
+
+ default void onSubscriptionEstablished() {}
+ }
+
+ public interface MaxMeasuredValueAttributeCallback {
+ void onSuccess(@Nullable Integer value);
+
+ void onError(Exception ex);
+
+ default void onSubscriptionEstablished() {}
+ }
+
public interface AttributeListAttributeCallback {
void onSuccess(List valueList);
@@ -15510,30 +15534,30 @@ public interface AttributeListAttributeCallback {
default void onSubscriptionEstablished() {}
}
- public void readMeasuredValueAttribute(IntegerAttributeCallback callback) {
+ public void readMeasuredValueAttribute(MeasuredValueAttributeCallback callback) {
readMeasuredValueAttribute(chipClusterPtr, callback);
}
public void subscribeMeasuredValueAttribute(
- IntegerAttributeCallback callback, int minInterval, int maxInterval) {
+ MeasuredValueAttributeCallback callback, int minInterval, int maxInterval) {
subscribeMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}
- public void readMinMeasuredValueAttribute(IntegerAttributeCallback callback) {
+ public void readMinMeasuredValueAttribute(MinMeasuredValueAttributeCallback callback) {
readMinMeasuredValueAttribute(chipClusterPtr, callback);
}
public void subscribeMinMeasuredValueAttribute(
- IntegerAttributeCallback callback, int minInterval, int maxInterval) {
+ MinMeasuredValueAttributeCallback callback, int minInterval, int maxInterval) {
subscribeMinMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}
- public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) {
+ public void readMaxMeasuredValueAttribute(MaxMeasuredValueAttributeCallback callback) {
readMaxMeasuredValueAttribute(chipClusterPtr, callback);
}
public void subscribeMaxMeasuredValueAttribute(
- IntegerAttributeCallback callback, int minInterval, int maxInterval) {
+ MaxMeasuredValueAttributeCallback callback, int minInterval, int maxInterval) {
subscribeMaxMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}
@@ -15565,22 +15589,31 @@ public void subscribeClusterRevisionAttribute(
}
private native void readMeasuredValueAttribute(
- long chipClusterPtr, IntegerAttributeCallback callback);
+ long chipClusterPtr, MeasuredValueAttributeCallback callback);
private native void subscribeMeasuredValueAttribute(
- long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);
+ long chipClusterPtr,
+ MeasuredValueAttributeCallback callback,
+ int minInterval,
+ int maxInterval);
private native void readMinMeasuredValueAttribute(
- long chipClusterPtr, IntegerAttributeCallback callback);
+ long chipClusterPtr, MinMeasuredValueAttributeCallback callback);
private native void subscribeMinMeasuredValueAttribute(
- long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);
+ long chipClusterPtr,
+ MinMeasuredValueAttributeCallback callback,
+ int minInterval,
+ int maxInterval);
private native void readMaxMeasuredValueAttribute(
- long chipClusterPtr, IntegerAttributeCallback callback);
+ long chipClusterPtr, MaxMeasuredValueAttributeCallback callback);
private native void subscribeMaxMeasuredValueAttribute(
- long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);
+ long chipClusterPtr,
+ MaxMeasuredValueAttributeCallback callback,
+ int minInterval,
+ int maxInterval);
private native void readToleranceAttribute(
long chipClusterPtr, IntegerAttributeCallback callback);
diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java
index 18bc56fe63080a..d516d210071394 100644
--- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java
+++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java
@@ -7469,7 +7469,9 @@ public Map> getReadAttributeMap() {
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureMeasurementCluster) cluster)
- .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback);
+ .readMeasuredValueAttribute(
+ (ChipClusters.TemperatureMeasurementCluster.MeasuredValueAttributeCallback)
+ callback);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureMeasurementMeasuredValueCommandParams);
@@ -7482,7 +7484,9 @@ public Map> getReadAttributeMap() {
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureMeasurementCluster) cluster)
- .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback);
+ .readMinMeasuredValueAttribute(
+ (ChipClusters.TemperatureMeasurementCluster.MinMeasuredValueAttributeCallback)
+ callback);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureMeasurementMinMeasuredValueCommandParams);
@@ -7495,7 +7499,9 @@ public Map> getReadAttributeMap() {
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureMeasurementCluster) cluster)
- .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback);
+ .readMaxMeasuredValueAttribute(
+ (ChipClusters.TemperatureMeasurementCluster.MaxMeasuredValueAttributeCallback)
+ callback);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureMeasurementMaxMeasuredValueCommandParams);
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index b6dcdf77f931d5..0b51ee35c4b3dd 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -23631,9 +23631,9 @@ class TemperatureMeasurement(Cluster):
def descriptor(cls) -> ClusterObjectDescriptor:
return ClusterObjectDescriptor(
Fields = [
- ClusterObjectFieldDescriptor(Label="measuredValue", Tag=0x00000000, Type=int),
- ClusterObjectFieldDescriptor(Label="minMeasuredValue", Tag=0x00000001, Type=int),
- ClusterObjectFieldDescriptor(Label="maxMeasuredValue", Tag=0x00000002, Type=int),
+ ClusterObjectFieldDescriptor(Label="measuredValue", Tag=0x00000000, Type=typing.Union[Nullable, int]),
+ ClusterObjectFieldDescriptor(Label="minMeasuredValue", Tag=0x00000001, Type=typing.Union[Nullable, int]),
+ ClusterObjectFieldDescriptor(Label="maxMeasuredValue", Tag=0x00000002, Type=typing.Union[Nullable, int]),
ClusterObjectFieldDescriptor(Label="tolerance", Tag=0x00000003, Type=typing.Optional[uint]),
ClusterObjectFieldDescriptor(Label="serverGeneratedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]),
ClusterObjectFieldDescriptor(Label="clientGeneratedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]),
@@ -23642,9 +23642,9 @@ def descriptor(cls) -> ClusterObjectDescriptor:
ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint),
])
- measuredValue: 'int' = None
- minMeasuredValue: 'int' = None
- maxMeasuredValue: 'int' = None
+ measuredValue: 'typing.Union[Nullable, int]' = None
+ minMeasuredValue: 'typing.Union[Nullable, int]' = None
+ maxMeasuredValue: 'typing.Union[Nullable, int]' = None
tolerance: 'typing.Optional[uint]' = None
serverGeneratedCommandList: 'typing.List[uint]' = None
clientGeneratedCommandList: 'typing.List[uint]' = None
@@ -23668,9 +23668,9 @@ def attribute_id(cls) -> int:
@ChipUtility.classproperty
def attribute_type(cls) -> ClusterObjectFieldDescriptor:
- return ClusterObjectFieldDescriptor(Type=int)
+ return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, int])
- value: 'int' = 0
+ value: 'typing.Union[Nullable, int]' = NullValue
@dataclass
class MinMeasuredValue(ClusterAttributeDescriptor):
@@ -23684,9 +23684,9 @@ def attribute_id(cls) -> int:
@ChipUtility.classproperty
def attribute_type(cls) -> ClusterObjectFieldDescriptor:
- return ClusterObjectFieldDescriptor(Type=int)
+ return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, int])
- value: 'int' = 0
+ value: 'typing.Union[Nullable, int]' = NullValue
@dataclass
class MaxMeasuredValue(ClusterAttributeDescriptor):
@@ -23700,9 +23700,9 @@ def attribute_id(cls) -> int:
@ChipUtility.classproperty
def attribute_type(cls) -> ClusterObjectFieldDescriptor:
- return ClusterObjectFieldDescriptor(Type=int)
+ return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, int])
- value: 'int' = 0
+ value: 'typing.Union[Nullable, int]' = NullValue
@dataclass
class Tolerance(ClusterAttributeDescriptor):
diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm
index 5d42e22e699b83..aac2e2f2efe0ce 100644
--- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm
@@ -9484,8 +9484,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader
if (*aError != CHIP_NO_ERROR) {
return nil;
}
- NSNumber * _Nonnull value;
- value = [NSNumber numberWithShort:cppValue];
+ NSNumber * _Nullable value;
+ if (cppValue.IsNull()) {
+ value = nil;
+ } else {
+ value = [NSNumber numberWithShort:cppValue.Value()];
+ }
return value;
}
case Attributes::MinMeasuredValue::Id: {
@@ -9495,8 +9499,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader
if (*aError != CHIP_NO_ERROR) {
return nil;
}
- NSNumber * _Nonnull value;
- value = [NSNumber numberWithShort:cppValue];
+ NSNumber * _Nullable value;
+ if (cppValue.IsNull()) {
+ value = nil;
+ } else {
+ value = [NSNumber numberWithShort:cppValue.Value()];
+ }
return value;
}
case Attributes::MaxMeasuredValue::Id: {
@@ -9506,8 +9514,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader
if (*aError != CHIP_NO_ERROR) {
return nil;
}
- NSNumber * _Nonnull value;
- value = [NSNumber numberWithShort:cppValue];
+ NSNumber * _Nullable value;
+ if (cppValue.IsNull()) {
+ value = nil;
+ } else {
+ value = [NSNumber numberWithShort:cppValue.Value()];
+ }
return value;
}
case Attributes::Tolerance::Id: {
diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm
index f07a306979843e..24c0eb8f998b97 100644
--- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm
@@ -35426,12 +35426,13 @@ @implementation CHIPTemperatureMeasurement
- (void)readAttributeMeasuredValueWithCompletionHandler:(void (^)(
NSNumber * _Nullable value, NSError * _Nullable error))completionHandler
{
- new CHIPInt16sAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
- using TypeInfo = TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo;
- auto successFn = Callback::FromCancelable(success);
- auto failureFn = Callback::FromCancelable(failure);
- return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall);
- });
+ new CHIPNullableInt16sAttributeCallbackBridge(
+ self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
+ using TypeInfo = TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo;
+ auto successFn = Callback::FromCancelable(success);
+ auto failureFn = Callback::FromCancelable(failure);
+ return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall);
+ });
}
- (void)subscribeAttributeMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minInterval
@@ -35441,15 +35442,15 @@ - (void)subscribeAttributeMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minI
reportHandler:
(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
{
- new CHIPInt16sAttributeCallbackSubscriptionBridge(
+ new CHIPNullableInt16sAttributeCallbackSubscriptionBridge(
self.callbackQueue, reportHandler,
^(Cancelable * success, Cancelable * failure) {
using TypeInfo = TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo;
- auto successFn = Callback::FromCancelable(success);
+ auto successFn = Callback::FromCancelable(success);
auto failureFn = Callback::FromCancelable(failure);
return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall,
[minInterval unsignedShortValue], [maxInterval unsignedShortValue],
- CHIPInt16sAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished,
+ CHIPNullableInt16sAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished,
params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue],
params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]);
},
@@ -35462,7 +35463,7 @@ + (void)readAttributeMeasuredValueWithAttributeCache:(CHIPAttributeCacheContaine
completionHandler:
(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler
{
- new CHIPInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
+ new CHIPNullableInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
if (attributeCacheContainer.cppAttributeCache) {
chip::app::ConcreteAttributePath path;
using TypeInfo = TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo;
@@ -35471,7 +35472,7 @@ new CHIPInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s
path.mAttributeId = TypeInfo::GetAttributeId();
TypeInfo::DecodableType value;
CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value);
- auto successFn = Callback::FromCancelable(success);
+ auto successFn = Callback::FromCancelable(success);
if (err == CHIP_NO_ERROR) {
successFn->mCall(successFn->mContext, value);
}
@@ -35484,12 +35485,13 @@ new CHIPInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s
- (void)readAttributeMinMeasuredValueWithCompletionHandler:(void (^)(NSNumber * _Nullable value,
NSError * _Nullable error))completionHandler
{
- new CHIPInt16sAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
- using TypeInfo = TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo;
- auto successFn = Callback::FromCancelable(success);
- auto failureFn = Callback::FromCancelable(failure);
- return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall);
- });
+ new CHIPNullableInt16sAttributeCallbackBridge(
+ self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
+ using TypeInfo = TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo;
+ auto successFn = Callback::FromCancelable(success);
+ auto failureFn = Callback::FromCancelable(failure);
+ return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall);
+ });
}
- (void)subscribeAttributeMinMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minInterval
@@ -35499,15 +35501,15 @@ - (void)subscribeAttributeMinMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m
reportHandler:
(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
{
- new CHIPInt16sAttributeCallbackSubscriptionBridge(
+ new CHIPNullableInt16sAttributeCallbackSubscriptionBridge(
self.callbackQueue, reportHandler,
^(Cancelable * success, Cancelable * failure) {
using TypeInfo = TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo;
- auto successFn = Callback::FromCancelable(success);
+ auto successFn = Callback::FromCancelable(success);
auto failureFn = Callback::FromCancelable(failure);
return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall,
[minInterval unsignedShortValue], [maxInterval unsignedShortValue],
- CHIPInt16sAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished,
+ CHIPNullableInt16sAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished,
params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue],
params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]);
},
@@ -35520,7 +35522,7 @@ + (void)readAttributeMinMeasuredValueWithAttributeCache:(CHIPAttributeCacheConta
completionHandler:
(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler
{
- new CHIPInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
+ new CHIPNullableInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
if (attributeCacheContainer.cppAttributeCache) {
chip::app::ConcreteAttributePath path;
using TypeInfo = TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo;
@@ -35529,7 +35531,7 @@ new CHIPInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s
path.mAttributeId = TypeInfo::GetAttributeId();
TypeInfo::DecodableType value;
CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value);
- auto successFn = Callback::FromCancelable(success);
+ auto successFn = Callback::FromCancelable(success);
if (err == CHIP_NO_ERROR) {
successFn->mCall(successFn->mContext, value);
}
@@ -35542,12 +35544,13 @@ new CHIPInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s
- (void)readAttributeMaxMeasuredValueWithCompletionHandler:(void (^)(NSNumber * _Nullable value,
NSError * _Nullable error))completionHandler
{
- new CHIPInt16sAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
- using TypeInfo = TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
- auto successFn = Callback::FromCancelable(success);
- auto failureFn = Callback::FromCancelable(failure);
- return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall);
- });
+ new CHIPNullableInt16sAttributeCallbackBridge(
+ self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
+ using TypeInfo = TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
+ auto successFn = Callback::FromCancelable(success);
+ auto failureFn = Callback::FromCancelable(failure);
+ return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall);
+ });
}
- (void)subscribeAttributeMaxMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minInterval
@@ -35557,15 +35560,15 @@ - (void)subscribeAttributeMaxMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m
reportHandler:
(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
{
- new CHIPInt16sAttributeCallbackSubscriptionBridge(
+ new CHIPNullableInt16sAttributeCallbackSubscriptionBridge(
self.callbackQueue, reportHandler,
^(Cancelable * success, Cancelable * failure) {
using TypeInfo = TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
- auto successFn = Callback::FromCancelable(success);
+ auto successFn = Callback::FromCancelable(success);
auto failureFn = Callback::FromCancelable(failure);
return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall,
[minInterval unsignedShortValue], [maxInterval unsignedShortValue],
- CHIPInt16sAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished,
+ CHIPNullableInt16sAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished,
params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue],
params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]);
},
@@ -35578,7 +35581,7 @@ + (void)readAttributeMaxMeasuredValueWithAttributeCache:(CHIPAttributeCacheConta
completionHandler:
(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler
{
- new CHIPInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
+ new CHIPNullableInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) {
if (attributeCacheContainer.cppAttributeCache) {
chip::app::ConcreteAttributePath path;
using TypeInfo = TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
@@ -35587,7 +35590,7 @@ new CHIPInt16sAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s
path.mAttributeId = TypeInfo::GetAttributeId();
TypeInfo::DecodableType value;
CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value);
- auto successFn = Callback::FromCancelable(success);
+ auto successFn = Callback::FromCancelable(success);
if (err == CHIP_NO_ERROR) {
successFn->mCall(successFn->mContext, value);
}
diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h
index e18f24e73de179..f70941c73a910e 100644
--- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h
@@ -1105,9 +1105,9 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface CHIPTestTemperatureMeasurement : CHIPTemperatureMeasurement
-- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler;
-- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler;
-- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler;
+- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler;
+- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler;
+- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler;
- (void)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler;
- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler;
- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler;
diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm
index 677349292d3ce2..28b624000f7f38 100644
--- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm
@@ -13338,7 +13338,7 @@ @implementation CHIPTestTemperatureMeasurement
return &_cppCluster;
}
-- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
+- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
new CHIPDefaultSuccessCallbackBridge(
self.callbackQueue,
@@ -13349,14 +13349,19 @@ new CHIPDefaultSuccessCallbackBridge(
ListFreer listFreer;
using TypeInfo = TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo;
TypeInfo::Type cppValue;
- cppValue = value.shortValue;
+ if (value == nil) {
+ cppValue.SetNull();
+ } else {
+ auto & nonNullValue_0 = cppValue.SetNonNull();
+ nonNullValue_0 = value.shortValue;
+ }
auto successFn = Callback::FromCancelable(success);
auto failureFn = Callback::FromCancelable(failure);
return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
});
}
-- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
+- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
new CHIPDefaultSuccessCallbackBridge(
self.callbackQueue,
@@ -13367,14 +13372,19 @@ new CHIPDefaultSuccessCallbackBridge(
ListFreer listFreer;
using TypeInfo = TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo;
TypeInfo::Type cppValue;
- cppValue = value.shortValue;
+ if (value == nil) {
+ cppValue.SetNull();
+ } else {
+ auto & nonNullValue_0 = cppValue.SetNonNull();
+ nonNullValue_0 = value.shortValue;
+ }
auto successFn = Callback::FromCancelable(success);
auto failureFn = Callback::FromCancelable(failure);
return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
});
}
-- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
+- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
new CHIPDefaultSuccessCallbackBridge(
self.callbackQueue,
@@ -13385,7 +13395,12 @@ new CHIPDefaultSuccessCallbackBridge(
ListFreer listFreer;
using TypeInfo = TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
TypeInfo::Type cppValue;
- cppValue = value.shortValue;
+ if (value == nil) {
+ cppValue.SetNull();
+ } else {
+ auto & nonNullValue_0 = cppValue.SetNonNull();
+ nonNullValue_0 = value.shortValue;
+ }
auto successFn = Callback::FromCancelable(success);
auto failureFn = Callback::FromCancelable(failure);
return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h
index fb4ef48a125f66..967714e7838575 100644
--- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h
+++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h
@@ -1678,11 +1678,11 @@
{ 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \
\
/* Endpoint: 1, Cluster: Temperature Measurement (server) */ \
- { 0x00000000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
- { 0x00000001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
- { 0x00000002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
- { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Tolerance */ \
- { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
+ { 0x00000000, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
+ { 0x00000001, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
+ { 0x00000002, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
+ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Tolerance */ \
+ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
\
/* Endpoint: 1, Cluster: Pressure Measurement (server) */ \
{ 0x00000000, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* MeasuredValue */ \
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 2a3aaf39e99c85..4a87e6a0e990e7 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
@@ -21957,24 +21957,27 @@ namespace Attributes {
namespace MeasuredValue {
-EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value)
+EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value)
{
using Traits = NumericAttributeTraits;
Traits::StorageType temp;
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::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, int16_t value)
{
using Traits = NumericAttributeTraits;
- if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
{
return EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
}
@@ -21984,28 +21987,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value)
return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
}
+EmberAfStatus SetNull(chip::EndpointId endpoint)
+{
+ using Traits = NumericAttributeTraits;
+ Traits::StorageType value;
+ Traits::SetNull(value);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
+ return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_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 MeasuredValue
namespace MinMeasuredValue {
-EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value)
+EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value)
{
using Traits = NumericAttributeTraits;
Traits::StorageType temp;
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::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, int16_t value)
{
using Traits = NumericAttributeTraits;
- if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
{
return EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
}
@@ -22015,28 +22040,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value)
return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
}
+EmberAfStatus SetNull(chip::EndpointId endpoint)
+{
+ using Traits = NumericAttributeTraits;
+ Traits::StorageType value;
+ Traits::SetNull(value);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
+ return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_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 MinMeasuredValue
namespace MaxMeasuredValue {
-EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value)
+EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value)
{
using Traits = NumericAttributeTraits;
Traits::StorageType temp;
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::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, int16_t value)
{
using Traits = NumericAttributeTraits;
- if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
{
return EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
}
@@ -22046,6 +22093,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value)
return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
}
+EmberAfStatus SetNull(chip::EndpointId endpoint)
+{
+ using Traits = NumericAttributeTraits;
+ Traits::StorageType value;
+ Traits::SetNull(value);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
+ return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_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 MaxMeasuredValue
namespace Tolerance {
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 4323dea438f55c..32db1883d7e531 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
@@ -3826,18 +3826,24 @@ namespace TemperatureMeasurement {
namespace Attributes {
namespace MeasuredValue {
-EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s
+EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16s
EmberAfStatus Set(chip::EndpointId endpoint, int16_t value);
+EmberAfStatus SetNull(chip::EndpointId endpoint);
+EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value);
} // namespace MeasuredValue
namespace MinMeasuredValue {
-EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s
+EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16s
EmberAfStatus Set(chip::EndpointId endpoint, int16_t value);
+EmberAfStatus SetNull(chip::EndpointId endpoint);
+EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value);
} // namespace MinMeasuredValue
namespace MaxMeasuredValue {
-EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s
+EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16s
EmberAfStatus Set(chip::EndpointId endpoint, int16_t value);
+EmberAfStatus SetNull(chip::EndpointId endpoint);
+EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value);
} // namespace MaxMeasuredValue
namespace Tolerance {
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 3a1a43feaed56b..538f052bbddb03 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
@@ -25348,9 +25348,9 @@ namespace Attributes {
namespace MeasuredValue {
struct TypeInfo
{
- using Type = int16_t;
- using DecodableType = int16_t;
- using DecodableArgType = int16_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::TemperatureMeasurement::Id; }
static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredValue::Id; }
@@ -25360,9 +25360,9 @@ struct TypeInfo
namespace MinMeasuredValue {
struct TypeInfo
{
- using Type = int16_t;
- using DecodableType = int16_t;
- using DecodableArgType = int16_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::TemperatureMeasurement::Id; }
static constexpr AttributeId GetAttributeId() { return Attributes::MinMeasuredValue::Id; }
@@ -25372,9 +25372,9 @@ struct TypeInfo
namespace MaxMeasuredValue {
struct TypeInfo
{
- using Type = int16_t;
- using DecodableType = int16_t;
- using DecodableArgType = int16_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::TemperatureMeasurement::Id; }
static constexpr AttributeId GetAttributeId() { return Attributes::MaxMeasuredValue::Id; }
@@ -25462,10 +25462,10 @@ struct TypeInfo
CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path);
- Attributes::MeasuredValue::TypeInfo::DecodableType measuredValue = static_cast(0);
- Attributes::MinMeasuredValue::TypeInfo::DecodableType minMeasuredValue = static_cast(0);
- Attributes::MaxMeasuredValue::TypeInfo::DecodableType maxMeasuredValue = static_cast(0);
- Attributes::Tolerance::TypeInfo::DecodableType tolerance = static_cast(0);
+ Attributes::MeasuredValue::TypeInfo::DecodableType measuredValue;
+ Attributes::MinMeasuredValue::TypeInfo::DecodableType minMeasuredValue;
+ Attributes::MaxMeasuredValue::TypeInfo::DecodableType maxMeasuredValue;
+ Attributes::Tolerance::TypeInfo::DecodableType tolerance = static_cast(0);
Attributes::ServerGeneratedCommandList::TypeInfo::DecodableType serverGeneratedCommandList;
Attributes::ClientGeneratedCommandList::TypeInfo::DecodableType clientGeneratedCommandList;
Attributes::AttributeList::TypeInfo::DecodableType attributeList;
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 7a5acd09f449d5..b0f44914d734a8 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
@@ -8408,17 +8408,17 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP
switch (path.mAttributeId)
{
case TemperatureMeasurement::Attributes::MeasuredValue::Id: {
- int16_t value;
+ chip::app::DataModel::Nullable value;
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
return DataModelLogger::LogValue("MeasuredValue", 1, value);
}
case TemperatureMeasurement::Attributes::MinMeasuredValue::Id: {
- int16_t value;
+ chip::app::DataModel::Nullable value;
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
return DataModelLogger::LogValue("MinMeasuredValue", 1, value);
}
case TemperatureMeasurement::Attributes::MaxMeasuredValue::Id: {
- int16_t value;
+ chip::app::DataModel::Nullable value;
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
return DataModelLogger::LogValue("MaxMeasuredValue", 1, value);
}
diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h
index 8268b8131ad27e..c494fa4ee2c36c 100644
--- a/zzz_generated/chip-tool/zap-generated/test/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h
@@ -40819,7 +40819,7 @@ class Test_TC_TM_2_1Suite : public TestCommand
(static_cast(context))->OnFailureResponse_1(error);
}
- static void OnSuccessCallback_1(void * context, int16_t measuredValue)
+ static void OnSuccessCallback_1(void * context, const chip::app::DataModel::Nullable & measuredValue)
{
(static_cast(context))->OnSuccessResponse_1(measuredValue);
}
@@ -40862,7 +40862,7 @@ class Test_TC_TM_2_1Suite : public TestCommand
ThrowFailureResponse();
}
- void OnSuccessResponse_1(int16_t measuredValue)
+ void OnSuccessResponse_1(const chip::app::DataModel::Nullable & measuredValue)
{
VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16"));
NextTest();
@@ -40984,7 +40984,7 @@ class Test_TC_TM_2_2Suite : public TestCommand
(static_cast(context))->OnFailureResponse_1(error);
}
- static void OnSuccessCallback_1(void * context, int16_t measuredValue)
+ static void OnSuccessCallback_1(void * context, const chip::app::DataModel::Nullable & measuredValue)
{
(static_cast(context))->OnSuccessResponse_1(measuredValue);
}
@@ -40994,7 +40994,7 @@ class Test_TC_TM_2_2Suite : public TestCommand
(static_cast(context))->OnFailureResponse_2(error);
}
- static void OnSuccessCallback_2(void * context, int16_t measuredValue)
+ static void OnSuccessCallback_2(void * context, const chip::app::DataModel::Nullable & measuredValue)
{
(static_cast(context))->OnSuccessResponse_2(measuredValue);
}
@@ -41027,7 +41027,7 @@ class Test_TC_TM_2_2Suite : public TestCommand
ThrowFailureResponse();
}
- void OnSuccessResponse_1(int16_t measuredValue)
+ void OnSuccessResponse_1(const chip::app::DataModel::Nullable & measuredValue)
{
VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16"));
NextTest();
@@ -41051,7 +41051,7 @@ class Test_TC_TM_2_2Suite : public TestCommand
ThrowFailureResponse();
}
- void OnSuccessResponse_2(int16_t measuredValue)
+ void OnSuccessResponse_2(const chip::app::DataModel::Nullable & measuredValue)
{
VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16"));
NextTest();
diff --git a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h
index 8418d5c76f99ec..357c1c868001d8 100644
--- a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h
+++ b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h
@@ -191,10 +191,10 @@
{ 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \
\
/* Endpoint: 0, Cluster: Temperature Measurement (server) */ \
- { 0x00000000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
- { 0x00000001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
- { 0x00000002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
- { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
+ { 0x00000000, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
+ { 0x00000001, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
+ { 0x00000002, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
+ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
\
/* Endpoint: 1, Cluster: Identify (server) */ \
{ 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
diff --git a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h
index 8418d5c76f99ec..357c1c868001d8 100644
--- a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h
+++ b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h
@@ -191,10 +191,10 @@
{ 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \
\
/* Endpoint: 0, Cluster: Temperature Measurement (server) */ \
- { 0x00000000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
- { 0x00000001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
- { 0x00000002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
- { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
+ { 0x00000000, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
+ { 0x00000001, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
+ { 0x00000002, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
+ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
\
/* Endpoint: 1, Cluster: Identify (server) */ \
{ 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h
index 0a9a9a3891afe6..0fd4a6706feb7a 100644
--- a/zzz_generated/pump-app/zap-generated/endpoint_config.h
+++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h
@@ -794,11 +794,11 @@
{ 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \
\
/* Endpoint: 1, Cluster: Temperature Measurement (server) */ \
- { 0x00000000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
- { 0x00000001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
- { 0x00000002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
- { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Tolerance */ \
- { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
+ { 0x00000000, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
+ { 0x00000001, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
+ { 0x00000002, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
+ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Tolerance */ \
+ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
\
/* Endpoint: 1, Cluster: Pressure Measurement (server) */ \
{ 0x00000000, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* MeasuredValue */ \
diff --git a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h
index a8e012749aee11..2b51464addef7b 100644
--- a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h
+++ b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h
@@ -445,10 +445,10 @@
{ 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \
\
/* Endpoint: 1, Cluster: Temperature Measurement (server) */ \
- { 0x00000000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
- { 0x00000001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
- { 0x00000002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
- { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
+ { 0x00000000, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
+ { 0x00000001, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
+ { 0x00000002, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
+ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
}
// This is an array of EmberAfCluster structures.
diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h
index 3d1f3c92c49e16..621626fac2e3de 100644
--- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h
+++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h
@@ -1168,10 +1168,10 @@
{ 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
\
/* Endpoint: 1, Cluster: Temperature Measurement (server) */ \
- { 0x00000000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
- { 0x00000001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
- { 0x00000002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
- { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
+ { 0x00000000, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \
+ { 0x00000001, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \
+ { 0x00000002, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \
+ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \
\
/* Endpoint: 1, Cluster: Pressure Measurement (server) */ \
{ 0x00000000, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* MeasuredValue */ \