From d9b09846f31ab51566755a69a31f3d97716f5a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Wed, 27 Apr 2022 15:16:27 +0200 Subject: [PATCH 01/59] [relativehumidity] Fix MaxMeasuredValue (#17682) * [relativehumidity] Fix MaxMeasuredValue Example apps used MaxMeasuredValue attribute of the RelativeHumidityMeasurement cluster that was out of the allowed range. Set correct and useful Min and Max. * Make RelativeHumidity attributes nullable * Restyled by clang-format * Fix Android build Co-authored-by: Restyled.io --- .../all-clusters-app.matter | 6 +- .../all-clusters-common/all-clusters-app.zap | 10 +- .../placeholder/linux/apps/app1/config.matter | 12 +- .../placeholder/linux/apps/app1/config.zap | 4 +- .../placeholder/linux/apps/app2/config.matter | 12 +- .../placeholder/linux/apps/app2/config.zap | 4 +- examples/tv-app/tv-common/tv-app.matter | 6 +- .../clusterclient/SensorClientFragment.kt | 78 +++++-- .../relative-humidity-measurement-cluster.xml | 6 +- .../data_model/controller-clusters.matter | 6 +- .../CHIPAttributeTLVValueDecoder.cpp | 45 ++-- .../java/zap-generated/CHIPReadCallbacks.cpp | 203 ++++++++++++++++++ .../java/zap-generated/CHIPReadCallbacks.h | 90 ++++++++ .../chip/devicecontroller/ChipClusters.java | 57 +++-- .../devicecontroller/ClusterReadMapping.java | 15 +- .../python/chip/clusters/Objects.py | 24 +-- .../CHIPAttributeTLVValueDecoder.mm | 24 ++- .../CHIP/zap-generated/CHIPClustersObjc.mm | 69 +++--- .../CHIP/zap-generated/CHIPTestClustersObjc.h | 6 +- .../zap-generated/CHIPTestClustersObjc.mm | 27 ++- .../zap-generated/endpoint_config.h | 14 +- .../zap-generated/attributes/Accessors.cpp | 99 +++++++-- .../zap-generated/attributes/Accessors.h | 12 +- .../zap-generated/cluster-objects.h | 26 +-- .../cluster/CHIPTestClustersObjc.h | 6 +- .../cluster/CHIPTestClustersObjc.mm | 27 ++- .../cluster/logging/DataModelLogger.cpp | 6 +- .../chip-tool/zap-generated/test/Commands.h | 10 +- .../app1/zap-generated/endpoint_config.h | 7 +- .../app2/zap-generated/endpoint_config.h | 7 +- .../tv-app/zap-generated/endpoint_config.h | 8 +- 31 files changed, 723 insertions(+), 203 deletions(-) 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 a2755ad226afd3..00141b2e93de59 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 @@ -2752,9 +2752,9 @@ server cluster PumpConfigurationAndControl = 512 { } server cluster RelativeHumidityMeasurement = 1029 { - readonly attribute int16u measuredValue = 0; - readonly attribute int16u minMeasuredValue = 1; - readonly attribute int16u maxMeasuredValue = 2; + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute int16u clusterRevision = 65533; } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index f17df8f6086378..0979e6a02c733d 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -6768,7 +6768,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6783,7 +6783,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x2710", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10808,7 +10808,7 @@ "incoming": 1, "outgoing": 0 }, - { + { "name": "GetYearDaySchedule", "code": 15, "mfgCode": null, @@ -14909,7 +14909,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14924,7 +14924,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x2710", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 66bdfffa54ce0c..4f6e5c8259fd74 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1917,9 +1917,9 @@ server cluster PumpConfigurationAndControl = 512 { } client cluster RelativeHumidityMeasurement = 1029 { - readonly attribute int16u measuredValue = 0; - readonly attribute int16u minMeasuredValue = 1; - readonly attribute int16u maxMeasuredValue = 2; + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1928,9 +1928,9 @@ client cluster RelativeHumidityMeasurement = 1029 { } server cluster RelativeHumidityMeasurement = 1029 { - readonly attribute int16u measuredValue = 0; - readonly attribute int16u minMeasuredValue = 1; - readonly attribute int16u maxMeasuredValue = 2; + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index 6c5ad0ff84f932..bf1fecfa9c664e 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -5554,7 +5554,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xFFFF", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5569,7 +5569,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xFFFF", + "defaultValue": "0x2710", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 66bdfffa54ce0c..4f6e5c8259fd74 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1917,9 +1917,9 @@ server cluster PumpConfigurationAndControl = 512 { } client cluster RelativeHumidityMeasurement = 1029 { - readonly attribute int16u measuredValue = 0; - readonly attribute int16u minMeasuredValue = 1; - readonly attribute int16u maxMeasuredValue = 2; + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1928,9 +1928,9 @@ client cluster RelativeHumidityMeasurement = 1029 { } server cluster RelativeHumidityMeasurement = 1029 { - readonly attribute int16u measuredValue = 0; - readonly attribute int16u minMeasuredValue = 1; - readonly attribute int16u maxMeasuredValue = 2; + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 6c5ad0ff84f932..bf1fecfa9c664e 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -5554,7 +5554,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xFFFF", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5569,7 +5569,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xFFFF", + "defaultValue": "0x2710", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index f71049b3645c26..b79a79fc5b4744 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1671,9 +1671,9 @@ server cluster OperationalCredentials = 62 { } server cluster RelativeHumidityMeasurement = 1029 { - readonly attribute int16u measuredValue = 0; - readonly attribute int16u minMeasuredValue = 1; - readonly attribute int16u maxMeasuredValue = 2; + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; readonly 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 5b236ed8da931a..64f35095652732 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 @@ -33,10 +33,14 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch private typealias ReadCallback = ChipClusters.IntegerAttributeCallback -private typealias PressureReadCallback = - ChipClusters.PressureMeasurementCluster.MeasuredValueAttributeCallback private typealias TemperatureReadCallback = - ChipClusters.TemperatureMeasurementCluster.MeasuredValueAttributeCallback + ChipClusters.TemperatureMeasurementCluster.MeasuredValueAttributeCallback + +private typealias PressureReadCallback = + ChipClusters.PressureMeasurementCluster.MeasuredValueAttributeCallback + +private typealias RelativeHumidityReadCallback = + ChipClusters.RelativeHumidityMeasurementCluster.MeasuredValueAttributeCallback class SensorClientFragment : Fragment() { private lateinit var scope: CoroutineScope @@ -243,29 +247,29 @@ class SensorClientFragment : Fragment() { private const val MAX_DATA_POINTS = 60 private val CLUSTERS = mapOf( "Temperature" to mapOf( - "read" to { device: Long, endpointId: Int, callback: TemperatureReadCallback -> + "read" to { device: Long, endpointId: Int, callback: ReadCallback -> val cluster = ChipClusters.TemperatureMeasurementCluster(device, endpointId) - cluster.readMeasuredValueAttribute(callback) + cluster.readMeasuredValueAttribute(makeTemperatureReadCallback(callback)) }, - "subscribe" to { device: Long, endpointId: Int, callback: TemperatureReadCallback -> + "subscribe" to { device: Long, endpointId: Int, callback: ReadCallback -> val cluster = ChipClusters.TemperatureMeasurementCluster(device, endpointId) - cluster.subscribeMeasuredValueAttribute(callback, - MIN_REFRESH_PERIOD_S, - MAX_REFRESH_PERIOD_S) + cluster.subscribeMeasuredValueAttribute(makeTemperatureReadCallback(callback), + MIN_REFRESH_PERIOD_S, + MAX_REFRESH_PERIOD_S) }, "unitValue" to 0.01, "unitSymbol" to "\u00B0C" ), "Pressure" to mapOf( - "read" to { device: Long, endpointId: Int, callback: PressureReadCallback -> + "read" to { device: Long, endpointId: Int, callback: ReadCallback -> val cluster = ChipClusters.PressureMeasurementCluster(device, endpointId) - cluster.readMeasuredValueAttribute(callback) + cluster.readMeasuredValueAttribute(makePressureReadCallback(callback)) }, - "subscribe" to { device: Long, endpointId: Int, callback: PressureReadCallback -> + "subscribe" to { device: Long, endpointId: Int, callback: ReadCallback -> val cluster = ChipClusters.PressureMeasurementCluster(device, endpointId) - cluster.subscribeMeasuredValueAttribute(callback, - MIN_REFRESH_PERIOD_S, - MAX_REFRESH_PERIOD_S) + cluster.subscribeMeasuredValueAttribute(makePressureReadCallback(callback), + MIN_REFRESH_PERIOD_S, + MAX_REFRESH_PERIOD_S) }, "unitValue" to 1.0, "unitSymbol" to "hPa" @@ -273,19 +277,55 @@ class SensorClientFragment : Fragment() { "Relative Humidity" to mapOf( "read" to { device: Long, endpointId: Int, callback: ReadCallback -> val cluster = ChipClusters.RelativeHumidityMeasurementCluster(device, endpointId) - cluster.readMeasuredValueAttribute(callback) + cluster.readMeasuredValueAttribute(makeHumidityReadCallback(callback)) }, "subscribe" to { device: Long, endpointId: Int, callback: ReadCallback -> val cluster = ChipClusters.RelativeHumidityMeasurementCluster(device, endpointId) - cluster.subscribeMeasuredValueAttribute(callback, - MIN_REFRESH_PERIOD_S, - MAX_REFRESH_PERIOD_S) + cluster.subscribeMeasuredValueAttribute(makeHumidityReadCallback(callback), + MIN_REFRESH_PERIOD_S, + MAX_REFRESH_PERIOD_S) }, "unitValue" to 0.01, "unitSymbol" to "%" ) ) + private fun makeTemperatureReadCallback(callback: ReadCallback): TemperatureReadCallback { + return object : TemperatureReadCallback { + override fun onSuccess(value: Int?) { + value?.let { callback.onSuccess(it) } + } + + override fun onError(error: java.lang.Exception?) { + callback.onError(error) + } + } + } + + private fun makePressureReadCallback(callback: ReadCallback): PressureReadCallback { + return object : PressureReadCallback { + override fun onSuccess(value: Int?) { + value?.let { callback.onSuccess(it) } + } + + override fun onError(error: java.lang.Exception?) { + callback.onError(error) + } + } + } + + private fun makeHumidityReadCallback(callback: ReadCallback): RelativeHumidityReadCallback { + return object : RelativeHumidityReadCallback { + override fun onSuccess(value: Int?) { + value?.let { callback.onSuccess(it) } + } + + override fun onError(error: java.lang.Exception?) { + callback.onError(error) + } + } + } + fun newInstance(): SensorClientFragment = SensorClientFragment() } } diff --git a/src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml index 8d18c1955288f4..2ff3bcd5dc87b9 100644 --- a/src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml @@ -24,9 +24,9 @@ limitations under the License. RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER true true - measured value - min measured value - max measured value + measured value + min measured value + max measured value tolerance diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d95b250f5a6373..75056c0daed50c 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3173,9 +3173,9 @@ client cluster PumpConfigurationAndControl = 512 { } client cluster RelativeHumidityMeasurement = 1029 { - readonly attribute int16u measuredValue = 0; - readonly attribute int16u minMeasuredValue = 1; - readonly attribute int16u maxMeasuredValue = 2; + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 9158f5b859a01c..e04a1abcde47c7 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -10965,10 +10965,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: { @@ -10980,10 +10987,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: { @@ -10995,10 +11009,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 444a10867939e0..6487c19e92b75b 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -16921,6 +16921,209 @@ void CHIPPumpConfigurationAndControlAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPRelativeHumidityMeasurementMeasuredValueAttributeCallback::CHIPRelativeHumidityMeasurementMeasuredValueAttributeCallback( + 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"); + } +} + +CHIPRelativeHumidityMeasurementMeasuredValueAttributeCallback::~CHIPRelativeHumidityMeasurementMeasuredValueAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRelativeHumidityMeasurementMeasuredValueAttributeCallback::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); +} + +CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback::CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback( + 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"); + } +} + +CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback::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); +} + +CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback::CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback( + 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"); + } +} + +CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback::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); +} + CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback:: CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback(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 08653886c9758d..d3fdd79023ba34 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -7059,6 +7059,96 @@ class CHIPPumpConfigurationAndControlAttributeListAttributeCallback bool keepAlive; }; +class CHIPRelativeHumidityMeasurementMeasuredValueAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPRelativeHumidityMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPRelativeHumidityMeasurementMeasuredValueAttributeCallback(); + + static void maybeDestroy(CHIPRelativeHumidityMeasurementMeasuredValueAttributeCallback * 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 CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback(); + + static void maybeDestroy(CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback * 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 CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback(); + + static void maybeDestroy(CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback * 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 CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback : 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 4f93d507d33a09..0eb9bf94dec2a4 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -14872,6 +14872,30 @@ public RelativeHumidityMeasurementCluster(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 GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -14896,30 +14920,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); } @@ -14969,22 +14993,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 add88b7a1e4c8a..94e529e1a06661 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -7082,7 +7082,10 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) - .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readMeasuredValueAttribute( + (ChipClusters.RelativeHumidityMeasurementCluster + .MeasuredValueAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readRelativeHumidityMeasurementMeasuredValueCommandParams); @@ -7095,7 +7098,10 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) - .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readMinMeasuredValueAttribute( + (ChipClusters.RelativeHumidityMeasurementCluster + .MinMeasuredValueAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readRelativeHumidityMeasurementMinMeasuredValueCommandParams); @@ -7108,7 +7114,10 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) - .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readMaxMeasuredValueAttribute( + (ChipClusters.RelativeHumidityMeasurementCluster + .MaxMeasuredValueAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readRelativeHumidityMeasurementMaxMeasuredValueCommandParams); diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 39d7e506a157eb..976a40de69ae22 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -24603,9 +24603,9 @@ class RelativeHumidityMeasurement(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="measuredValue", Tag=0x00000000, Type=uint), - ClusterObjectFieldDescriptor(Label="minMeasuredValue", Tag=0x00000001, Type=uint), - ClusterObjectFieldDescriptor(Label="maxMeasuredValue", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="measuredValue", Tag=0x00000000, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="minMeasuredValue", Tag=0x00000001, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="maxMeasuredValue", Tag=0x00000002, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="tolerance", Tag=0x00000003, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), @@ -24614,9 +24614,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - measuredValue: 'uint' = None - minMeasuredValue: 'uint' = None - maxMeasuredValue: 'uint' = None + measuredValue: 'typing.Union[Nullable, uint]' = None + minMeasuredValue: 'typing.Union[Nullable, uint]' = None + maxMeasuredValue: 'typing.Union[Nullable, uint]' = None tolerance: 'typing.Optional[uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None @@ -24640,9 +24640,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[Nullable, uint]' = NullValue @dataclass class MinMeasuredValue(ClusterAttributeDescriptor): @@ -24656,9 +24656,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[Nullable, uint]' = NullValue @dataclass class MaxMeasuredValue(ClusterAttributeDescriptor): @@ -24672,9 +24672,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[Nullable, uint]' = 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 d5e8925bc03f92..ef121fd1a886db 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -9024,8 +9024,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader 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::MinMeasuredValue::Id: { @@ -9035,8 +9039,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader 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::MaxMeasuredValue::Id: { @@ -9046,8 +9054,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader 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::Tolerance::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 4b9a7342a71631..b4bfd3e1cfee4f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -36097,12 +36097,13 @@ @implementation CHIPRelativeHumidityMeasurement - (void)readAttributeMeasuredValueWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = RelativeHumidityMeasurement::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 @@ -36112,7 +36113,7 @@ - (void)subscribeAttributeMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minI reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { @@ -36120,11 +36121,11 @@ new CHIPInt16uAttributeCallbackSubscriptionBridge( return CHIP_ERROR_INVALID_ARGUMENT; } using TypeInfo = RelativeHumidityMeasurement::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], - CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -36137,7 +36138,7 @@ + (void)readAttributeMeasuredValueWithAttributeCache:(CHIPAttributeCacheContaine completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPNullableInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; @@ -36146,7 +36147,7 @@ new CHIPInt16uAttributeCallbackBridge(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); } @@ -36159,12 +36160,13 @@ new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s - (void)readAttributeMinMeasuredValueWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = RelativeHumidityMeasurement::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 @@ -36174,7 +36176,7 @@ - (void)subscribeAttributeMinMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { @@ -36182,11 +36184,11 @@ new CHIPInt16uAttributeCallbackSubscriptionBridge( return CHIP_ERROR_INVALID_ARGUMENT; } using TypeInfo = RelativeHumidityMeasurement::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], - CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -36199,7 +36201,7 @@ + (void)readAttributeMinMeasuredValueWithAttributeCache:(CHIPAttributeCacheConta completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPNullableInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; @@ -36208,7 +36210,7 @@ new CHIPInt16uAttributeCallbackBridge(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); } @@ -36221,12 +36223,13 @@ new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s - (void)readAttributeMaxMeasuredValueWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = RelativeHumidityMeasurement::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 @@ -36236,7 +36239,7 @@ - (void)subscribeAttributeMaxMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { @@ -36244,11 +36247,11 @@ new CHIPInt16uAttributeCallbackSubscriptionBridge( return CHIP_ERROR_INVALID_ARGUMENT; } using TypeInfo = RelativeHumidityMeasurement::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], - CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -36261,7 +36264,7 @@ + (void)readAttributeMaxMeasuredValueWithAttributeCache:(CHIPAttributeCacheConta completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPNullableInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; @@ -36270,7 +36273,7 @@ new CHIPInt16uAttributeCallbackBridge(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 29ae722d22bfd7..f5a0ebf1e25ae0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -937,9 +937,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestRelativeHumidityMeasurement : CHIPRelativeHumidityMeasurement -- (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)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _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 2e2ea18cee0f86..dfcc84369068fb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -12399,7 +12399,7 @@ @implementation CHIPTestRelativeHumidityMeasurement return &_cppCluster; } -- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -12410,14 +12410,19 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } 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, @@ -12428,14 +12433,19 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } 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, @@ -12446,7 +12456,12 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } 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 eed4701085b38b..80f28b6e071c9f 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1321,9 +1321,10 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ - { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* min measured value */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* max measured value */ \ + { 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* measured value */ \ + { 0x00000001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* min measured value */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0x2710) }, /* max measured value */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Identify (server) */ \ @@ -1731,9 +1732,10 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ - { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* min measured value */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* max measured value */ \ + { 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* measured value */ \ + { 0x00000001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* min measured value */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0x2710) }, /* max measured value */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* tolerance */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ 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 6d789d02eec01f..9c0090caf84cbd 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 @@ -23843,7 +23843,7 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; @@ -23851,17 +23851,20 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::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; } @@ -23872,11 +23875,31 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) 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 emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::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 MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; @@ -23884,17 +23907,20 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::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; } @@ -23905,11 +23931,31 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) 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 emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::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 MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; @@ -23917,17 +23963,20 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::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; } @@ -23938,6 +23987,26 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) 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 emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::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 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 bb1808b5b5a808..7af5e3a658fea8 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 @@ -4113,18 +4113,24 @@ namespace RelativeHumidityMeasurement { namespace Attributes { namespace MeasuredValue { -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 MeasuredValue namespace MinMeasuredValue { -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 MinMeasuredValue namespace MaxMeasuredValue { -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 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 2d6784210f1e69..7d3db24a221bb6 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 @@ -26048,9 +26048,9 @@ namespace Attributes { namespace MeasuredValue { 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::RelativeHumidityMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredValue::Id; } @@ -26060,9 +26060,9 @@ struct TypeInfo namespace MinMeasuredValue { 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::RelativeHumidityMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MinMeasuredValue::Id; } @@ -26072,9 +26072,9 @@ struct TypeInfo namespace MaxMeasuredValue { 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::RelativeHumidityMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MaxMeasuredValue::Id; } @@ -26162,10 +26162,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::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h index 29ae722d22bfd7..f5a0ebf1e25ae0 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h @@ -937,9 +937,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestRelativeHumidityMeasurement : CHIPRelativeHumidityMeasurement -- (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)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm index 2e2ea18cee0f86..dfcc84369068fb 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm @@ -12399,7 +12399,7 @@ @implementation CHIPTestRelativeHumidityMeasurement return &_cppCluster; } -- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -12410,14 +12410,19 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } 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, @@ -12428,14 +12433,19 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } 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, @@ -12446,7 +12456,12 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } 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/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index d8831e97eca6c9..c97f85dc5a2222 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -8257,17 +8257,17 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP switch (path.mAttributeId) { case RelativeHumidityMeasurement::Attributes::MeasuredValue::Id: { - uint16_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("measured value", 1, value); } case RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id: { - uint16_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("min measured value", 1, value); } case RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id: { - uint16_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("max measured value", 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 e8c631020ff9d1..db857b603dde5c 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -20291,7 +20291,7 @@ class Test_TC_RH_2_1Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); @@ -20301,7 +20301,7 @@ class Test_TC_RH_2_1Suite : public TestCommand case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); @@ -20405,7 +20405,7 @@ class Test_TC_RH_2_2Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); @@ -20415,7 +20415,7 @@ class Test_TC_RH_2_2Suite : public TestCommand case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); @@ -20425,7 +20425,7 @@ class Test_TC_RH_2_2Suite : public TestCommand case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } diff --git a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h index cf1dbcb50d80d5..1ea3bd0a6e3209 100644 --- a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h @@ -794,9 +794,10 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ - { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* min measured value */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* max measured value */ \ + { 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* measured value */ \ + { 0x00000001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* min measured value */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0x2710) }, /* max measured value */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* tolerance */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(194) }, /* FeatureMap */ \ \ diff --git a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h index cf1dbcb50d80d5..1ea3bd0a6e3209 100644 --- a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h @@ -794,9 +794,10 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ - { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* min measured value */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* max measured value */ \ + { 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* measured value */ \ + { 0x00000001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* min measured value */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0x2710) }, /* max measured value */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* tolerance */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(194) }, /* FeatureMap */ \ \ diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index c661158f5a53d9..048d993cb910b5 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -915,10 +915,10 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ - { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* min measured value */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* max measured value */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* measured value */ \ + { 0x00000001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* min measured value */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* max measured value */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x00000000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \ From 2baab6163539aced836611c7796dd822667705c6 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 27 Apr 2022 10:01:45 -0400 Subject: [PATCH 02/59] Remove some unnecessary nullable annotations. (#17799) Just need to initialize things in the initializer list instead of default-constructing them as nil and then initializing them. --- .../Framework/CHIP/CHIPPersistentStorageDelegateBridge.h | 4 ++-- .../Framework/CHIP/CHIPPersistentStorageDelegateBridge.mm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegateBridge.h b/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegateBridge.h index 395ba3cdf44186..a497500129ce24 100644 --- a/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegateBridge.h +++ b/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegateBridge.h @@ -35,8 +35,8 @@ class CHIPPersistentStorageDelegateBridge : public chip::PersistentStorageDelega CHIP_ERROR SyncDeleteKeyValue(const char * key) override; private: - _Nullable id mDelegate; - _Nullable dispatch_queue_t mWorkQueue; + id mDelegate; + dispatch_queue_t mWorkQueue; }; NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegateBridge.mm b/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegateBridge.mm index ccd7e2b0af0d33..7e7dcaf8289526 100644 --- a/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegateBridge.mm @@ -53,8 +53,8 @@ CHIPPersistentStorageDelegateBridge::CHIPPersistentStorageDelegateBridge(id delegate) : mDelegate(delegate) + , mWorkQueue(dispatch_queue_create("com.zigbee.chip.framework.storage.workqueue", DISPATCH_QUEUE_SERIAL)) { - mWorkQueue = dispatch_queue_create("com.zigbee.chip.framework.storage.workqueue", DISPATCH_QUEUE_SERIAL); } CHIPPersistentStorageDelegateBridge::~CHIPPersistentStorageDelegateBridge(void) {} From 7666b048aa1d03444aac8296ec32d261be52c696 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 27 Apr 2022 10:19:16 -0400 Subject: [PATCH 03/59] Add a config variable for disabling platform KVS. (#17777) Implement support for doing that on Darwin, and enable that support when building the Darwin framework, via either Xcode or chip-tool-darwin. --- examples/chip-tool-darwin/.gn | 2 + .../commands/common/CHIPCommandBridge.mm | 1 - .../Framework/CHIP/MatterControllerFactory.h | 5 - .../Framework/CHIP/MatterControllerFactory.mm | 11 -- .../Framework/chip_xcode_build_connector.sh | 1 + src/platform/BUILD.gn | 1 + src/platform/Darwin/BUILD.gn | 9 +- .../Darwin/ConfigurationManagerImpl.cpp | 116 ++++++++++++++++++ src/platform/Darwin/PlatformManagerImpl.cpp | 2 + src/platform/Darwin/PosixConfig.cpp | 3 + src/platform/Darwin/PosixConfig.h | 7 +- src/platform/device.gni | 9 ++ 12 files changed, 143 insertions(+), 24 deletions(-) diff --git a/examples/chip-tool-darwin/.gn b/examples/chip-tool-darwin/.gn index c16b1aba00f50c..00e402644d1877 100644 --- a/examples/chip-tool-darwin/.gn +++ b/examples/chip-tool-darwin/.gn @@ -22,4 +22,6 @@ check_system_includes = true default_args = { import("//args.gni") + + chip_disable_platform_kvs = true } diff --git a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm index f468c1993f3f16..489e82ef91a325 100644 --- a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm +++ b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm @@ -43,7 +43,6 @@ auto params = [[MatterControllerFactoryParams alloc] initWithStorage:storage]; params.port = @(kListenPort); params.startServer = YES; - params.kvsPath = @("/tmp/chip_kvs_darwin"); if ([factory startup:params] == NO) { ChipLogError(chipTool, "Controller factory startup failed"); diff --git a/src/darwin/Framework/CHIP/MatterControllerFactory.h b/src/darwin/Framework/CHIP/MatterControllerFactory.h index 2eba28b535a724..22337fea2303c5 100644 --- a/src/darwin/Framework/CHIP/MatterControllerFactory.h +++ b/src/darwin/Framework/CHIP/MatterControllerFactory.h @@ -56,11 +56,6 @@ NS_ASSUME_NONNULL_BEGIN * connections. Defaults to NO. */ @property (nonatomic) BOOL startServer; -/* - * Path to a file to use for backing our KVS storage. This should not - * be used, generally; it will be removed soon. Defaults to nil. - */ -@property (strong, nonatomic, nullable) NSString * kvsPath; - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithStorage:(id)storageDelegate; diff --git a/src/darwin/Framework/CHIP/MatterControllerFactory.mm b/src/darwin/Framework/CHIP/MatterControllerFactory.mm index bd26258b00d1eb..0d585bb4684ab1 100644 --- a/src/darwin/Framework/CHIP/MatterControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MatterControllerFactory.mm @@ -41,7 +41,6 @@ static NSString * const kErrorAttestationTrustStoreInit = @"Init failure while creating the attestation trust store"; static NSString * const kInfoFactoryShutdown = @"Shutting down the Matter controller factory"; static NSString * const kErrorGroupProviderInit = @"Init failure while initializing group data provider"; -static NSString * const kErrorKVSInit = @"Init Key Value Store failure"; static NSString * const kErrorControllersInit = @"Init controllers array failure"; static NSString * const kErrorControllerFactoryInit = @"Init failure while initializing controller factory"; @@ -179,15 +178,6 @@ - (BOOL)startup:(MatterControllerFactoryParams *)startupParams [CHIPControllerAccessControl init]; - if (startupParams.kvsPath != nil) { - // TODO: We should stop needing a KeyValueStoreManager on the client side, then remove this code. - CHIP_ERROR errorCode = DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init([startupParams.kvsPath UTF8String]); - if (errorCode != CHIP_NO_ERROR) { - CHIP_LOG_ERROR("Error: %@", kErrorKVSInit); - return; - } - } - _persistentStorageDelegateBridge = new CHIPPersistentStorageDelegateBridge(startupParams.storageDelegate); if (_persistentStorageDelegateBridge == nil) { CHIP_LOG_ERROR("Error: %@", kErrorPersistentStorageInit); @@ -468,7 +458,6 @@ - (instancetype)initWithStorage:(id)storageDelega _paaCerts = nil; _port = nil; _startServer = NO; - _kvsPath = nil; return self; } diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index 0b5d884f7fae33..eb88853c847b54 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -96,6 +96,7 @@ declare -a args=( 'chip_crypto="mbedtls"' 'chip_build_tools=false' 'chip_build_tests=false' + 'chip_disable_platform_kvs=true' 'target_cpu="'"$target_cpu"'"' 'target_defines='"$target_defines" 'target_cflags=['"$target_cflags"']' diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 285502d69bab9c..ce0b3bc89c518c 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -108,6 +108,7 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { "CHIP_STACK_LOCK_TRACKING_ERROR_FATAL=${chip_stack_lock_tracking_fatal}", "CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING=${chip_enable_additional_data_advertising}", "CHIP_DEVICE_CONFIG_RUN_AS_ROOT=${chip_device_config_run_as_root}", + "CHIP_DISABLE_PLATFORM_KVS=${chip_disable_platform_kvs}", ] if (chip_device_platform == "linux" || chip_device_platform == "darwin" || diff --git a/src/platform/Darwin/BUILD.gn b/src/platform/Darwin/BUILD.gn index f66a1001144f89..024f5b2b7e4587 100644 --- a/src/platform/Darwin/BUILD.gn +++ b/src/platform/Darwin/BUILD.gn @@ -55,8 +55,6 @@ static_library("Darwin") { "DnssdImpl.cpp", "DnssdImpl.h", "InetPlatformConfig.h", - "KeyValueStoreManagerImpl.h", - "KeyValueStoreManagerImpl.mm", "Logging.cpp", "MdnsError.cpp", "MdnsError.h", @@ -68,6 +66,13 @@ static_library("Darwin") { "SystemTimeSupport.cpp", ] + if (chip_disable_platform_kvs == false) { + sources += [ + "KeyValueStoreManagerImpl.h", + "KeyValueStoreManagerImpl.mm", + ] + } + deps = [ "${chip_root}/src/lib/dnssd:platform_header", "${chip_root}/src/setup_payload", diff --git a/src/platform/Darwin/ConfigurationManagerImpl.cpp b/src/platform/Darwin/ConfigurationManagerImpl.cpp index 1658d1827fb501..6960b1e3be6060 100644 --- a/src/platform/Darwin/ConfigurationManagerImpl.cpp +++ b/src/platform/Darwin/ConfigurationManagerImpl.cpp @@ -151,6 +151,9 @@ ConfigurationManagerImpl & ConfigurationManagerImpl::GetDefaultInstance() CHIP_ERROR ConfigurationManagerImpl::Init() { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_NO_ERROR; +#else // CHIP_DISABLE_PLATFORM_KVS // Initialize the generic implementation base class. ReturnErrorOnFailure(Internal::GenericConfigurationManagerImpl::Init()); @@ -199,6 +202,7 @@ CHIP_ERROR ConfigurationManagerImpl::Init() } return CHIP_NO_ERROR; +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) @@ -232,56 +236,99 @@ void ConfigurationManagerImpl::InitiateFactoryReset() CHIP_ERROR ConfigurationManagerImpl::GetVendorId(uint16_t & vendorId) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return ReadConfigValue(PosixConfig::kConfigKey_VendorId, vendorId); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::GetProductId(uint16_t & productId) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return ReadConfigValue(PosixConfig::kConfigKey_ProductId, productId); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::StoreVendorId(uint16_t vendorId) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return WriteConfigValue(PosixConfig::kConfigKey_VendorId, vendorId); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::StoreProductId(uint16_t productId) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return WriteConfigValue(PosixConfig::kConfigKey_ProductId, productId); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::GetRebootCount(uint32_t & rebootCount) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return ReadConfigValue(PosixConfig::kCounterKey_RebootCount, rebootCount); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::StoreRebootCount(uint32_t rebootCount) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return WriteConfigValue(PosixConfig::kCounterKey_RebootCount, rebootCount); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::GetTotalOperationalHours(uint32_t & totalOperationalHours) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return ReadConfigValue(PosixConfig::kCounterKey_TotalOperationalHours, totalOperationalHours); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::StoreTotalOperationalHours(uint32_t totalOperationalHours) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return WriteConfigValue(PosixConfig::kCounterKey_TotalOperationalHours, totalOperationalHours); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::GetBootReason(uint32_t & bootReason) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return ReadConfigValue(PosixConfig::kCounterKey_BootReason, bootReason); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::StoreBootReason(uint32_t bootReason) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return WriteConfigValue(PosixConfig::kCounterKey_BootReason, bootReason); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::GetRegulatoryLocation(uint8_t & location) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS uint32_t value = 0; CHIP_ERROR err = ReadConfigValue(PosixConfig::kConfigKey_RegulatoryLocation, value); @@ -293,10 +340,14 @@ CHIP_ERROR ConfigurationManagerImpl::GetRegulatoryLocation(uint8_t & location) } return err; +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::GetLocationCapability(uint8_t & location) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS uint32_t value = 0; CHIP_ERROR err = ReadConfigValue(PosixConfig::kConfigKey_LocationCapability, value); @@ -308,10 +359,14 @@ CHIP_ERROR ConfigurationManagerImpl::GetLocationCapability(uint8_t & location) } return err; +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t & value) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS PosixConfig::Key configKey{ PosixConfig::kConfigNamespace_ChipCounters, key }; CHIP_ERROR err = ReadConfigValue(configKey, value); @@ -320,82 +375,143 @@ CHIP_ERROR ConfigurationManagerImpl::ReadPersistedStorageValue(::chip::Platform: err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; } return err; +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::WritePersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t value) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS PosixConfig::Key configKey{ PosixConfig::kConfigNamespace_ChipCounters, key }; return WriteConfigValue(configKey, value); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, bool & val) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::ReadConfigValue(key, val); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, uint16_t & val) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::ReadConfigValue(key, val); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, uint32_t & val) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::ReadConfigValue(key, val); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, uint64_t & val) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::ReadConfigValue(key, val); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::ReadConfigValueStr(key, buf, bufSize, outLen); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::ReadConfigValueBin(key, buf, bufSize, outLen); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, bool val) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::WriteConfigValue(key, val); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, uint16_t val) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::WriteConfigValue(key, val); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, uint32_t val) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::WriteConfigValue(key, val); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, uint64_t val) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::WriteConfigValue(key, val); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueStr(Key key, const char * str) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::WriteConfigValueStr(key, str); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueStr(Key key, const char * str, size_t strLen) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::WriteConfigValueStr(key, str, strLen); +#endif // CHIP_DISABLE_PLATFORM_KVS } CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen) { +#if CHIP_DISABLE_PLATFORM_KVS + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#else // CHIP_DISABLE_PLATFORM_KVS return PosixConfig::WriteConfigValueBin(key, data, dataLen); +#endif // CHIP_DISABLE_PLATFORM_KVS } void ConfigurationManagerImpl::RunConfigUnitTest(void) { +#if CHIP_DISABLE_PLATFORM_KVS + return; +#else // CHIP_DISABLE_PLATFORM_KVS PosixConfig::RunConfigUnitTest(); +#endif // CHIP_DISABLE_PLATFORM_KVS } } // namespace DeviceLayer diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp index d39022c03a5132..0fd31ac1acbf11 100644 --- a/src/platform/Darwin/PlatformManagerImpl.cpp +++ b/src/platform/Darwin/PlatformManagerImpl.cpp @@ -43,8 +43,10 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack() CHIP_ERROR err; // Initialize the configuration system. +#if !CHIP_DISABLE_PLATFORM_KVS err = Internal::PosixConfig::Init(); SuccessOrExit(err); +#endif // CHIP_DISABLE_PLATFORM_KVS SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance()); SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance()); SetDeviceInfoProvider(&DeviceInfoProviderImpl::GetDefaultInstance()); diff --git a/src/platform/Darwin/PosixConfig.cpp b/src/platform/Darwin/PosixConfig.cpp index 2ac950b9bdbd35..e31eebdd9098c2 100644 --- a/src/platform/Darwin/PosixConfig.cpp +++ b/src/platform/Darwin/PosixConfig.cpp @@ -83,6 +83,7 @@ const PosixConfig::Key PosixConfig::kCounterKey_TotalOperationalHours = { kConfi "total-operational-hours" }; const PosixConfig::Key PosixConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipConfig, "unique-id" }; +#if !CHIP_DISABLE_PLATFORM_KVS // Prefix used for NVS keys that contain Chip group encryption keys. const char PosixConfig::kGroupKeyNamePrefix[] = "gk-"; @@ -211,6 +212,8 @@ CHIP_ERROR PosixConfig::FactoryResetConfig(void) void PosixConfig::RunConfigUnitTest() {} +#endif // CHIP_DISABLE_PLATFORM_KVS + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/Darwin/PosixConfig.h b/src/platform/Darwin/PosixConfig.h index 4b39677f611a05..b142c62b9cee8a 100644 --- a/src/platform/Darwin/PosixConfig.h +++ b/src/platform/Darwin/PosixConfig.h @@ -88,6 +88,7 @@ class PosixConfig static const char kGroupKeyNamePrefix[]; +#if !CHIP_DISABLE_PLATFORM_KVS static CHIP_ERROR Init(void); // Config value accessors. @@ -114,11 +115,7 @@ class PosixConfig // NVS Namespace helper functions. static CHIP_ERROR EnsureNamespace(const char * ns); static CHIP_ERROR ClearNamespace(const char * ns); - -private: - // TODO: This is temporary until Darwin implements a proper ReadConfigValue - static uint16_t mPosixSetupDiscriminator; - static char mPosixCountryCode[2 + 1]; +#endif // CHIP_DISABLE_PLATFORM_KVS }; struct PosixConfig::Key diff --git a/src/platform/device.gni b/src/platform/device.gni index a9e630a7eeb1e6..6ac5b17f02202a 100755 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -143,6 +143,15 @@ if (chip_device_platform != "external") { } } +declare_args() { + # If true, disables KVS implementation for the platform. May not be + # supported on all platforms. + chip_disable_platform_kvs = false +} + +assert(chip_disable_platform_kvs == false || chip_device_platform == "darwin", + "Can only disable KVS on some platforms") + if (_chip_device_layer != "none" && chip_device_platform != "external") { chip_ble_platform_config_include = "" From afe0fef5c9344d51530a285f3814d37f50467094 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 27 Apr 2022 10:19:47 -0400 Subject: [PATCH 04/59] Fix error reporting in chip-tool. (#17760) The actual error message got lost in #17628. --- examples/chip-tool/commands/tests/TestCommand.cpp | 2 +- examples/placeholder/linux/include/TestCommand.h | 2 +- src/app/tests/suites/include/TestRunner.h | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index 32f1ac00fa7cad..ad881b5d78c43d 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -77,7 +77,7 @@ void TestCommand::Exit(std::string message, CHIP_ERROR err) { mContinueProcessing = false; - LogEnd(err); + LogEnd(message, err); if (CHIP_NO_ERROR == err) { diff --git a/examples/placeholder/linux/include/TestCommand.h b/examples/placeholder/linux/include/TestCommand.h index 9696412568e708..6fd3655a22a70a 100644 --- a/examples/placeholder/linux/include/TestCommand.h +++ b/examples/placeholder/linux/include/TestCommand.h @@ -86,7 +86,7 @@ class TestCommand : public TestRunner, void Exit(std::string message, CHIP_ERROR err) override { - LogEnd(err); + LogEnd(message, err); SetCommandExitStatus(err); } diff --git a/src/app/tests/suites/include/TestRunner.h b/src/app/tests/suites/include/TestRunner.h index 57ed9500c6f2c0..05310351b2c425 100644 --- a/src/app/tests/suites/include/TestRunner.h +++ b/src/app/tests/suites/include/TestRunner.h @@ -33,15 +33,15 @@ class TestRunner ChipLogProgress(chipTool, " ***** Test Step %u : %s\n", stepNumber, stepName); } - void LogEnd(CHIP_ERROR err) + void LogEnd(std::string message, CHIP_ERROR err) { if (CHIP_NO_ERROR == err) { - ChipLogProgress(chipTool, " **** Test Complete: %s\n", mTestName); + ChipLogProgress(chipTool, " **** Test Complete: %s\n", message.c_str()); } else { - ChipLogError(chipTool, " ***** Test Failure: %s\n", mTestName); + ChipLogError(chipTool, " ***** Test Failure: %s\n", message.c_str()); } } @@ -59,7 +59,6 @@ class TestRunner if (mTestCount == mTestIndex) { - LogEnd(CHIP_NO_ERROR); Exit(mTestName, CHIP_NO_ERROR); return; } From a69011579910f52952b502e90ce481804e879b4f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 27 Apr 2022 10:20:10 -0400 Subject: [PATCH 05/59] Create CHIPAttestationTrustStoreBridge when we know we have PAA certs. (#17783) Fixes https://github.com/project-chip/connectedhomeip/issues/17746 --- .../CHIP/CHIPAttestationTrustStoreBridge.h | 8 ++-- .../CHIP/CHIPAttestationTrustStoreBridge.mm | 2 - .../Framework/CHIP/MatterControllerFactory.mm | 38 ++++++++++--------- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/darwin/Framework/CHIP/CHIPAttestationTrustStoreBridge.h b/src/darwin/Framework/CHIP/CHIPAttestationTrustStoreBridge.h index b24657b5b67448..e0082c4ba56b8f 100644 --- a/src/darwin/Framework/CHIP/CHIPAttestationTrustStoreBridge.h +++ b/src/darwin/Framework/CHIP/CHIPAttestationTrustStoreBridge.h @@ -22,15 +22,17 @@ NS_ASSUME_NONNULL_BEGIN class CHIPAttestationTrustStoreBridge : public chip::Credentials::AttestationTrustStore { public: + CHIPAttestationTrustStoreBridge(NSArray * paaCerts) + : mPaaCerts(paaCerts) + { + } ~CHIPAttestationTrustStoreBridge() {}; - void Init(NSArray * paaCerts); - CHIP_ERROR GetProductAttestationAuthorityCert( const chip::ByteSpan & skid, chip::MutableByteSpan & outPaaDerBuffer) const override; private: - NSArray * _Nullable mPaaCerts; + NSArray * mPaaCerts; }; NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/CHIPAttestationTrustStoreBridge.mm b/src/darwin/Framework/CHIP/CHIPAttestationTrustStoreBridge.mm index c224ed77e4bca5..861413c9ab36b1 100644 --- a/src/darwin/Framework/CHIP/CHIPAttestationTrustStoreBridge.mm +++ b/src/darwin/Framework/CHIP/CHIPAttestationTrustStoreBridge.mm @@ -19,8 +19,6 @@ static chip::ByteSpan asByteSpan(NSData * value) { return chip::ByteSpan(static_cast(value.bytes), value.length); } -void CHIPAttestationTrustStoreBridge::Init(NSArray * paaCerts) { mPaaCerts = paaCerts; } - CHIP_ERROR CHIPAttestationTrustStoreBridge::GetProductAttestationAuthorityCert( const chip::ByteSpan & skid, chip::MutableByteSpan & outPaaDerBuffer) const { diff --git a/src/darwin/Framework/CHIP/MatterControllerFactory.mm b/src/darwin/Framework/CHIP/MatterControllerFactory.mm index 0d585bb4684ab1..780a1e3ba11596 100644 --- a/src/darwin/Framework/CHIP/MatterControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MatterControllerFactory.mm @@ -86,11 +86,6 @@ - (instancetype)init return nil; } - _attestationTrustStoreBridge = new CHIPAttestationTrustStoreBridge(); - if ([self checkForInitError:(_attestationTrustStoreBridge != nullptr) logMsg:kErrorAttestationTrustStoreInit]) { - return nil; - } - _groupStorageDelegate = new chip::TestPersistentStorageDelegate(); if ([self checkForInitError:(_groupStorageDelegate != nullptr) logMsg:kErrorGroupProviderInit]) { return nil; @@ -118,7 +113,8 @@ - (instancetype)init - (void)dealloc { - [self cleanupOwnedObjects]; + [self shutdown]; + [self cleanupInitObjects]; } - (BOOL)checkForInitError:(BOOL)condition logMsg:(NSString *)logMsg @@ -129,12 +125,12 @@ - (BOOL)checkForInitError:(BOOL)condition logMsg:(NSString *)logMsg CHIP_LOG_ERROR("Error: %@", logMsg); - [self cleanupOwnedObjects]; + [self cleanupInitObjects]; return YES; } -- (void)cleanupOwnedObjects +- (void)cleanupInitObjects { _controllers = nil; @@ -149,6 +145,11 @@ - (void)cleanupOwnedObjects _groupStorageDelegate = nullptr; } + Platform::MemoryShutdown(); +} + +- (void)cleanupStartupObjects +{ if (_attestationTrustStoreBridge) { delete _attestationTrustStoreBridge; _attestationTrustStoreBridge = nullptr; @@ -158,8 +159,6 @@ - (void)cleanupOwnedObjects delete _persistentStorageDelegateBridge; _persistentStorageDelegateBridge = nullptr; } - - Platform::MemoryShutdown(); } - (BOOL)startup:(MatterControllerFactoryParams *)startupParams @@ -186,7 +185,11 @@ - (BOOL)startup:(MatterControllerFactoryParams *)startupParams // Initialize device attestation verifier if (startupParams.paaCerts) { - _attestationTrustStoreBridge->Init(startupParams.paaCerts); + _attestationTrustStoreBridge = new CHIPAttestationTrustStoreBridge(startupParams.paaCerts); + if (_attestationTrustStoreBridge == nullptr) { + CHIP_LOG_ERROR("Error: %@", kErrorAttestationTrustStoreInit); + return; + } chip::Credentials::SetDeviceAttestationVerifier(chip::Credentials::GetDefaultDACVerifier(_attestationTrustStoreBridge)); } else { // TODO: Replace testingRootStore with a AttestationTrustStore that has the necessary official PAA roots available @@ -216,6 +219,10 @@ - (BOOL)startup:(MatterControllerFactoryParams *)startupParams // Make sure to stop the event loop again before returning, so we are not running it while we don't have any controllers. DeviceLayer::PlatformMgrImpl().StopEventLoopTask(); + if (![self isRunning]) { + [self cleanupStartupObjects]; + } + return [self isRunning]; } @@ -232,13 +239,10 @@ - (void)shutdown CHIP_LOG_DEBUG("%@", kInfoFactoryShutdown); _controllerFactory->Shutdown(); - if (_persistentStorageDelegateBridge) { - delete _persistentStorageDelegateBridge; - _persistentStorageDelegateBridge = nullptr; - } + [self cleanupStartupObjects]; - // NOTE: we do not call cleanupOwnedObjects because we can be restarted, and - // that does not re-create the owned objects that we create inside init. + // NOTE: we do not call cleanupInitObjects because we can be restarted, and + // that does not re-create the objects that we create inside init. // Maybe we should be creating them in startup? _isRunning = NO; From 1f862e34d8dde852f63cecfd6d7481adff4908d8 Mon Sep 17 00:00:00 2001 From: Song GUO Date: Wed, 27 Apr 2022 22:52:39 +0800 Subject: [PATCH 06/59] [Linux] Implement Ethernet network driver (#17802) --- .../all-clusters-app/linux/main-common.cpp | 11 ++++- src/platform/Linux/BUILD.gn | 1 + .../Linux/NetworkCommissioningDriver.h | 32 ++++++++++++++ .../NetworkCommissioningEthernetDriver.cpp | 43 +++++++++++++++++++ 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 src/platform/Linux/NetworkCommissioningEthernetDriver.cpp diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index a9b09291304849..7829f3a6c1894a 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -107,10 +107,13 @@ NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver; Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointSecondary, &sLinuxWiFiDriver); #endif -#endif // CHIP_DEVICE_LAYER_TARGET_LINUX - +NetworkCommissioning::LinuxEthernetDriver sLinuxEthernetDriver; +Clusters::NetworkCommissioning::Instance sEthernetNetworkCommissioningInstance(kNetworkCommissioningEndpointMain, + &sLinuxEthernetDriver); +#else // CHIP_DEVICE_LAYER_TARGET_LINUX Clusters::NetworkCommissioning::NullNetworkDriver sNullNetworkDriver; Clusters::NetworkCommissioning::Instance sNullNetworkCommissioningInstance(kNetworkCommissioningEndpointMain, &sNullNetworkDriver); +#endif // CHIP_DEVICE_LAYER_TARGET_LINUX } // namespace void ApplicationInit() @@ -166,8 +169,12 @@ void ApplicationInit() else #endif // CHIP_DEVICE_LAYER_TARGET_LINUX { +#if CHIP_DEVICE_LAYER_TARGET_LINUX + sEthernetNetworkCommissioningInstance.Init(); +#else // Use NullNetworkCommissioningInstance to disable the network commissioning functions. sNullNetworkCommissioningInstance.Init(); +#endif } } diff --git a/src/platform/Linux/BUILD.gn b/src/platform/Linux/BUILD.gn index 0e42fb227e9ae0..1095bcebb93084 100644 --- a/src/platform/Linux/BUILD.gn +++ b/src/platform/Linux/BUILD.gn @@ -64,6 +64,7 @@ static_library("Linux") { "KeyValueStoreManagerImpl.h", "Logging.cpp", "NetworkCommissioningDriver.h", + "NetworkCommissioningEthernetDriver.cpp", "NetworkCommissioningThreadDriver.cpp", "NetworkCommissioningWiFiDriver.cpp", "PlatformManagerImpl.cpp", diff --git a/src/platform/Linux/NetworkCommissioningDriver.h b/src/platform/Linux/NetworkCommissioningDriver.h index a474535cd2e3ff..f0bce1902799dd 100644 --- a/src/platform/Linux/NetworkCommissioningDriver.h +++ b/src/platform/Linux/NetworkCommissioningDriver.h @@ -156,6 +156,38 @@ class LinuxThreadDriver final : public ThreadDriver #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD +class LinuxEthernetDriver final : public EthernetDriver +{ +public: + struct EthernetNetworkIterator final : public NetworkIterator + { + EthernetNetworkIterator() = default; + size_t Count() override { return interfaceNameLen > 0 ? 1 : 0; } + bool Next(Network & item) override + { + if (exhausted) + { + return false; + } + exhausted = true; + memcpy(item.networkID, interfaceName, interfaceNameLen); + item.networkIDLen = interfaceNameLen; + item.connected = true; + return true; + } + void Release() override { delete this; } + ~EthernetNetworkIterator() override = default; + + // Public, but cannot be accessed via NetworkIterator interface. + uint8_t interfaceName[kMaxNetworkIDLen]; + uint8_t interfaceNameLen = 0; + bool exhausted = false; + }; + + uint8_t GetMaxNetworks() override { return 1; }; + NetworkIterator * GetNetworks() override; +}; + } // namespace NetworkCommissioning } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/Linux/NetworkCommissioningEthernetDriver.cpp b/src/platform/Linux/NetworkCommissioningEthernetDriver.cpp new file mode 100644 index 00000000000000..00c619c3605be3 --- /dev/null +++ b/src/platform/Linux/NetworkCommissioningEthernetDriver.cpp @@ -0,0 +1,43 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include +#include +#include + +using namespace chip::DeviceLayer::Internal; + +namespace chip { +namespace DeviceLayer { +namespace NetworkCommissioning { + +NetworkIterator * LinuxEthernetDriver::GetNetworks() +{ + auto ret = new EthernetNetworkIterator(); + ConnectivityUtils::GetEthInterfaceName(SafePointerCast(ret->interfaceName), sizeof(ret->interfaceName)); + ret->interfaceNameLen = strnlen(SafePointerCast(ret->interfaceName), sizeof(ret->interfaceName)); + return ret; +} + +} // namespace NetworkCommissioning +} // namespace DeviceLayer +} // namespace chip From 1dd1e806723d334583fbfaa99697480400b41836 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 27 Apr 2022 12:18:05 -0400 Subject: [PATCH 07/59] Stop trying to get NodeLabel and LocalConfigDisabled from configuration manager (#17758) * Stop trying to get NodeLabel and LocalConfigDisabled from configuration manager. We're never _storing_ these in the configuration manager, so getting them from there, on startup only, makes no sense. The added tests verify that we are in fact properly storing them in NVM. * Address review comments. --- .../chip-tool-darwin/templates/tests/tests.js | 3 +- src/app/clusters/basic/basic.cpp | 30 ++- src/app/clusters/basic/basic.h | 15 ++ .../ota-requestor/DefaultOTARequestor.cpp | 3 +- .../ExtendedOTARequestorDriver.cpp | 7 +- .../tests/suites/TestBasicInformation.yaml | 72 ++++++ .../Framework/CHIP/templates/tests/tests.js | 3 +- .../Framework/CHIPTests/CHIPClustersTests.m | 149 ------------ src/include/platform/ConfigurationManager.h | 4 - .../GenericConfigurationManagerImpl.h | 3 - .../GenericConfigurationManagerImpl.ipp | 18 -- src/platform/android/AndroidConfig.cpp | 4 +- src/platform/android/AndroidConfig.h | 2 - .../android/ConfigurationManagerImpl.cpp | 16 -- .../android/ConfigurationManagerImpl.h | 3 - .../chip/platform/ConfigurationManager.java | 2 - src/platform/fake/ConfigurationManagerImpl.h | 3 - .../zap-generated/test/Commands.h | 223 ------------------ .../chip-tool/zap-generated/test/Commands.h | 128 +++++++++- 19 files changed, 236 insertions(+), 452 deletions(-) diff --git a/examples/chip-tool-darwin/templates/tests/tests.js b/examples/chip-tool-darwin/templates/tests/tests.js index 94d0d32c70cd38..8439bed5f3dec6 100644 --- a/examples/chip-tool-darwin/templates/tests/tests.js +++ b/examples/chip-tool-darwin/templates/tests/tests.js @@ -275,7 +275,8 @@ function getTests() 'TestConstraints', 'TestDelayCommands', 'TestDescriptorCluster', - 'TestBasicInformation', + // TestBasicInformation needs Reboot + //'TestBasicInformation', 'TestGeneralCommissioning', 'TestGroupsCluster', 'TestGroupKeyManagementCluster', diff --git a/src/app/clusters/basic/basic.cpp b/src/app/clusters/basic/basic.cpp index 32dd9f00443e7a..0d5b9a91a812b3 100644 --- a/src/app/clusters/basic/basic.cpp +++ b/src/app/clusters/basic/basic.cpp @@ -389,24 +389,22 @@ PlatformMgrDelegate gPlatformMgrDelegate; } // anonymous namespace -void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint) +namespace chip { +namespace app { +namespace Clusters { +namespace Basic { +bool IsLocalConfigDisabled() { - EmberAfStatus status; - - char nodeLabel[DeviceLayer::ConfigurationManager::kMaxNodeLabelLength + 1]; - if (ConfigurationMgr().GetNodeLabel(nodeLabel, sizeof(nodeLabel)) == CHIP_NO_ERROR) - { - status = Attributes::NodeLabel::Set(endpoint, chip::CharSpan::fromCharString(nodeLabel)); - VerifyOrdo(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Node Label: 0x%02x", status)); - } - - bool localConfigDisabled; - if (ConfigurationMgr().GetLocalConfigDisabled(localConfigDisabled) == CHIP_NO_ERROR) - { - status = Attributes::LocalConfigDisabled::Set(endpoint, localConfigDisabled); - VerifyOrdo(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Local Config Disabled: 0x%02x", status)); - } + bool disabled = false; + EmberAfStatus status = LocalConfigDisabled::Get(0, &disabled); + return status == EMBER_ZCL_STATUS_SUCCESS && disabled; } +} // namespace Basic +} // namespace Clusters +} // namespace app +} // namespace chip + +void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint) {} void MatterBasicPluginServerInitCallback() { diff --git a/src/app/clusters/basic/basic.h b/src/app/clusters/basic/basic.h index 712a1dcce398a8..16d1f1e6b08624 100644 --- a/src/app/clusters/basic/basic.h +++ b/src/app/clusters/basic/basic.h @@ -19,6 +19,21 @@ #include +namespace chip { +namespace app { +namespace Clusters { +namespace Basic { +/** + * Check whether LocalConfigDisabled is set (on endpoint 0, which is the only + * place the Basic Information cluster exists and can have the attribute be + * set). + */ +bool IsLocalConfigDisabled(); +} // namespace Basic +} // namespace Clusters +} // namespace app +} // namespace chip + /** @brief Basic Cluster Server Init * * This function is called at startup for a given endpoint to initialize diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp index d53a4466cdcc07..cb1017100e8092 100644 --- a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp +++ b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp @@ -20,6 +20,7 @@ * OTA Requestor logic is contained in this class. */ +#include #include #include #include @@ -733,7 +734,7 @@ CHIP_ERROR DefaultOTARequestor::SendQueryImageRequest(OperationalDeviceProxy & d ReturnErrorOnFailure(DeviceLayer::ConfigurationMgr().GetSoftwareVersion(args.softwareVersion)); args.protocolsSupported = kProtocolsSupported; - args.requestorCanConsent.SetValue(mOtaRequestorDriver->CanConsent()); + args.requestorCanConsent.SetValue(!Basic::IsLocalConfigDisabled() && mOtaRequestorDriver->CanConsent()); uint16_t hardwareVersion; if (DeviceLayer::ConfigurationMgr().GetHardwareVersion(hardwareVersion) == CHIP_NO_ERROR) diff --git a/src/app/clusters/ota-requestor/ExtendedOTARequestorDriver.cpp b/src/app/clusters/ota-requestor/ExtendedOTARequestorDriver.cpp index 07f96e9e00041e..e1218cb60f3000 100644 --- a/src/app/clusters/ota-requestor/ExtendedOTARequestorDriver.cpp +++ b/src/app/clusters/ota-requestor/ExtendedOTARequestorDriver.cpp @@ -30,12 +30,7 @@ constexpr System::Clock::Seconds32 kUserConsentPollInterval = System::Clock::Sec bool ExtendedOTARequestorDriver::CanConsent() { - bool localConfigDisabled = false; - VerifyOrdo(DeviceLayer::ConfigurationMgr().GetLocalConfigDisabled(localConfigDisabled) == CHIP_NO_ERROR, - ChipLogProgress(SoftwareUpdate, "Failed to get local config disabled, assuming not disabled")); - - // User consent delegation SHALL NOT be used if a Node is configured with the LocalConfigDisabled attribute set to True - return localConfigDisabled == false; + return mUserConsentDelegate != nullptr; } void ExtendedOTARequestorDriver::UpdateAvailable(const UpdateDescription & update, System::Clock::Seconds32 delay) diff --git a/src/app/tests/suites/TestBasicInformation.yaml b/src/app/tests/suites/TestBasicInformation.yaml index 133a7aa2fe03d8..8d312219b5ed13 100644 --- a/src/app/tests/suites/TestBasicInformation.yaml +++ b/src/app/tests/suites/TestBasicInformation.yaml @@ -82,3 +82,75 @@ tests: 0xFFFB, # AttributeList 0xFFFD, # ClusterRevision ] + + - label: "Read NodeLabel" + command: "readAttribute" + attribute: "NodeLabel" + response: + value: "" + + - label: "Write NodeLabel" + command: "writeAttribute" + attribute: "NodeLabel" + arguments: + value: "My node" + + - label: "Read back NodeLabel" + command: "readAttribute" + attribute: "NodeLabel" + response: + value: "My node" + + - label: "Read LocalConfigDisabled" + command: "readAttribute" + attribute: "LocalConfigDisabled" + response: + value: false + + - label: "Write LocalConfigDisabled" + command: "writeAttribute" + attribute: "LocalConfigDisabled" + arguments: + value: true + + - label: "Read back LocalConfigDisabled" + command: "readAttribute" + attribute: "LocalConfigDisabled" + response: + value: true + + - label: "Reboot the device" + cluster: "SystemCommands" + command: "Reboot" + + - label: "Connect to the device again" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read back NodeLabel after reboot" + command: "readAttribute" + attribute: "NodeLabel" + response: + value: "My node" + + - label: "Restore initial NodeLabel value" + command: "writeAttribute" + attribute: "NodeLabel" + arguments: + value: "" + + - label: "Read back LocalConfigDisabled after reboot" + command: "readAttribute" + attribute: "LocalConfigDisabled" + response: + value: true + + - label: "Restore initial LocalConfigDisabled value" + command: "writeAttribute" + attribute: "LocalConfigDisabled" + arguments: + value: false diff --git a/src/darwin/Framework/CHIP/templates/tests/tests.js b/src/darwin/Framework/CHIP/templates/tests/tests.js index 278ed1896d3039..aa54647a79220b 100644 --- a/src/darwin/Framework/CHIP/templates/tests/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests/tests.js @@ -271,7 +271,8 @@ function getTests() 'TestConstraints', 'TestDelayCommands', 'TestDescriptorCluster', - 'TestBasicInformation', + // TestBasicInformation needs support for Reboot with no discriminator + //'TestBasicInformation', 'TestGeneralCommissioning', 'TestGroupsCluster', 'TestGroupKeyManagementCluster', diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 40f2321c3f51c6..e656b0acbc87a6 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -48858,155 +48858,6 @@ - (void)testSendClusterTestDescriptorCluster_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestBasicInformation_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBasicInformation_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read location"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read location Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@"XX"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBasicInformation_000002_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write location"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id locationArgument; - locationArgument = @"US"; - [cluster writeAttributeLocationWithValue:locationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write location Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBasicInformation_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back location"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back location Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@"US"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBasicInformation_000004_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Restore initial location value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id locationArgument; - locationArgument = @"XX"; - [cluster writeAttributeLocationWithValue:locationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Restore initial location value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBasicInformation_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read AttributeList value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read AttributeList value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 24); - XCTAssertEqual([actualValue[0] unsignedIntValue], 0UL); - XCTAssertEqual([actualValue[1] unsignedIntValue], 1UL); - XCTAssertEqual([actualValue[2] unsignedIntValue], 2UL); - XCTAssertEqual([actualValue[3] unsignedIntValue], 3UL); - XCTAssertEqual([actualValue[4] unsignedIntValue], 4UL); - XCTAssertEqual([actualValue[5] unsignedIntValue], 5UL); - XCTAssertEqual([actualValue[6] unsignedIntValue], 6UL); - XCTAssertEqual([actualValue[7] unsignedIntValue], 7UL); - XCTAssertEqual([actualValue[8] unsignedIntValue], 8UL); - XCTAssertEqual([actualValue[9] unsignedIntValue], 9UL); - XCTAssertEqual([actualValue[10] unsignedIntValue], 10UL); - XCTAssertEqual([actualValue[11] unsignedIntValue], 11UL); - XCTAssertEqual([actualValue[12] unsignedIntValue], 12UL); - XCTAssertEqual([actualValue[13] unsignedIntValue], 13UL); - XCTAssertEqual([actualValue[14] unsignedIntValue], 14UL); - XCTAssertEqual([actualValue[15] unsignedIntValue], 15UL); - XCTAssertEqual([actualValue[16] unsignedIntValue], 16UL); - XCTAssertEqual([actualValue[17] unsignedIntValue], 17UL); - XCTAssertEqual([actualValue[18] unsignedIntValue], 18UL); - XCTAssertEqual([actualValue[19] unsignedIntValue], 19UL); - XCTAssertEqual([actualValue[20] unsignedIntValue], 65528UL); - XCTAssertEqual([actualValue[21] unsignedIntValue], 65529UL); - XCTAssertEqual([actualValue[22] unsignedIntValue], 65531UL); - XCTAssertEqual([actualValue[23] unsignedIntValue], 65533UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTestGeneralCommissioning_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index fc120d686505bd..d4779dd46f305d 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -63,7 +63,6 @@ class ConfigurationManager { kMaxVendorNameLength = 32, kMaxProductNameLength = 32, - kMaxNodeLabelLength = 32, kMaxLocationLength = 2, kMaxHardwareVersionStringLength = 64, kMaxSoftwareVersionStringLength = 64, @@ -123,12 +122,9 @@ class ConfigurationManager virtual CHIP_ERROR StoreTotalOperationalHours(uint32_t totalOperationalHours) = 0; virtual CHIP_ERROR GetBootReason(uint32_t & bootReason) = 0; virtual CHIP_ERROR StoreBootReason(uint32_t bootReason) = 0; - virtual CHIP_ERROR GetNodeLabel(char * buf, size_t bufSize) = 0; - virtual CHIP_ERROR StoreNodeLabel(const char * buf, size_t bufSize) = 0; virtual CHIP_ERROR GetPartNumber(char * buf, size_t bufSize) = 0; virtual CHIP_ERROR GetProductURL(char * buf, size_t bufSize) = 0; virtual CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) = 0; - virtual CHIP_ERROR GetLocalConfigDisabled(bool & disabled) = 0; virtual CHIP_ERROR GetUniqueId(char * buf, size_t bufSize) = 0; virtual CHIP_ERROR StoreUniqueId(const char * uniqueId, size_t uniqueIdLen) = 0; virtual CHIP_ERROR GenerateUniqueId(char * buf, size_t bufSize) = 0; diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.h b/src/include/platform/internal/GenericConfigurationManagerImpl.h index 71ebcda397477b..5e33e04e2088e0 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.h +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.h @@ -104,12 +104,9 @@ class GenericConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR StoreTotalOperationalHours(uint32_t totalOperationalHours) override; CHIP_ERROR GetBootReason(uint32_t & bootReason) override; CHIP_ERROR StoreBootReason(uint32_t bootReason) override; - CHIP_ERROR GetNodeLabel(char * buf, size_t bufSize) override; - CHIP_ERROR StoreNodeLabel(const char * buf, size_t bufSize) override; CHIP_ERROR GetPartNumber(char * buf, size_t bufSize) override; CHIP_ERROR GetProductURL(char * buf, size_t bufSize) override; CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) override; - CHIP_ERROR GetLocalConfigDisabled(bool & disabled) override; CHIP_ERROR GetUniqueId(char * buf, size_t bufSize) override; CHIP_ERROR StoreUniqueId(const char * uniqueId, size_t uniqueIdLen) override; CHIP_ERROR GenerateUniqueId(char * buf, size_t bufSize) override; diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp index 1eda6d47ba914e..91423c452ebc49 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp @@ -590,18 +590,6 @@ CHIP_ERROR GenericConfigurationManagerImpl::StoreBootReason(uint32_t return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } -template -CHIP_ERROR GenericConfigurationManagerImpl::GetNodeLabel(char * buf, size_t bufSize) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -template -CHIP_ERROR GenericConfigurationManagerImpl::StoreNodeLabel(const char * buf, size_t bufSize) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - template CHIP_ERROR GenericConfigurationManagerImpl::GetPartNumber(char * buf, size_t bufSize) { @@ -620,12 +608,6 @@ CHIP_ERROR GenericConfigurationManagerImpl::GetProductLabel(char * return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } -template -CHIP_ERROR GenericConfigurationManagerImpl::GetLocalConfigDisabled(bool & disabled) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - template CHIP_ERROR GenericConfigurationManagerImpl::GetUniqueId(char * buf, size_t bufSize) { diff --git a/src/platform/android/AndroidConfig.cpp b/src/platform/android/AndroidConfig.cpp index 98040a81ef38fb..ef6b298b8581ae 100644 --- a/src/platform/android/AndroidConfig.cpp +++ b/src/platform/android/AndroidConfig.cpp @@ -71,12 +71,10 @@ const AndroidConfig::Key AndroidConfig::kConfigKey_ProductId = { kCo const AndroidConfig::Key AndroidConfig::kConfigKey_ProductName = { kConfigNamespace_ChipFactory, "product-name" }; const AndroidConfig::Key AndroidConfig::kConfigKey_SoftwareVersion = { kConfigNamespace_ChipFactory, "software-version" }; const AndroidConfig::Key AndroidConfig::kConfigKey_SoftwareVersionString = { kConfigNamespace_ChipFactory, "software-version-str" }; -const AndroidConfig::Key AndroidConfig::kConfigKey_NodeLabel = { kConfigNamespace_ChipFactory, "node-label" }; const AndroidConfig::Key AndroidConfig::kConfigKey_PartNumber = { kConfigNamespace_ChipFactory, "part-number" }; const AndroidConfig::Key AndroidConfig::kConfigKey_ProductURL = { kConfigNamespace_ChipFactory, "product-url" }; const AndroidConfig::Key AndroidConfig::kConfigKey_ProductLabel = { kConfigNamespace_ChipFactory, "product-label" }; -const AndroidConfig::Key AndroidConfig::kConfigKey_LocalConfigDisabled = { kConfigNamespace_ChipFactory, "local-config-disabled" }; -const AndroidConfig::Key AndroidConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipFactory, "uniqueId" }; +const AndroidConfig::Key AndroidConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipFactory, "uniqueId" }; const AndroidConfig::Key AndroidConfig::kConfigKey_Spake2pIterationCount = { kConfigNamespace_ChipFactory, "iteration-count" }; const AndroidConfig::Key AndroidConfig::kConfigKey_Spake2pSalt = { kConfigNamespace_ChipFactory, "salt" }; const AndroidConfig::Key AndroidConfig::kConfigKey_Spake2pVerifier = { kConfigNamespace_ChipFactory, "verifier" }; diff --git a/src/platform/android/AndroidConfig.h b/src/platform/android/AndroidConfig.h index e71bc189fa42eb..3f53259432a9f8 100644 --- a/src/platform/android/AndroidConfig.h +++ b/src/platform/android/AndroidConfig.h @@ -79,11 +79,9 @@ class AndroidConfig static const Key kConfigKey_ProductName; static const Key kConfigKey_SoftwareVersion; static const Key kConfigKey_SoftwareVersionString; - static const Key kConfigKey_NodeLabel; static const Key kConfigKey_PartNumber; static const Key kConfigKey_ProductURL; static const Key kConfigKey_ProductLabel; - static const Key kConfigKey_LocalConfigDisabled; static const Key kConfigKey_UniqueId; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; diff --git a/src/platform/android/ConfigurationManagerImpl.cpp b/src/platform/android/ConfigurationManagerImpl.cpp index 9ffd720cfa729f..a34fc504e2c50d 100644 --- a/src/platform/android/ConfigurationManagerImpl.cpp +++ b/src/platform/android/ConfigurationManagerImpl.cpp @@ -237,17 +237,6 @@ CHIP_ERROR ConfigurationManagerImpl::GetHardwareVersionString(char * buf, size_t return CHIP_NO_ERROR; } -CHIP_ERROR ConfigurationManagerImpl::GetNodeLabel(char * buf, size_t bufSize) -{ - size_t dateLen; - return ReadConfigValueStr(AndroidConfig::kConfigKey_NodeLabel, buf, bufSize, dateLen); -} - -CHIP_ERROR ConfigurationManagerImpl::StoreNodeLabel(const char * buf, size_t bufSize) -{ - return WriteConfigValueStr(AndroidConfig::kConfigKey_NodeLabel, buf, bufSize); -} - CHIP_ERROR ConfigurationManagerImpl::GetPartNumber(char * buf, size_t bufSize) { size_t dateLen; @@ -266,11 +255,6 @@ CHIP_ERROR ConfigurationManagerImpl::GetProductLabel(char * buf, size_t bufSize) return ReadConfigValueStr(AndroidConfig::kConfigKey_ProductLabel, buf, bufSize, dateLen); } -CHIP_ERROR ConfigurationManagerImpl::GetLocalConfigDisabled(bool & disabled) -{ - return ReadConfigValue(AndroidConfig::kConfigKey_LocalConfigDisabled, disabled); -} - CHIP_ERROR ConfigurationManagerImpl::GetUniqueId(char * buf, size_t bufSize) { size_t dateLen; diff --git a/src/platform/android/ConfigurationManagerImpl.h b/src/platform/android/ConfigurationManagerImpl.h index 25ea7c4681f37c..42c5c30c4b174c 100644 --- a/src/platform/android/ConfigurationManagerImpl.h +++ b/src/platform/android/ConfigurationManagerImpl.h @@ -45,12 +45,9 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp CHIP_ERROR GetHardwareVersionString(char * buf, size_t bufSize) override; CHIP_ERROR GetSoftwareVersionString(char * buf, size_t bufSize) override; CHIP_ERROR GetSoftwareVersion(uint32_t & softwareVer) override; - CHIP_ERROR GetNodeLabel(char * buf, size_t bufSize) override; - CHIP_ERROR StoreNodeLabel(const char * buf, size_t bufSize) override; CHIP_ERROR GetPartNumber(char * buf, size_t bufSize) override; CHIP_ERROR GetProductURL(char * buf, size_t bufSize) override; CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) override; - CHIP_ERROR GetLocalConfigDisabled(bool & disabled) override; CHIP_ERROR GetUniqueId(char * buf, size_t bufSize) override; private: diff --git a/src/platform/android/java/chip/platform/ConfigurationManager.java b/src/platform/android/java/chip/platform/ConfigurationManager.java index 38d6dd71973d1f..ae35caed7b4401 100644 --- a/src/platform/android/java/chip/platform/ConfigurationManager.java +++ b/src/platform/android/java/chip/platform/ConfigurationManager.java @@ -39,11 +39,9 @@ public interface ConfigurationManager { String kConfigKey_ProductName = "product-name"; String kConfigKey_SoftwareVersion = "software-version"; String kConfigKey_SoftwareVersionString = "software-version-str"; - String kConfigKey_NodeLabel = "node-label"; String kConfigKey_PartNumber = "part-number"; String kConfigKey_ProductURL = "product-url"; String kConfigKey_ProductLabel = "product-label"; - String kConfigKey_LocalConfigDisabled = "local-config-disabled"; String kConfigKey_UniqueId = "uniqueId"; String kConfigKey_Spake2pIterationCount = "iteration-count"; String kConfigKey_Spake2pSalt = "salt"; diff --git a/src/platform/fake/ConfigurationManagerImpl.h b/src/platform/fake/ConfigurationManagerImpl.h index 127cff6ff51368..e7ebe3ffefa752 100644 --- a/src/platform/fake/ConfigurationManagerImpl.h +++ b/src/platform/fake/ConfigurationManagerImpl.h @@ -86,12 +86,9 @@ class ConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR StoreTotalOperationalHours(uint32_t totalOperationalHours) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetBootReason(uint32_t & bootReason) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreBootReason(uint32_t bootReason) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetNodeLabel(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR StoreNodeLabel(const char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetPartNumber(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetProductURL(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetLocalConfigDisabled(bool & disabled) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetUniqueId(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreUniqueId(const char * uniqueId, size_t uniqueIdLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GenerateUniqueId(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index e6bb84ddf4b0fc..e11d010f474978 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -179,7 +179,6 @@ class TestList : public Command { printf("TestConstraints\n"); printf("TestDelayCommands\n"); printf("TestDescriptorCluster\n"); - printf("TestBasicInformation\n"); printf("TestGeneralCommissioning\n"); printf("TestGroupsCluster\n"); printf("TestGroupKeyManagementCluster\n"); @@ -61457,227 +61456,6 @@ class TestDescriptorCluster : public TestCommandBridge { } }; -class TestBasicInformation : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestBasicInformation() - : TestCommandBridge("TestBasicInformation") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~TestBasicInformation() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestBasicInformation\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestBasicInformation\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read location\n"); - err = TestReadLocation_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Write location\n"); - err = TestWriteLocation_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read back location\n"); - err = TestReadBackLocation_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Restore initial location value\n"); - err = TestRestoreInitialLocationValue_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read AttributeList value\n"); - err = TestReadAttributeListValue_5(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadLocation_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read location Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("Location", actualValue, @"XX")); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteLocation_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id locationArgument; - locationArgument = @"US"; - [cluster writeAttributeLocationWithValue:locationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write location Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadBackLocation_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back location Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("Location", actualValue, @"US")); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestRestoreInitialLocationValue_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id locationArgument; - locationArgument = @"XX"; - [cluster writeAttributeLocationWithValue:locationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Restore initial location value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeListValue_5() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read AttributeList value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(24))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 8UL)); - VerifyOrReturn(CheckValue("", actualValue[9], 9UL)); - VerifyOrReturn(CheckValue("", actualValue[10], 10UL)); - VerifyOrReturn(CheckValue("", actualValue[11], 11UL)); - VerifyOrReturn(CheckValue("", actualValue[12], 12UL)); - VerifyOrReturn(CheckValue("", actualValue[13], 13UL)); - VerifyOrReturn(CheckValue("", actualValue[14], 14UL)); - VerifyOrReturn(CheckValue("", actualValue[15], 15UL)); - VerifyOrReturn(CheckValue("", actualValue[16], 16UL)); - VerifyOrReturn(CheckValue("", actualValue[17], 17UL)); - VerifyOrReturn(CheckValue("", actualValue[18], 18UL)); - VerifyOrReturn(CheckValue("", actualValue[19], 19UL)); - VerifyOrReturn(CheckValue("", actualValue[20], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[21], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[22], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[23], 65533UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - class TestGeneralCommissioning : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -64940,7 +64718,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index db857b603dde5c..d9b9cd7da43def 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -40216,7 +40216,7 @@ class TestBasicInformationSuite : public TestCommand { public: TestBasicInformationSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("TestBasicInformation", 6, credsIssuerConfig) + TestCommand("TestBasicInformation", 18, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -40334,6 +40334,74 @@ class TestBasicInformationSuite : public TestCommand } } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("My node", 7))); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, false)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("My node", 7))); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -40378,6 +40446,64 @@ class TestBasicInformationSuite : public TestCommand LogStep(5, "Read AttributeList value"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id); } + case 6: { + LogStep(6, "Read NodeLabel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); + } + case 7: { + LogStep(7, "Write NodeLabel"); + chip::CharSpan value; + value = chip::Span("My nodegarbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); + } + case 8: { + LogStep(8, "Read back NodeLabel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); + } + case 9: { + LogStep(9, "Read LocalConfigDisabled"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id); + } + case 10: { + LogStep(10, "Write LocalConfigDisabled"); + bool value; + value = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, value); + } + case 11: { + LogStep(11, "Read back LocalConfigDisabled"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id); + } + case 12: { + LogStep(12, "Reboot the device"); + SetIdentity(kIdentityAlpha); + return Reboot(); + } + case 13: { + LogStep(13, "Connect to the device again"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 14: { + LogStep(14, "Read back NodeLabel after reboot"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); + } + case 15: { + LogStep(15, "Restore initial NodeLabel value"); + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); + } + case 16: { + LogStep(16, "Read back LocalConfigDisabled after reboot"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id); + } + case 17: { + LogStep(17, "Restore initial LocalConfigDisabled value"); + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, value); + } } return CHIP_NO_ERROR; } From 6e737a6683ea48918c8a21d498586207003c0104 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 27 Apr 2022 19:26:36 +0200 Subject: [PATCH 08/59] [Darwin] Pass the correct type to the register callback (#17767) --- src/platform/Darwin/DnssdContexts.cpp | 16 ++++++++++++++-- src/platform/Darwin/DnssdImpl.h | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/platform/Darwin/DnssdContexts.cpp b/src/platform/Darwin/DnssdContexts.cpp index bd68b126e004e7..777f9d8a98d67c 100644 --- a/src/platform/Darwin/DnssdContexts.cpp +++ b/src/platform/Darwin/DnssdContexts.cpp @@ -39,6 +39,17 @@ std::string GetHostNameWithoutDomain(const char * hostnameWithDomain) return hostname; } +std::string GetFullTypeWithoutSubTypes(std::string fullType) +{ + size_t position = fullType.find(","); + if (position != std::string::npos) + { + fullType.erase(position); + } + + return fullType; +} + void GetTextEntries(DnssdService & service, const unsigned char * data, uint16_t len) { uint16_t recordCount = TXTRecordGetCount(len, data); @@ -246,7 +257,7 @@ RegisterContext::RegisterContext(const char * sType, DnssdPublishCallback cb, vo context = cbContext; callback = cb; - Platform::CopyString(mType, sType); + mType = sType; } void RegisterContext::DispatchFailure(DNSServiceErrorType err) @@ -258,7 +269,8 @@ void RegisterContext::DispatchFailure(DNSServiceErrorType err) void RegisterContext::DispatchSuccess() { - callback(context, mType, CHIP_NO_ERROR); + std::string typeWithoutSubTypes = GetFullTypeWithoutSubTypes(mType); + callback(context, typeWithoutSubTypes.c_str(), CHIP_NO_ERROR); } BrowseContext::BrowseContext(void * cbContext, DnssdBrowseCallback cb, DnssdServiceProtocol cbContextProtocol) diff --git a/src/platform/Darwin/DnssdImpl.h b/src/platform/Darwin/DnssdImpl.h index b3934cedae1fff..e41b61421028a7 100644 --- a/src/platform/Darwin/DnssdImpl.h +++ b/src/platform/Darwin/DnssdImpl.h @@ -91,7 +91,7 @@ class MdnsContexts struct RegisterContext : public GenericContext { DnssdPublishCallback callback; - char mType[kDnssdTypeMaxSize + 1]; + std::string mType; RegisterContext(const char * sType, DnssdPublishCallback cb, void * cbContext); virtual ~RegisterContext() {} @@ -99,7 +99,7 @@ struct RegisterContext : public GenericContext void DispatchFailure(DNSServiceErrorType err) override; void DispatchSuccess() override; - bool matches(const char * sType) { return (strcmp(mType, sType) == 0); } + bool matches(const char * sType) { return mType.compare(sType) == 0; } }; struct BrowseContext : public GenericContext From 408db8a4b9d3c4d89b75efec73998f644383ea96 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 27 Apr 2022 19:29:03 +0200 Subject: [PATCH 09/59] [Yaml] Add TestEvents.yaml (#17810) * [YAML] Add TestEvents.yaml * [YAML] Update chip-tool templates to support multiple responses * [YAML] Fix some syntax errors in Test_TC_MC_6_4.yaml * Update generated test content --- .../tests/partials/test_cluster.zapt | 13 +- .../tests/partials/saveAs/setupSaveAs.zapt | 2 + .../tests/partials/saveAs/teardownSaveAs.zapt | 2 + .../templates/tests/partials/test_step.zapt | 7 + .../tests/partials/test_step_response.zapt | 37 ++- examples/chip-tool/templates/tests/tests.js | 1 + src/app/tests/suites/TestEvents.yaml | 87 ++++++++ .../suites/certification/Test_TC_MC_6_4.yaml | 8 +- src/app/tests/suites/include/TestRunner.h | 12 +- .../common/ClusterTestGeneration.js | 210 +++++++++++------- .../common/variables/Variables.js | 24 +- .../tests/partials/test_cluster.zapt | 12 +- .../chip-tool/zap-generated/test/Commands.h | 183 +++++++++++++++ 13 files changed, 484 insertions(+), 114 deletions(-) create mode 100644 src/app/tests/suites/TestEvents.yaml diff --git a/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt b/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt index 3809ad4944248e..977d844374d04c 100644 --- a/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt +++ b/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt @@ -84,11 +84,13 @@ class {{filename}}: public TestCommandBridge {{#if async}} bool testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase command}}_Fulfilled = false; {{/if}} + {{#chip_tests_item_responses}} {{#chip_tests_item_response_parameters}} {{#if saveAs}} {{asObjectiveCType type ../cluster}} {{saveAs}}; {{/if}} {{/chip_tests_item_response_parameters}} + {{/chip_tests_item_responses}} {{~#*inline "subscribeDataCallback"}} test_{{parent.filename}}_{{attribute}}_Reported @@ -172,11 +174,9 @@ class {{filename}}: public TestCommandBridge } {{/if}} - {{#if response.error}} - VerifyOrReturn(CheckValue("status", err, {{response.error}})); - NextTest(); - {{else if response.errorWrongValue}} - VerifyOrReturn(CheckConstraintNotValue("status", err, 0)); + {{#chip_tests_item_responses}} + {{#if error}} + VerifyOrReturn(CheckValue("status", err, {{error}})); NextTest(); {{else}} VerifyOrReturn(CheckValue("status", err, 0)); @@ -235,7 +235,7 @@ class {{filename}}: public TestCommandBridge {{#unless async}} NextTest(); {{else}} - testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase command}}_Fulfilled = true; + testSendCluster{{parent.filename}}_{{asTestIndex ../index}}_{{asUpperCamelCase command}}_Fulfilled = true; {{/unless}} {{else}} {{! We're a subscription }} @@ -246,6 +246,7 @@ class {{filename}}: public TestCommandBridge } {{/unless}} {{/if}} + {{/chip_tests_item_responses}} }{{#unless isWaitForReport}}]{{/unless}}; {{/if}} diff --git a/examples/chip-tool/templates/tests/partials/saveAs/setupSaveAs.zapt b/examples/chip-tool/templates/tests/partials/saveAs/setupSaveAs.zapt index 386f1ff95b9df7..32bc6b0dfa818e 100644 --- a/examples/chip-tool/templates/tests/partials/saveAs/setupSaveAs.zapt +++ b/examples/chip-tool/templates/tests/partials/saveAs/setupSaveAs.zapt @@ -1,4 +1,5 @@ {{#chip_tests_items}} + {{#chip_tests_item_responses}} {{#chip_tests_item_response_parameters}} {{#if saveAs}} {{~#if (isString type)}} @@ -7,4 +8,5 @@ {{zapTypeToDecodableClusterObjectType type ns=../cluster}} {{saveAs}}; {{/if}} {{/chip_tests_item_response_parameters}} + {{/chip_tests_item_responses}} {{/chip_tests_items}} diff --git a/examples/chip-tool/templates/tests/partials/saveAs/teardownSaveAs.zapt b/examples/chip-tool/templates/tests/partials/saveAs/teardownSaveAs.zapt index 1bd6bd992dce4c..9f0652fafd78e2 100644 --- a/examples/chip-tool/templates/tests/partials/saveAs/teardownSaveAs.zapt +++ b/examples/chip-tool/templates/tests/partials/saveAs/teardownSaveAs.zapt @@ -1,4 +1,5 @@ {{#chip_tests_items}} + {{#chip_tests_item_responses}} {{#chip_tests_item_response_parameters}} {{#if saveAs}} {{#if (isString type)}} @@ -10,4 +11,5 @@ {{/if}} {{/if}} {{/chip_tests_item_response_parameters}} + {{/chip_tests_item_responses}} {{/chip_tests_items}} diff --git a/examples/chip-tool/templates/tests/partials/test_step.zapt b/examples/chip-tool/templates/tests/partials/test_step.zapt index 309011f0e3013f..e4e50f2b68ee4a 100644 --- a/examples/chip-tool/templates/tests/partials/test_step.zapt +++ b/examples/chip-tool/templates/tests/partials/test_step.zapt @@ -6,6 +6,12 @@ {{/if}} {{/inline~}} +{{~#*inline "maybeSetupSubStepCount"}} +{{#if expectMultipleResponses}} + mTestSubStepCount = {{response.length}}; +{{/if}} +{{/inline~}} + {{~#*inline "maybePrepareArguments"}} {{#unless isWait}} {{#if (isTestOnlyCluster cluster)}} @@ -107,5 +113,6 @@ {{! --- Test Step Content --}} LogStep({{index}}, "{{label}}"); {{>maybePICS}} +{{>maybeSetupSubStepCount}} {{>maybePrepareArguments}} {{>maybeBusyWait}} diff --git a/examples/chip-tool/templates/tests/partials/test_step_response.zapt b/examples/chip-tool/templates/tests/partials/test_step_response.zapt index 3957c03d9c1cf2..8ad0fa73f14df4 100644 --- a/examples/chip-tool/templates/tests/partials/test_step_response.zapt +++ b/examples/chip-tool/templates/tests/partials/test_step_response.zapt @@ -1,15 +1,20 @@ -{{~#*inline "maybeCheckClusterError"}} -{{#if response.clusterError}} - VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.HasValue(), true)); - VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.Value(), {{response.clusterError}})); +{{#if expectMultipleResponses}} +switch(mTestSubStepIndex) +{ {{/if}} -{{/inline~}} - +{{#chip_tests_item_responses}} {{~#*inline "maybeContinueWithoutWaitingOnDone"}} {{~#if isWaitForReport}}shouldContinue = true;{{/if~}} {{~#if (isTestOnlyCluster cluster)}}shouldContinue = true;{{/if~}} {{/inline~}} +{{~#*inline "maybeCheckClusterError"}} +{{#if clusterError}} + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.HasValue(), true)); + VerifyOrReturn(CheckValue("clusterStatus", status.mClusterStatus.Value(), {{clusterError}})); +{{/if}} +{{/inline~}} + {{~#*inline "maybeReturnOnUnsupported"}} {{~#if optional}} if (IsUnsupported(status.mStatus)) @@ -21,12 +26,15 @@ {{/inline~}} {{! --- Test Step Response Content --}} -{{#if response.error}} - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), {{response.error}})); +{{#if ../expectMultipleResponses}} + case {{index}}: +{{/if}} +{{#if error}} + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), {{error}})); {{>maybeCheckClusterError}} {{else}} {{>maybeReturnOnUnsupported}} - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), {{response.error}})); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), {{error}})); {{#if hasSpecificResponse}} { {{asDecodableType}} value; @@ -40,3 +48,14 @@ {{/if}} {{/if}} {{>maybeContinueWithoutWaitingOnDone}} +{{#if ../expectMultipleResponses}} + mTestSubStepIndex++; + break; +{{/if}} +{{/chip_tests_item_responses}} +{{#if expectMultipleResponses}} + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; +} +{{/if}} diff --git a/examples/chip-tool/templates/tests/tests.js b/examples/chip-tool/templates/tests/tests.js index 0487a94e93cadd..f468db1b4f860e 100644 --- a/examples/chip-tool/templates/tests/tests.js +++ b/examples/chip-tool/templates/tests/tests.js @@ -536,6 +536,7 @@ function getTests() 'TestClusterComplexTypes', 'TestConstraints', 'TestDelayCommands', + 'TestEvents', 'TestDiscovery', 'TestLogCommands', 'TestSaveAs', diff --git a/src/app/tests/suites/TestEvents.yaml b/src/app/tests/suites/TestEvents.yaml new file mode 100644 index 00000000000000..d8c978af53b92a --- /dev/null +++ b/src/app/tests/suites/TestEvents.yaml @@ -0,0 +1,87 @@ +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Events Tests + +config: + nodeId: 0x12344321 + cluster: "Test Cluster" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Check there is no event on the target endpoint" + command: "readEvent" + event: "TestEvent" + response: + value: {} + + - label: "Check reading events from an invalid endpoint" + command: "readEvent" + event: "TestEvent" + endpoint: 0 + response: + value: {} + + - label: "Generate an event on the accessory" + command: "TestEmitTestEventRequest" + arguments: + values: + - name: "arg1" + value: 1 + - name: "arg2" + value: 2 + - name: "arg3" + value: true + response: + values: + - name: "value" + saveAs: eventNumber + + - label: "Read the event back" + command: "readEvent" + event: "TestEvent" + response: + value: { arg1: 1, arg2: 2, arg3: true } + + - label: "Generate a second event on the accessory" + command: "TestEmitTestEventRequest" + arguments: + values: + - name: "arg1" + value: 3 + - name: "arg2" + value: 4 + - name: "arg3" + value: false + response: + values: + - name: "value" + value: eventNumber + 1 + + - label: "Read the event back" + command: "readEvent" + event: "TestEvent" + response: + - values: + - value: { arg1: 1, arg2: 2, arg3: true } + - values: + - value: { arg1: 3, arg2: 4, arg3: false } diff --git a/src/app/tests/suites/certification/Test_TC_MC_6_4.yaml b/src/app/tests/suites/certification/Test_TC_MC_6_4.yaml index 72c202d2cb7702..488b53d1f6993c 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_6_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_6_4.yaml @@ -65,7 +65,7 @@ tests: response: values: - name: "returnValue" - - value: 0 + value: 0 - label: "log a command" cluster: "LogCommands" @@ -94,7 +94,7 @@ tests: response: values: - name: "returnValue" - - value: 0 + value: 0 - label: "log a command" cluster: "LogCommands" @@ -142,7 +142,7 @@ tests: response: values: - name: "returnValue" - - value: 0 + value: 0 - label: "log a command" cluster: "LogCommands" @@ -165,7 +165,7 @@ tests: response: values: - name: "returnValue" - - value: 0 + value: 0 - label: "log a command" cluster: "LogCommands" diff --git a/src/app/tests/suites/include/TestRunner.h b/src/app/tests/suites/include/TestRunner.h index 05310351b2c425..1c76839a8aaf72 100644 --- a/src/app/tests/suites/include/TestRunner.h +++ b/src/app/tests/suites/include/TestRunner.h @@ -50,7 +50,12 @@ class TestRunner void NextTest() { - CHIP_ERROR err = CHIP_NO_ERROR; + if (mTestSubStepIndex != mTestSubStepCount) + { + Exit(mTestName, CHIP_ERROR_INVALID_ARGUMENT); + } + mTestSubStepIndex = 0; + mTestSubStepCount = 0; if (0 == mTestIndex) { @@ -72,7 +77,7 @@ class TestRunner // command. That way if we lose the timeslice after we send the message // but before our function call returns, we won't end up with an // incorrect mTestIndex value observed when we get the response. - DoTestStep(mTestIndex++); + auto err = DoTestStep(mTestIndex++); if (CHIP_NO_ERROR != err) { Exit(chip::ErrorStr(err)); @@ -84,4 +89,7 @@ class TestRunner const uint16_t mTestCount; std::atomic_uint16_t mTestIndex; chip::Optional mDelayInMs; + + uint16_t mTestSubStepIndex = 0; + uint16_t mTestSubStepCount = 0; }; diff --git a/src/app/zap-templates/common/ClusterTestGeneration.js b/src/app/zap-templates/common/ClusterTestGeneration.js index d4b2d827edf4c8..d013afde283dd6 100644 --- a/src/app/zap-templates/common/ClusterTestGeneration.js +++ b/src/app/zap-templates/common/ClusterTestGeneration.js @@ -247,90 +247,128 @@ function ensureValidError(response, errorName) function setDefaultResponse(test, useSynthesizeWaitForReport) { + // Some of the tests does not have any command defined. + if (!test.command || test.isWait) { + setDefault(test, kResponseName, []); + return; + } + const defaultResponse = {}; setDefault(test, kResponseName, defaultResponse); - const hasResponseError = (kResponseErrorName in test[kResponseName]); + // There is different syntax for expressing the expected response, but in the + // end it needs to be converted to an array of responses. + if (kResponseName in test && !Array.isArray(test[kResponseName])) { + let testValues = {}; - const defaultResponseError = 0; - setDefault(test[kResponseName], kResponseErrorName, defaultResponseError); + const response = test[kResponseName]; - const defaultResponseValues = []; - setDefault(test[kResponseName], kValuesName, defaultResponseValues); + if (kValuesName in response) { + testValues[kValuesName] = response[kValuesName]; + } else if ('value' in response || kConstraintsName in response || kSaveAsName in response) { + let obj = {}; + if ('value' in response) { + obj['value'] = response['value']; + } - // Ensure only valid keywords are used for response values. - const values = test[kResponseName][kValuesName]; - for (let i = 0; i < values.length; i++) { - for (let key in values[i]) { - if (key == "name" || key == "value" || key == kConstraintsName || key == kSaveAsName) { - continue; + if (kConstraintsName in response) { + obj[kConstraintsName] = response[kConstraintsName]; } - const errorStr = `Unknown key "${key}"`; - throwError(test, errorStr); + if (kSaveAsName in response) { + obj[kSaveAsName] = response[kSaveAsName]; + } + + testValues[kValuesName] = [ obj ]; + } else { + testValues[kValuesName] = []; } - } - const defaultResponseConstraints = {}; - setDefault(test[kResponseName], kConstraintsName, defaultResponseConstraints); - - const defaultResponseSaveAs = ''; - setDefault(test[kResponseName], kSaveAsName, defaultResponseSaveAs); - - const hasResponseValue = 'value' in test[kResponseName]; - const hasResponseConstraints = 'constraints' in test[kResponseName] && Object.keys(test[kResponseName].constraints).length; - const hasResponseValueOrConstraints = hasResponseValue || hasResponseConstraints; - - if (test.isCommand && hasResponseValueOrConstraints) { - const errorStr = 'Test has a "value" or a "constraints" defined.\n' + - '\n' + - 'Command should explicitly use the response argument name. Example: \n' + - '- label: "Send Test Specific Command"\n' + - ' command: "testSpecific"\n' + - ' response: \n' + - ' values: \n' + - ' - name: "returnValue"\n' + - ' - value: 7\n'; - throwError(test, errorStr); - } + if (kResponseErrorName in response) { + testValues[kResponseErrorName] = response[kResponseErrorName]; + } - ensureValidError(test[kResponseName], kResponseErrorName); + if ('clusterError' in response) { + testValues['clusterError'] = response['clusterError']; + } - // Step that waits for a particular event does not requires constraints nor expected values. - if (test.isWait) { - return; + test[kResponseName] = [ testValues ]; } - if (!test.isAttribute && !test.isEvent) { - return; - } + // Ensure only valid keywords are used for response values. + test[kResponseName].forEach(response => { + const values = response[kValuesName]; + for (let i = 0; i < values.length; i++) { + for (let key in values[i]) { + if (key == "name" || key == "value" || key == kConstraintsName || key == kSaveAsName) { + continue; + } - if (test.isWriteAttribute || (useSynthesizeWaitForReport && test.isSubscribe)) { - if (hasResponseValueOrConstraints) { - const errorStr = 'Test has a "value" or a "constraints" defined.'; - throwError(test, errorStr); + const errorStr = `Unknown key "${key}" in "${JSON.stringify(values)}"`; + throwError(test, errorStr); + } } + }); - return; + let responseType = ''; + if (test.isCommand) { + responseType = 'command'; + } else if (test.isAttribute) { + responseType = 'attribute'; + } else if (test.isEvent) { + responseType = 'event'; + } else { + const errorStr = 'Unknown response type'; + throwError(response, errorStr); } - if (!hasResponseValueOrConstraints && !hasResponseError) { - console.log(test); - console.log(test[kResponseName]); - const errorStr = 'Test does not have a "value" or a "constraints" defined and is not expecting an error.'; - throwError(test, errorStr); - } + const defaultName = test[responseType]; - if (hasResponseValueOrConstraints) { - const name = test.isAttribute ? test.attribute : test.event; - const response = test[kResponseName]; - const responseValue = hasResponseValue ? { value : response.value } : null; - const constraintsValue = hasResponseConstraints ? { constraints : response.constraints } : null; + test[kResponseName].forEach(response => { + const hasResponseError = (kResponseErrorName in response); - response.values.push({ name, saveAs : response.saveAs, ...responseValue, ...constraintsValue }); - } + const defaultResponseError = 0; + setDefault(response, kResponseErrorName, defaultResponseError); + ensureValidError(response, kResponseErrorName); + + const values = response[kValuesName]; + values.forEach(expectedValue => { + const hasResponseValue = 'value' in expectedValue; + const hasResponseConstraints = (kConstraintsName in expectedValue) && !!Object.keys(expectedValue.constraints).length; + const hasResponseSaveAs = (kSaveAsName in expectedValue); - delete test[kResponseName].value; + if (test.isWriteAttribute || (useSynthesizeWaitForReport && test.isSubscribe)) { + if (hasResponseValue || hasResponseConstraints) { + const errorStr = 'Test has a "value" or a "constraints" defined.'; + throwError(test, errorStr); + } + } + + if (test.isCommand && !('name' in expectedValue)) { + const errorStr = 'Test value does not have a named argument.\n' + + '\n' + + 'Command should explicitly use the response argument name. Example: \n' + + '- label: "Send Test Specific Command"\n' + + ' command: "testSpecific"\n' + + ' response: \n' + + ' values: \n' + + ' - name: "returnValue"\n' + + ' - value: 7\n'; + throwError(test, errorStr); + } + + setDefault(expectedValue, 'name', defaultName); + }); + + test.expectMultipleResponses = test[kResponseName].length > 1; + + setDefault(response, kCommandName, test.command); + setDefault(response, responseType, test[responseType]); + setDefault(response, kClusterName, test.cluster); + setDefault(response, 'optional', test.optional || false); + setDefault(response, 'async', test.async || false); + setDefaultType(response); + }); } function setDefaults(test, defaultConfig, useSynthesizeWaitForReport) @@ -496,6 +534,26 @@ function chip_tests_pics(options) return templateUtil.collectBlocks(PICS.getAll(), options, this); } +async function configureTestItem(item) +{ + if (item.isCommand) { + let command = await assertCommandOrAttributeOrEvent(item); + item.commandObject = command; + item.hasSpecificArguments = true; + item.hasSpecificResponse = command.hasSpecificResponse || false; + } else if (item.isAttribute) { + let attr = await assertCommandOrAttributeOrEvent(item); + item.attributeObject = attr; + item.hasSpecificArguments = item.isWriteAttribute || false; + item.hasSpecificResponse = item.isReadAttribute || item.isSubscribeAttribute || item.isWaitForReport || false; + } else if (item.isEvent) { + let evt = await assertCommandOrAttributeOrEvent(item); + item.eventObject = evt; + item.hasSpecificArguments = false; + item.hasSpecificResponse = true; + } +} + async function chip_tests(list, options) { // Set a global on our items so assertCommandOrAttributeOrEvent can work. @@ -508,22 +566,12 @@ async function chip_tests(list, options) tests = await Promise.all(tests.map(async function(test) { test.tests = await Promise.all(test.tests.map(async function(item) { item.global = global; - if (item.isCommand) { - let command = await assertCommandOrAttributeOrEvent(item); - item.commandObject = command; - item.hasSpecificArguments = true; - item.hasSpecificResponse = command.hasSpecificResponse; - } else if (item.isAttribute) { - let attr = await assertCommandOrAttributeOrEvent(item); - item.attributeObject = attr; - item.hasSpecificArguments = item.isWriteAttribute; - item.hasSpecificResponse = item.isReadAttribute || item.isSubscribeAttribute || item.isWaitForReport; - } else if (item.isEvent) { - let evt = await assertCommandOrAttributeOrEvent(item); - item.eventObject = evt; - item.hasSpecificArguments = false; - item.hasSpecificResponse = true; + await configureTestItem(item); + + if (kResponseName in item) { + await Promise.all(item[kResponseName].map(response => configureTestItem(response))); } + return item; })); @@ -708,9 +756,14 @@ function chip_tests_item_parameters(options) return asBlocks.call(this, promise, options); } +function chip_tests_item_responses(options) +{ + return templateUtil.collectBlocks(this[kResponseName], options, this); +} + function chip_tests_item_response_parameters(options) { - const responseValues = this.response.values.slice(); + const responseValues = this.values.slice(); const promise = assertCommandOrAttributeOrEvent(this).then(item => { if (this.isWriteAttribute) { @@ -831,6 +884,7 @@ exports.chip_tests = chip_tests; exports.chip_tests_items = chip_tests_items; exports.chip_tests_item_has_list = chip_tests_item_has_list; exports.chip_tests_item_parameters = chip_tests_item_parameters; +exports.chip_tests_item_responses = chip_tests_item_responses; exports.chip_tests_item_response_parameters = chip_tests_item_response_parameters; exports.chip_tests_pics = chip_tests_pics; exports.chip_tests_config = chip_tests_config; diff --git a/src/app/zap-templates/common/variables/Variables.js b/src/app/zap-templates/common/variables/Variables.js index bbf33c99e5890c..978661cebc59cc 100644 --- a/src/app/zap-templates/common/variables/Variables.js +++ b/src/app/zap-templates/common/variables/Variables.js @@ -109,17 +109,19 @@ async function extractVariablesFromTests(context, suite) { let variables = {}; suite.tests.forEach(test => { - test.response.values.filter(value => value.saveAs).forEach(saveAsValue => { - const key = saveAsValue.saveAs; - if (key in variables) { - throwError(test, `Variable with name: ${key} is already registered.`); - } - - if (!test.isCommand && !test.isAttribute) { - throwError(test, `Variable support for step ${test} is not supported. Only commands and attributes are supported.`); - } - - variables[key] = { test, name : saveAsValue.name }; + test.response.forEach(response => { + response.values.filter(value => value.saveAs).forEach(saveAsValue => { + const key = saveAsValue.saveAs; + if (key in variables) { + throwError(test, `Variable with name: ${key} is already registered.`); + } + + if (!test.isCommand && !test.isAttribute) { + throwError(test, `Variable support for step ${test} is not supported. Only commands and attributes are supported.`); + } + + variables[key] = { test, name : saveAsValue.name }; + }); }); }); diff --git a/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt b/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt index 2d6567a39b9dc6..c6b388389700ca 100644 --- a/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt +++ b/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt @@ -3,11 +3,13 @@ {{#if async}} bool testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase command}}_Fulfilled = false; {{/if}} +{{#chip_tests_item_responses}} {{#chip_tests_item_response_parameters}} {{#if saveAs}} {{asObjectiveCType type ../cluster}} {{saveAs}}; {{/if}} {{/chip_tests_item_response_parameters}} +{{/chip_tests_item_responses}} {{~#*inline "subscribeDataCallback"}} test_{{parent.filename}}_{{attribute}}_Reported @@ -86,7 +88,8 @@ ResponseHandler {{> subscribeDataCallback}} = nil; {{/chip_tests_item_parameters}} [cluster writeAttribute{{asUpperCamelCase attribute}}WithValue:{{#chip_tests_item_parameters}}{{asLowerCamelCase name}}Argument{{/chip_tests_item_parameters}} completionHandler:^(NSError * _Nullable err) { {{/if}} - NSLog(@"{{label}} Error: %@", err); + {{#chip_tests_item_responses}} + NSLog(@"{{../label}} Error: %@", err); {{#if optional}} if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { @@ -95,8 +98,8 @@ ResponseHandler {{> subscribeDataCallback}} = nil; } {{/if}} - {{#if response.error}} - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], {{response.error}}); + {{#if error}} + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], {{error}}); [expectation fulfill]; {{else}} XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -211,7 +214,7 @@ ResponseHandler {{> subscribeDataCallback}} = nil; {{#unless async}} [expectation fulfill]; {{else}} - testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase command}}_Fulfilled = true; + testSendCluster{{parent.filename}}_{{asTestIndex ../index}}_{{asUpperCamelCase command}}_Fulfilled = true; {{/unless}} {{else}} {{! We're a subscription }} @@ -222,6 +225,7 @@ ResponseHandler {{> subscribeDataCallback}} = nil; } {{/unless}} {{/if}} + {{/chip_tests_item_responses}} }{{#unless isWaitForReport}}]{{/unless}}; {{/if}} diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index d9b9cd7da43def..5a8d514cbac275 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -196,6 +196,7 @@ class TestList : public Command printf("TestClusterComplexTypes\n"); printf("TestConstraints\n"); printf("TestDelayCommands\n"); + printf("TestEvents\n"); printf("TestDiscovery\n"); printf("TestLogCommands\n"); printf("TestSaveAs\n"); @@ -38022,6 +38023,187 @@ class TestDelayCommandsSuite : public TestCommand } }; +class TestEventsSuite : public TestCommand +{ +public: + TestEventsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestEvents", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestEventsSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint64_t eventNumber; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Commands::TestEmitTestEventResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + + eventNumber = value.value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 1)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 2)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, true)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Commands::TestEmitTestEventResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, eventNumber + 1)); + } + break; + case 6: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 1)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 2)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, true)); + } + mTestSubStepIndex++; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 3)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 4)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, false)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 1: { + LogStep(1, "Check there is no event on the target endpoint"); + return ReadEvent(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Events::TestEvent::Id, false + + ); + } + case 2: { + LogStep(2, "Check reading events from an invalid endpoint"); + return ReadEvent(kIdentityAlpha, GetEndpoint(0), TestCluster::Id, TestCluster::Events::TestEvent::Id, false + + ); + } + case 3: { + LogStep(3, "Generate an event on the accessory"); + chip::app::Clusters::TestCluster::Commands::TestEmitTestEventRequest::Type value; + value.arg1 = 1; + value.arg2 = static_cast(2); + value.arg3 = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Commands::TestEmitTestEventRequest::Id, + value); + } + case 4: { + LogStep(4, "Read the event back"); + return ReadEvent(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Events::TestEvent::Id, false + + ); + } + case 5: { + LogStep(5, "Generate a second event on the accessory"); + chip::app::Clusters::TestCluster::Commands::TestEmitTestEventRequest::Type value; + value.arg1 = 3; + value.arg2 = static_cast(4); + value.arg3 = false; + return SendCommand(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Commands::TestEmitTestEventRequest::Id, + value); + } + case 6: { + LogStep(6, "Read the event back"); + mTestSubStepCount = 2; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Events::TestEvent::Id, false + + ); + } + } + return CHIP_NO_ERROR; + } +}; + class TestDiscoverySuite : public TestCommand { public: @@ -57049,6 +57231,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), From 4b985dd79ca9cb3d5083f35868c11d9857d45c6a Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Wed, 27 Apr 2022 10:34:48 -0700 Subject: [PATCH 10/59] Fix missing data version parameter pass in EncodeAttribute (#17801) * Fix missing data version parameter pass in EncodeAttribute * address comments --- src/app/WriteClient.h | 2 +- src/app/tests/TestWriteInteraction.cpp | 120 ++++++++++++++++++++++++- 2 files changed, 117 insertions(+), 5 deletions(-) diff --git a/src/app/WriteClient.h b/src/app/WriteClient.h index 0fd3e8466e1590..7360d4566f23eb 100644 --- a/src/app/WriteClient.h +++ b/src/app/WriteClient.h @@ -197,7 +197,7 @@ class WriteClient : public Messaging::ExchangeDelegate value); } - return EncodeAttribute(attributePath, value.Value()); + return EncodeAttribute(attributePath, value.Value(), aDataVersion); } /** diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index 32ded140075031..194f28725909f3 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -38,10 +38,11 @@ using TestContext = chip::Test::AppContext; namespace { uint8_t attributeDataTLV[CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE]; -size_t attributeDataTLVLen = 0; - -constexpr uint16_t kMaxGroupsPerFabric = 5; -constexpr uint16_t kMaxGroupKeysPerFabric = 8; +size_t attributeDataTLVLen = 0; +constexpr chip::DataVersion kRejectedDataVersion = 1; +constexpr chip::DataVersion kAcceptedDataVersion = 5; +constexpr uint16_t kMaxGroupsPerFabric = 5; +constexpr uint16_t kMaxGroupKeysPerFabric = 8; chip::TestPersistentStorageDelegate gTestStorage; chip::Credentials::GroupDataProviderImpl gGroupsProvider(kMaxGroupsPerFabric, kMaxGroupKeysPerFabric); @@ -57,6 +58,8 @@ class TestWriteInteraction static void TestWriteHandler(nlTestSuite * apSuite, void * apContext); static void TestWriteRoundtrip(nlTestSuite * apSuite, void * apContext); static void TestWriteRoundtripWithClusterObjects(nlTestSuite * apSuite, void * apContext); + static void TestWriteRoundtripWithClusterObjectsVersionMatch(nlTestSuite * apSuite, void * apContext); + static void TestWriteRoundtripWithClusterObjectsVersionMismatch(nlTestSuite * apSuite, void * apContext); private: static void AddAttributeDataIB(nlTestSuite * apSuite, void * apContext, WriteClient & aWriteClient); @@ -83,6 +86,7 @@ class TestWriteClientCallback : public chip::app::WriteClient::Callback void ResetCounter() { mOnSuccessCalled = mOnErrorCalled = mOnDoneCalled = 0; } void OnResponse(const WriteClient * apWriteClient, const chip::app::ConcreteDataAttributePath & path, StatusIB status) override { + mStatus = status; mOnSuccessCalled++; } void OnError(const WriteClient * apWriteClient, CHIP_ERROR chipError) override { mOnErrorCalled++; } @@ -91,6 +95,7 @@ class TestWriteClientCallback : public chip::app::WriteClient::Callback int mOnSuccessCalled = 0; int mOnErrorCalled = 0; int mOnDoneCalled = 0; + StatusIB mStatus; }; void TestWriteInteraction::AddAttributeDataIB(nlTestSuite * apSuite, void * apContext, WriteClient & aWriteClient) @@ -330,6 +335,11 @@ const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePat CHIP_ERROR WriteSingleClusterData(const Access::SubjectDescriptor & aSubjectDescriptor, const ConcreteDataAttributePath & aPath, TLV::TLVReader & aReader, WriteHandler * aWriteHandler) { + if (aPath.mDataVersion.HasValue() && aPath.mDataVersion.Value() == kRejectedDataVersion) + { + return aWriteHandler->AddStatus(aPath, Protocols::InteractionModel::Status::DataVersionMismatch); + } + TLV::TLVWriter writer; writer.Init(attributeDataTLV); writer.CopyElement(TLV::AnonymousTag(), aReader); @@ -405,6 +415,106 @@ void TestWriteInteraction::TestWriteRoundtripWithClusterObjects(nlTestSuite * ap engine->Shutdown(); } +void TestWriteInteraction::TestWriteRoundtripWithClusterObjectsVersionMatch(nlTestSuite * apSuite, void * apContext) +{ + TestContext & ctx = *static_cast(apContext); + + CHIP_ERROR err = CHIP_NO_ERROR; + + Messaging::ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr(); + // Shouldn't have anything in the retransmit table when starting the test. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + + TestWriteClientCallback callback; + auto * engine = chip::app::InteractionModelEngine::GetInstance(); + err = engine->Init(&ctx.GetExchangeManager(), &ctx.GetFabricTable()); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + app::WriteClient writeClient(engine->GetExchangeManager(), &callback, Optional::Missing()); + + System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); + + AttributePathParams attributePathParams; + attributePathParams.mEndpointId = 2; + attributePathParams.mClusterId = 3; + attributePathParams.mAttributeId = 4; + + DataModel::Nullable dataTx; + + Optional version(kAcceptedDataVersion); + + writeClient.EncodeAttribute(attributePathParams, dataTx, version); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + NL_TEST_ASSERT(apSuite, callback.mOnSuccessCalled == 0); + + err = writeClient.SendWriteRequest(ctx.GetSessionBobToAlice()); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + ctx.DrainAndServiceIO(); + + NL_TEST_ASSERT(apSuite, + callback.mOnSuccessCalled == 1 && callback.mOnErrorCalled == 0 && callback.mOnDoneCalled == 1 && + callback.mStatus.mStatus == Protocols::InteractionModel::Status::Success); + + // By now we should have closed all exchanges and sent all pending acks, so + // there should be no queued-up things in the retransmit table. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + + engine->Shutdown(); +} + +void TestWriteInteraction::TestWriteRoundtripWithClusterObjectsVersionMismatch(nlTestSuite * apSuite, void * apContext) +{ + TestContext & ctx = *static_cast(apContext); + + CHIP_ERROR err = CHIP_NO_ERROR; + + Messaging::ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr(); + // Shouldn't have anything in the retransmit table when starting the test. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + + TestWriteClientCallback callback; + auto * engine = chip::app::InteractionModelEngine::GetInstance(); + err = engine->Init(&ctx.GetExchangeManager(), &ctx.GetFabricTable()); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + app::WriteClient writeClient(engine->GetExchangeManager(), &callback, Optional::Missing()); + + System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); + + AttributePathParams attributePathParams; + attributePathParams.mEndpointId = 2; + attributePathParams.mClusterId = 3; + attributePathParams.mAttributeId = 4; + + app::Clusters::TestCluster::Structs::SimpleStruct::Type dataTxValue; + dataTxValue.a = 12; + dataTxValue.b = true; + DataModel::Nullable dataTx; + dataTx.SetNonNull(dataTxValue); + Optional version(kRejectedDataVersion); + writeClient.EncodeAttribute(attributePathParams, dataTx, version); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + NL_TEST_ASSERT(apSuite, callback.mOnSuccessCalled == 0); + + err = writeClient.SendWriteRequest(ctx.GetSessionBobToAlice()); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + ctx.DrainAndServiceIO(); + + NL_TEST_ASSERT(apSuite, + callback.mOnSuccessCalled == 1 && callback.mOnErrorCalled == 0 && callback.mOnDoneCalled == 1 && + callback.mStatus.mStatus == Protocols::InteractionModel::Status::DataVersionMismatch); + + // By now we should have closed all exchanges and sent all pending acks, so + // there should be no queued-up things in the retransmit table. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + + engine->Shutdown(); +} + void TestWriteInteraction::TestWriteRoundtrip(nlTestSuite * apSuite, void * apContext) { TestContext & ctx = *static_cast(apContext); @@ -458,6 +568,8 @@ const nlTest sTests[] = NL_TEST_DEF("CheckWriteHandler", chip::app::TestWriteInteraction::TestWriteHandler), NL_TEST_DEF("CheckWriteRoundtrip", chip::app::TestWriteInteraction::TestWriteRoundtrip), NL_TEST_DEF("TestWriteRoundtripWithClusterObjects", chip::app::TestWriteInteraction::TestWriteRoundtripWithClusterObjects), + NL_TEST_DEF("TestWriteRoundtripWithClusterObjectsVersionMatch", chip::app::TestWriteInteraction::TestWriteRoundtripWithClusterObjectsVersionMatch), + NL_TEST_DEF("TestWriteRoundtripWithClusterObjectsVersionMismatch", chip::app::TestWriteInteraction::TestWriteRoundtripWithClusterObjectsVersionMismatch), NL_TEST_SENTINEL() }; // clang-format on From 4432d08518a63c8b213d1fe56299a3151829085a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 27 Apr 2022 13:42:10 -0400 Subject: [PATCH 11/59] Ignore non-context tags in IM encoding instead of erroring out. (#17665) We don't want to preclude future encoding evolution using non-context tags here (or expanding the set of what's considered to be a context tag in some way that would not be detected as a context tag by downrev code). --- src/app/MessageDef/AttributeDataIB.cpp | 5 +- src/app/MessageDef/AttributePathIB.cpp | 5 +- src/app/MessageDef/AttributeReportIB.cpp | 5 +- src/app/MessageDef/AttributeStatusIB.cpp | 5 +- src/app/MessageDef/ClusterPathIB.cpp | 5 +- src/app/MessageDef/CommandDataIB.cpp | 5 +- src/app/MessageDef/CommandPathIB.cpp | 5 +- src/app/MessageDef/CommandStatusIB.cpp | 5 +- src/app/MessageDef/DataVersionFilterIB.cpp | 5 +- src/app/MessageDef/EventDataIB.cpp | 5 +- src/app/MessageDef/EventFilterIB.cpp | 5 +- src/app/MessageDef/EventPathIB.cpp | 5 +- src/app/MessageDef/EventReportIB.cpp | 5 +- src/app/MessageDef/EventStatusIB.cpp | 5 +- src/app/MessageDef/InvokeRequestMessage.cpp | 5 +- src/app/MessageDef/InvokeResponseIB.cpp | 5 +- src/app/MessageDef/InvokeResponseMessage.cpp | 5 +- src/app/MessageDef/ReadRequestMessage.cpp | 5 +- src/app/MessageDef/ReportDataMessage.cpp | 5 +- src/app/MessageDef/StatusIB.cpp | 10 +- src/app/MessageDef/StatusResponseMessage.cpp | 5 +- src/app/MessageDef/StructParser.cpp | 6 +- .../MessageDef/SubscribeRequestMessage.cpp | 5 +- .../MessageDef/SubscribeResponseMessage.cpp | 5 +- src/app/MessageDef/TimedRequestMessage.cpp | 5 +- src/app/MessageDef/WriteRequestMessage.cpp | 5 +- src/app/MessageDef/WriteResponseMessage.cpp | 5 +- .../partials/cluster-objects-struct.zapt | 5 +- .../templates/app/cluster-objects-src.zapt | 10 +- .../zap-generated/cluster-objects.cpp | 2325 +++++++++++++---- 30 files changed, 1985 insertions(+), 496 deletions(-) diff --git a/src/app/MessageDef/AttributeDataIB.cpp b/src/app/MessageDef/AttributeDataIB.cpp index 31610bdee8bb70..072b5671ad5059 100644 --- a/src/app/MessageDef/AttributeDataIB.cpp +++ b/src/app/MessageDef/AttributeDataIB.cpp @@ -198,7 +198,10 @@ CHIP_ERROR AttributeDataIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/AttributePathIB.cpp b/src/app/MessageDef/AttributePathIB.cpp index 63e5b907639c14..c8fbb03e67a7a2 100644 --- a/src/app/MessageDef/AttributePathIB.cpp +++ b/src/app/MessageDef/AttributePathIB.cpp @@ -44,7 +44,10 @@ CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/AttributeReportIB.cpp b/src/app/MessageDef/AttributeReportIB.cpp index 502a9816613de7..40add8b660cdea 100644 --- a/src/app/MessageDef/AttributeReportIB.cpp +++ b/src/app/MessageDef/AttributeReportIB.cpp @@ -43,7 +43,10 @@ CHIP_ERROR AttributeReportIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/AttributeStatusIB.cpp b/src/app/MessageDef/AttributeStatusIB.cpp index c6124ed3c2669e..9a3bf1ee980dc0 100644 --- a/src/app/MessageDef/AttributeStatusIB.cpp +++ b/src/app/MessageDef/AttributeStatusIB.cpp @@ -42,7 +42,10 @@ CHIP_ERROR AttributeStatusIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/ClusterPathIB.cpp b/src/app/MessageDef/ClusterPathIB.cpp index 8147f0151f6149..a7105263dc5e9b 100644 --- a/src/app/MessageDef/ClusterPathIB.cpp +++ b/src/app/MessageDef/ClusterPathIB.cpp @@ -40,7 +40,10 @@ CHIP_ERROR ClusterPathIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/CommandDataIB.cpp b/src/app/MessageDef/CommandDataIB.cpp index cd75c24ce35fa9..5f24d1c828da2a 100644 --- a/src/app/MessageDef/CommandDataIB.cpp +++ b/src/app/MessageDef/CommandDataIB.cpp @@ -214,7 +214,10 @@ CHIP_ERROR CommandDataIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) diff --git a/src/app/MessageDef/CommandPathIB.cpp b/src/app/MessageDef/CommandPathIB.cpp index 56004aab0efcd5..f947b221083812 100644 --- a/src/app/MessageDef/CommandPathIB.cpp +++ b/src/app/MessageDef/CommandPathIB.cpp @@ -45,7 +45,10 @@ CHIP_ERROR CommandPathIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrExit(chip::TLV::IsContextTag(reader.GetTag()), err = CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (chip::TLV::TagNumFromTag(reader.GetTag())) { case kCsTag_EndpointId: diff --git a/src/app/MessageDef/CommandStatusIB.cpp b/src/app/MessageDef/CommandStatusIB.cpp index 463b495e44538c..8be31797735ef6 100644 --- a/src/app/MessageDef/CommandStatusIB.cpp +++ b/src/app/MessageDef/CommandStatusIB.cpp @@ -42,7 +42,10 @@ CHIP_ERROR CommandStatusIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/DataVersionFilterIB.cpp b/src/app/MessageDef/DataVersionFilterIB.cpp index f7826c7d52f73c..c68db041297d8e 100644 --- a/src/app/MessageDef/DataVersionFilterIB.cpp +++ b/src/app/MessageDef/DataVersionFilterIB.cpp @@ -46,7 +46,10 @@ CHIP_ERROR DataVersionFilterIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/EventDataIB.cpp b/src/app/MessageDef/EventDataIB.cpp index b1343f4357d795..5e8a076b69b4e0 100644 --- a/src/app/MessageDef/EventDataIB.cpp +++ b/src/app/MessageDef/EventDataIB.cpp @@ -193,7 +193,10 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/EventFilterIB.cpp b/src/app/MessageDef/EventFilterIB.cpp index 8eab8ffa92d69b..5fc1824d7a7d07 100644 --- a/src/app/MessageDef/EventFilterIB.cpp +++ b/src/app/MessageDef/EventFilterIB.cpp @@ -46,7 +46,10 @@ CHIP_ERROR EventFilterIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/EventPathIB.cpp b/src/app/MessageDef/EventPathIB.cpp index a2e4f789012c40..3a2e13b1d84eda 100644 --- a/src/app/MessageDef/EventPathIB.cpp +++ b/src/app/MessageDef/EventPathIB.cpp @@ -43,7 +43,10 @@ CHIP_ERROR EventPathIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/EventReportIB.cpp b/src/app/MessageDef/EventReportIB.cpp index 8dac9c789db944..b9ac47d75da332 100644 --- a/src/app/MessageDef/EventReportIB.cpp +++ b/src/app/MessageDef/EventReportIB.cpp @@ -43,7 +43,10 @@ CHIP_ERROR EventReportIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/EventStatusIB.cpp b/src/app/MessageDef/EventStatusIB.cpp index 536f28b703f8b5..84188a16370f9d 100644 --- a/src/app/MessageDef/EventStatusIB.cpp +++ b/src/app/MessageDef/EventStatusIB.cpp @@ -42,7 +42,10 @@ CHIP_ERROR EventStatusIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/InvokeRequestMessage.cpp b/src/app/MessageDef/InvokeRequestMessage.cpp index 54bd6670a4cbd2..2610a4d4e7ca5a 100644 --- a/src/app/MessageDef/InvokeRequestMessage.cpp +++ b/src/app/MessageDef/InvokeRequestMessage.cpp @@ -40,7 +40,10 @@ CHIP_ERROR InvokeRequestMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/InvokeResponseIB.cpp b/src/app/MessageDef/InvokeResponseIB.cpp index 5ce38453e5e66a..d28dc49ccad6e3 100644 --- a/src/app/MessageDef/InvokeResponseIB.cpp +++ b/src/app/MessageDef/InvokeResponseIB.cpp @@ -40,7 +40,10 @@ CHIP_ERROR InvokeResponseIB::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/InvokeResponseMessage.cpp b/src/app/MessageDef/InvokeResponseMessage.cpp index c36e76abfdefc3..80c22a960a5f91 100644 --- a/src/app/MessageDef/InvokeResponseMessage.cpp +++ b/src/app/MessageDef/InvokeResponseMessage.cpp @@ -40,7 +40,10 @@ CHIP_ERROR InvokeResponseMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/ReadRequestMessage.cpp b/src/app/MessageDef/ReadRequestMessage.cpp index 97d2a2abb88105..0f25328584e7f6 100644 --- a/src/app/MessageDef/ReadRequestMessage.cpp +++ b/src/app/MessageDef/ReadRequestMessage.cpp @@ -40,7 +40,10 @@ CHIP_ERROR ReadRequestMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/ReportDataMessage.cpp b/src/app/MessageDef/ReportDataMessage.cpp index 51d6b678a3fe00..6a244896ce454b 100644 --- a/src/app/MessageDef/ReportDataMessage.cpp +++ b/src/app/MessageDef/ReportDataMessage.cpp @@ -52,7 +52,10 @@ CHIP_ERROR ReportDataMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/StatusIB.cpp b/src/app/MessageDef/StatusIB.cpp index 37fbca49cab78b..7707011dfb017e 100644 --- a/src/app/MessageDef/StatusIB.cpp +++ b/src/app/MessageDef/StatusIB.cpp @@ -45,7 +45,10 @@ CHIP_ERROR StatusIB::Parser::DecodeStatusIB(StatusIB & aStatusIB) const reader.Init(mReader); while (CHIP_NO_ERROR == reader.Next()) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Tag::kStatus): @@ -75,7 +78,10 @@ CHIP_ERROR StatusIB::Parser::CheckSchemaValidity() const reader.Init(mReader); while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } if (!(TagPresenceMask & (1 << to_underlying(Tag::kStatus)))) { TagPresenceMask |= (1 << to_underlying(Tag::kStatus)); diff --git a/src/app/MessageDef/StatusResponseMessage.cpp b/src/app/MessageDef/StatusResponseMessage.cpp index d0a605e1c47d98..0b09592f015bb6 100644 --- a/src/app/MessageDef/StatusResponseMessage.cpp +++ b/src/app/MessageDef/StatusResponseMessage.cpp @@ -36,7 +36,10 @@ CHIP_ERROR StatusResponseMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Tag::kStatus): diff --git a/src/app/MessageDef/StructParser.cpp b/src/app/MessageDef/StructParser.cpp index c1886939ce5993..b6150b677efe25 100644 --- a/src/app/MessageDef/StructParser.cpp +++ b/src/app/MessageDef/StructParser.cpp @@ -36,7 +36,11 @@ CHIP_ERROR StructParser::CheckSchemaOrdering() const bool first = true; while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + // Just skip over non-context tags, for forward compat. + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); if (first || (preTagNum < tagNum)) { diff --git a/src/app/MessageDef/SubscribeRequestMessage.cpp b/src/app/MessageDef/SubscribeRequestMessage.cpp index f0098b53fd8248..a30f577a3ad61b 100644 --- a/src/app/MessageDef/SubscribeRequestMessage.cpp +++ b/src/app/MessageDef/SubscribeRequestMessage.cpp @@ -34,7 +34,10 @@ CHIP_ERROR SubscribeRequestMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/SubscribeResponseMessage.cpp b/src/app/MessageDef/SubscribeResponseMessage.cpp index 99a18e734b6166..f422395f8e5aef 100644 --- a/src/app/MessageDef/SubscribeResponseMessage.cpp +++ b/src/app/MessageDef/SubscribeResponseMessage.cpp @@ -33,7 +33,10 @@ CHIP_ERROR SubscribeResponseMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/TimedRequestMessage.cpp b/src/app/MessageDef/TimedRequestMessage.cpp index 0b3041a44d6923..957cd5e4d6c905 100644 --- a/src/app/MessageDef/TimedRequestMessage.cpp +++ b/src/app/MessageDef/TimedRequestMessage.cpp @@ -33,7 +33,10 @@ CHIP_ERROR TimedRequestMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/WriteRequestMessage.cpp b/src/app/MessageDef/WriteRequestMessage.cpp index df586e55077b32..b367530711d097 100644 --- a/src/app/MessageDef/WriteRequestMessage.cpp +++ b/src/app/MessageDef/WriteRequestMessage.cpp @@ -45,7 +45,10 @@ CHIP_ERROR WriteRequestMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/MessageDef/WriteResponseMessage.cpp b/src/app/MessageDef/WriteResponseMessage.cpp index d0b70644037d6a..5beaed04e87a11 100644 --- a/src/app/MessageDef/WriteResponseMessage.cpp +++ b/src/app/MessageDef/WriteResponseMessage.cpp @@ -40,7 +40,10 @@ CHIP_ERROR WriteResponseMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), err = CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); switch (tagNum) { diff --git a/src/app/zap-templates/partials/cluster-objects-struct.zapt b/src/app/zap-templates/partials/cluster-objects-struct.zapt index 67f6e5732c8e7e..2939e4c375a664 100644 --- a/src/app/zap-templates/partials/cluster-objects-struct.zapt +++ b/src/app/zap-templates/partials/cluster-objects-struct.zapt @@ -119,7 +119,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader &reader) { err = reader.EnterContainer(outer); ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { {{#zcl_struct_items}} diff --git a/src/app/zap-templates/templates/app/cluster-objects-src.zapt b/src/app/zap-templates/templates/app/cluster-objects-src.zapt index be048a3e15d1fc..1d1c070e9e2652 100644 --- a/src/app/zap-templates/templates/app/cluster-objects-src.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects-src.zapt @@ -50,7 +50,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader &reader) { VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { {{#zcl_command_arguments}} @@ -111,7 +114,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader &reader) { VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { {{#zcl_event_fields}} diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index bfe5c28aa688f2..4602c3c8be6bfa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -46,7 +46,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLabel): @@ -363,7 +366,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kIdentifyTime): @@ -397,7 +403,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTimeout): @@ -430,7 +439,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -462,7 +474,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEffectIdentifier): @@ -543,7 +558,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -581,7 +599,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -618,7 +639,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -654,7 +678,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -694,7 +721,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupList): @@ -729,7 +759,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCapacity): @@ -766,7 +799,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -801,7 +837,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -837,7 +876,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -869,7 +911,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -948,7 +993,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kClusterId): @@ -998,7 +1046,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -1046,7 +1097,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -1087,7 +1141,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -1130,7 +1187,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -1180,7 +1240,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -1219,7 +1282,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -1259,7 +1325,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -1294,7 +1363,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -1332,7 +1404,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -1371,7 +1446,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -1413,7 +1491,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -1453,7 +1534,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -1491,7 +1575,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -1542,7 +1629,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -1590,7 +1680,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -1631,7 +1724,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -1674,7 +1770,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -1727,7 +1826,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMode): @@ -1775,7 +1877,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -1869,7 +1974,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -1899,7 +2007,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -1929,7 +2040,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -1961,7 +2075,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEffectId): @@ -1997,7 +2114,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -2030,7 +2150,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kOnOffControl): @@ -2168,7 +2291,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLevel): @@ -2214,7 +2340,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMoveMode): @@ -2261,7 +2390,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStepMode): @@ -2308,7 +2440,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kOptionMask): @@ -2346,7 +2481,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLevel): @@ -2384,7 +2522,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMoveMode): @@ -2423,7 +2564,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStepMode): @@ -2462,7 +2606,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -2573,7 +2720,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAlarmCode): @@ -2611,7 +2761,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAlarmCode): @@ -2647,7 +2800,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -2681,7 +2837,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -2723,7 +2882,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -2753,7 +2915,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -2959,7 +3124,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3006,7 +3174,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEnergyPhaseId): @@ -3052,7 +3223,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEnergyPhaseId): @@ -3106,7 +3280,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3144,7 +3321,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTotalProfileNum): @@ -3186,7 +3366,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -3221,7 +3404,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTotalProfileNum): @@ -3268,7 +3454,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3313,7 +3502,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileCount): @@ -3353,7 +3545,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCurrency): @@ -3393,7 +3588,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3430,7 +3628,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3472,7 +3673,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileCount): @@ -3512,7 +3716,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3551,7 +3758,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -3582,7 +3792,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3616,7 +3829,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3650,7 +3866,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3687,7 +3906,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3731,7 +3953,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3777,7 +4002,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3819,7 +4047,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3861,7 +4092,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPowerProfileId): @@ -3904,7 +4138,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kOptions): @@ -3996,7 +4233,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCommandId): @@ -4033,7 +4273,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kApplianceStatus): @@ -4072,7 +4315,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -4106,7 +4352,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kApplianceStatus): @@ -4148,7 +4397,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kFunctionId): @@ -4187,7 +4439,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -4217,7 +4472,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -4248,7 +4506,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kWarningEvent): @@ -4366,7 +4627,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kType): @@ -4474,7 +4738,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNode): @@ -4567,7 +4834,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCluster): @@ -4640,7 +4910,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPrivilege): @@ -4707,7 +4980,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kData): @@ -4800,7 +5076,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAdminNodeID): @@ -4851,7 +5130,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAdminNodeID): @@ -4902,7 +5184,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -4934,7 +5219,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStartFastPolling): @@ -4970,7 +5258,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -5002,7 +5293,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNewLongPollInterval): @@ -5037,7 +5331,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNewShortPollInterval): @@ -5134,7 +5431,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5189,7 +5489,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEndpointListID): @@ -5238,7 +5541,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5277,7 +5583,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5318,7 +5627,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5357,7 +5669,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5398,7 +5713,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5436,7 +5754,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5475,7 +5796,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5516,7 +5840,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5554,7 +5881,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5593,7 +5923,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5634,7 +5967,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5673,7 +6009,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5755,7 +6094,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5798,7 +6140,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActionID): @@ -5850,7 +6195,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCaseSessionsPerFabric): @@ -5891,7 +6239,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -6013,7 +6364,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSoftwareVersion): @@ -6046,7 +6400,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -6076,7 +6433,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -6107,7 +6467,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kReachableNewValue): @@ -6157,7 +6520,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kVendorId): @@ -6221,7 +6587,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -6277,7 +6646,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUpdateToken): @@ -6315,7 +6687,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAction): @@ -6353,7 +6728,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUpdateToken): @@ -6442,7 +6820,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kProviderNodeID): @@ -6492,7 +6873,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kProviderNodeId): @@ -6585,7 +6969,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPreviousState): @@ -6629,7 +7016,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSoftwareVersion): @@ -6669,7 +7059,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSoftwareVersion): @@ -6888,7 +7281,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCurrent): @@ -6929,7 +7325,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCurrent): @@ -6970,7 +7369,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCurrent): @@ -7143,7 +7545,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kFailSafeExpiryLengthSeconds): @@ -7184,7 +7589,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kExpiryLengthSeconds): @@ -7222,7 +7630,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kErrorCode): @@ -7262,7 +7673,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNewRegulatoryConfig): @@ -7303,7 +7717,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kErrorCode): @@ -7339,7 +7756,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -7371,7 +7791,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kErrorCode): @@ -7461,7 +7884,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNetworkID): @@ -7508,7 +7934,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPanId): @@ -7571,7 +8000,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSecurity): @@ -7626,7 +8058,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSsid): @@ -7666,7 +8101,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNetworkingStatus): @@ -7711,7 +8149,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSsid): @@ -7753,7 +8194,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kOperationalDataset): @@ -7791,7 +8235,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNetworkID): @@ -7830,7 +8277,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNetworkingStatus): @@ -7871,7 +8321,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNetworkID): @@ -7910,7 +8363,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNetworkingStatus): @@ -7952,7 +8408,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNetworkID): @@ -8056,7 +8515,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kIntent): @@ -8099,7 +8561,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -8188,7 +8653,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kName): @@ -8304,7 +8772,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCurrent): @@ -8342,7 +8813,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCurrent): @@ -8380,7 +8854,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCurrent): @@ -8417,7 +8894,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kBootReason): @@ -8459,7 +8939,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kId): @@ -8506,7 +8989,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kId): @@ -8556,7 +9042,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -8630,7 +9119,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSoftwareFault): @@ -8683,7 +9175,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kExtAddress): @@ -8777,7 +9272,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kActiveTimestampPresent): @@ -8856,7 +9354,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kExtAddress): @@ -8921,7 +9422,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kRotationTime): @@ -8962,7 +9466,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -9213,7 +9720,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kConnectionStatus): @@ -9252,7 +9762,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -9353,7 +9866,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kReasonCode): @@ -9389,7 +9905,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAssociationFailure): @@ -9426,7 +9945,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kConnectionStatus): @@ -9465,7 +9987,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -9673,7 +10198,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSoftwareVersion): @@ -9706,7 +10234,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -9736,7 +10267,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -9767,7 +10301,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kReachableNewValue): @@ -9847,7 +10384,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNewPosition): @@ -9881,7 +10421,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNewPosition): @@ -9915,7 +10458,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNewPosition): @@ -9949,7 +10495,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPreviousPosition): @@ -9983,7 +10532,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPreviousPosition): @@ -10019,7 +10571,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNewPosition): @@ -10058,7 +10613,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNewPosition): @@ -10106,7 +10664,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCommissioningTimeout): @@ -10153,7 +10714,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCommissioningTimeout): @@ -10186,7 +10750,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -10281,7 +10848,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kRootPublicKey): @@ -10355,7 +10925,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNoc): @@ -10400,7 +10973,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAttestationNonce): @@ -10436,7 +11012,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAttestationElements): @@ -10473,7 +11052,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCertificateType): @@ -10507,7 +11089,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCertificate): @@ -10541,7 +11126,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCSRNonce): @@ -10577,7 +11165,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNOCSRElements): @@ -10618,7 +11209,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNOCValue): @@ -10665,7 +11259,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNOCValue): @@ -10704,7 +11301,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatusCode): @@ -10744,7 +11344,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLabel): @@ -10778,7 +11381,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kFabricIndex): @@ -10812,7 +11418,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kRootCertificate): @@ -10847,7 +11456,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTrustedRootIdentifier): @@ -10952,7 +11564,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -11013,7 +11628,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupId): @@ -11064,7 +11682,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupKeySetID): @@ -11124,7 +11745,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupKeySet): @@ -11158,7 +11782,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupKeySetID): @@ -11192,7 +11819,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupKeySet): @@ -11226,7 +11856,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupKeySetID): @@ -11260,7 +11893,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupKeySetIDs): @@ -11294,7 +11930,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kGroupKeySetIDs): @@ -11606,7 +12245,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStateValue): @@ -11648,7 +12290,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLabel): @@ -11692,7 +12337,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMfgCode): @@ -11734,7 +12382,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNewMode): @@ -11876,7 +12527,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCredentialType): @@ -11918,7 +12572,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPinCode): @@ -11952,7 +12609,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPinCode): @@ -11987,7 +12647,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTimeout): @@ -12024,7 +12687,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLogIndex): @@ -12065,7 +12731,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLogEntryId): @@ -12120,7 +12789,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -12163,7 +12835,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -12200,7 +12875,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -12243,7 +12921,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPinSlotIndex): @@ -12276,7 +12957,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -12308,7 +12992,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -12345,7 +13032,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -12380,7 +13070,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -12423,7 +13116,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kWeekDayIndex): @@ -12476,7 +13172,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kWeekDayIndex): @@ -12520,7 +13219,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kWeekDayIndex): @@ -12576,7 +13278,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kWeekDayIndex): @@ -12616,7 +13321,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kYearDayIndex): @@ -12660,7 +13368,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kYearDayIndex): @@ -12701,7 +13412,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kYearDayIndex): @@ -12748,7 +13462,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kYearDayIndex): @@ -12788,7 +13505,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kHolidayIndex): @@ -12831,7 +13551,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kHolidayIndex): @@ -12869,7 +13592,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kHolidayIndex): @@ -12915,7 +13641,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kHolidayIndex): @@ -12950,7 +13679,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -12987,7 +13719,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -13022,7 +13757,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -13062,7 +13800,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -13105,7 +13846,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -13142,7 +13886,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserId): @@ -13185,7 +13932,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kRfidSlotIndex): @@ -13218,7 +13968,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -13255,7 +14008,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kOperationType): @@ -13307,7 +14063,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserIndex): @@ -13352,7 +14111,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserIndex): @@ -13413,7 +14175,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUserIndex): @@ -13454,7 +14219,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kOperationEventSource): @@ -13511,7 +14279,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kProgramEventSource): @@ -13571,7 +14342,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kOperationType): @@ -13623,7 +14397,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -13663,7 +14440,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCredential): @@ -13700,7 +14480,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCredentialExists): @@ -13740,7 +14523,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCredential): @@ -13940,7 +14726,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAlarmCode): @@ -13974,7 +14763,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kDoorState): @@ -14013,7 +14805,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLockOperationType): @@ -14068,7 +14863,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLockOperationType): @@ -14126,7 +14924,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLockDataType): @@ -14183,7 +14984,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14213,7 +15017,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14243,7 +15050,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14274,7 +15084,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLiftValue): @@ -14311,7 +15124,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLiftPercentageValue): @@ -14348,7 +15164,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTiltValue): @@ -14385,7 +15204,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTiltPercentageValue): @@ -14525,7 +15347,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPercentOpen): @@ -14558,7 +15383,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14758,7 +15586,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14788,7 +15619,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14818,7 +15652,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14848,7 +15685,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14878,7 +15718,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14908,7 +15751,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14938,7 +15784,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14968,7 +15817,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -14998,7 +15850,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15028,7 +15883,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15058,7 +15916,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15088,7 +15949,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15118,7 +15982,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15148,7 +16015,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15178,7 +16048,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15208,7 +16081,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15238,7 +16114,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15276,7 +16155,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMode): @@ -15318,7 +16200,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNumberOfTransitionsForSequence): @@ -15366,7 +16251,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNumberOfTransitionsForSequence): @@ -15415,7 +16303,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTimeOfDay): @@ -15465,7 +16356,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kDaysToReturn): @@ -15501,7 +16395,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15531,7 +16428,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -15909,7 +16809,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kHue): @@ -15958,7 +16861,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMoveMode): @@ -16005,7 +16911,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStepMode): @@ -16054,7 +16963,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSaturation): @@ -16100,7 +17012,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMoveMode): @@ -16147,7 +17062,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStepMode): @@ -16197,7 +17115,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kHue): @@ -16247,7 +17168,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kColorX): @@ -16296,7 +17220,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kRateX): @@ -16343,7 +17270,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStepX): @@ -16392,7 +17322,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kColorTemperature): @@ -16439,7 +17372,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEnhancedHue): @@ -16488,7 +17424,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMoveMode): @@ -16535,7 +17474,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStepMode): @@ -16585,7 +17527,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEnhancedHue): @@ -16637,7 +17582,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUpdateFlags): @@ -16690,7 +17638,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kOptionsMask): @@ -16734,7 +17685,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMoveMode): @@ -16791,7 +17745,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStepMode): @@ -18929,7 +19886,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEnrollResponseCode): @@ -18969,7 +19929,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kZoneStatus): @@ -19011,7 +19974,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -19043,7 +20009,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kZoneType): @@ -19082,7 +20051,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTestModeDuration): @@ -19118,7 +20090,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -19148,7 +20123,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -19238,7 +20216,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kZoneId): @@ -19282,7 +20263,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArmMode): @@ -19322,7 +20306,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArmNotification): @@ -19358,7 +20345,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNumberOfZones): @@ -19413,7 +20403,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSection0): @@ -19491,7 +20484,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -19525,7 +20521,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kZoneId): @@ -19567,7 +20566,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -19602,7 +20604,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kZoneId): @@ -19644,7 +20649,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -19679,7 +20687,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPanelStatus): @@ -19721,7 +20732,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -19756,7 +20770,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPanelStatus): @@ -19799,7 +20816,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kZoneId): @@ -19834,7 +20854,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNumberOfZones): @@ -19870,7 +20893,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -19902,7 +20928,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNumberOfZones): @@ -19938,7 +20967,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -19972,7 +21004,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kZoneStatusComplete): @@ -20017,7 +21052,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStartingZoneId): @@ -20100,7 +21138,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kWarningInfo): @@ -20143,7 +21184,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSquawkInfo): @@ -20261,7 +21305,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMajorNumber): @@ -20313,7 +21360,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kOperatorName): @@ -20361,7 +21411,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMatch): @@ -20396,7 +21449,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -20434,7 +21490,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMajorNumber): @@ -20471,7 +21530,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCount): @@ -20552,7 +21614,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kIdentifier): @@ -20595,7 +21660,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTarget): @@ -20633,7 +21701,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -20714,7 +21785,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kUpdatedAt): @@ -20755,7 +21829,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -20785,7 +21862,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -20815,7 +21895,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -20845,7 +21928,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -20875,7 +21961,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -20905,7 +21994,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -20935,7 +22027,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -20965,7 +22060,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -20997,7 +22095,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kDeltaPositionMilliseconds): @@ -21032,7 +22133,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kDeltaPositionMilliseconds): @@ -21067,7 +22171,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -21104,7 +22211,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kPosition): @@ -21199,7 +22309,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kIndex): @@ -21247,7 +22360,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kIndex): @@ -21280,7 +22396,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -21310,7 +22429,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -21342,7 +22464,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kIndex): @@ -21421,7 +22546,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -21489,7 +22617,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kKeyCode): @@ -21523,7 +22654,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -21596,7 +22730,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kWidth): @@ -21640,7 +22777,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kName): @@ -21682,7 +22822,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kType): @@ -21725,7 +22868,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kParameterList): @@ -21764,7 +22910,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kImageUrl): @@ -21812,7 +22961,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kProviderName): @@ -21868,7 +23020,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSearch): @@ -21911,7 +23066,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kContentURL): @@ -21952,7 +23110,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -22034,7 +23195,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kIndex): @@ -22079,7 +23243,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kIndex): @@ -22114,7 +23281,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kIndex): @@ -22195,7 +23365,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCatalogVendorId): @@ -22236,7 +23409,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kApplication): @@ -22279,7 +23455,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kApplication): @@ -22316,7 +23495,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kApplication): @@ -22350,7 +23532,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kApplication): @@ -22385,7 +23570,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStatus): @@ -22466,7 +23654,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kCatalogVendorId): @@ -22570,7 +23761,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTempAccountIdentifier): @@ -22604,7 +23798,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kSetupPIN): @@ -22640,7 +23837,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTempAccountIdentifier): @@ -22676,7 +23876,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -22751,7 +23954,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kA): @@ -22859,7 +24065,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kFabricSensitiveInt8u): @@ -22932,7 +24141,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNullableInt): @@ -23004,7 +24216,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kA): @@ -23053,7 +24268,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kA): @@ -23108,7 +24326,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kA): @@ -23146,7 +24367,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kFabricIndex): @@ -23187,7 +24411,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -23218,7 +24445,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kReturnValue): @@ -23251,7 +24481,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -23282,7 +24515,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kReturnValue): @@ -23315,7 +24551,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -23346,7 +24585,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kReturnValue): @@ -23379,7 +24621,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -23415,7 +24660,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -23465,7 +24713,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -23502,7 +24753,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -23536,7 +24790,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -23571,7 +24828,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -23613,7 +24873,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -23665,7 +24928,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kWasPresent): @@ -23708,7 +24974,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -23793,7 +25062,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNullableIntWasNull): @@ -23908,7 +25180,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -23942,7 +25217,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kValue): @@ -23976,7 +25254,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24010,7 +25291,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24044,7 +25328,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24078,7 +25365,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kValue): @@ -24112,7 +25402,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24146,7 +25439,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kValue): @@ -24180,7 +25476,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24214,7 +25513,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24249,7 +25551,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24286,7 +25591,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24335,7 +25643,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kNullableInt): @@ -24402,7 +25713,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24435,7 +25749,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -24466,7 +25783,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24502,7 +25822,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24542,7 +25865,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24855,7 +26181,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24904,7 +26233,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kArg1): @@ -24950,7 +26282,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMessageId): @@ -24998,7 +26333,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -25030,7 +26368,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMessageId): @@ -25071,7 +26412,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMessageId): @@ -25120,7 +26464,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kMessageId): @@ -25170,7 +26517,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEarliestImplementationTime): @@ -25205,7 +26555,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kImplementationDateTime): @@ -25421,7 +26774,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -25453,7 +26809,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAlertsCount): @@ -25491,7 +26850,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAlertsCount): @@ -25529,7 +26891,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kEventHeader): @@ -25606,7 +26971,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTimeStamp): @@ -25649,7 +27017,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLogId): @@ -25686,7 +27057,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kTimeStamp): @@ -25728,7 +27102,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -25760,7 +27137,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLogQueueSize): @@ -25798,7 +27178,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kLogQueueSize): @@ -25883,7 +27266,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kProfileCount): @@ -25925,7 +27311,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { default: @@ -25963,7 +27352,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kStartTime): @@ -26014,7 +27406,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } switch (TLV::TagNumFromTag(reader.GetTag())) { case to_underlying(Fields::kAttributeId): From 173b505b162c01a64ef00992b04858574b65ab86 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 27 Apr 2022 13:58:05 -0400 Subject: [PATCH 12/59] Remove some unused keys from platform manager configs. (#17784) --- src/platform/Ameba/AmebaConfig.cpp | 31 +++++++++---------- src/platform/Ameba/AmebaConfig.h | 6 ---- .../Ameba/ConfigurationManagerImpl.cpp | 2 -- src/platform/CYW30739/CYW30739Config.h | 2 -- src/platform/Darwin/PosixConfig.cpp | 6 ---- src/platform/Darwin/PosixConfig.h | 5 --- src/platform/EFR32/EFR32Config.h | 2 -- src/platform/ESP32/ESP32Config.cpp | 5 --- src/platform/ESP32/ESP32Config.h | 5 --- src/platform/Linux/PosixConfig.cpp | 6 ---- src/platform/Linux/PosixConfig.h | 5 --- src/platform/P6/P6Config.cpp | 14 +++------ src/platform/P6/P6Config.h | 5 --- src/platform/Tizen/PosixConfig.cpp | 6 ---- src/platform/Tizen/PosixConfig.h | 5 --- src/platform/Zephyr/ZephyrConfig.cpp | 13 +++----- src/platform/Zephyr/ZephyrConfig.h | 3 -- src/platform/android/AndroidConfig.cpp | 6 ---- src/platform/android/AndroidConfig.h | 5 --- .../chip/platform/ConfigurationManager.java | 6 ---- .../bouffalolab/BL602/BL602Config.cpp | 5 --- src/platform/bouffalolab/BL602/BL602Config.h | 5 --- .../cc13x2_26x2/CC13X2_26X2Config.cpp | 6 ---- src/platform/cc13x2_26x2/CC13X2_26X2Config.h | 3 -- src/platform/mbed/MbedConfig.cpp | 2 -- src/platform/mbed/MbedConfig.h | 3 -- src/platform/nxp/k32w/k32w0/K32W0Config.h | 2 -- src/platform/qpg/qpgConfig.h | 4 +-- 28 files changed, 23 insertions(+), 145 deletions(-) diff --git a/src/platform/Ameba/AmebaConfig.cpp b/src/platform/Ameba/AmebaConfig.cpp index f34f0f6f90c160..34c8cc1d53b5a7 100644 --- a/src/platform/Ameba/AmebaConfig.cpp +++ b/src/platform/Ameba/AmebaConfig.cpp @@ -42,21 +42,20 @@ namespace Internal { // *** CAUTION ***: Changing the names or namespaces of these values will *break* existing devices. // NVS namespaces used to store device configuration information. -const char AmebaConfig::kConfigNamespace_ChipFactory[] = "chip-factory"; -const char AmebaConfig::kConfigNamespace_ChipConfig[] = "chip-config"; -const char AmebaConfig::kConfigNamespace_ChipCounters[] = "chip-counters"; -const char AmebaConfig::kConfigNamespace_ChipFabric1[] = "chip-fabric-1"; -const char AmebaConfig::kConfigNamespace_ChipFabric2[] = "chip-fabric-2"; -const char AmebaConfig::kConfigNamespace_ChipFabric3[] = "chip-fabric-3"; -const char AmebaConfig::kConfigNamespace_ChipFabric4[] = "chip-fabric-4"; -const char AmebaConfig::kConfigNamespace_ChipFabric5[] = "chip-fabric-5"; -const char AmebaConfig::kConfigNamespace_ChipACL[] = "chip-acl"; -const char AmebaConfig::kConfigNamespace_ChipGroupMsgCounters[] = "chip-groupmsgcounters"; -const char AmebaConfig::kConfigNamespace_ChipAttributes[] = "chip-attributes"; -const char AmebaConfig::kConfigNamespace_ChipBindingTable[] = "chip-bindingtable"; -const char AmebaConfig::kConfigNamespace_ChipOTA[] = "chip-ota"; -const char AmebaConfig::kConfigNamespace_ChipDNS[] = "chip-dns"; -const char AmebaConfig::kConfigNamespace_ChipOthers[] = "chip-others"; +const char AmebaConfig::kConfigNamespace_ChipFactory[] = "chip-factory"; +const char AmebaConfig::kConfigNamespace_ChipConfig[] = "chip-config"; +const char AmebaConfig::kConfigNamespace_ChipCounters[] = "chip-counters"; +const char AmebaConfig::kConfigNamespace_ChipFabric1[] = "chip-fabric-1"; +const char AmebaConfig::kConfigNamespace_ChipFabric2[] = "chip-fabric-2"; +const char AmebaConfig::kConfigNamespace_ChipFabric3[] = "chip-fabric-3"; +const char AmebaConfig::kConfigNamespace_ChipFabric4[] = "chip-fabric-4"; +const char AmebaConfig::kConfigNamespace_ChipFabric5[] = "chip-fabric-5"; +const char AmebaConfig::kConfigNamespace_ChipACL[] = "chip-acl"; +const char AmebaConfig::kConfigNamespace_ChipAttributes[] = "chip-attributes"; +const char AmebaConfig::kConfigNamespace_ChipBindingTable[] = "chip-bindingtable"; +const char AmebaConfig::kConfigNamespace_ChipOTA[] = "chip-ota"; +const char AmebaConfig::kConfigNamespace_ChipDNS[] = "chip-dns"; +const char AmebaConfig::kConfigNamespace_ChipOthers[] = "chip-others"; // Keys stored in the chip-factory namespace const AmebaConfig::Key AmebaConfig::kConfigKey_SerialNum = { kConfigNamespace_ChipFactory, "serial-num" }; @@ -74,11 +73,9 @@ const AmebaConfig::Key AmebaConfig::kConfigKey_Spake2pVerifier = { kConfig const AmebaConfig::Key AmebaConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipFactory, "uniqueId" }; // Keys stored in the chip-config namespace -const AmebaConfig::Key AmebaConfig::kConfigKey_FabricId = { kConfigNamespace_ChipConfig, "fabric-id" }; const AmebaConfig::Key AmebaConfig::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; const AmebaConfig::Key AmebaConfig::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; const AmebaConfig::Key AmebaConfig::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; -const AmebaConfig::Key AmebaConfig::kConfigKey_GroupKeyIndex = { kConfigNamespace_ChipConfig, "group-key-index" }; const AmebaConfig::Key AmebaConfig::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; const AmebaConfig::Key AmebaConfig::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; const AmebaConfig::Key AmebaConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; diff --git a/src/platform/Ameba/AmebaConfig.h b/src/platform/Ameba/AmebaConfig.h index dc87ed455f9dcd..6c518132432634 100755 --- a/src/platform/Ameba/AmebaConfig.h +++ b/src/platform/Ameba/AmebaConfig.h @@ -46,7 +46,6 @@ class AmebaConfig static const char kConfigNamespace_ChipFabric4[]; static const char kConfigNamespace_ChipFabric5[]; static const char kConfigNamespace_ChipACL[]; - static const char kConfigNamespace_ChipGroupMsgCounters[]; static const char kConfigNamespace_ChipAttributes[]; static const char kConfigNamespace_ChipBindingTable[]; static const char kConfigNamespace_ChipOTA[]; @@ -62,12 +61,9 @@ class AmebaConfig static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; @@ -90,8 +86,6 @@ class AmebaConfig static const Key kCounterKey_TotalOperationalHours; static const Key kCounterKey_BootReason; - static const char kGroupKeyNamePrefix[]; - // Config value accessors. static CHIP_ERROR ReadConfigValue(Key key, bool & val); static CHIP_ERROR ReadConfigValue(Key key, uint32_t & val); diff --git a/src/platform/Ameba/ConfigurationManagerImpl.cpp b/src/platform/Ameba/ConfigurationManagerImpl.cpp index 3aed7d347cb59f..18a05566248367 100644 --- a/src/platform/Ameba/ConfigurationManagerImpl.cpp +++ b/src/platform/Ameba/ConfigurationManagerImpl.cpp @@ -67,8 +67,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() SuccessOrExit(err); err = AmebaConfig::EnsureNamespace(AmebaConfig::kConfigNamespace_ChipACL); SuccessOrExit(err); - err = AmebaConfig::EnsureNamespace(AmebaConfig::kConfigNamespace_ChipGroupMsgCounters); - SuccessOrExit(err); err = AmebaConfig::EnsureNamespace(AmebaConfig::kConfigNamespace_ChipAttributes); SuccessOrExit(err); err = AmebaConfig::EnsureNamespace(AmebaConfig::kConfigNamespace_ChipBindingTable); diff --git a/src/platform/CYW30739/CYW30739Config.h b/src/platform/CYW30739/CYW30739Config.h index 661b93ef3e5000..51795a261dc28b 100644 --- a/src/platform/CYW30739/CYW30739Config.h +++ b/src/platform/CYW30739/CYW30739Config.h @@ -54,11 +54,9 @@ class CYW30739Config static constexpr Key kConfigKey_Spake2pSalt = 9; static constexpr Key kConfigKey_Spake2pVerifier = 10; // CHIP Config Keys - static constexpr Key kConfigKey_FabricId = 8; static constexpr Key kConfigKey_ServiceConfig = 9; static constexpr Key kConfigKey_PairedAccountId = 10; static constexpr Key kConfigKey_ServiceId = 11; - static constexpr Key kConfigKey_FabricSecret = 12; static constexpr Key kConfigKey_LastUsedEpochKeyId = 13; static constexpr Key kConfigKey_FailSafeArmed = 14; static constexpr Key kConfigKey_GroupKey = 15; diff --git a/src/platform/Darwin/PosixConfig.cpp b/src/platform/Darwin/PosixConfig.cpp index e31eebdd9098c2..014063c8b49d52 100644 --- a/src/platform/Darwin/PosixConfig.cpp +++ b/src/platform/Darwin/PosixConfig.cpp @@ -61,12 +61,9 @@ const PosixConfig::Key PosixConfig::kConfigKey_VendorId = { kConfig const PosixConfig::Key PosixConfig::kConfigKey_ProductId = { kConfigNamespace_ChipFactory, "product-id" }; // Keys stored in the Chip-config namespace -const PosixConfig::Key PosixConfig::kConfigKey_FabricId = { kConfigNamespace_ChipConfig, "fabric-id" }; const PosixConfig::Key PosixConfig::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; const PosixConfig::Key PosixConfig::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; const PosixConfig::Key PosixConfig::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_FabricSecret = { kConfigNamespace_ChipConfig, "fabric-secret" }; -const PosixConfig::Key PosixConfig::kConfigKey_GroupKeyIndex = { kConfigNamespace_ChipConfig, "group-key-index" }; const PosixConfig::Key PosixConfig::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; @@ -84,9 +81,6 @@ const PosixConfig::Key PosixConfig::kCounterKey_TotalOperationalHours = { kConfi const PosixConfig::Key PosixConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipConfig, "unique-id" }; #if !CHIP_DISABLE_PLATFORM_KVS -// Prefix used for NVS keys that contain Chip group encryption keys. -const char PosixConfig::kGroupKeyNamePrefix[] = "gk-"; - CHIP_ERROR PosixConfig::Init() { return PersistedStorage::KeyValueStoreMgrImpl().Init(CHIP_CONFIG_KVS_PATH); diff --git a/src/platform/Darwin/PosixConfig.h b/src/platform/Darwin/PosixConfig.h index b142c62b9cee8a..b77aae87dbb3ce 100644 --- a/src/platform/Darwin/PosixConfig.h +++ b/src/platform/Darwin/PosixConfig.h @@ -61,12 +61,9 @@ class PosixConfig static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; @@ -86,8 +83,6 @@ class PosixConfig static const Key kCounterKey_BootReason; static const Key kCounterKey_UpTime; - static const char kGroupKeyNamePrefix[]; - #if !CHIP_DISABLE_PLATFORM_KVS static CHIP_ERROR Init(void); diff --git a/src/platform/EFR32/EFR32Config.h b/src/platform/EFR32/EFR32Config.h index fe9846a926928e..d59632b6614ebd 100644 --- a/src/platform/EFR32/EFR32Config.h +++ b/src/platform/EFR32/EFR32Config.h @@ -101,11 +101,9 @@ class EFR32Config static constexpr Key kConfigKey_Spake2pSalt = EFR32ConfigKey(kMatterFactory_KeyBase, 0x09); static constexpr Key kConfigKey_Spake2pVerifier = EFR32ConfigKey(kMatterFactory_KeyBase, 0x0A); // Matter Config Keys - static constexpr Key kConfigKey_FabricId = EFR32ConfigKey(kMatterConfig_KeyBase, 0x00); static constexpr Key kConfigKey_ServiceConfig = EFR32ConfigKey(kMatterConfig_KeyBase, 0x01); static constexpr Key kConfigKey_PairedAccountId = EFR32ConfigKey(kMatterConfig_KeyBase, 0x02); static constexpr Key kConfigKey_ServiceId = EFR32ConfigKey(kMatterConfig_KeyBase, 0x03); - static constexpr Key kConfigKey_FabricSecret = EFR32ConfigKey(kMatterConfig_KeyBase, 0x04); static constexpr Key kConfigKey_LastUsedEpochKeyId = EFR32ConfigKey(kMatterConfig_KeyBase, 0x05); static constexpr Key kConfigKey_FailSafeArmed = EFR32ConfigKey(kMatterConfig_KeyBase, 0x06); static constexpr Key kConfigKey_GroupKey = EFR32ConfigKey(kMatterConfig_KeyBase, 0x07); diff --git a/src/platform/ESP32/ESP32Config.cpp b/src/platform/ESP32/ESP32Config.cpp index 047edec41c202c..c52d68ba030e1d 100644 --- a/src/platform/ESP32/ESP32Config.cpp +++ b/src/platform/ESP32/ESP32Config.cpp @@ -69,11 +69,9 @@ const ESP32Config::Key ESP32Config::kConfigKey_PAICert = { kConfig const ESP32Config::Key ESP32Config::kConfigKey_CertDeclaration = { kConfigNamespace_ChipFactory, "cert-dclrn" }; // Keys stored in the chip-config namespace -const ESP32Config::Key ESP32Config::kConfigKey_FabricId = { kConfigNamespace_ChipConfig, "fabric-id" }; const ESP32Config::Key ESP32Config::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; const ESP32Config::Key ESP32Config::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; const ESP32Config::Key ESP32Config::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; -const ESP32Config::Key ESP32Config::kConfigKey_GroupKeyIndex = { kConfigNamespace_ChipConfig, "group-key-index" }; const ESP32Config::Key ESP32Config::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; const ESP32Config::Key ESP32Config::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; const ESP32Config::Key ESP32Config::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; @@ -87,9 +85,6 @@ const ESP32Config::Key ESP32Config::kCounterKey_RebootCount = { kConfi const ESP32Config::Key ESP32Config::kCounterKey_UpTime = { kConfigNamespace_ChipCounters, "up-time" }; const ESP32Config::Key ESP32Config::kCounterKey_TotalOperationalHours = { kConfigNamespace_ChipCounters, "total-hours" }; -// Prefix used for NVS keys that contain Chip group encryption keys. -const char ESP32Config::kGroupKeyNamePrefix[] = "gk-"; - const char * ESP32Config::GetPartitionLabelByNamespace(const char * ns) { if (strcmp(ns, kConfigNamespace_ChipFactory) == 0) diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index 15156113fd4678..f873a623849b20 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -60,12 +60,9 @@ class ESP32Config static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; @@ -87,8 +84,6 @@ class ESP32Config static const Key kCounterKey_UpTime; static const Key kCounterKey_TotalOperationalHours; - static const char kGroupKeyNamePrefix[]; - // Config value accessors. static CHIP_ERROR ReadConfigValue(Key key, bool & val); static CHIP_ERROR ReadConfigValue(Key key, uint32_t & val); diff --git a/src/platform/Linux/PosixConfig.cpp b/src/platform/Linux/PosixConfig.cpp index 94ffba82c3d476..da52f00a0001d1 100644 --- a/src/platform/Linux/PosixConfig.cpp +++ b/src/platform/Linux/PosixConfig.cpp @@ -64,12 +64,9 @@ const PosixConfig::Key PosixConfig::kConfigKey_VendorId = { kConfig const PosixConfig::Key PosixConfig::kConfigKey_ProductId = { kConfigNamespace_ChipFactory, "product-id" }; // Keys stored in the Chip-config namespace -const PosixConfig::Key PosixConfig::kConfigKey_FabricId = { kConfigNamespace_ChipConfig, "fabric-id" }; const PosixConfig::Key PosixConfig::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; const PosixConfig::Key PosixConfig::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; const PosixConfig::Key PosixConfig::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_FabricSecret = { kConfigNamespace_ChipConfig, "fabric-secret" }; -const PosixConfig::Key PosixConfig::kConfigKey_GroupKeyIndex = { kConfigNamespace_ChipConfig, "group-key-index" }; const PosixConfig::Key PosixConfig::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; @@ -86,9 +83,6 @@ const PosixConfig::Key PosixConfig::kCounterKey_TotalOperationalHours = { kConfi "total-operational-hours" }; const PosixConfig::Key PosixConfig::kCounterKey_BootReason = { kConfigNamespace_ChipCounters, "boot-reason" }; -// Prefix used for NVS keys that contain Chip group encryption keys. -const char PosixConfig::kGroupKeyNamePrefix[] = "gk-"; - ChipLinuxStorage * PosixConfig::GetStorageForNamespace(Key key) { if (strcmp(key.Namespace, kConfigNamespace_ChipFactory) == 0) diff --git a/src/platform/Linux/PosixConfig.h b/src/platform/Linux/PosixConfig.h index b4febb3d68967c..52263d4aea0c71 100644 --- a/src/platform/Linux/PosixConfig.h +++ b/src/platform/Linux/PosixConfig.h @@ -63,12 +63,9 @@ class PosixConfig static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; @@ -88,8 +85,6 @@ class PosixConfig static const Key kCounterKey_TotalOperationalHours; static const Key kCounterKey_BootReason; - static const char kGroupKeyNamePrefix[]; - static CHIP_ERROR Init(); // Config value accessors. diff --git a/src/platform/P6/P6Config.cpp b/src/platform/P6/P6Config.cpp index f6a5dbbe77b67f..19a4cb35cb62ea 100644 --- a/src/platform/P6/P6Config.cpp +++ b/src/platform/P6/P6Config.cpp @@ -63,11 +63,9 @@ const P6Config::Key P6Config::kConfigKey_Spake2pSalt = { kConfigNamesp const P6Config::Key P6Config::kConfigKey_Spake2pVerifier = { kConfigNamespace_ChipFactory, "verifier" }; // Keys stored in the chip-config namespace -const P6Config::Key P6Config::kConfigKey_FabricId = { kConfigNamespace_ChipConfig, "fabric-id" }; const P6Config::Key P6Config::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; const P6Config::Key P6Config::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; const P6Config::Key P6Config::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; -const P6Config::Key P6Config::kConfigKey_GroupKeyIndex = { kConfigNamespace_ChipConfig, "group-key-index" }; const P6Config::Key P6Config::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; const P6Config::Key P6Config::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; const P6Config::Key P6Config::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; @@ -85,9 +83,6 @@ const P6Config::Key P6Config::kCounterKey_RebootCount = { kConfigNames const P6Config::Key P6Config::kCounterKey_UpTime = { kConfigNamespace_ChipCounters, "up-time" }; const P6Config::Key P6Config::kCounterKey_TotalOperationalHours = { kConfigNamespace_ChipCounters, "total-hours" }; -// Prefix used for keys that contain Chip group encryption keys. -const char P6Config::kGroupKeyNamePrefix[] = "gk-"; - CHIP_ERROR P6Config::ReadConfigValue(Key key, bool & val) { bool in; @@ -219,11 +214,10 @@ bool P6Config::ConfigValueExists(Key key) CHIP_ERROR P6Config::FactoryResetConfig(void) { CHIP_ERROR err = CHIP_NO_ERROR; - const Key * config_keys[] = { &kConfigKey_FabricId, &kConfigKey_ServiceConfig, &kConfigKey_PairedAccountId, - &kConfigKey_ServiceId, &kConfigKey_GroupKeyIndex, &kConfigKey_LastUsedEpochKeyId, - &kConfigKey_FailSafeArmed, &kConfigKey_WiFiStationSecType, &kConfigKey_WiFiSSID, - &kConfigKey_WiFiPassword, &kConfigKey_WiFiSecurity, &kConfigKey_WiFiMode, - &kConfigKey_SoftwareVersion }; + const Key * config_keys[] = { &kConfigKey_ServiceConfig, &kConfigKey_PairedAccountId, &kConfigKey_ServiceId, + &kConfigKey_LastUsedEpochKeyId, &kConfigKey_FailSafeArmed, &kConfigKey_WiFiStationSecType, + &kConfigKey_WiFiSSID, &kConfigKey_WiFiPassword, &kConfigKey_WiFiSecurity, + &kConfigKey_WiFiMode, &kConfigKey_SoftwareVersion }; for (uint32_t i = 0; i < (sizeof(config_keys) / sizeof(config_keys[0])); i++) { diff --git a/src/platform/P6/P6Config.h b/src/platform/P6/P6Config.h index ae44ced3261c9d..336a91d17d82cc 100644 --- a/src/platform/P6/P6Config.h +++ b/src/platform/P6/P6Config.h @@ -64,12 +64,9 @@ class P6Config static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; @@ -90,8 +87,6 @@ class P6Config static const Key kCounterKey_UpTime; static const Key kCounterKey_TotalOperationalHours; - static const char kGroupKeyNamePrefix[]; - // Config value accessors. static CHIP_ERROR ReadConfigValue(Key key, bool & val); static CHIP_ERROR ReadConfigValue(Key key, uint32_t & val); diff --git a/src/platform/Tizen/PosixConfig.cpp b/src/platform/Tizen/PosixConfig.cpp index a831325d892d2f..28577d22cc6abb 100644 --- a/src/platform/Tizen/PosixConfig.cpp +++ b/src/platform/Tizen/PosixConfig.cpp @@ -60,12 +60,9 @@ const PosixConfig::Key PosixConfig::kConfigKey_VendorId = { kConfig const PosixConfig::Key PosixConfig::kConfigKey_ProductId = { kConfigNamespace_ChipFactory, "product-id" }; // Keys stored in the Chip-config namespace -const PosixConfig::Key PosixConfig::kConfigKey_FabricId = { kConfigNamespace_ChipConfig, "fabric-id" }; const PosixConfig::Key PosixConfig::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; const PosixConfig::Key PosixConfig::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; const PosixConfig::Key PosixConfig::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_FabricSecret = { kConfigNamespace_ChipConfig, "fabric-secret" }; -const PosixConfig::Key PosixConfig::kConfigKey_GroupKeyIndex = { kConfigNamespace_ChipConfig, "group-key-index" }; const PosixConfig::Key PosixConfig::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; @@ -74,9 +71,6 @@ const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNam const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; const PosixConfig::Key PosixConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipConfig, "unique-id" }; -// Prefix used for NVS keys that contain Chip group encryption keys. -const char PosixConfig::kGroupKeyNamePrefix[] = "gk-"; - CHIP_ERROR PosixConfig::Init() { return CHIP_NO_ERROR; diff --git a/src/platform/Tizen/PosixConfig.h b/src/platform/Tizen/PosixConfig.h index 65440f4ce53abb..05cb43cbcebd10 100644 --- a/src/platform/Tizen/PosixConfig.h +++ b/src/platform/Tizen/PosixConfig.h @@ -61,12 +61,9 @@ class PosixConfig static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; @@ -80,8 +77,6 @@ class PosixConfig static const Key kConfigKey_VendorId; static const Key kConfigKey_ProductId; - static const char kGroupKeyNamePrefix[]; - static CHIP_ERROR Init(void); // Config value accessors. diff --git a/src/platform/Zephyr/ZephyrConfig.cpp b/src/platform/Zephyr/ZephyrConfig.cpp index 0b247220c10e2e..822d37a10171cd 100644 --- a/src/platform/Zephyr/ZephyrConfig.cpp +++ b/src/platform/Zephyr/ZephyrConfig.cpp @@ -63,12 +63,9 @@ const ZephyrConfig::Key ZephyrConfig::kConfigKey_Spake2pSalt = CONFIG_ const ZephyrConfig::Key ZephyrConfig::kConfigKey_Spake2pVerifier = CONFIG_KEY(NAMESPACE_FACTORY "verifier"); // Keys stored in the chip config namespace // NOTE: update sAllResettableConfigKeys definition when adding a new entry below -const ZephyrConfig::Key ZephyrConfig::kConfigKey_FabricId = CONFIG_KEY(NAMESPACE_CONFIG "fabric-id"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_ServiceConfig = CONFIG_KEY(NAMESPACE_CONFIG "service-config"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_PairedAccountId = CONFIG_KEY(NAMESPACE_CONFIG "account-id"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_ServiceId = CONFIG_KEY(NAMESPACE_CONFIG "service-id"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_FabricSecret = CONFIG_KEY(NAMESPACE_CONFIG "fabric-secret"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_GroupKeyIndex = CONFIG_KEY(NAMESPACE_CONFIG "group-key-index"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_LastUsedEpochKeyId = CONFIG_KEY(NAMESPACE_CONFIG "last-ek-id"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_FailSafeArmed = CONFIG_KEY(NAMESPACE_CONFIG "fail-safe-armed"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_RegulatoryLocation = CONFIG_KEY(NAMESPACE_CONFIG "regulatory-location"); @@ -84,12 +81,10 @@ const ZephyrConfig::Key ZephyrConfig::kCounterKey_TotalOperationalHours = CONFIG namespace { constexpr const char * sAllResettableConfigKeys[] = { - ZephyrConfig::kConfigKey_FabricId, ZephyrConfig::kConfigKey_ServiceConfig, - ZephyrConfig::kConfigKey_PairedAccountId, ZephyrConfig::kConfigKey_ServiceId, - ZephyrConfig::kConfigKey_FabricSecret, ZephyrConfig::kConfigKey_GroupKeyIndex, - ZephyrConfig::kConfigKey_LastUsedEpochKeyId, ZephyrConfig::kConfigKey_FailSafeArmed, - ZephyrConfig::kConfigKey_RegulatoryLocation, ZephyrConfig::kConfigKey_CountryCode, - ZephyrConfig::kConfigKey_Breadcrumb, + ZephyrConfig::kConfigKey_ServiceConfig, ZephyrConfig::kConfigKey_PairedAccountId, + ZephyrConfig::kConfigKey_ServiceId, ZephyrConfig::kConfigKey_LastUsedEpochKeyId, + ZephyrConfig::kConfigKey_FailSafeArmed, ZephyrConfig::kConfigKey_RegulatoryLocation, + ZephyrConfig::kConfigKey_CountryCode, ZephyrConfig::kConfigKey_Breadcrumb, }; // Data structure to be passed as a parameter of Zephyr's settings_load_subtree_direct() function diff --git a/src/platform/Zephyr/ZephyrConfig.h b/src/platform/Zephyr/ZephyrConfig.h index 668627df6be618..bd6f8e8591dd79 100644 --- a/src/platform/Zephyr/ZephyrConfig.h +++ b/src/platform/Zephyr/ZephyrConfig.h @@ -53,12 +53,9 @@ class ZephyrConfig static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_SetupDiscriminator; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_RegulatoryLocation; diff --git a/src/platform/android/AndroidConfig.cpp b/src/platform/android/AndroidConfig.cpp index ef6b298b8581ae..9b95a93fcce068 100644 --- a/src/platform/android/AndroidConfig.cpp +++ b/src/platform/android/AndroidConfig.cpp @@ -80,12 +80,9 @@ const AndroidConfig::Key AndroidConfig::kConfigKey_Spake2pSalt = { kCo const AndroidConfig::Key AndroidConfig::kConfigKey_Spake2pVerifier = { kConfigNamespace_ChipFactory, "verifier" }; // Keys stored in the Chip-config namespace -const AndroidConfig::Key AndroidConfig::kConfigKey_FabricId = { kConfigNamespace_ChipConfig, "fabric-id" }; const AndroidConfig::Key AndroidConfig::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; const AndroidConfig::Key AndroidConfig::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; const AndroidConfig::Key AndroidConfig::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; -const AndroidConfig::Key AndroidConfig::kConfigKey_FabricSecret = { kConfigNamespace_ChipConfig, "fabric-secret" }; -const AndroidConfig::Key AndroidConfig::kConfigKey_GroupKeyIndex = { kConfigNamespace_ChipConfig, "group-key-index" }; const AndroidConfig::Key AndroidConfig::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; const AndroidConfig::Key AndroidConfig::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; const AndroidConfig::Key AndroidConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; @@ -93,9 +90,6 @@ const AndroidConfig::Key AndroidConfig::kConfigKey_RegulatoryLocation = { kConfi const AndroidConfig::Key AndroidConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; const AndroidConfig::Key AndroidConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; -// Prefix used for NVS keys that contain Chip group encryption keys. -const char AndroidConfig::kGroupKeyNamePrefix[] = "gk-"; - void AndroidConfig::InitializeWithObject(jobject managerObject) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); diff --git a/src/platform/android/AndroidConfig.h b/src/platform/android/AndroidConfig.h index 3f53259432a9f8..1fbae97846174b 100644 --- a/src/platform/android/AndroidConfig.h +++ b/src/platform/android/AndroidConfig.h @@ -62,12 +62,9 @@ class AndroidConfig static const Key kConfigKey_HardwareVersionString; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; @@ -87,8 +84,6 @@ class AndroidConfig static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; - static const char kGroupKeyNamePrefix[]; - static CHIP_ERROR Init(); // Config value accessors. diff --git a/src/platform/android/java/chip/platform/ConfigurationManager.java b/src/platform/android/java/chip/platform/ConfigurationManager.java index ae35caed7b4401..5079c5aedb2945 100644 --- a/src/platform/android/java/chip/platform/ConfigurationManager.java +++ b/src/platform/android/java/chip/platform/ConfigurationManager.java @@ -48,12 +48,9 @@ public interface ConfigurationManager { String kConfigKey_Spake2pVerifier = "verifier"; // Keys stored in the Chip-config namespace - String kConfigKey_FabricId = "fabric-id"; String kConfigKey_ServiceConfig = "service-config"; String kConfigKey_PairedAccountId = "account-id"; String kConfigKey_ServiceId = "service-id"; - String kConfigKey_FabricSecret = "fabric-secret"; - String kConfigKey_GroupKeyIndex = "group-key-index"; String kConfigKey_LastUsedEpochKeyId = "last-ek-id"; String kConfigKey_FailSafeArmed = "fail-safe-armed"; String kConfigKey_WiFiStationSecType = "sta-sec-type"; @@ -61,9 +58,6 @@ public interface ConfigurationManager { String kConfigKey_CountryCode = "country-code"; String kConfigKey_Breadcrumb = "breadcrumb"; - // Prefix used for NVS keys that contain Chip group encryption keys. - String kGroupKeyNamePrefix = "gk-"; - long readConfigValueLong(String namespace, String name) throws AndroidChipPlatformException; String readConfigValueStr(String namespace, String name) throws AndroidChipPlatformException; diff --git a/src/platform/bouffalolab/BL602/BL602Config.cpp b/src/platform/bouffalolab/BL602/BL602Config.cpp index 025d48ae18cd16..ffeb2f72f0099d 100644 --- a/src/platform/bouffalolab/BL602/BL602Config.cpp +++ b/src/platform/bouffalolab/BL602/BL602Config.cpp @@ -57,11 +57,9 @@ const BL602Config::Key BL602Config::kConfigKey_Spake2pSalt = { "salt" const BL602Config::Key BL602Config::kConfigKey_Spake2pVerifier = { "verifier" }; // Keys stored in the chip-config namespace -const BL602Config::Key BL602Config::kConfigKey_FabricId = { "fabric-id" }; const BL602Config::Key BL602Config::kConfigKey_ServiceConfig = { "service-config" }; const BL602Config::Key BL602Config::kConfigKey_PairedAccountId = { "account-id" }; const BL602Config::Key BL602Config::kConfigKey_ServiceId = { "service-id" }; -const BL602Config::Key BL602Config::kConfigKey_GroupKeyIndex = { "group-key-index" }; const BL602Config::Key BL602Config::kConfigKey_LastUsedEpochKeyId = { "last-ek-id" }; const BL602Config::Key BL602Config::kConfigKey_FailSafeArmed = { "fail-safe-armed" }; const BL602Config::Key BL602Config::kConfigKey_WiFiStationSecType = { "sta-sec-type" }; @@ -74,9 +72,6 @@ const BL602Config::Key BL602Config::kConfigKey_CountryCode = { " const BL602Config::Key BL602Config::kConfigKey_Breadcrumb = { "breadcrumb" }; const BL602Config::Key BL602Config::kConfigKey_UniqueId = { "unique-id" }; -// Prefix used for Easyflash keys that contain Chip group encryption keys. -const char BL602Config::kGroupKeyNamePrefix[] = "gk-"; - CHIP_ERROR BL602Config::Init() { EfErrCode err = easyflash_init(); diff --git a/src/platform/bouffalolab/BL602/BL602Config.h b/src/platform/bouffalolab/BL602/BL602Config.h index 4422d6d10014ac..b4ded47ae49c45 100644 --- a/src/platform/bouffalolab/BL602/BL602Config.h +++ b/src/platform/bouffalolab/BL602/BL602Config.h @@ -63,12 +63,9 @@ class BL602Config static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; @@ -85,8 +82,6 @@ class BL602Config static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; - static const char kGroupKeyNamePrefix[]; - static CHIP_ERROR Init(void); // Config value accessors. diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp index 3795cf9aa77430..daaafa4ea22f9b 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp @@ -69,18 +69,12 @@ const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_Spake2pVerifier .itemID = 0x000c } }; // Keys stored in the Chip-config namespace -const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_FabricId = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, - .itemID = 0x0011 } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_ServiceConfig = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x0012 } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_PairedAccountId = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x0013 } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_ServiceId = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x0014 } }; -const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_FabricSecret = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, - .itemID = 0x0015 } }; -const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_GroupKeyIndex = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, - .itemID = 0x0016 } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_LastUsedEpochKeyId = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x0017 } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_FailSafeArmed = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h index a177f1e4f54b3c..c71c72cbaf67da 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h @@ -55,12 +55,9 @@ class CC13X2_26X2Config static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_SetupDiscriminator; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; diff --git a/src/platform/mbed/MbedConfig.cpp b/src/platform/mbed/MbedConfig.cpp index afe551b72d0c98..686c97df706f55 100644 --- a/src/platform/mbed/MbedConfig.cpp +++ b/src/platform/mbed/MbedConfig.cpp @@ -75,11 +75,9 @@ const MbedConfig::Key MbedConfig::kConfigKey_Spake2pSalt = { FACTORY_K const MbedConfig::Key MbedConfig::kConfigKey_Spake2pVerifier = { FACTORY_KEY("verifier") }; // Keys stored in the chip-config namespace -const MbedConfig::Key MbedConfig::kConfigKey_FabricId = { CONFIG_KEY("fabric-id") }; const MbedConfig::Key MbedConfig::kConfigKey_ServiceConfig = { CONFIG_KEY("service-config") }; const MbedConfig::Key MbedConfig::kConfigKey_PairedAccountId = { CONFIG_KEY("account-id") }; const MbedConfig::Key MbedConfig::kConfigKey_ServiceId = { CONFIG_KEY("service-id") }; -const MbedConfig::Key MbedConfig::kConfigKey_GroupKeyIndex = { CONFIG_KEY("group-key-index") }; const MbedConfig::Key MbedConfig::kConfigKey_LastUsedEpochKeyId = { CONFIG_KEY("last-ek-id") }; const MbedConfig::Key MbedConfig::kConfigKey_FailSafeArmed = { CONFIG_KEY("fail-safe-armed") }; const MbedConfig::Key MbedConfig::kConfigKey_WiFiStationSecType = { CONFIG_KEY("sta-sec-type") }; diff --git a/src/platform/mbed/MbedConfig.h b/src/platform/mbed/MbedConfig.h index bbccfbfd2031ea..9c03bbaf69d897 100644 --- a/src/platform/mbed/MbedConfig.h +++ b/src/platform/mbed/MbedConfig.h @@ -60,12 +60,9 @@ class MbedConfig static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_FabricId; static const Key kConfigKey_ServiceConfig; static const Key kConfigKey_PairedAccountId; static const Key kConfigKey_ServiceId; - static const Key kConfigKey_FabricSecret; - static const Key kConfigKey_GroupKeyIndex; static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_WiFiStationSecType; diff --git a/src/platform/nxp/k32w/k32w0/K32W0Config.h b/src/platform/nxp/k32w/k32w0/K32W0Config.h index f02bd367036f1a..a875142cd50f00 100644 --- a/src/platform/nxp/k32w/k32w0/K32W0Config.h +++ b/src/platform/nxp/k32w/k32w0/K32W0Config.h @@ -80,11 +80,9 @@ class K32WConfig static constexpr Key kConfigKey_Spake2pVerifier = K32WConfigKey(kPDMId_ChipFactory, 0x0B); // CHIP Config Keys - static constexpr Key kConfigKey_FabricId = K32WConfigKey(kPDMId_ChipConfig, 0x00); static constexpr Key kConfigKey_ServiceConfig = K32WConfigKey(kPDMId_ChipConfig, 0x01); static constexpr Key kConfigKey_PairedAccountId = K32WConfigKey(kPDMId_ChipConfig, 0x02); static constexpr Key kConfigKey_ServiceId = K32WConfigKey(kPDMId_ChipConfig, 0x03); - static constexpr Key kConfigKey_FabricSecret = K32WConfigKey(kPDMId_ChipConfig, 0x04); static constexpr Key kConfigKey_LastUsedEpochKeyId = K32WConfigKey(kPDMId_ChipConfig, 0x05); static constexpr Key kConfigKey_FailSafeArmed = K32WConfigKey(kPDMId_ChipConfig, 0x06); static constexpr Key kConfigKey_RegulatoryLocation = K32WConfigKey(kPDMId_ChipConfig, 0x07); diff --git a/src/platform/qpg/qpgConfig.h b/src/platform/qpg/qpgConfig.h index 73cf8d09b1f8d2..7af2c5be1664c1 100644 --- a/src/platform/qpg/qpgConfig.h +++ b/src/platform/qpg/qpgConfig.h @@ -76,11 +76,9 @@ class QPGConfig static constexpr Key kConfigKey_Spake2pSalt = QorvoConfigKey(kFileId_ChipFactory, 0x09); static constexpr Key kConfigKey_Spake2pVerifier = QorvoConfigKey(kFileId_ChipFactory, 0x0A); - static constexpr Key kConfigKey_FabricId = QorvoConfigKey(kFileId_ChipConfig, 0x00); static constexpr Key kConfigKey_ServiceConfig = QorvoConfigKey(kFileId_ChipConfig, 0x01); static constexpr Key kConfigKey_PairedAccountId = QorvoConfigKey(kFileId_ChipConfig, 0x02); static constexpr Key kConfigKey_ServiceId = QorvoConfigKey(kFileId_ChipConfig, 0x03); - static constexpr Key kConfigKey_FabricSecret = QorvoConfigKey(kFileId_ChipConfig, 0x04); static constexpr Key kConfigKey_LastUsedEpochKeyId = QorvoConfigKey(kFileId_ChipConfig, 0x05); static constexpr Key kConfigKey_FailSafeArmed = QorvoConfigKey(kFileId_ChipConfig, 0x06); static constexpr Key kConfigKey_GroupKey = QorvoConfigKey(kFileId_ChipConfig, 0x07); @@ -100,7 +98,7 @@ class QPGConfig // Set key id limits for each group. static constexpr Key kMinConfigKey_ChipFactory = kConfigKey_SerialNum; static constexpr Key kMaxConfigKey_ChipFactory = kConfigKey_Spake2pVerifier; - static constexpr Key kMinConfigKey_ChipConfig = kConfigKey_FabricId; + static constexpr Key kMinConfigKey_ChipConfig = kConfigKey_ServiceConfig; static constexpr Key kMaxConfigKey_ChipConfig = kConfigKey_GroupKeyMax; static constexpr Key kMinConfigKey_ChipCounter = kConfigKey_CounterKeyBase; static constexpr Key kMaxConfigKey_ChipCounter = kConfigKey_CounterKeyMax; // Allows 32 Counters to be created. From e9fb68a752384954394a2133eef445bf0fa9b331 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 27 Apr 2022 11:41:34 -0700 Subject: [PATCH 13/59] =?UTF-8?q?Use=20CHIP=20memory=20allocator=20instead?= =?UTF-8?q?=20of=20native=20malloc=20for=20watermark=20stat=E2=80=A6=20(#1?= =?UTF-8?q?7791)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use CHIP memory allocator instead of native malloc for watermark statistics * Address review comment --- src/inet/InetInterface.cpp | 11 ++++++----- src/lib/support/logging/CHIPLogging.cpp | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp index 5d0eb3aa94243f..72da25ea7ad7a2 100644 --- a/src/inet/InetInterface.cpp +++ b/src/inet/InetInterface.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -506,11 +507,11 @@ static void backport_if_freenameindex(struct if_nameindex * inArray) { if (inArray[i].if_name != NULL) { - free(inArray[i].if_name); + MemoryFree(inArray[i].if_name); } } - free(inArray); + MemoryFree(inArray); } static struct if_nameindex * backport_if_nameindex(void) @@ -542,7 +543,7 @@ static struct if_nameindex * backport_if_nameindex(void) lastIntfName = addrIter->ifa_name; } - tmpval = (struct if_nameindex *) malloc((numIntf + 1) * sizeof(struct if_nameindex)); + tmpval = (struct if_nameindex *) MemoryAlloc((numIntf + 1) * sizeof(struct if_nameindex)); VerifyOrExit(tmpval != NULL, ); memset(tmpval, 0, (numIntf + 1) * sizeof(struct if_nameindex)); @@ -574,7 +575,7 @@ static struct if_nameindex * backport_if_nameindex(void) } } - retval = (struct if_nameindex *) malloc((maxIntfNum + 1) * sizeof(struct if_nameindex)); + retval = (struct if_nameindex *) MemoryAlloc((maxIntfNum + 1) * sizeof(struct if_nameindex)); VerifyOrExit(retval != NULL, ); memset(retval, 0, (maxIntfNum + 1) * sizeof(struct if_nameindex)); @@ -614,7 +615,7 @@ static struct if_nameindex * backport_if_nameindex(void) exit: if (tmpval != NULL) { - free(tmpval); + MemoryFree(tmpval); } if (addrList != NULL) diff --git a/src/lib/support/logging/CHIPLogging.cpp b/src/lib/support/logging/CHIPLogging.cpp index 3cbd9e7acdf946..97876d08fb56f9 100644 --- a/src/lib/support/logging/CHIPLogging.cpp +++ b/src/lib/support/logging/CHIPLogging.cpp @@ -26,6 +26,7 @@ #include "CHIPLogging.h" #include +#include #include #include #include @@ -42,7 +43,7 @@ extern "C" void pw_tokenizer_HandleEncodedMessageWithPayload(uintptr_t levels, c { uint8_t log_category = levels >> 8 & 0xFF; uint8_t log_module = levels & 0xFF; - char * buffer = (char *) malloc(2 * size_bytes + 1); + char * buffer = (char *) chip::Platform::MemoryAlloc(2 * size_bytes + 1); if (buffer) { @@ -52,7 +53,7 @@ extern "C" void pw_tokenizer_HandleEncodedMessageWithPayload(uintptr_t levels, c } buffer[2 * size_bytes] = '\0'; chip::Logging::Log(log_module, log_category, "%s", buffer); - free(buffer); + chip::Platform::MemoryFree(buffer); } } From e67b3b43c473638ca4acc65aecabc41358b83b40 Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Thu, 28 Apr 2022 03:11:37 +0800 Subject: [PATCH 14/59] CASESession: Fix SessionResumption bugs (#17728) * CASESession: Fix SessionResumption bugs * Resolve comments --- src/protocols/secure_channel/CASESession.cpp | 114 +++++++++++-------- src/protocols/secure_channel/CASESession.h | 23 ++-- src/transport/CryptoContext.cpp | 3 +- 3 files changed, 82 insertions(+), 58 deletions(-) diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index 21b3b52cfdef50..c791a46a5e3a35 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -92,11 +92,9 @@ using namespace Messaging; using namespace Encoding; using namespace Protocols::SecureChannel; -constexpr uint8_t kKDFSR2Info[] = { 0x53, 0x69, 0x67, 0x6d, 0x61, 0x32 }; -constexpr uint8_t kKDFSR3Info[] = { 0x53, 0x69, 0x67, 0x6d, 0x61, 0x33 }; -constexpr size_t kKDFInfoLength = sizeof(kKDFSR2Info); -constexpr uint8_t kKDFSEInfo[] = { 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73 }; -constexpr size_t kKDFSEInfoLength = sizeof(kKDFSEInfo); +constexpr uint8_t kKDFSR2Info[] = { 0x53, 0x69, 0x67, 0x6d, 0x61, 0x32 }; +constexpr uint8_t kKDFSR3Info[] = { 0x53, 0x69, 0x67, 0x6d, 0x61, 0x33 }; +constexpr size_t kKDFInfoLength = sizeof(kKDFSR2Info); constexpr uint8_t kKDFS1RKeyInfo[] = { 0x53, 0x69, 0x67, 0x6d, 0x61, 0x31, 0x5f, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65 }; constexpr uint8_t kKDFS2RKeyInfo[] = { 0x53, 0x69, 0x67, 0x6d, 0x61, 0x32, 0x5f, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65 }; @@ -131,8 +129,6 @@ CASESession::~CASESession() void CASESession::Finish() { - mCASESessionEstablished = true; - Transport::PeerAddress address = mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->GetPeerAddress(); // Discard the exchange so that Clear() doesn't try closing it. The exchange will handle that. @@ -154,7 +150,6 @@ void CASESession::Clear() // This function zeroes out and resets the memory used by the object. // It's done so that no security related information will be leaked. mCommissioningHash.Clear(); - mCASESessionEstablished = false; PairingSession::Clear(); mState = State::kInitialized; @@ -222,8 +217,6 @@ CASESession::ListenForSessionEstablishment(SessionManager & sessionManager, Fabr mSessionResumptionStorage = sessionResumptionStorage; mLocalMRPConfig = mrpConfig; - mCASESessionEstablished = false; - ChipLogDetail(SecureChannel, "Waiting for Sigma1 msg"); return CHIP_NO_ERROR; @@ -252,8 +245,9 @@ CHIP_ERROR CASESession::EstablishSession(SessionManager & sessionManager, Fabric // been initialized SuccessOrExit(err); - mFabricInfo = fabric; - mLocalMRPConfig = mrpConfig; + mFabricInfo = fabric; + mSessionResumptionStorage = sessionResumptionStorage; + mLocalMRPConfig = mrpConfig; mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout + mExchangeCtxt->GetSessionHandle()->GetAckTimeout()); mPeerNodeId = peerNodeId; @@ -285,30 +279,43 @@ void CASESession::OnResponseTimeout(ExchangeContext * ec) CHIP_ERROR CASESession::DeriveSecureSession(CryptoContext & session) const { - size_t saltlen; - - (void) kKDFSEInfo; - (void) kKDFSEInfoLength; + switch (mState) + { + case State::kFinished: { + std::array msg_salt; - VerifyOrReturnError(mCASESessionEstablished, CHIP_ERROR_INCORRECT_STATE); + { + Encoding::LittleEndian::BufferWriter bbuf(msg_salt); + bbuf.Put(mIPK, sizeof(mIPK)); + bbuf.Put(mMessageDigest, sizeof(mMessageDigest)); - // Generate Salt for Encryption keys - saltlen = sizeof(mIPK) + kSHA256_Hash_Length; + VerifyOrReturnError(bbuf.Fit(), CHIP_ERROR_BUFFER_TOO_SMALL); + } - chip::Platform::ScopedMemoryBuffer msg_salt; - ReturnErrorCodeIf(!msg_salt.Alloc(saltlen), CHIP_ERROR_NO_MEMORY); - { - Encoding::LittleEndian::BufferWriter bbuf(msg_salt.Get(), saltlen); - bbuf.Put(mIPK, sizeof(mIPK)); - bbuf.Put(mMessageDigest, sizeof(mMessageDigest)); + ReturnErrorOnFailure(session.InitFromSecret(ByteSpan(mSharedSecret, mSharedSecret.Length()), ByteSpan(msg_salt), + CryptoContext::SessionInfoType::kSessionEstablishment, mRole)); - VerifyOrReturnError(bbuf.Fit(), CHIP_ERROR_BUFFER_TOO_SMALL); + return CHIP_NO_ERROR; } + case State::kFinishedViaResume: { + std::array msg_salt; - ReturnErrorOnFailure(session.InitFromSecret(ByteSpan(mSharedSecret, mSharedSecret.Length()), ByteSpan(msg_salt.Get(), saltlen), - CryptoContext::SessionInfoType::kSessionEstablishment, mRole)); + { + Encoding::LittleEndian::BufferWriter bbuf(msg_salt); + bbuf.Put(mInitiatorRandom, sizeof(mInitiatorRandom)); + bbuf.Put(mResumeResumptionId.data(), mResumeResumptionId.size()); - return CHIP_NO_ERROR; + VerifyOrReturnError(bbuf.Fit(), CHIP_ERROR_BUFFER_TOO_SMALL); + } + + ReturnErrorOnFailure(session.InitFromSecret(ByteSpan(mSharedSecret, mSharedSecret.Length()), ByteSpan(msg_salt), + CryptoContext::SessionInfoType::kSessionResumption, mRole)); + + return CHIP_NO_ERROR; + } + default: + return CHIP_ERROR_INCORRECT_STATE; + } } CHIP_ERROR CASESession::RecoverInitiatorIpk() @@ -409,17 +416,16 @@ CHIP_ERROR CASESession::SendSigma1() bool resuming = false; if (mSessionResumptionStorage != nullptr) { - SessionResumptionStorage::ResumptionIdStorage resumptionId; CHIP_ERROR err = mSessionResumptionStorage->FindByScopedNodeId(mFabricInfo->GetScopedNodeIdForNode(mPeerNodeId), - resumptionId, mSharedSecret, mPeerCATs); + mResumeResumptionId, mSharedSecret, mPeerCATs); if (err == CHIP_NO_ERROR) { // Found valid resumption state, try to resume the session. - ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(6), resumptionId)); + ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(6), mResumeResumptionId)); uint8_t initiatorResume1MIC[CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES]; MutableByteSpan resumeMICSpan(initiatorResume1MIC); - ReturnErrorOnFailure(GenerateSigmaResumeMIC(ByteSpan(mInitiatorRandom), ByteSpan(resumptionId), + ReturnErrorOnFailure(GenerateSigmaResumeMIC(ByteSpan(mInitiatorRandom), ByteSpan(mResumeResumptionId), ByteSpan(kKDFS1RKeyInfo), ByteSpan(kResume1MIC_Nonce), resumeMICSpan)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(7), resumeMICSpan)); @@ -560,8 +566,11 @@ CHIP_ERROR CASESession::HandleSigma1(System::PacketBufferHandle && msg) CHIP_NO_ERROR == TryResumeSession(SessionResumptionStorage::ConstResumptionIdView(resumptionId.data()), resume1MIC, initiatorRandom)) { + std::copy(initiatorRandom.begin(), initiatorRandom.end(), mInitiatorRandom); + std::copy(resumptionId.begin(), resumptionId.end(), mResumeResumptionId.begin()); + // Send Sigma2Resume message to the initiator - SuccessOrExit(err = SendSigma2Resume(initiatorRandom)); + SuccessOrExit(err = SendSigma2Resume()); mDelegate->OnSessionEstablishmentStarted(); @@ -604,7 +613,7 @@ CHIP_ERROR CASESession::HandleSigma1(System::PacketBufferHandle && msg) return err; } -CHIP_ERROR CASESession::SendSigma2Resume(const ByteSpan & initiatorRandom) +CHIP_ERROR CASESession::SendSigma2Resume() { MATTER_TRACE_EVENT_SCOPE("SendSigma2Resume", "CASESession"); const size_t mrpParamsSize = mLocalMRPConfig.HasValue() ? TLV::EstimateStructOverhead(sizeof(uint16_t), sizeof(uint16_t)) : 0; @@ -624,14 +633,14 @@ CHIP_ERROR CASESession::SendSigma2Resume(const ByteSpan & initiatorRandom) tlvWriter.Init(std::move(msg_R2_resume)); // Generate a new resumption ID - ReturnErrorOnFailure(DRBG_get_bytes(mResumptionId.data(), mResumptionId.size())); + ReturnErrorOnFailure(DRBG_get_bytes(mNewResumptionId.data(), mNewResumptionId.size())); ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); - ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(1), mResumptionId)); + ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(1), mNewResumptionId)); uint8_t sigma2ResumeMIC[CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES]; MutableByteSpan resumeMICSpan(sigma2ResumeMIC); - ReturnErrorOnFailure(GenerateSigmaResumeMIC(initiatorRandom, mResumptionId, ByteSpan(kKDFS2RKeyInfo), + ReturnErrorOnFailure(GenerateSigmaResumeMIC(ByteSpan(mInitiatorRandom), mNewResumptionId, ByteSpan(kKDFS2RKeyInfo), ByteSpan(kResume2MIC_Nonce), resumeMICSpan)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(2), resumeMICSpan)); @@ -735,8 +744,8 @@ CHIP_ERROR CASESession::SendSigma2() static_cast(tbsData2Signature.Length()))); // Generate a new resumption ID - ReturnErrorOnFailure(DRBG_get_bytes(mResumptionId.data(), mResumptionId.size())); - ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(kTag_TBEData_ResumptionID), mResumptionId)); + ReturnErrorOnFailure(DRBG_get_bytes(mNewResumptionId.data(), mNewResumptionId.size())); + ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(kTag_TBEData_ResumptionID), mNewResumptionId)); ReturnErrorOnFailure(tlvWriter.EndContainer(outerContainerType)); ReturnErrorOnFailure(tlvWriter.Finalize()); @@ -842,7 +851,9 @@ CHIP_ERROR CASESession::HandleSigma2Resume(System::PacketBufferHandle && msg) SendStatusReport(mExchangeCtxt, kProtocolCodeSuccess); + mState = State::kFinishedViaResume; Finish(); + exit: if (err != CHIP_NO_ERROR) { @@ -1000,7 +1011,7 @@ CHIP_ERROR CASESession::HandleSigma2(System::PacketBufferHandle && msg) // Retrieve session resumption ID SuccessOrExit(err = decryptedDataTlvReader.Next(TLV::kTLVType_ByteString, TLV::ContextTag(kTag_TBEData_ResumptionID))); - SuccessOrExit(err = decryptedDataTlvReader.GetBytes(mResumptionId.data(), mResumptionId.size())); + SuccessOrExit(err = decryptedDataTlvReader.GetBytes(mNewResumptionId.data(), mNewResumptionId.size())); // Retrieve peer CASE Authenticated Tags (CATs) from peer's NOC. SuccessOrExit(err = ExtractCATsFromOpCert(responderNOC, mPeerCATs)); @@ -1289,14 +1300,16 @@ CHIP_ERROR CASESession::HandleSigma3(System::PacketBufferHandle && msg) if (mSessionResumptionStorage != nullptr) { - CHIP_ERROR err2 = mSessionResumptionStorage->Save(GetPeer(), mResumptionId, mSharedSecret, mPeerCATs); + CHIP_ERROR err2 = mSessionResumptionStorage->Save(GetPeer(), mNewResumptionId, mSharedSecret, mPeerCATs); if (err2 != CHIP_NO_ERROR) ChipLogError(SecureChannel, "Unable to save session resumption state: %" CHIP_ERROR_FORMAT, err2.Format()); } SendStatusReport(mExchangeCtxt, kProtocolCodeSuccess); + mState = State::kFinished; Finish(); + exit: if (err != CHIP_NO_ERROR) { @@ -1487,16 +1500,27 @@ CHIP_ERROR CASESession::SetEffectiveTime() void CASESession::OnSuccessStatusReport() { ChipLogProgress(SecureChannel, "Success status report received. Session was established"); - mCASESessionEstablished = true; if (mSessionResumptionStorage != nullptr) { - CHIP_ERROR err2 = mSessionResumptionStorage->Save(GetPeer(), mResumptionId, mSharedSecret, mPeerCATs); + CHIP_ERROR err2 = mSessionResumptionStorage->Save(GetPeer(), mNewResumptionId, mSharedSecret, mPeerCATs); if (err2 != CHIP_NO_ERROR) ChipLogError(SecureChannel, "Unable to save session resumption state: %" CHIP_ERROR_FORMAT, err2.Format()); } - mState = State::kInitialized; + switch (mState) + { + case State::kSentSigma3: + mState = State::kFinished; + break; + case State::kSentSigma2Resume: + mState = State::kFinishedViaResume; + break; + default: + VerifyOrDie(false && "Reached invalid internal state keeping in CASE session"); + break; + } + Finish(); } diff --git a/src/protocols/secure_channel/CASESession.h b/src/protocols/secure_channel/CASESession.h index a1c136acfa6b26..ebb5dfb92f9f15 100644 --- a/src/protocols/secure_channel/CASESession.h +++ b/src/protocols/secure_channel/CASESession.h @@ -164,12 +164,14 @@ class DLL_EXPORT CASESession : public Messaging::UnsolicitedMessageHandler, private: enum class State : uint8_t { - kInitialized = 0, - kSentSigma1 = 1, - kSentSigma2 = 2, - kSentSigma3 = 3, - kSentSigma1Resume = 4, - kSentSigma2Resume = 5, + kInitialized = 0, + kSentSigma1 = 1, + kSentSigma2 = 2, + kSentSigma3 = 3, + kSentSigma1Resume = 4, + kSentSigma2Resume = 5, + kFinished = 6, + kFinishedViaResume = 7, }; CHIP_ERROR Init(SessionManager & sessionManager, SessionEstablishmentDelegate * delegate); @@ -192,7 +194,7 @@ class DLL_EXPORT CASESession : public Messaging::UnsolicitedMessageHandler, CHIP_ERROR SendSigma3(); CHIP_ERROR HandleSigma3(System::PacketBufferHandle && msg); - CHIP_ERROR SendSigma2Resume(const ByteSpan & initiatorRandom); + CHIP_ERROR SendSigma2Resume(); CHIP_ERROR ConstructSaltSigma2(const ByteSpan & rand, const Crypto::P256PublicKey & pubkey, const ByteSpan & ipk, MutableByteSpan & salt); @@ -255,15 +257,12 @@ class DLL_EXPORT CASESession : public Messaging::UnsolicitedMessageHandler, NodeId mPeerNodeId = kUndefinedNodeId; CATValues mPeerCATs; - // This field is only used for CASE responder, when during sending sigma2 and waiting for sigma3 - SessionResumptionStorage::ResumptionIdStorage mResumptionId; + SessionResumptionStorage::ResumptionIdStorage mResumeResumptionId; // ResumptionId which is used to resume this session + SessionResumptionStorage::ResumptionIdStorage mNewResumptionId; // ResumptionId which is stored to resume future session // Sigma1 initiator random, maintained to be reused post-Sigma1, such as when generating Sigma2 S2RK key uint8_t mInitiatorRandom[kSigmaParamRandomNumberSize]; State mState; - -protected: - bool mCASESessionEstablished = false; }; } // namespace chip diff --git a/src/transport/CryptoContext.cpp b/src/transport/CryptoContext.cpp index a0d3fcf1305f6b..1ef1a06d2a47b9 100644 --- a/src/transport/CryptoContext.cpp +++ b/src/transport/CryptoContext.cpp @@ -43,7 +43,8 @@ constexpr size_t kMaxAADLen = 128; constexpr uint8_t SEKeysInfo[] = { 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73 }; /* Session Resumption Key Info */ -constexpr uint8_t RSEKeysInfo[] = { 0x53, 0x69, 0x67, 0x6d, 0x61, 0x31, 0x5f, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65 }; +constexpr uint8_t RSEKeysInfo[] = { 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, + 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73 }; } // namespace From dab97ff1049831a3be8c14c572abc464672a13b8 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 27 Apr 2022 16:11:07 -0400 Subject: [PATCH 15/59] Remove unused configuration manager keys on Darwin. (#17818) --- src/platform/Darwin/PosixConfig.cpp | 10 ---------- src/platform/Darwin/PosixConfig.h | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/src/platform/Darwin/PosixConfig.cpp b/src/platform/Darwin/PosixConfig.cpp index 014063c8b49d52..919ebc6d618e68 100644 --- a/src/platform/Darwin/PosixConfig.cpp +++ b/src/platform/Darwin/PosixConfig.cpp @@ -46,10 +46,6 @@ const char PosixConfig::kConfigNamespace_ChipCounters[] = "chip-counters"; // Keys stored in the Chip-factory namespace const PosixConfig::Key PosixConfig::kConfigKey_SerialNum = { kConfigNamespace_ChipFactory, "serial-num" }; -const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceId = { kConfigNamespace_ChipFactory, "device-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceCert = { kConfigNamespace_ChipFactory, "device-cert" }; -const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceICACerts = { kConfigNamespace_ChipFactory, "device-ca-certs" }; -const PosixConfig::Key PosixConfig::kConfigKey_MfrDevicePrivateKey = { kConfigNamespace_ChipFactory, "device-key" }; const PosixConfig::Key PosixConfig::kConfigKey_HardwareVersion = { kConfigNamespace_ChipFactory, "hardware-ver" }; const PosixConfig::Key PosixConfig::kConfigKey_ManufacturingDate = { kConfigNamespace_ChipFactory, "mfg-date" }; const PosixConfig::Key PosixConfig::kConfigKey_SetupPinCode = { kConfigNamespace_ChipFactory, "pin-code" }; @@ -61,12 +57,7 @@ const PosixConfig::Key PosixConfig::kConfigKey_VendorId = { kConfig const PosixConfig::Key PosixConfig::kConfigKey_ProductId = { kConfigNamespace_ChipFactory, "product-id" }; // Keys stored in the Chip-config namespace -const PosixConfig::Key PosixConfig::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; -const PosixConfig::Key PosixConfig::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; -const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; @@ -74,7 +65,6 @@ const PosixConfig::Key PosixConfig::kConfigKey_LocationCapability = { kConfigNam // Keys stored in the Chip-counters namespace const PosixConfig::Key PosixConfig::kCounterKey_RebootCount = { kConfigNamespace_ChipCounters, "reboot-count" }; -const PosixConfig::Key PosixConfig::kCounterKey_UpTime = { kConfigNamespace_ChipCounters, "up-time" }; const PosixConfig::Key PosixConfig::kCounterKey_BootReason = { kConfigNamespace_ChipCounters, "boot-reason" }; const PosixConfig::Key PosixConfig::kCounterKey_TotalOperationalHours = { kConfigNamespace_ChipCounters, "total-operational-hours" }; diff --git a/src/platform/Darwin/PosixConfig.h b/src/platform/Darwin/PosixConfig.h index b77aae87dbb3ce..bdad020f308c74 100644 --- a/src/platform/Darwin/PosixConfig.h +++ b/src/platform/Darwin/PosixConfig.h @@ -54,19 +54,10 @@ class PosixConfig // Key definitions for well-known keys. static const Key kConfigKey_SerialNum; static const Key kConfigKey_UniqueId; - static const Key kConfigKey_MfrDeviceId; - static const Key kConfigKey_MfrDeviceCert; - static const Key kConfigKey_MfrDeviceICACerts; - static const Key kConfigKey_MfrDevicePrivateKey; static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_ServiceConfig; - static const Key kConfigKey_PairedAccountId; - static const Key kConfigKey_ServiceId; - static const Key kConfigKey_LastUsedEpochKeyId; static const Key kConfigKey_FailSafeArmed; - static const Key kConfigKey_WiFiStationSecType; static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; @@ -81,7 +72,6 @@ class PosixConfig static const Key kCounterKey_TotalOperationalHours; static const Key kCounterKey_RebootCount; static const Key kCounterKey_BootReason; - static const Key kCounterKey_UpTime; #if !CHIP_DISABLE_PLATFORM_KVS static CHIP_ERROR Init(void); From 73d2d509679f33f54502e2686914313803bdf5f5 Mon Sep 17 00:00:00 2001 From: Bharat Raju Date: Wed, 27 Apr 2022 16:11:24 -0400 Subject: [PATCH 16/59] Renaming Status Enum in xml and regening (#17813) * Renaming Status Enum in xml and regening - Renaming the Status enum with the cluster name prefix because we have multiple definitions of Status Enum with the same name and type - Regerating all the apps after the change * Changing contentLauncher to contentlaunch * Cleaning up the status enum renaming in the static code --- .../all-clusters-app.matter | 44 +- .../placeholder/linux/apps/app1/config.matter | 44 +- .../placeholder/linux/apps/app2/config.matter | 44 +- .../ApplicationLauncherManager.cpp | 6 +- .../AppContentLauncherManager.cpp | 4 +- .../TargetNavigatorManager.cpp | 4 +- .../tv-app/android/java/ChannelManager.cpp | 2 +- .../android/java/ContentLauncherManager.cpp | 4 +- .../android/java/KeypadInputManager.cpp | 4 +- .../android/java/MediaPlaybackManager.cpp | 6 +- .../ApplicationLauncherManager.cpp | 6 +- .../linux/include/channel/ChannelManager.cpp | 6 +- .../ContentLauncherManager.cpp | 4 +- .../keypad-input/KeypadInputManager.cpp | 18 +- .../media-playback/MediaPlaybackManager.cpp | 24 +- .../TargetNavigatorManager.cpp | 4 +- examples/tv-app/tv-common/tv-app.matter | 54 +- .../tv-casting-common/tv-casting-app.matter | 44 +- .../application-launcher-server.cpp | 6 +- .../chip/application-launcher-cluster.xml | 4 +- .../zcl/data-model/chip/channel-cluster.xml | 4 +- .../chip/content-launch-cluster.xml | 4 +- .../data-model/chip/keypad-input-cluster.xml | 4 +- .../chip/media-playback-cluster.xml | 4 +- .../chip/target-navigator-cluster.xml | 4 +- .../data_model/controller-clusters.matter | 56 +- .../python/chip/clusters/Objects.py | 62 +-- .../CHIP/zap-generated/CHIPCallbackBridge.mm | 173 ++++--- .../CHIPCallbackBridge_internal.h | 483 +++++++++--------- .../CHIP/zap-generated/CHIPClustersObjc.h | 34 +- .../app-common/zap-generated/cluster-enums.h | 66 +-- .../zap-generated/cluster-objects.h | 24 +- 32 files changed, 645 insertions(+), 605 deletions(-) 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 00141b2e93de59..ff166c7c5bfb31 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 @@ -128,7 +128,7 @@ server cluster ApplicationBasic = 1293 { } server cluster ApplicationLauncher = 1292 { - enum StatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : ENUM8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; @@ -339,16 +339,16 @@ server cluster BridgedActions = 37 { } server cluster Channel = 1284 { - enum LineupInfoTypeEnum : ENUM8 { - kMso = 0; - } - - enum StatusEnum : ENUM8 { + enum ChannelStatusEnum : ENUM8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } + enum LineupInfoTypeEnum : ENUM8 { + kMso = 0; + } + bitmap ChannelFeature : BITMAP32 { kChannelList = 0x1; kLineupInfo = 0x2; @@ -661,6 +661,12 @@ server cluster ColorControl = 768 { } server cluster ContentLauncher = 1290 { + enum ContentLaunchStatusEnum : ENUM8 { + kSuccess = 0; + kUrlNotAvailable = 1; + kAuthFailed = 2; + } + enum MetricTypeEnum : ENUM8 { kPixels = 0; kPercentage = 1; @@ -682,12 +688,6 @@ server cluster ContentLauncher = 1290 { kType = 12; } - enum StatusEnum : ENUM8 { - kSuccess = 0; - kUrlNotAvailable = 1; - kAuthFailed = 2; - } - bitmap ContentLauncherFeature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; @@ -1910,7 +1910,7 @@ server cluster KeypadInput = 1289 { kData = 118; } - enum StatusEnum : ENUM8 { + enum KeypadInputStatusEnum : ENUM8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; @@ -2057,14 +2057,7 @@ server cluster MediaInput = 1287 { } server cluster MediaPlayback = 1286 { - enum PlaybackStateEnum : ENUM8 { - kPlaying = 0; - kPaused = 1; - kNotPlaying = 2; - kBuffering = 3; - } - - enum StatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : ENUM8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -2073,6 +2066,13 @@ server cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } + enum PlaybackStateEnum : ENUM8 { + kPlaying = 0; + kPaused = 1; + kNotPlaying = 2; + kBuffering = 3; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute nullable epoch_us startTime = 1; readonly attribute nullable int64u duration = 2; @@ -2925,7 +2925,7 @@ server cluster Switch = 59 { } server cluster TargetNavigator = 1285 { - enum StatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : ENUM8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 4f6e5c8259fd74..64c10c41a8dc78 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -327,6 +327,12 @@ server cluster ColorControl = 768 { } client cluster ContentLauncher = 1290 { + enum ContentLaunchStatusEnum : ENUM8 { + kSuccess = 0; + kUrlNotAvailable = 1; + kAuthFailed = 2; + } + enum MetricTypeEnum : ENUM8 { kPixels = 0; kPercentage = 1; @@ -348,12 +354,6 @@ client cluster ContentLauncher = 1290 { kType = 12; } - enum StatusEnum : ENUM8 { - kSuccess = 0; - kUrlNotAvailable = 1; - kAuthFailed = 2; - } - bitmap ContentLauncherFeature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; @@ -420,7 +420,7 @@ client cluster ContentLauncher = 1290 { } response struct LaunchResponse = 2 { - StatusEnum status = 0; + ContentLaunchStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -429,6 +429,12 @@ client cluster ContentLauncher = 1290 { } server cluster ContentLauncher = 1290 { + enum ContentLaunchStatusEnum : ENUM8 { + kSuccess = 0; + kUrlNotAvailable = 1; + kAuthFailed = 2; + } + enum MetricTypeEnum : ENUM8 { kPixels = 0; kPercentage = 1; @@ -450,12 +456,6 @@ server cluster ContentLauncher = 1290 { kType = 12; } - enum StatusEnum : ENUM8 { - kSuccess = 0; - kUrlNotAvailable = 1; - kAuthFailed = 2; - } - bitmap ContentLauncherFeature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; @@ -522,7 +522,7 @@ server cluster ContentLauncher = 1290 { } response struct LaunchResponse = 2 { - StatusEnum status = 0; + ContentLaunchStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -976,7 +976,7 @@ client cluster KeypadInput = 1289 { kData = 118; } - enum StatusEnum : ENUM8 { + enum KeypadInputStatusEnum : ENUM8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; @@ -998,7 +998,7 @@ client cluster KeypadInput = 1289 { } response struct SendKeyResponse = 1 { - StatusEnum status = 0; + KeypadInputStatusEnum status = 0; } command SendKey(SendKeyRequest): SendKeyResponse = 0; @@ -1094,7 +1094,7 @@ server cluster KeypadInput = 1289 { kData = 118; } - enum StatusEnum : ENUM8 { + enum KeypadInputStatusEnum : ENUM8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; @@ -1116,7 +1116,7 @@ server cluster KeypadInput = 1289 { } response struct SendKeyResponse = 1 { - StatusEnum status = 0; + KeypadInputStatusEnum status = 0; } command SendKey(SendKeyRequest): SendKeyResponse = 0; @@ -2148,7 +2148,7 @@ server cluster Switch = 59 { } client cluster TargetNavigator = 1285 { - enum StatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : ENUM8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -2172,7 +2172,7 @@ client cluster TargetNavigator = 1285 { } response struct NavigateTargetResponse = 1 { - StatusEnum status = 0; + TargetNavigatorStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -2180,7 +2180,7 @@ client cluster TargetNavigator = 1285 { } server cluster TargetNavigator = 1285 { - enum StatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : ENUM8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -2204,7 +2204,7 @@ server cluster TargetNavigator = 1285 { } response struct NavigateTargetResponse = 1 { - StatusEnum status = 0; + TargetNavigatorStatusEnum status = 0; optional CHAR_STRING data = 1; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 4f6e5c8259fd74..64c10c41a8dc78 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -327,6 +327,12 @@ server cluster ColorControl = 768 { } client cluster ContentLauncher = 1290 { + enum ContentLaunchStatusEnum : ENUM8 { + kSuccess = 0; + kUrlNotAvailable = 1; + kAuthFailed = 2; + } + enum MetricTypeEnum : ENUM8 { kPixels = 0; kPercentage = 1; @@ -348,12 +354,6 @@ client cluster ContentLauncher = 1290 { kType = 12; } - enum StatusEnum : ENUM8 { - kSuccess = 0; - kUrlNotAvailable = 1; - kAuthFailed = 2; - } - bitmap ContentLauncherFeature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; @@ -420,7 +420,7 @@ client cluster ContentLauncher = 1290 { } response struct LaunchResponse = 2 { - StatusEnum status = 0; + ContentLaunchStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -429,6 +429,12 @@ client cluster ContentLauncher = 1290 { } server cluster ContentLauncher = 1290 { + enum ContentLaunchStatusEnum : ENUM8 { + kSuccess = 0; + kUrlNotAvailable = 1; + kAuthFailed = 2; + } + enum MetricTypeEnum : ENUM8 { kPixels = 0; kPercentage = 1; @@ -450,12 +456,6 @@ server cluster ContentLauncher = 1290 { kType = 12; } - enum StatusEnum : ENUM8 { - kSuccess = 0; - kUrlNotAvailable = 1; - kAuthFailed = 2; - } - bitmap ContentLauncherFeature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; @@ -522,7 +522,7 @@ server cluster ContentLauncher = 1290 { } response struct LaunchResponse = 2 { - StatusEnum status = 0; + ContentLaunchStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -976,7 +976,7 @@ client cluster KeypadInput = 1289 { kData = 118; } - enum StatusEnum : ENUM8 { + enum KeypadInputStatusEnum : ENUM8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; @@ -998,7 +998,7 @@ client cluster KeypadInput = 1289 { } response struct SendKeyResponse = 1 { - StatusEnum status = 0; + KeypadInputStatusEnum status = 0; } command SendKey(SendKeyRequest): SendKeyResponse = 0; @@ -1094,7 +1094,7 @@ server cluster KeypadInput = 1289 { kData = 118; } - enum StatusEnum : ENUM8 { + enum KeypadInputStatusEnum : ENUM8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; @@ -1116,7 +1116,7 @@ server cluster KeypadInput = 1289 { } response struct SendKeyResponse = 1 { - StatusEnum status = 0; + KeypadInputStatusEnum status = 0; } command SendKey(SendKeyRequest): SendKeyResponse = 0; @@ -2148,7 +2148,7 @@ server cluster Switch = 59 { } client cluster TargetNavigator = 1285 { - enum StatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : ENUM8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -2172,7 +2172,7 @@ client cluster TargetNavigator = 1285 { } response struct NavigateTargetResponse = 1 { - StatusEnum status = 0; + TargetNavigatorStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -2180,7 +2180,7 @@ client cluster TargetNavigator = 1285 { } server cluster TargetNavigator = 1285 { - enum StatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : ENUM8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -2204,7 +2204,7 @@ server cluster TargetNavigator = 1285 { } response struct NavigateTargetResponse = 1 { - StatusEnum status = 0; + TargetNavigatorStatusEnum status = 0; optional CHAR_STRING data = 1; } diff --git a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp index f8b5043d5dac56..b1ef1d11c36a2c 100644 --- a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp +++ b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp @@ -45,7 +45,7 @@ void ApplicationLauncherManager::HandleLaunchApp(CommandResponseHelper mTargets.size()) { response.data = chip::MakeOptional(CharSpan::fromCharString("error")); - response.status = StatusEnum::kTargetNotFound; + response.status = TargetNavigatorStatusEnum::kTargetNotFound; helper.Success(response); return; } mCurrentTarget = static_cast(target); response.data = chip::MakeOptional(CharSpan::fromCharString("data response")); - response.status = StatusEnum::kSuccess; + response.status = TargetNavigatorStatusEnum::kSuccess; helper.Success(response); } diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp index fef1174fbd9a84..48728c376deb32 100644 --- a/examples/tv-app/android/java/ChannelManager.cpp +++ b/examples/tv-app/android/java/ChannelManager.cpp @@ -284,7 +284,7 @@ void ChannelManager::HandleChangeChannel(CommandResponseHelperGetFieldID(channelClass, "status", "I"); jint jstatus = env->GetIntField(channelObject, getStatusField); - response.status = static_cast(jstatus); + response.status = static_cast(jstatus); jfieldID getNameField = env->GetFieldID(channelClass, "name", "Ljava/lang/String;"); jstring jname = static_cast(env->GetObjectField(channelObject, getNameField)); diff --git a/examples/tv-app/android/java/ContentLauncherManager.cpp b/examples/tv-app/android/java/ContentLauncherManager.cpp index 219cac94f5b47e..78868abdbb68ae 100644 --- a/examples/tv-app/android/java/ContentLauncherManager.cpp +++ b/examples/tv-app/android/java/ContentLauncherManager.cpp @@ -85,7 +85,7 @@ void ContentLauncherManager::HandleLaunchContent(CommandResponseHelperGetObjectField(resp, dataFid); JniUtfString dataStr(env, jdataStr); - response.status = static_cast(status); + response.status = static_cast(status); response.data = chip::Optional(dataStr.charSpan()); err = helper.Success(response); @@ -140,7 +140,7 @@ void ContentLauncherManager::HandleLaunchUrl(CommandResponseHelperGetObjectField(resp, dataFid); JniUtfString dataStr(env, jdataStr); - response.status = static_cast(status); + response.status = static_cast(status); response.data = chip::Optional(dataStr.charSpan()); err = helper.Success(response); diff --git a/examples/tv-app/android/java/KeypadInputManager.cpp b/examples/tv-app/android/java/KeypadInputManager.cpp index 18492edad71084..f8c19a136c2609 100644 --- a/examples/tv-app/android/java/KeypadInputManager.cpp +++ b/examples/tv-app/android/java/KeypadInputManager.cpp @@ -59,11 +59,11 @@ void KeypadInputManager::HandleSendKey(CommandResponseHelper(ret); + response.status = static_cast(ret); } helper.Success(response); } diff --git a/examples/tv-app/android/java/MediaPlaybackManager.cpp b/examples/tv-app/android/java/MediaPlaybackManager.cpp index 5ef17ff8037f59..b27d376b0a6b29 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.cpp +++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp @@ -243,14 +243,14 @@ Commands::PlaybackResponse::Type MediaPlaybackManager::HandleMediaRequest(MediaP ChipLogError(AppServer, "Java exception in MediaPlaybackManager::Request %d", mediaPlaybackRequest); env->ExceptionDescribe(); env->ExceptionClear(); - response.status = StatusEnum::kInvalidStateForCommand; + response.status = MediaPlaybackStatusEnum::kInvalidStateForCommand; } - response.status = static_cast(ret); + response.status = static_cast(ret); exit: if (err != CHIP_NO_ERROR) { - response.status = StatusEnum::kInvalidStateForCommand; + response.status = MediaPlaybackStatusEnum::kInvalidStateForCommand; ChipLogError(Zcl, "MediaPlaybackManager::HandleMediaRequest status error: %s", err.AsString()); } diff --git a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp index f8b5043d5dac56..b1ef1d11c36a2c 100644 --- a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp +++ b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp @@ -45,7 +45,7 @@ void ApplicationLauncherManager::HandleLaunchApp(CommandResponseHelper 1) { - response.status = chip::app::Clusters::Channel::StatusEnum::kMultipleMatches; + response.status = chip::app::Clusters::Channel::ChannelStatusEnum::kMultipleMatches; helper.Success(response); } else if (matchedChannels.size() == 0) { // Error: Found no match - response.status = chip::app::Clusters::Channel::StatusEnum::kNoMatches; + response.status = chip::app::Clusters::Channel::ChannelStatusEnum::kNoMatches; helper.Success(response); } else { - response.status = chip::app::Clusters::Channel::StatusEnum::kSuccess; + response.status = chip::app::Clusters::Channel::ChannelStatusEnum::kSuccess; response.data = chip::MakeOptional(CharSpan::fromCharString("data response")); mCurrentChannel = matchedChannels[0]; mCurrentChannelIndex = index; diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp index 8c6abf7418ad4f..cba64f0b73a38d 100644 --- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp +++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp @@ -40,7 +40,7 @@ void ContentLauncherManager::HandleLaunchContent(CommandResponseHelper(0) }; Commands::PlaybackResponse::Type response; response.data = chip::MakeOptional(CharSpan::fromCharString("data response")); - response.status = StatusEnum::kSuccess; + response.status = MediaPlaybackStatusEnum::kSuccess; helper.Success(response); } @@ -113,7 +113,7 @@ void MediaPlaybackManager::HandleRewind(CommandResponseHelper(0) }; Commands::PlaybackResponse::Type response; response.data = chip::MakeOptional(CharSpan::fromCharString("data response")); - response.status = StatusEnum::kSuccess; + response.status = MediaPlaybackStatusEnum::kSuccess; helper.Success(response); } @@ -126,7 +126,7 @@ void MediaPlaybackManager::HandleSkipBackward(CommandResponseHelper(0) }; Commands::PlaybackResponse::Type response; response.data = chip::MakeOptional(CharSpan::fromCharString("data response")); - response.status = StatusEnum::kSuccess; + response.status = MediaPlaybackStatusEnum::kSuccess; helper.Success(response); } diff --git a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp index d0ae459e56fc07..ec9b24598acd3d 100644 --- a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp +++ b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp @@ -56,13 +56,13 @@ void TargetNavigatorManager::HandleNavigateTarget(CommandResponseHelper mTargets.size()) { response.data = chip::MakeOptional(CharSpan::fromCharString("error")); - response.status = StatusEnum::kTargetNotFound; + response.status = TargetNavigatorStatusEnum::kTargetNotFound; helper.Success(response); return; } mCurrentTarget = static_cast(target); response.data = chip::MakeOptional(CharSpan::fromCharString("data response")); - response.status = StatusEnum::kSuccess; + response.status = TargetNavigatorStatusEnum::kSuccess; helper.Success(response); } diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index b79a79fc5b4744..1562faaa7cddc1 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -152,7 +152,7 @@ server cluster ApplicationBasic = 1293 { } server cluster ApplicationLauncher = 1292 { - enum StatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : ENUM8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; @@ -191,7 +191,7 @@ server cluster ApplicationLauncher = 1292 { } response struct LauncherResponse = 3 { - StatusEnum status = 0; + ApplicationLauncherStatusEnum status = 0; OCTET_STRING data = 1; } @@ -308,16 +308,16 @@ server cluster Binding = 30 { } server cluster Channel = 1284 { - enum LineupInfoTypeEnum : ENUM8 { - kMso = 0; - } - - enum StatusEnum : ENUM8 { + enum ChannelStatusEnum : ENUM8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } + enum LineupInfoTypeEnum : ENUM8 { + kMso = 0; + } + bitmap ChannelFeature : BITMAP32 { kChannelList = 0x1; kLineupInfo = 0x2; @@ -358,7 +358,7 @@ server cluster Channel = 1284 { } response struct ChangeChannelResponse = 1 { - StatusEnum status = 0; + ChannelStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -368,6 +368,12 @@ server cluster Channel = 1284 { } server cluster ContentLauncher = 1290 { + enum ContentLaunchStatusEnum : ENUM8 { + kSuccess = 0; + kUrlNotAvailable = 1; + kAuthFailed = 2; + } + enum MetricTypeEnum : ENUM8 { kPixels = 0; kPercentage = 1; @@ -389,12 +395,6 @@ server cluster ContentLauncher = 1290 { kType = 12; } - enum StatusEnum : ENUM8 { - kSuccess = 0; - kUrlNotAvailable = 1; - kAuthFailed = 2; - } - bitmap ContentLauncherFeature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; @@ -459,7 +459,7 @@ server cluster ContentLauncher = 1290 { } response struct LaunchResponse = 2 { - StatusEnum status = 0; + ContentLaunchStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -863,7 +863,7 @@ server cluster KeypadInput = 1289 { kData = 118; } - enum StatusEnum : ENUM8 { + enum KeypadInputStatusEnum : ENUM8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; @@ -1032,14 +1032,7 @@ server cluster MediaInput = 1287 { } server cluster MediaPlayback = 1286 { - enum PlaybackStateEnum : ENUM8 { - kPlaying = 0; - kPaused = 1; - kNotPlaying = 2; - kBuffering = 3; - } - - enum StatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : ENUM8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -1048,6 +1041,13 @@ server cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } + enum PlaybackStateEnum : ENUM8 { + kPlaying = 0; + kPaused = 1; + kNotPlaying = 2; + kBuffering = 3; + } + struct PlaybackPosition { INT64U updatedAt = 0; nullable INT64U position = 1; @@ -1075,7 +1075,7 @@ server cluster MediaPlayback = 1286 { } response struct PlaybackResponse = 10 { - StatusEnum status = 0; + MediaPlaybackStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -1699,7 +1699,7 @@ server cluster SoftwareDiagnostics = 52 { } server cluster TargetNavigator = 1285 { - enum StatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : ENUM8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -1721,7 +1721,7 @@ server cluster TargetNavigator = 1285 { } response struct NavigateTargetResponse = 1 { - StatusEnum status = 0; + TargetNavigatorStatusEnum status = 0; optional CHAR_STRING data = 1; } 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 fc5b7315713bb0..3acb85f9f9b48b 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 @@ -141,7 +141,7 @@ client cluster ApplicationBasic = 1293 { } client cluster ApplicationLauncher = 1292 { - enum StatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : ENUM8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; @@ -292,16 +292,16 @@ server cluster Binding = 30 { } client cluster Channel = 1284 { - enum LineupInfoTypeEnum : ENUM8 { - kMso = 0; - } - - enum StatusEnum : ENUM8 { + enum ChannelStatusEnum : ENUM8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } + enum LineupInfoTypeEnum : ENUM8 { + kMso = 0; + } + bitmap ChannelFeature : BITMAP32 { kChannelList = 0x1; kLineupInfo = 0x2; @@ -346,6 +346,12 @@ client cluster Channel = 1284 { } client cluster ContentLauncher = 1290 { + enum ContentLaunchStatusEnum : ENUM8 { + kSuccess = 0; + kUrlNotAvailable = 1; + kAuthFailed = 2; + } + enum MetricTypeEnum : ENUM8 { kPixels = 0; kPercentage = 1; @@ -367,12 +373,6 @@ client cluster ContentLauncher = 1290 { kType = 12; } - enum StatusEnum : ENUM8 { - kSuccess = 0; - kUrlNotAvailable = 1; - kAuthFailed = 2; - } - bitmap ContentLauncherFeature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; @@ -950,7 +950,7 @@ client cluster KeypadInput = 1289 { kData = 118; } - enum StatusEnum : ENUM8 { + enum KeypadInputStatusEnum : ENUM8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; @@ -1195,14 +1195,7 @@ client cluster MediaInput = 1287 { } client cluster MediaPlayback = 1286 { - enum PlaybackStateEnum : ENUM8 { - kPlaying = 0; - kPaused = 1; - kNotPlaying = 2; - kBuffering = 3; - } - - enum StatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : ENUM8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -1211,6 +1204,13 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } + enum PlaybackStateEnum : ENUM8 { + kPlaying = 0; + kPaused = 1; + kNotPlaying = 2; + kBuffering = 3; + } + readonly attribute int16u clusterRevision = 65533; request struct SkipForwardRequest { @@ -1794,7 +1794,7 @@ server cluster Switch = 59 { } client cluster TargetNavigator = 1285 { - enum StatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : ENUM8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 1f456e234893f8..1a12db9a628e91 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -232,7 +232,7 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co LauncherResponseType response; const char * buf = "data"; response.data = ByteSpan(from_const_char(buf), strlen(buf)); - response.status = StatusEnum::kAppNotAvailable; + response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; responder.Success(response); return true; } @@ -313,7 +313,7 @@ bool emberAfApplicationLauncherClusterStopAppCallback(app::CommandHandler * comm LauncherResponseType response; const char * buf = "data"; response.data = ByteSpan(from_const_char(buf), strlen(buf)); - response.status = StatusEnum::kAppNotAvailable; + response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; responder.Success(response); return true; } @@ -396,7 +396,7 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm LauncherResponseType response; const char * buf = "data"; response.data = ByteSpan(from_const_char(buf), strlen(buf)); - response.status = StatusEnum::kAppNotAvailable; + response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; responder.Success(response); return true; } diff --git a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml index db34ec1b71f65c..9d9501469447ea 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml @@ -46,7 +46,7 @@ limitations under the License. This command SHALL be generated in response to LaunchApp commands. - + @@ -64,7 +64,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml index 319741801e110c..58583a73a99640 100644 --- a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml @@ -46,7 +46,7 @@ limitations under the License. Upon receipt, this SHALL display the active status of the input list on screen. - + @@ -74,7 +74,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml index a6101ad89592c7..4846a49bd532e3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml @@ -44,7 +44,7 @@ limitations under the License. This command SHALL be generated in response to LaunchContent command. - + @@ -109,7 +109,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml index 11696e3e32d48e..8842498b9d236a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml @@ -32,12 +32,12 @@ limitations under the License. This command SHALL be generated in response to a SendKey Request command. - + - + diff --git a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml index 71c3b00aa31140..2c9b4cc45479b1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml @@ -83,7 +83,7 @@ limitations under the License. This command SHALL be generated in response to various Playback Request commands. - + @@ -103,7 +103,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml index 8295bb40fd2125..8a62451bfe3580 100644 --- a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml @@ -35,12 +35,12 @@ limitations under the License. This command SHALL be generated in response to NavigateTarget commands. - + - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 75056c0daed50c..0716fd020fb9e4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -163,7 +163,7 @@ client cluster ApplicationBasic = 1293 { } client cluster ApplicationLauncher = 1292 { - enum StatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : ENUM8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; @@ -204,7 +204,7 @@ client cluster ApplicationLauncher = 1292 { } response struct LauncherResponse = 3 { - StatusEnum status = 0; + ApplicationLauncherStatusEnum status = 0; OCTET_STRING data = 1; } @@ -552,16 +552,16 @@ client cluster BridgedDeviceBasic = 57 { } client cluster Channel = 1284 { - enum LineupInfoTypeEnum : ENUM8 { - kMso = 0; - } - - enum StatusEnum : ENUM8 { + enum ChannelStatusEnum : ENUM8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } + enum LineupInfoTypeEnum : ENUM8 { + kMso = 0; + } + bitmap ChannelFeature : BITMAP32 { kChannelList = 0x1; kLineupInfo = 0x2; @@ -604,7 +604,7 @@ client cluster Channel = 1284 { } response struct ChangeChannelResponse = 1 { - StatusEnum status = 0; + ChannelStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -910,6 +910,12 @@ client cluster ColorControl = 768 { } client cluster ContentLauncher = 1290 { + enum ContentLaunchStatusEnum : ENUM8 { + kSuccess = 0; + kUrlNotAvailable = 1; + kAuthFailed = 2; + } + enum MetricTypeEnum : ENUM8 { kPixels = 0; kPercentage = 1; @@ -931,12 +937,6 @@ client cluster ContentLauncher = 1290 { kType = 12; } - enum StatusEnum : ENUM8 { - kSuccess = 0; - kUrlNotAvailable = 1; - kAuthFailed = 2; - } - bitmap ContentLauncherFeature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; @@ -1003,7 +1003,7 @@ client cluster ContentLauncher = 1290 { } response struct LaunchResponse = 2 { - StatusEnum status = 0; + ContentLaunchStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -2218,7 +2218,7 @@ client cluster KeypadInput = 1289 { kData = 118; } - enum StatusEnum : ENUM8 { + enum KeypadInputStatusEnum : ENUM8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; @@ -2240,7 +2240,7 @@ client cluster KeypadInput = 1289 { } response struct SendKeyResponse = 1 { - StatusEnum status = 0; + KeypadInputStatusEnum status = 0; } command SendKey(SendKeyRequest): SendKeyResponse = 0; @@ -2403,14 +2403,7 @@ client cluster MediaInput = 1287 { } client cluster MediaPlayback = 1286 { - enum PlaybackStateEnum : ENUM8 { - kPlaying = 0; - kPaused = 1; - kNotPlaying = 2; - kBuffering = 3; - } - - enum StatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : ENUM8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -2419,6 +2412,13 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } + enum PlaybackStateEnum : ENUM8 { + kPlaying = 0; + kPaused = 1; + kNotPlaying = 2; + kBuffering = 3; + } + struct PlaybackPosition { INT64U updatedAt = 0; nullable INT64U position = 1; @@ -2449,7 +2449,7 @@ client cluster MediaPlayback = 1286 { } response struct PlaybackResponse = 10 { - StatusEnum status = 0; + MediaPlaybackStatusEnum status = 0; optional CHAR_STRING data = 1; } @@ -3358,7 +3358,7 @@ client cluster Switch = 59 { } client cluster TargetNavigator = 1285 { - enum StatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : ENUM8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -3382,7 +3382,7 @@ client cluster TargetNavigator = 1285 { } response struct NavigateTargetResponse = 1 { - StatusEnum status = 0; + TargetNavigatorStatusEnum status = 0; optional CHAR_STRING data = 1; } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 976a40de69ae22..0d10f97f0ed423 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -31692,14 +31692,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class LineupInfoTypeEnum(IntEnum): - kMso = 0x00 - - class StatusEnum(IntEnum): + class ChannelStatusEnum(IntEnum): kSuccess = 0x00 kMultipleMatches = 0x01 kNoMatches = 0x02 + class LineupInfoTypeEnum(IntEnum): + kMso = 0x00 + class Structs: @dataclass @@ -31766,11 +31766,11 @@ class ChangeChannelResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=Channel.Enums.StatusEnum), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=Channel.Enums.ChannelStatusEnum), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=typing.Optional[str]), ]) - status: 'Channel.Enums.StatusEnum' = 0 + status: 'Channel.Enums.ChannelStatusEnum' = 0 data: 'typing.Optional[str]' = None @dataclass @@ -31963,7 +31963,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class StatusEnum(IntEnum): + class TargetNavigatorStatusEnum(IntEnum): kSuccess = 0x00 kTargetNotFound = 0x01 kNotAllowed = 0x02 @@ -32013,11 +32013,11 @@ class NavigateTargetResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=TargetNavigator.Enums.StatusEnum), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=TargetNavigator.Enums.TargetNavigatorStatusEnum), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=typing.Optional[str]), ]) - status: 'TargetNavigator.Enums.StatusEnum' = 0 + status: 'TargetNavigator.Enums.TargetNavigatorStatusEnum' = 0 data: 'typing.Optional[str]' = None @@ -32172,13 +32172,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class PlaybackStateEnum(IntEnum): - kPlaying = 0x00 - kPaused = 0x01 - kNotPlaying = 0x02 - kBuffering = 0x03 - - class StatusEnum(IntEnum): + class MediaPlaybackStatusEnum(IntEnum): kSuccess = 0x00 kInvalidStateForCommand = 0x01 kNotAllowed = 0x02 @@ -32186,6 +32180,12 @@ class StatusEnum(IntEnum): kSpeedOutOfRange = 0x04 kSeekOutOfRange = 0x05 + class PlaybackStateEnum(IntEnum): + kPlaying = 0x00 + kPaused = 0x01 + kNotPlaying = 0x02 + kBuffering = 0x03 + class Structs: @dataclass @@ -32348,11 +32348,11 @@ class PlaybackResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=MediaPlayback.Enums.StatusEnum), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatusEnum), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=typing.Optional[str]), ]) - status: 'MediaPlayback.Enums.StatusEnum' = 0 + status: 'MediaPlayback.Enums.MediaPlaybackStatusEnum' = 0 data: 'typing.Optional[str]' = None @dataclass @@ -33033,7 +33033,7 @@ class CecKeyCode(IntEnum): kF5 = 0x75 kData = 0x76 - class StatusEnum(IntEnum): + class KeypadInputStatusEnum(IntEnum): kSuccess = 0x00 kUnsupportedKey = 0x01 kInvalidKeyInCurrentState = 0x02 @@ -33066,10 +33066,10 @@ class SendKeyResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=KeypadInput.Enums.StatusEnum), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=KeypadInput.Enums.KeypadInputStatusEnum), ]) - status: 'KeypadInput.Enums.StatusEnum' = 0 + status: 'KeypadInput.Enums.KeypadInputStatusEnum' = 0 class Attributes: @@ -33181,6 +33181,11 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: + class ContentLaunchStatusEnum(IntEnum): + kSuccess = 0x00 + kUrlNotAvailable = 0x01 + kAuthFailed = 0x02 + class MetricTypeEnum(IntEnum): kPixels = 0x00 kPercentage = 0x01 @@ -33200,11 +33205,6 @@ class ParameterEnum(IntEnum): kSportsTeam = 0x0B kType = 0x0C - class StatusEnum(IntEnum): - kSuccess = 0x00 - kUrlNotAvailable = 0x01 - kAuthFailed = 0x02 - class Structs: @dataclass @@ -33348,11 +33348,11 @@ class LaunchResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ContentLauncher.Enums.StatusEnum), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ContentLauncher.Enums.ContentLaunchStatusEnum), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=typing.Optional[str]), ]) - status: 'ContentLauncher.Enums.StatusEnum' = 0 + status: 'ContentLauncher.Enums.ContentLaunchStatusEnum' = 0 data: 'typing.Optional[str]' = None @@ -33699,7 +33699,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class StatusEnum(IntEnum): + class ApplicationLauncherStatusEnum(IntEnum): kSuccess = 0x00 kAppNotAvailable = 0x01 kSystemBusy = 0x02 @@ -33792,11 +33792,11 @@ class LauncherResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationLauncher.Enums.StatusEnum), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationLauncher.Enums.ApplicationLauncherStatusEnum), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=bytes), ]) - status: 'ApplicationLauncher.Enums.StatusEnum' = 0 + status: 'ApplicationLauncher.Enums.ApplicationLauncherStatusEnum' = 0 data: 'bytes' = b"" diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index f0e07b1e4a6225..20c86b3bf84bf9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -17499,17 +17499,17 @@ } } -void CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::Channel::LineupInfoTypeEnum value) +void CHIPChannelClusterChannelStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::Channel::ChannelStatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPChannelClusterChannelStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17523,8 +17523,8 @@ } } -void CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableChannelClusterChannelStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -17535,9 +17535,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableChannelClusterChannelStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17551,17 +17551,17 @@ } } -void CHIPChannelClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::Channel::StatusEnum value) +void CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::Channel::LineupInfoTypeEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPChannelClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17575,8 +17575,8 @@ } } -void CHIPNullableChannelClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -17587,9 +17587,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableChannelClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17603,17 +17603,18 @@ } } -void CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::TargetNavigator::StatusEnum value) +void CHIPTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::TargetNavigator::TargetNavigatorStatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( + void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17627,8 +17628,8 @@ } } -void CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -17639,9 +17640,11 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( + void * context) { - auto * self = static_cast(context); + auto * self + = static_cast(context); if (!self->mQueue) { return; } @@ -17655,17 +17658,17 @@ } } -void CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) +void CHIPMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::MediaPlayback::MediaPlaybackStatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17679,8 +17682,8 @@ } } -void CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -17691,9 +17694,11 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( + void * context) { - auto * self = static_cast(context); + auto * self + = static_cast(context); if (!self->mQueue) { return; } @@ -17707,17 +17712,17 @@ } } -void CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::MediaPlayback::StatusEnum value) +void CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17731,8 +17736,8 @@ } } -void CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -17743,9 +17748,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17863,17 +17868,17 @@ } } -void CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::KeypadInput::StatusEnum value) +void CHIPKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::KeypadInput::KeypadInputStatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPKeypadInputClusterKeypadInputStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17887,8 +17892,8 @@ } } -void CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -17899,9 +17904,10 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableKeypadInputClusterKeypadInputStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( + void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17915,17 +17921,17 @@ } } -void CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ContentLauncher::MetricTypeEnum value) +void CHIPContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::ContentLauncher::ContentLaunchStatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPContentLauncherClusterContentLaunchStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17939,8 +17945,8 @@ } } -void CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -17951,9 +17957,11 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableContentLauncherClusterContentLaunchStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( + void * context) { - auto * self = static_cast(context); + auto * self + = static_cast(context); if (!self->mQueue) { return; } @@ -17967,17 +17975,17 @@ } } -void CHIPContentLauncherClusterParameterEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ContentLauncher::ParameterEnum value) +void CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::ContentLauncher::MetricTypeEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -17991,8 +17999,8 @@ } } -void CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -18003,9 +18011,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -18019,17 +18027,17 @@ } } -void CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ContentLauncher::StatusEnum value) +void CHIPContentLauncherClusterParameterEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::ContentLauncher::ParameterEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -18043,8 +18051,8 @@ } } -void CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -18055,9 +18063,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -18123,17 +18131,19 @@ } } -void CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ApplicationLauncher::StatusEnum value) +void CHIPApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( + void * context) { - auto * self = static_cast(context); + auto * self + = static_cast(context); if (!self->mQueue) { return; } @@ -18147,8 +18157,8 @@ } } -void CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -18159,9 +18169,12 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackSubscriptionBridge:: + OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self + = static_cast( + context); if (!self->mQueue) { return; } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index e069190147a20b..d939c3b9a7f02e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -501,46 +501,51 @@ typedef void (*NullableIasAceClusterIasAcePanelStatusAttributeCallback)( typedef void (*IasAceClusterIasZoneTypeAttributeCallback)(void *, chip::app::Clusters::IasAce::IasZoneType); typedef void (*NullableIasAceClusterIasZoneTypeAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*ChannelClusterChannelStatusEnumAttributeCallback)(void *, chip::app::Clusters::Channel::ChannelStatusEnum); +typedef void (*NullableChannelClusterChannelStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*ChannelClusterLineupInfoTypeEnumAttributeCallback)(void *, chip::app::Clusters::Channel::LineupInfoTypeEnum); typedef void (*NullableChannelClusterLineupInfoTypeEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*ChannelClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::Channel::StatusEnum); -typedef void (*NullableChannelClusterStatusEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*TargetNavigatorClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::TargetNavigator::StatusEnum); -typedef void (*NullableTargetNavigatorClusterStatusEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); +typedef void (*TargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallback)( + void *, chip::app::Clusters::TargetNavigator::TargetNavigatorStatusEnum); +typedef void (*NullableTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*MediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallback)( + void *, chip::app::Clusters::MediaPlayback::MediaPlaybackStatusEnum); +typedef void (*NullableMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*MediaPlaybackClusterPlaybackStateEnumAttributeCallback)(void *, chip::app::Clusters::MediaPlayback::PlaybackStateEnum); typedef void (*NullableMediaPlaybackClusterPlaybackStateEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*MediaPlaybackClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::MediaPlayback::StatusEnum); -typedef void (*NullableMediaPlaybackClusterStatusEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); typedef void (*MediaInputClusterInputTypeEnumAttributeCallback)(void *, chip::app::Clusters::MediaInput::InputTypeEnum); typedef void (*NullableMediaInputClusterInputTypeEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); typedef void (*KeypadInputClusterCecKeyCodeAttributeCallback)(void *, chip::app::Clusters::KeypadInput::CecKeyCode); typedef void (*NullableKeypadInputClusterCecKeyCodeAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*KeypadInputClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::KeypadInput::StatusEnum); -typedef void (*NullableKeypadInputClusterStatusEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); +typedef void (*KeypadInputClusterKeypadInputStatusEnumAttributeCallback)(void *, + chip::app::Clusters::KeypadInput::KeypadInputStatusEnum); +typedef void (*NullableKeypadInputClusterKeypadInputStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*ContentLauncherClusterContentLaunchStatusEnumAttributeCallback)( + void *, chip::app::Clusters::ContentLauncher::ContentLaunchStatusEnum); +typedef void (*NullableContentLauncherClusterContentLaunchStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*ContentLauncherClusterMetricTypeEnumAttributeCallback)(void *, chip::app::Clusters::ContentLauncher::MetricTypeEnum); typedef void (*NullableContentLauncherClusterMetricTypeEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); typedef void (*ContentLauncherClusterParameterEnumAttributeCallback)(void *, chip::app::Clusters::ContentLauncher::ParameterEnum); typedef void (*NullableContentLauncherClusterParameterEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*ContentLauncherClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::ContentLauncher::StatusEnum); -typedef void (*NullableContentLauncherClusterStatusEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); typedef void (*AudioOutputClusterOutputTypeEnumAttributeCallback)(void *, chip::app::Clusters::AudioOutput::OutputTypeEnum); typedef void (*NullableAudioOutputClusterOutputTypeEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*ApplicationLauncherClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::ApplicationLauncher::StatusEnum); -typedef void (*NullableApplicationLauncherClusterStatusEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); +typedef void (*ApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallback)( + void *, chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatusEnum); +typedef void (*NullableApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*ApplicationBasicClusterApplicationStatusEnumAttributeCallback)( void *, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum); typedef void (*NullableApplicationBasicClusterApplicationStatusEnumAttributeCallback)( @@ -15221,6 +15226,64 @@ class CHIPNullableIasAceClusterIasZoneTypeAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPChannelClusterChannelStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPChannelClusterChannelStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::Channel::ChannelStatusEnum value); +}; + +class CHIPChannelClusterChannelStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPChannelClusterChannelStatusEnumAttributeCallbackBridge +{ +public: + CHIPChannelClusterChannelStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPChannelClusterChannelStatusEnumAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPNullableChannelClusterChannelStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPNullableChannelClusterChannelStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class CHIPNullableChannelClusterChannelStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableChannelClusterChannelStatusEnumAttributeCallbackBridge +{ +public: + CHIPNullableChannelClusterChannelStatusEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableChannelClusterChannelStatusEnumAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackBridge : public CHIPCallbackBridge { @@ -15279,23 +15342,26 @@ class CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionB SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPChannelClusterStatusEnumAttributeCallbackBridge : public CHIPCallbackBridge +class CHIPTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPChannelClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::Channel::StatusEnum value); + static void OnSuccessFn(void * context, chip::app::Clusters::TargetNavigator::TargetNavigatorStatusEnum value); }; -class CHIPChannelClusterStatusEnumAttributeCallbackSubscriptionBridge : public CHIPChannelClusterStatusEnumAttributeCallbackBridge +class CHIPTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge { public: - CHIPChannelClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPChannelClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -15305,25 +15371,30 @@ class CHIPChannelClusterStatusEnumAttributeCallbackSubscriptionBridge : public C SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableChannelClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableChannelClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPNullableTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, + OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, const chip::app::DataModel::Nullable & value); + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableChannelClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPNullableChannelClusterStatusEnumAttributeCallbackBridge +class CHIPNullableTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge { public: - CHIPNullableChannelClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableChannelClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableTargetNavigatorClusterTargetNavigatorStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -15333,25 +15404,26 @@ class CHIPNullableChannelClusterStatusEnumAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::TargetNavigator::StatusEnum value); + static void OnSuccessFn(void * context, chip::app::Clusters::MediaPlayback::MediaPlaybackStatusEnum value); }; -class CHIPTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge +class CHIPMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge { public: - CHIPTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -15361,27 +15433,28 @@ class CHIPTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, + OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge +class CHIPNullableMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge { public: - CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge( + CHIPNullableMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableMediaPlaybackClusterMediaPlaybackStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -15450,64 +15523,6 @@ class CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscrip SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, chip::app::Clusters::MediaPlayback::StatusEnum value); -}; - -class CHIPMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge -{ -public: - CHIPMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); -}; - -class CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge -{ -public: - CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - class CHIPMediaInputClusterInputTypeEnumAttributeCallbackBridge : public CHIPCallbackBridge { @@ -15623,25 +15638,26 @@ class CHIPNullableKeypadInputClusterCecKeyCodeAttributeCallbackSubscriptionBridg SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::KeypadInput::StatusEnum value); + static void OnSuccessFn(void * context, chip::app::Clusters::KeypadInput::KeypadInputStatusEnum value); }; -class CHIPKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge +class CHIPKeypadInputClusterKeypadInputStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge { public: - CHIPKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPKeypadInputClusterKeypadInputStatusEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -15651,26 +15667,89 @@ class CHIPKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPNullableKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge +class CHIPNullableKeypadInputClusterKeypadInputStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge { public: - CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableKeypadInputClusterKeypadInputStatusEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableKeypadInputClusterKeypadInputStatusEnumAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::ContentLauncher::ContentLaunchStatusEnum value); +}; + +class CHIPContentLauncherClusterContentLaunchStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge +{ +public: + CHIPContentLauncherClusterContentLaunchStatusEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPNullableContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPNullableContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, + OnSuccessFn, keepAlive){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class CHIPNullableContentLauncherClusterContentLaunchStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge +{ +public: + CHIPNullableContentLauncherClusterContentLaunchStatusEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableContentLauncherClusterContentLaunchStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -15796,64 +15875,6 @@ class CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackSubscripti SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, chip::app::Clusters::ContentLauncher::StatusEnum value); -}; - -class CHIPContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge -{ -public: - CHIPContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); -}; - -class CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge -{ -public: - CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - class CHIPAudioOutputClusterOutputTypeEnumAttributeCallbackBridge : public CHIPCallbackBridge { @@ -15912,25 +15933,28 @@ class CHIPNullableAudioOutputClusterOutputTypeEnumAttributeCallbackSubscriptionB SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, + OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::ApplicationLauncher::StatusEnum value); + static void OnSuccessFn(void * context, chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatusEnum value); }; -class CHIPApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge +class CHIPApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge { public: - CHIPApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -15940,27 +15964,30 @@ class CHIPApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridg SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge( + queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + static void OnSuccessFn( + void * context, + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge - : public CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge +class CHIPNullableApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge { public: - CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge( + CHIPNullableApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableApplicationLauncherClusterApplicationLauncherStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 0ded00acd54868..226a97758d73d2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -16503,16 +16503,16 @@ typedef NS_OPTIONS(uint8_t, CHIPIasWdWarningInfo) { CHIPIasWdWarningInfoSirenLevel = 0x3, }; -typedef NS_ENUM(uint8_t, CHIPChannelLineupInfoType) { - CHIPChannelLineupInfoTypeMso = 0x00, -}; - typedef NS_ENUM(uint8_t, CHIPChannelStatus) { CHIPChannelStatusSuccess = 0x00, CHIPChannelStatusMultipleMatches = 0x01, CHIPChannelStatusNoMatches = 0x02, }; +typedef NS_ENUM(uint8_t, CHIPChannelLineupInfoType) { + CHIPChannelLineupInfoTypeMso = 0x00, +}; + typedef NS_OPTIONS(uint32_t, CHIPChannelFeature) { CHIPChannelFeatureChannelList = 0x1, CHIPChannelFeatureLineupInfo = 0x2, @@ -16524,13 +16524,6 @@ typedef NS_ENUM(uint8_t, CHIPTargetNavigatorStatus) { CHIPTargetNavigatorStatusNotAllowed = 0x02, }; -typedef NS_ENUM(uint8_t, CHIPMediaPlaybackPlaybackState) { - CHIPMediaPlaybackPlaybackStatePlaying = 0x00, - CHIPMediaPlaybackPlaybackStatePaused = 0x01, - CHIPMediaPlaybackPlaybackStateNotPlaying = 0x02, - CHIPMediaPlaybackPlaybackStateBuffering = 0x03, -}; - typedef NS_ENUM(uint8_t, CHIPMediaPlaybackStatus) { CHIPMediaPlaybackStatusSuccess = 0x00, CHIPMediaPlaybackStatusInvalidStateForCommand = 0x01, @@ -16540,6 +16533,13 @@ typedef NS_ENUM(uint8_t, CHIPMediaPlaybackStatus) { CHIPMediaPlaybackStatusSeekOutOfRange = 0x05, }; +typedef NS_ENUM(uint8_t, CHIPMediaPlaybackPlaybackState) { + CHIPMediaPlaybackPlaybackStatePlaying = 0x00, + CHIPMediaPlaybackPlaybackStatePaused = 0x01, + CHIPMediaPlaybackPlaybackStateNotPlaying = 0x02, + CHIPMediaPlaybackPlaybackStateBuffering = 0x03, +}; + typedef NS_ENUM(uint8_t, CHIPMediaInputInputType) { CHIPMediaInputInputTypeInternal = 0x00, CHIPMediaInputInputTypeAux = 0x01, @@ -16660,6 +16660,12 @@ typedef NS_OPTIONS(uint32_t, CHIPKeypadInputFeature) { CHIPKeypadInputFeatureNumberKeys = 0x4, }; +typedef NS_ENUM(uint8_t, CHIPContentLauncherContentLaunchStatus) { + CHIPContentLauncherContentLaunchStatusSuccess = 0x00, + CHIPContentLauncherContentLaunchStatusUrlNotAvailable = 0x01, + CHIPContentLauncherContentLaunchStatusAuthFailed = 0x02, +}; + typedef NS_ENUM(uint8_t, CHIPContentLauncherMetricType) { CHIPContentLauncherMetricTypePIXELS = 0x00, CHIPContentLauncherMetricTypePERCENTAGE = 0x01, @@ -16681,12 +16687,6 @@ typedef NS_ENUM(uint8_t, CHIPContentLauncherParameter) { CHIPContentLauncherParameterType = 0x0C, }; -typedef NS_ENUM(uint8_t, CHIPContentLauncherStatus) { - CHIPContentLauncherStatusSuccess = 0x00, - CHIPContentLauncherStatusUrlNotAvailable = 0x01, - CHIPContentLauncherStatusAuthFailed = 0x02, -}; - typedef NS_OPTIONS(uint32_t, CHIPContentLauncherFeature) { CHIPContentLauncherFeatureContentSearch = 0x1, CHIPContentLauncherFeatureURLPlayback = 0x2, diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index e1fbc609d73341..8309fe4d0a0b22 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -2126,20 +2126,20 @@ namespace WakeOnLan { namespace Channel { -// Enum for LineupInfoTypeEnum -enum class LineupInfoTypeEnum : uint8_t -{ - kMso = 0x00, -}; - -// Enum for StatusEnum -enum class StatusEnum : uint8_t +// Enum for ChannelStatusEnum +enum class ChannelStatusEnum : uint8_t { kSuccess = 0x00, kMultipleMatches = 0x01, kNoMatches = 0x02, }; +// Enum for LineupInfoTypeEnum +enum class LineupInfoTypeEnum : uint8_t +{ + kMso = 0x00, +}; + // Bitmap for ChannelFeature enum class ChannelFeature : uint32_t { @@ -2150,8 +2150,8 @@ enum class ChannelFeature : uint32_t namespace TargetNavigator { -// Enum for StatusEnum -enum class StatusEnum : uint8_t +// Enum for TargetNavigatorStatusEnum +enum class TargetNavigatorStatusEnum : uint8_t { kSuccess = 0x00, kTargetNotFound = 0x01, @@ -2161,17 +2161,8 @@ enum class StatusEnum : uint8_t namespace MediaPlayback { -// Enum for PlaybackStateEnum -enum class PlaybackStateEnum : uint8_t -{ - kPlaying = 0x00, - kPaused = 0x01, - kNotPlaying = 0x02, - kBuffering = 0x03, -}; - -// Enum for StatusEnum -enum class StatusEnum : uint8_t +// Enum for MediaPlaybackStatusEnum +enum class MediaPlaybackStatusEnum : uint8_t { kSuccess = 0x00, kInvalidStateForCommand = 0x01, @@ -2180,6 +2171,15 @@ enum class StatusEnum : uint8_t kSpeedOutOfRange = 0x04, kSeekOutOfRange = 0x05, }; + +// Enum for PlaybackStateEnum +enum class PlaybackStateEnum : uint8_t +{ + kPlaying = 0x00, + kPaused = 0x01, + kNotPlaying = 0x02, + kBuffering = 0x03, +}; } // namespace MediaPlayback namespace MediaInput { @@ -2304,8 +2304,8 @@ enum class CecKeyCode : uint8_t kData = 0x76, }; -// Enum for StatusEnum -enum class StatusEnum : uint8_t +// Enum for KeypadInputStatusEnum +enum class KeypadInputStatusEnum : uint8_t { kSuccess = 0x00, kUnsupportedKey = 0x01, @@ -2323,6 +2323,14 @@ enum class KeypadInputFeature : uint32_t namespace ContentLauncher { +// Enum for ContentLaunchStatusEnum +enum class ContentLaunchStatusEnum : uint8_t +{ + kSuccess = 0x00, + kUrlNotAvailable = 0x01, + kAuthFailed = 0x02, +}; + // Enum for MetricTypeEnum enum class MetricTypeEnum : uint8_t { @@ -2348,14 +2356,6 @@ enum class ParameterEnum : uint8_t kType = 0x0C, }; -// Enum for StatusEnum -enum class StatusEnum : uint8_t -{ - kSuccess = 0x00, - kUrlNotAvailable = 0x01, - kAuthFailed = 0x02, -}; - // Bitmap for ContentLauncherFeature enum class ContentLauncherFeature : uint32_t { @@ -2393,8 +2393,8 @@ enum class AudioOutputFeature : uint32_t namespace ApplicationLauncher { -// Enum for StatusEnum -enum class StatusEnum : uint8_t +// Enum for ApplicationLauncherStatusEnum +enum class ApplicationLauncherStatusEnum : uint8_t { kSuccess = 0x00, kAppNotAvailable = 0x01, 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 7d3db24a221bb6..322c76cb61a72c 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 @@ -32209,7 +32209,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::ChangeChannelResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } - StatusEnum status = static_cast(0); + ChannelStatusEnum status = static_cast(0); Optional data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -32225,7 +32225,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::ChangeChannelResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } - StatusEnum status = static_cast(0); + ChannelStatusEnum status = static_cast(0); Optional data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -32513,7 +32513,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::NavigateTargetResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } - StatusEnum status = static_cast(0); + TargetNavigatorStatusEnum status = static_cast(0); Optional data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -32529,7 +32529,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::NavigateTargetResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } - StatusEnum status = static_cast(0); + TargetNavigatorStatusEnum status = static_cast(0); Optional data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -33039,7 +33039,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::PlaybackResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - StatusEnum status = static_cast(0); + MediaPlaybackStatusEnum status = static_cast(0); Optional data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -33055,7 +33055,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::PlaybackResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - StatusEnum status = static_cast(0); + MediaPlaybackStatusEnum status = static_cast(0); Optional data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -33743,7 +33743,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::SendKeyResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } - StatusEnum status = static_cast(0); + KeypadInputStatusEnum status = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -33758,7 +33758,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::SendKeyResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } - StatusEnum status = static_cast(0); + KeypadInputStatusEnum status = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SendKeyResponse @@ -34123,7 +34123,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::LaunchResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } - StatusEnum status = static_cast(0); + ContentLaunchStatusEnum status = static_cast(0); Optional data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -34139,7 +34139,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::LaunchResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } - StatusEnum status = static_cast(0); + ContentLaunchStatusEnum status = static_cast(0); Optional data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -34662,7 +34662,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::LauncherResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - StatusEnum status = static_cast(0); + ApplicationLauncherStatusEnum status = static_cast(0); chip::ByteSpan data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -34678,7 +34678,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::LauncherResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - StatusEnum status = static_cast(0); + ApplicationLauncherStatusEnum status = static_cast(0); chip::ByteSpan data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; From 4517de3da595831e1a72e2c72ee2d79beda9682a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 27 Apr 2022 16:11:48 -0400 Subject: [PATCH 17/59] Stop storing breadcrumb in persistent storage. (#17769) Breadcrumb is not supposed to be stored persistently. Also adds a bunch of tests and fixes various bugs where we were setting breadcrumbs when we should not (e.g. in error conditions) and not setting them when we should (e.g. when the fail-safe expires). Fixes https://github.com/project-chip/connectedhomeip/issues/17515 --- .../chip-tool-darwin/templates/tests/tests.js | 3 +- .../general-commissioning-server.cpp | 51 ++- .../suites/TestGeneralCommissioning.yaml | 214 ++++++++++++ .../Framework/CHIP/templates/tests/tests.js | 4 +- .../Framework/CHIPTests/CHIPClustersTests.m | 120 ------- src/include/platform/ConfigurationManager.h | 2 - src/include/platform/DeviceControlServer.h | 4 +- .../GenericConfigurationManagerImpl.h | 2 - .../GenericConfigurationManagerImpl.ipp | 12 - src/platform/Ameba/AmebaConfig.cpp | 1 - src/platform/Ameba/AmebaConfig.h | 1 - src/platform/CYW30739/CYW30739Config.h | 1 - src/platform/Darwin/PosixConfig.cpp | 1 - src/platform/Darwin/PosixConfig.h | 1 - src/platform/DeviceControlServer.cpp | 16 +- src/platform/EFR32/EFR32Config.h | 1 - src/platform/ESP32/ESP32Config.cpp | 1 - src/platform/ESP32/ESP32Config.h | 1 - src/platform/Linux/PosixConfig.cpp | 1 - src/platform/Linux/PosixConfig.h | 1 - src/platform/P6/P6Config.cpp | 1 - src/platform/P6/P6Config.h | 1 - src/platform/Tizen/PosixConfig.cpp | 1 - src/platform/Tizen/PosixConfig.h | 1 - src/platform/Zephyr/ZephyrConfig.cpp | 3 +- src/platform/Zephyr/ZephyrConfig.h | 1 - src/platform/android/AndroidConfig.cpp | 1 - src/platform/android/AndroidConfig.h | 1 - .../chip/platform/ConfigurationManager.java | 1 - .../bouffalolab/BL602/BL602Config.cpp | 1 - src/platform/bouffalolab/BL602/BL602Config.h | 1 - .../cc13x2_26x2/CC13X2_26X2Config.cpp | 5 +- src/platform/cc13x2_26x2/CC13X2_26X2Config.h | 1 - src/platform/fake/ConfigurationManagerImpl.h | 2 - src/platform/mbed/MbedConfig.cpp | 1 - src/platform/mbed/MbedConfig.h | 1 - src/platform/nxp/k32w/k32w0/K32W0Config.h | 1 - src/platform/qpg/qpgConfig.h | 1 - src/platform/tests/TestConfigurationMgr.cpp | 15 - .../zap-generated/test/Commands.h | 206 ----------- .../chip-tool/zap-generated/test/Commands.h | 328 +++++++++++++++++- 41 files changed, 570 insertions(+), 442 deletions(-) diff --git a/examples/chip-tool-darwin/templates/tests/tests.js b/examples/chip-tool-darwin/templates/tests/tests.js index 8439bed5f3dec6..c07769440a5dd3 100644 --- a/examples/chip-tool-darwin/templates/tests/tests.js +++ b/examples/chip-tool-darwin/templates/tests/tests.js @@ -277,7 +277,8 @@ function getTests() 'TestDescriptorCluster', // TestBasicInformation needs Reboot //'TestBasicInformation', - 'TestGeneralCommissioning', + // TestGeneralCommissioning needs Reboot + //'TestGeneralCommissioning', 'TestGroupsCluster', 'TestGroupKeyManagementCluster', 'TestIdentifyCluster', diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 692373e63394ea..1e9552a4c99611 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -68,7 +68,6 @@ class GeneralCommissioningAttrAccess : public AttributeAccessInterface GeneralCommissioningAttrAccess() : AttributeAccessInterface(Optional::Missing(), GeneralCommissioning::Id) {} CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; private: CHIP_ERROR ReadIfSupported(CHIP_ERROR (ConfigurationManager::*getter)(uint8_t &), AttributeValueEncoder & aEncoder); @@ -100,9 +99,6 @@ CHIP_ERROR GeneralCommissioningAttrAccess::Read(const ConcreteReadAttributePath case SupportsConcurrentConnection::Id: { return ReadSupportsConcurrentConnection(aEncoder); } - case Breadcrumb::Id: { - return aEncoder.Encode(DeviceLayer::DeviceControlServer::DeviceControlSvr().GetBreadcrumb()); - } default: { break; } @@ -110,27 +106,6 @@ CHIP_ERROR GeneralCommissioningAttrAccess::Read(const ConcreteReadAttributePath return CHIP_NO_ERROR; } -CHIP_ERROR GeneralCommissioningAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) -{ - // TODO: There was discussion about moving the breadcrumb to the attribute store, which would make this function obsolete - - if (aPath.mClusterId != GeneralCommissioning::Id) - { - // We shouldn't have been called at all. - return CHIP_ERROR_INVALID_ARGUMENT; - } - - switch (aPath.mAttributeId) - { - case Attributes::Breadcrumb::Id: - Attributes::Breadcrumb::TypeInfo::DecodableType value; - ReturnErrorOnFailure(aDecoder.Decode(value)); - return DeviceLayer::DeviceControlServer::DeviceControlSvr().SetBreadcrumb(value); - default: - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; - } -} - CHIP_ERROR GeneralCommissioningAttrAccess::ReadIfSupported(CHIP_ERROR (ConfigurationManager::*getter)(uint8_t &), AttributeValueEncoder & aEncoder) { @@ -208,6 +183,8 @@ bool emberAfGeneralCommissioningClusterArmFailSafeCallback(app::CommandHandler * { // Force the timer to expire immediately. failSafeContext.ForceFailSafeTimerExpiry(); + // Don't set the breadcrumb, since expiring the failsafe should + // reset it anyway. response.errorCode = CommissioningError::kOk; commandObj->AddResponse(commandPath, response); } @@ -216,10 +193,10 @@ bool emberAfGeneralCommissioningClusterArmFailSafeCallback(app::CommandHandler * CheckSuccess( failSafeContext.ArmFailSafe(accessingFabricIndex, System::Clock::Seconds16(commandData.expiryLengthSeconds)), Failure); + Breadcrumb::Set(commandPath.mEndpointId, commandData.breadcrumb); response.errorCode = CommissioningError::kOk; commandObj->AddResponse(commandPath, response); } - DeviceLayer::DeviceControlServer::DeviceControlSvr().SetBreadcrumb(commandData.breadcrumb); } else { @@ -265,11 +242,11 @@ bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback( CheckSuccess(server->CommissioningComplete(handle->AsSecureSession()->GetPeerNodeId(), handle->GetFabricIndex()), Failure); + Breadcrumb::Set(commandPath.mEndpointId, 0); response.errorCode = CommissioningError::kOk; } } - DeviceLayer::DeviceControlServer::DeviceControlSvr().SetBreadcrumb(0); commandObj->AddResponse(commandPath, response); return true; @@ -282,9 +259,8 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(app::CommandH MATTER_TRACE_EVENT_SCOPE("SetRegulatoryConfig", "GeneralCommissioning"); DeviceControlServer * server = &DeviceLayer::DeviceControlServer::DeviceControlSvr(); - CheckSuccess(server->SetRegulatoryConfig(to_underlying(commandData.newRegulatoryConfig), commandData.countryCode, - commandData.breadcrumb), - Failure); + CheckSuccess(server->SetRegulatoryConfig(to_underlying(commandData.newRegulatoryConfig), commandData.countryCode), Failure); + Breadcrumb::Set(commandPath.mEndpointId, commandData.breadcrumb); Commands::SetRegulatoryConfigResponse::Type response; response.errorCode = CommissioningError::kOk; @@ -293,8 +269,21 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(app::CommandH return true; } +namespace { +void OnPlatformEventHandler(const DeviceLayer::ChipDeviceEvent * event, intptr_t arg) +{ + if (event->Type == DeviceLayer::DeviceEventType::kFailSafeTimerExpired) + { + // Spec says to reset Breadcrumb attribute to 0. + Breadcrumb::Set(0, 0); + } +} + +} // anonymous namespace + void MatterGeneralCommissioningPluginServerInitCallback() { - DeviceLayer::DeviceControlServer::DeviceControlSvr().SetBreadcrumb(0); + Breadcrumb::Set(0, 0); registerAttributeAccessOverride(&gAttrAccess); + DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler); } diff --git a/src/app/tests/suites/TestGeneralCommissioning.yaml b/src/app/tests/suites/TestGeneralCommissioning.yaml index 320f60e635bbd7..80386a86fd9e96 100644 --- a/src/app/tests/suites/TestGeneralCommissioning.yaml +++ b/src/app/tests/suites/TestGeneralCommissioning.yaml @@ -18,6 +18,12 @@ config: nodeId: 0x12344321 cluster: "General Commissioning" endpoint: 0 + discriminator: + type: INT16U + defaultValue: 3840 + payload: + type: CHAR_STRING + defaultValue: "MT:-24J0AFN00KA0648G00" # This value needs to be generated automatically tests: - label: "Wait for the commissioned device to be retrieved" @@ -52,6 +58,214 @@ tests: response: value: 81 + - label: "Reboot to reset Breadcrumb" + cluster: "SystemCommands" + command: "Reboot" + + - label: "Connect to the device again" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read back Breadcrumb after reboot and ensure it was not persisted" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 0 + + - label: "Set Breadcrumb to nonzero value" + command: "writeAttribute" + attribute: "Breadcrumb" + arguments: + value: 1 + + - label: "Check Breadcrumb set worked" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 1 + + - label: "Send CommissioningComplete without armed fail-safe" + command: "CommissioningComplete" + response: + values: + - name: errorCode + value: 3 # NoFailSafe + + - label: "Check Breadcrumb was not touched by invalid CommissioningComplete" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 1 + + - label: "Open Commissioning Window from alpha" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + # Arming a fail-safe over CASE while a commissioning window is open should not work. + - label: "Try to arm fail-safe" + command: "ArmFailSafe" + arguments: + values: + - name: expiryLengthSeconds + value: 10 + - name: breadcrumb + value: 5000 + response: + values: + - name: errorCode + value: 4 # BusyWithOtherAdmin + + - label: + "Check Breadcrumb was not touched by ArmFailSafe with commissioning + window open" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 1 + + - label: "Reset Breadcrumb to 0 so we can commission" + command: "writeAttribute" + attribute: "Breadcrumb" + arguments: + value: 0 + + - label: "Commission from beta" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: 0x12345 + - name: "payload" + value: payload + + - label: "Wait for the commissioned device to be retrieved for beta" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: 0x12345 + + - label: "Arm fail-safe" + command: "ArmFailSafe" + arguments: + values: + - name: expiryLengthSeconds + value: 500 + - name: breadcrumb + value: 2 + response: + values: + - name: errorCode + value: 0 # OK + + - label: "Check Breadcrumb was properly set by ArmFailSafe" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 2 + + - label: "Try to arm fail-safe from wrong fabric" + command: "ArmFailSafe" + identity: "beta" + arguments: + values: + - name: expiryLengthSeconds + value: 10 + - name: breadcrumb + value: 5000 + response: + values: + - name: errorCode + value: 4 # BusyWithOtherAdmin + + - label: + "Check Breadcrumb was not touched by ArmFailSafe with existing + fail-safe armed" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 2 + + - label: "Send CommissioningComplete from wrong fabric" + command: "CommissioningComplete" + identity: "beta" + response: + values: + - name: errorCode + value: 2 # InvalidAuthentication + + - label: + "Check Breadcrumb was not touched by CommissioningComplete from wrong + fabric" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 2 + + - label: "Close out the fail-safe gracefully" + command: "CommissioningComplete" + response: + values: + - name: errorCode + value: 0 # Ok + + - label: "Check Breadcrumb was reset to 0 by CommissioningComplete" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 0 + + - label: "Arm fail-safe again" + command: "ArmFailSafe" + arguments: + values: + - name: expiryLengthSeconds + value: 500 + - name: breadcrumb + value: 3 + response: + values: + - name: errorCode + value: 0 # OK + + - label: "Check Breadcrumb was set by arming fail-safe again" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 3 + + - label: "Force-expire the fail-safe" + command: "ArmFailSafe" + arguments: + values: + - name: expiryLengthSeconds + value: 0 + - name: breadcrumb + value: 4 + response: + values: + - name: errorCode + value: 0 # OK + + - label: "Check Breadcrumb was reset by expiring the fail-safe" + command: "readAttribute" + attribute: "Breadcrumb" + response: + value: 0 + - label: "Validate presence of SupportsConcurrentConnection" command: "readAttribute" attribute: "SupportsConcurrentConnection" diff --git a/src/darwin/Framework/CHIP/templates/tests/tests.js b/src/darwin/Framework/CHIP/templates/tests/tests.js index aa54647a79220b..b4f0dbdd57df1a 100644 --- a/src/darwin/Framework/CHIP/templates/tests/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests/tests.js @@ -273,7 +273,9 @@ function getTests() 'TestDescriptorCluster', // TestBasicInformation needs support for Reboot with no discriminator //'TestBasicInformation', - 'TestGeneralCommissioning', + // TestGeneralCommissioning does reboots that need to have side-effects, so + // can't be tested in this test framework. + //'TestGeneralCommissioning', 'TestGroupsCluster', 'TestGroupKeyManagementCluster', 'TestIdentifyCluster', diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index e656b0acbc87a6..1bdb545620108c 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -48858,126 +48858,6 @@ - (void)testSendClusterTestDescriptorCluster_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGeneralCommissioning_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGeneralCommissioning_000001_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write Breadcrumb (1/2)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id breadcrumbArgument; - breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:137438953472ULL]; - [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Breadcrumb (1/2) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGeneralCommissioning_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back Breadcrumb (1/2)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back Breadcrumb (1/2) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 137438953472ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGeneralCommissioning_000003_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write Breadcrumb (2/2)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id breadcrumbArgument; - breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:81ULL]; - [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Breadcrumb (2/2) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGeneralCommissioning_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back Breadcrumb (2/2)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back Breadcrumb (2/2) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 81ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGeneralCommissioning_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate presence of SupportsConcurrentConnection"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSupportsConcurrentConnectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate presence of SupportsConcurrentConnection Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTestGroupsCluster_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index d4779dd46f305d..7816b80ff6ea86 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -108,14 +108,12 @@ class ConfigurationManager #endif virtual CHIP_ERROR GetRegulatoryLocation(uint8_t & location) = 0; virtual CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) = 0; - virtual CHIP_ERROR GetBreadcrumb(uint64_t & breadcrumb) = 0; virtual CHIP_ERROR StoreSerialNumber(const char * serialNum, size_t serialNumLen) = 0; virtual CHIP_ERROR StoreManufacturingDate(const char * mfgDate, size_t mfgDateLen) = 0; virtual CHIP_ERROR StoreSoftwareVersion(uint32_t softwareVer) = 0; virtual CHIP_ERROR StoreHardwareVersion(uint16_t hardwareVer) = 0; virtual CHIP_ERROR StoreRegulatoryLocation(uint8_t location) = 0; virtual CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) = 0; - virtual CHIP_ERROR StoreBreadcrumb(uint64_t breadcrumb) = 0; virtual CHIP_ERROR GetRebootCount(uint32_t & rebootCount) = 0; virtual CHIP_ERROR StoreRebootCount(uint32_t rebootCount) = 0; virtual CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours) = 0; diff --git a/src/include/platform/DeviceControlServer.h b/src/include/platform/DeviceControlServer.h index d22a67f5b781a2..6dc4ee7d07fdba 100644 --- a/src/include/platform/DeviceControlServer.h +++ b/src/include/platform/DeviceControlServer.h @@ -89,14 +89,12 @@ class DeviceControlServer final // ===== Members for internal use by other Device Layer components. CHIP_ERROR CommissioningComplete(NodeId peerNodeId, FabricIndex accessingFabricIndex); - CHIP_ERROR SetRegulatoryConfig(uint8_t location, const CharSpan & countryCode, uint64_t breadcrumb); + CHIP_ERROR SetRegulatoryConfig(uint8_t location, const CharSpan & countryCode); CHIP_ERROR ConnectNetworkForOperational(ByteSpan networkID); void SetSwitchDelegate(SwitchDeviceControlDelegate * delegate) { mSwitchDelegate = delegate; } SwitchDeviceControlDelegate * GetSwitchDelegate() const { return mSwitchDelegate; } FailSafeContext & GetFailSafeContext() { return mFailSafeContext; } - CHIP_ERROR SetBreadcrumb(uint64_t breadcrumb); - uint64_t GetBreadcrumb(); static DeviceControlServer & DeviceControlSvr(); diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.h b/src/include/platform/internal/GenericConfigurationManagerImpl.h index 5e33e04e2088e0..65d8281f70b1c8 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.h +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.h @@ -96,8 +96,6 @@ class GenericConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR StoreRegulatoryLocation(uint8_t location) override; CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) override; CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) override; - CHIP_ERROR GetBreadcrumb(uint64_t & breadcrumb) override; - CHIP_ERROR StoreBreadcrumb(uint64_t breadcrumb) override; CHIP_ERROR GetRebootCount(uint32_t & rebootCount) override; CHIP_ERROR StoreRebootCount(uint32_t rebootCount) override; CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours) override; diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp index 91423c452ebc49..11b368dbd81f3c 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp @@ -542,18 +542,6 @@ CHIP_ERROR GenericConfigurationManagerImpl::StoreCountryCode(const return WriteConfigValueStr(ConfigClass::kConfigKey_CountryCode, code, codeLen); } -template -CHIP_ERROR GenericConfigurationManagerImpl::GetBreadcrumb(uint64_t & breadcrumb) -{ - return ReadConfigValue(ConfigClass::kConfigKey_Breadcrumb, breadcrumb); -} - -template -CHIP_ERROR GenericConfigurationManagerImpl::StoreBreadcrumb(uint64_t breadcrumb) -{ - return WriteConfigValue(ConfigClass::kConfigKey_Breadcrumb, breadcrumb); -} - template CHIP_ERROR GenericConfigurationManagerImpl::GetRebootCount(uint32_t & rebootCount) { diff --git a/src/platform/Ameba/AmebaConfig.cpp b/src/platform/Ameba/AmebaConfig.cpp index 34c8cc1d53b5a7..d9a34c92f5cd6c 100644 --- a/src/platform/Ameba/AmebaConfig.cpp +++ b/src/platform/Ameba/AmebaConfig.cpp @@ -85,7 +85,6 @@ const AmebaConfig::Key AmebaConfig::kConfigKey_OperationalDeviceICACerts = { k const AmebaConfig::Key AmebaConfig::kConfigKey_OperationalDevicePrivateKey = { kConfigNamespace_ChipConfig, "op-device-key" }; const AmebaConfig::Key AmebaConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const AmebaConfig::Key AmebaConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const AmebaConfig::Key AmebaConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; // Keys stored in the Chip-counters namespace const AmebaConfig::Key AmebaConfig::kCounterKey_RebootCount = { kConfigNamespace_ChipCounters, "reboot-count" }; diff --git a/src/platform/Ameba/AmebaConfig.h b/src/platform/Ameba/AmebaConfig.h index 6c518132432634..e2af3ea97826c7 100755 --- a/src/platform/Ameba/AmebaConfig.h +++ b/src/platform/Ameba/AmebaConfig.h @@ -74,7 +74,6 @@ class AmebaConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; diff --git a/src/platform/CYW30739/CYW30739Config.h b/src/platform/CYW30739/CYW30739Config.h index 51795a261dc28b..00975a89f77fb6 100644 --- a/src/platform/CYW30739/CYW30739Config.h +++ b/src/platform/CYW30739/CYW30739Config.h @@ -65,7 +65,6 @@ class CYW30739Config static constexpr Key kConfigKey_CountryCode = 18; static constexpr Key kConfigKey_HourFormat = 20; static constexpr Key kConfigKey_CalendarType = 21; - static constexpr Key kConfigKey_Breadcrumb = 22; static constexpr Key kConfigKey_UniqueId = 23; // Set key id limits for each group. diff --git a/src/platform/Darwin/PosixConfig.cpp b/src/platform/Darwin/PosixConfig.cpp index 919ebc6d618e68..7740d6637344a1 100644 --- a/src/platform/Darwin/PosixConfig.cpp +++ b/src/platform/Darwin/PosixConfig.cpp @@ -60,7 +60,6 @@ const PosixConfig::Key PosixConfig::kConfigKey_ProductId = { kConfig const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; const PosixConfig::Key PosixConfig::kConfigKey_LocationCapability = { kConfigNamespace_ChipConfig, "location-capability" }; // Keys stored in the Chip-counters namespace diff --git a/src/platform/Darwin/PosixConfig.h b/src/platform/Darwin/PosixConfig.h index bdad020f308c74..ea4a7222568170 100644 --- a/src/platform/Darwin/PosixConfig.h +++ b/src/platform/Darwin/PosixConfig.h @@ -61,7 +61,6 @@ class PosixConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; diff --git a/src/platform/DeviceControlServer.cpp b/src/platform/DeviceControlServer.cpp index 30f1821bc38283..9c630c53e17872 100644 --- a/src/platform/DeviceControlServer.cpp +++ b/src/platform/DeviceControlServer.cpp @@ -47,18 +47,7 @@ CHIP_ERROR DeviceControlServer::CommissioningComplete(NodeId peerNodeId, FabricI return PlatformMgr().PostEvent(&event); } -CHIP_ERROR DeviceControlServer::SetBreadcrumb(uint64_t breadcrumb) -{ - return ConfigurationMgr().StoreBreadcrumb(breadcrumb); -} -uint64_t DeviceControlServer::GetBreadcrumb() -{ - uint64_t breadcrumb = 0; - ConfigurationMgr().GetBreadcrumb(breadcrumb); - return breadcrumb; -} - -CHIP_ERROR DeviceControlServer::SetRegulatoryConfig(uint8_t location, const CharSpan & countryCode, uint64_t breadcrumb) +CHIP_ERROR DeviceControlServer::SetRegulatoryConfig(uint8_t location, const CharSpan & countryCode) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -68,9 +57,6 @@ CHIP_ERROR DeviceControlServer::SetRegulatoryConfig(uint8_t location, const Char err = ConfigurationMgr().StoreCountryCode(countryCode.data(), countryCode.size()); SuccessOrExit(err); - err = ConfigurationMgr().StoreBreadcrumb(breadcrumb); - SuccessOrExit(err); - exit: if (err != CHIP_NO_ERROR) { diff --git a/src/platform/EFR32/EFR32Config.h b/src/platform/EFR32/EFR32Config.h index d59632b6614ebd..1943b902ca2e61 100644 --- a/src/platform/EFR32/EFR32Config.h +++ b/src/platform/EFR32/EFR32Config.h @@ -110,7 +110,6 @@ class EFR32Config static constexpr Key kConfigKey_HardwareVersion = EFR32ConfigKey(kMatterConfig_KeyBase, 0x08); static constexpr Key kConfigKey_RegulatoryLocation = EFR32ConfigKey(kMatterConfig_KeyBase, 0x09); static constexpr Key kConfigKey_CountryCode = EFR32ConfigKey(kMatterConfig_KeyBase, 0x0A); - static constexpr Key kConfigKey_Breadcrumb = EFR32ConfigKey(kMatterConfig_KeyBase, 0x0B); static constexpr Key kConfigKey_WiFiSSID = EFR32ConfigKey(kMatterConfig_KeyBase, 0x0C); static constexpr Key kConfigKey_WiFiPSK = EFR32ConfigKey(kMatterConfig_KeyBase, 0x0D); static constexpr Key kConfigKey_WiFiSEC = EFR32ConfigKey(kMatterConfig_KeyBase, 0x0E); diff --git a/src/platform/ESP32/ESP32Config.cpp b/src/platform/ESP32/ESP32Config.cpp index c52d68ba030e1d..8152c89092b052 100644 --- a/src/platform/ESP32/ESP32Config.cpp +++ b/src/platform/ESP32/ESP32Config.cpp @@ -77,7 +77,6 @@ const ESP32Config::Key ESP32Config::kConfigKey_FailSafeArmed = { kConfigNam const ESP32Config::Key ESP32Config::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const ESP32Config::Key ESP32Config::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "reg-location" }; const ESP32Config::Key ESP32Config::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const ESP32Config::Key ESP32Config::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; const ESP32Config::Key ESP32Config::kConfigKey_UniqueId = { kConfigNamespace_ChipFactory, "unique-id" }; // Keys stored in the Chip-counters namespace diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index f873a623849b20..01d9609aaf2e70 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -69,7 +69,6 @@ class ESP32Config static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; diff --git a/src/platform/Linux/PosixConfig.cpp b/src/platform/Linux/PosixConfig.cpp index da52f00a0001d1..69a570a8f6e242 100644 --- a/src/platform/Linux/PosixConfig.cpp +++ b/src/platform/Linux/PosixConfig.cpp @@ -72,7 +72,6 @@ const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNam const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; const PosixConfig::Key PosixConfig::kConfigKey_LocationCapability = { kConfigNamespace_ChipConfig, "location-capability" }; const PosixConfig::Key PosixConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipFactory, "unique-id" }; diff --git a/src/platform/Linux/PosixConfig.h b/src/platform/Linux/PosixConfig.h index 52263d4aea0c71..c2965e2ea8b205 100644 --- a/src/platform/Linux/PosixConfig.h +++ b/src/platform/Linux/PosixConfig.h @@ -72,7 +72,6 @@ class PosixConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_LocationCapability; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; diff --git a/src/platform/P6/P6Config.cpp b/src/platform/P6/P6Config.cpp index 19a4cb35cb62ea..ecaa219979e65f 100644 --- a/src/platform/P6/P6Config.cpp +++ b/src/platform/P6/P6Config.cpp @@ -71,7 +71,6 @@ const P6Config::Key P6Config::kConfigKey_FailSafeArmed = { kConfigNamespace const P6Config::Key P6Config::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const P6Config::Key P6Config::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const P6Config::Key P6Config::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const P6Config::Key P6Config::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; const P6Config::Key P6Config::kConfigKey_WiFiSSID = { kConfigNamespace_ChipConfig, "wifi-ssid" }; const P6Config::Key P6Config::kConfigKey_WiFiPassword = { kConfigNamespace_ChipConfig, "wifi-password" }; const P6Config::Key P6Config::kConfigKey_WiFiSecurity = { kConfigNamespace_ChipConfig, "wifi-security" }; diff --git a/src/platform/P6/P6Config.h b/src/platform/P6/P6Config.h index 336a91d17d82cc..0be7aa5abb7696 100644 --- a/src/platform/P6/P6Config.h +++ b/src/platform/P6/P6Config.h @@ -73,7 +73,6 @@ class P6Config static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_WiFiSSID; static const Key kConfigKey_WiFiPassword; static const Key kConfigKey_WiFiSecurity; diff --git a/src/platform/Tizen/PosixConfig.cpp b/src/platform/Tizen/PosixConfig.cpp index 28577d22cc6abb..9b9e57a55ef0dc 100644 --- a/src/platform/Tizen/PosixConfig.cpp +++ b/src/platform/Tizen/PosixConfig.cpp @@ -68,7 +68,6 @@ const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNam const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; const PosixConfig::Key PosixConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipConfig, "unique-id" }; CHIP_ERROR PosixConfig::Init() diff --git a/src/platform/Tizen/PosixConfig.h b/src/platform/Tizen/PosixConfig.h index 05cb43cbcebd10..aa5203bf989f7e 100644 --- a/src/platform/Tizen/PosixConfig.h +++ b/src/platform/Tizen/PosixConfig.h @@ -70,7 +70,6 @@ class PosixConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; diff --git a/src/platform/Zephyr/ZephyrConfig.cpp b/src/platform/Zephyr/ZephyrConfig.cpp index 822d37a10171cd..0ffb96d3f07744 100644 --- a/src/platform/Zephyr/ZephyrConfig.cpp +++ b/src/platform/Zephyr/ZephyrConfig.cpp @@ -70,7 +70,6 @@ const ZephyrConfig::Key ZephyrConfig::kConfigKey_LastUsedEpochKeyId = CONFIG_KEY const ZephyrConfig::Key ZephyrConfig::kConfigKey_FailSafeArmed = CONFIG_KEY(NAMESPACE_CONFIG "fail-safe-armed"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_RegulatoryLocation = CONFIG_KEY(NAMESPACE_CONFIG "regulatory-location"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_CountryCode = CONFIG_KEY(NAMESPACE_CONFIG "country-code"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_Breadcrumb = CONFIG_KEY(NAMESPACE_CONFIG "breadcrumb"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_UniqueId = CONFIG_KEY(NAMESPACE_CONFIG "unique-id"); // Keys stored in the counters namespace @@ -84,7 +83,7 @@ constexpr const char * sAllResettableConfigKeys[] = { ZephyrConfig::kConfigKey_ServiceConfig, ZephyrConfig::kConfigKey_PairedAccountId, ZephyrConfig::kConfigKey_ServiceId, ZephyrConfig::kConfigKey_LastUsedEpochKeyId, ZephyrConfig::kConfigKey_FailSafeArmed, ZephyrConfig::kConfigKey_RegulatoryLocation, - ZephyrConfig::kConfigKey_CountryCode, ZephyrConfig::kConfigKey_Breadcrumb, + ZephyrConfig::kConfigKey_CountryCode, }; // Data structure to be passed as a parameter of Zephyr's settings_load_subtree_direct() function diff --git a/src/platform/Zephyr/ZephyrConfig.h b/src/platform/Zephyr/ZephyrConfig.h index bd6f8e8591dd79..bf18c131965125 100644 --- a/src/platform/Zephyr/ZephyrConfig.h +++ b/src/platform/Zephyr/ZephyrConfig.h @@ -60,7 +60,6 @@ class ZephyrConfig static const Key kConfigKey_FailSafeArmed; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; diff --git a/src/platform/android/AndroidConfig.cpp b/src/platform/android/AndroidConfig.cpp index 9b95a93fcce068..5750ae9c59fbb3 100644 --- a/src/platform/android/AndroidConfig.cpp +++ b/src/platform/android/AndroidConfig.cpp @@ -88,7 +88,6 @@ const AndroidConfig::Key AndroidConfig::kConfigKey_FailSafeArmed = { kConfi const AndroidConfig::Key AndroidConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const AndroidConfig::Key AndroidConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; const AndroidConfig::Key AndroidConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const AndroidConfig::Key AndroidConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; void AndroidConfig::InitializeWithObject(jobject managerObject) { diff --git a/src/platform/android/AndroidConfig.h b/src/platform/android/AndroidConfig.h index 1fbae97846174b..2d265ca6b9b6b7 100644 --- a/src/platform/android/AndroidConfig.h +++ b/src/platform/android/AndroidConfig.h @@ -71,7 +71,6 @@ class AndroidConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_ProductId; static const Key kConfigKey_ProductName; static const Key kConfigKey_SoftwareVersion; diff --git a/src/platform/android/java/chip/platform/ConfigurationManager.java b/src/platform/android/java/chip/platform/ConfigurationManager.java index 5079c5aedb2945..b05b061e757c36 100644 --- a/src/platform/android/java/chip/platform/ConfigurationManager.java +++ b/src/platform/android/java/chip/platform/ConfigurationManager.java @@ -56,7 +56,6 @@ public interface ConfigurationManager { String kConfigKey_WiFiStationSecType = "sta-sec-type"; String kConfigKey_RegulatoryLocation = "regulatory-location"; String kConfigKey_CountryCode = "country-code"; - String kConfigKey_Breadcrumb = "breadcrumb"; long readConfigValueLong(String namespace, String name) throws AndroidChipPlatformException; diff --git a/src/platform/bouffalolab/BL602/BL602Config.cpp b/src/platform/bouffalolab/BL602/BL602Config.cpp index ffeb2f72f0099d..11cbdfbddd6bfb 100644 --- a/src/platform/bouffalolab/BL602/BL602Config.cpp +++ b/src/platform/bouffalolab/BL602/BL602Config.cpp @@ -69,7 +69,6 @@ const BL602Config::Key BL602Config::kConfigKey_OperationalDeviceICACerts = { " const BL602Config::Key BL602Config::kConfigKey_OperationalDevicePrivateKey = { "op-device-key" }; const BL602Config::Key BL602Config::kConfigKey_RegulatoryLocation = { "regulatory-location" }; const BL602Config::Key BL602Config::kConfigKey_CountryCode = { "country-code" }; -const BL602Config::Key BL602Config::kConfigKey_Breadcrumb = { "breadcrumb" }; const BL602Config::Key BL602Config::kConfigKey_UniqueId = { "unique-id" }; CHIP_ERROR BL602Config::Init() diff --git a/src/platform/bouffalolab/BL602/BL602Config.h b/src/platform/bouffalolab/BL602/BL602Config.h index b4ded47ae49c45..d8367cc1c2cbba 100644 --- a/src/platform/bouffalolab/BL602/BL602Config.h +++ b/src/platform/bouffalolab/BL602/BL602Config.h @@ -76,7 +76,6 @@ class BL602Config static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_UniqueId; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp index daaafa4ea22f9b..6c3dbef4573f35 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp @@ -85,9 +85,8 @@ const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_RegulatoryLocation = .itemID = 0x001a } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_CountryCode = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x001b } }; -const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_Breadcrumb = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, - .itemID = 0x001c } }; -const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_UniqueId = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, +// itemID 0x001c is unused (used to be breadcrumb). +const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_UniqueId = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x001d } }; /* Internal for the KVS interface. */ diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h index c71c72cbaf67da..b9a91e05367233 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h @@ -63,7 +63,6 @@ class CC13X2_26X2Config static const Key kConfigKey_WiFiStationSecType; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_KVS_key; // special key for KVS system, key storage static const Key kConfigKey_KVS_value; // special key for KVS system, value storage static const Key kConfigKey_Spake2pIterationCount; diff --git a/src/platform/fake/ConfigurationManagerImpl.h b/src/platform/fake/ConfigurationManagerImpl.h index e7ebe3ffefa752..9e0c4b26588552 100644 --- a/src/platform/fake/ConfigurationManagerImpl.h +++ b/src/platform/fake/ConfigurationManagerImpl.h @@ -78,8 +78,6 @@ class ConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR StoreRegulatoryLocation(uint8_t location) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetBreadcrumb(uint64_t & breadcrumb) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR StoreBreadcrumb(uint64_t breadcrumb) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetRebootCount(uint32_t & rebootCount) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreRebootCount(uint32_t rebootCount) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours) override { return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/src/platform/mbed/MbedConfig.cpp b/src/platform/mbed/MbedConfig.cpp index 686c97df706f55..e8891a7699c579 100644 --- a/src/platform/mbed/MbedConfig.cpp +++ b/src/platform/mbed/MbedConfig.cpp @@ -83,7 +83,6 @@ const MbedConfig::Key MbedConfig::kConfigKey_FailSafeArmed = { CONFIG_KEY(" const MbedConfig::Key MbedConfig::kConfigKey_WiFiStationSecType = { CONFIG_KEY("sta-sec-type") }; const MbedConfig::Key MbedConfig::kConfigKey_RegulatoryLocation = { CONFIG_KEY("regulatory-location") }; const MbedConfig::Key MbedConfig::kConfigKey_CountryCode = { CONFIG_KEY("country-code") }; -const MbedConfig::Key MbedConfig::kConfigKey_Breadcrumb = { CONFIG_KEY("breadcrumb") }; const MbedConfig::Key MbedConfig::kConfigKey_UniqueId = { CONFIG_KEY("unique-id") }; CHIP_ERROR MbedConfig::ReadConfigValue(Key key, bool & val) diff --git a/src/platform/mbed/MbedConfig.h b/src/platform/mbed/MbedConfig.h index 9c03bbaf69d897..4e2cb7a6507563 100644 --- a/src/platform/mbed/MbedConfig.h +++ b/src/platform/mbed/MbedConfig.h @@ -69,7 +69,6 @@ class MbedConfig static const Key kConfigKey_SetupDiscriminator; static const Key kConfigKey_RegulatoryLocation; static const Key kConfigKey_CountryCode; - static const Key kConfigKey_Breadcrumb; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; diff --git a/src/platform/nxp/k32w/k32w0/K32W0Config.h b/src/platform/nxp/k32w/k32w0/K32W0Config.h index a875142cd50f00..bae56b39845996 100644 --- a/src/platform/nxp/k32w/k32w0/K32W0Config.h +++ b/src/platform/nxp/k32w/k32w0/K32W0Config.h @@ -87,7 +87,6 @@ class K32WConfig static constexpr Key kConfigKey_FailSafeArmed = K32WConfigKey(kPDMId_ChipConfig, 0x06); static constexpr Key kConfigKey_RegulatoryLocation = K32WConfigKey(kPDMId_ChipConfig, 0x07); static constexpr Key kConfigKey_CountryCode = K32WConfigKey(kPDMId_ChipConfig, 0x08); - static constexpr Key kConfigKey_Breadcrumb = K32WConfigKey(kPDMId_ChipConfig, 0x09); static constexpr Key kConfigKey_UniqueId = K32WConfigKey(kPDMId_ChipConfig, 0x0A); static constexpr Key kConfigKey_SoftwareVersion = K32WConfigKey(kPDMId_ChipConfig, 0x0B); static constexpr Key kConfigKey_FirstRunOfOTAImage = K32WConfigKey(kPDMId_ChipConfig, 0x0C); diff --git a/src/platform/qpg/qpgConfig.h b/src/platform/qpg/qpgConfig.h index 7af2c5be1664c1..3500ec23f69dbd 100644 --- a/src/platform/qpg/qpgConfig.h +++ b/src/platform/qpg/qpgConfig.h @@ -85,7 +85,6 @@ class QPGConfig static constexpr Key kConfigKey_HardwareVersion = QorvoConfigKey(kFileId_ChipConfig, 0x08); static constexpr Key kConfigKey_RegulatoryLocation = QorvoConfigKey(kFileId_ChipConfig, 0x09); static constexpr Key kConfigKey_CountryCode = QorvoConfigKey(kFileId_ChipConfig, 0x0A); - static constexpr Key kConfigKey_Breadcrumb = QorvoConfigKey(kFileId_ChipConfig, 0x0B); static constexpr Key kConfigKey_UniqueId = QorvoConfigKey(kFileId_ChipConfig, 0x0C); static constexpr Key kConfigKey_GroupKeyBase = QorvoConfigKey(kFileId_ChipConfig, 0x0F); diff --git a/src/platform/tests/TestConfigurationMgr.cpp b/src/platform/tests/TestConfigurationMgr.cpp index 0c426fe558bae4..fc29e0dc7633aa 100644 --- a/src/platform/tests/TestConfigurationMgr.cpp +++ b/src/platform/tests/TestConfigurationMgr.cpp @@ -167,20 +167,6 @@ static void TestConfigurationMgr_CountryCode(nlTestSuite * inSuite, void * inCon NL_TEST_ASSERT(inSuite, strcmp(buf, countryCode) == 0); } -static void TestConfigurationMgr_Breadcrumb(nlTestSuite * inSuite, void * inContext) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - uint64_t breadcrumb = 0; - - err = ConfigurationMgr().StoreBreadcrumb(12345); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - err = ConfigurationMgr().GetBreadcrumb(breadcrumb); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - NL_TEST_ASSERT(inSuite, breadcrumb == 12345); -} - static void TestConfigurationMgr_GetPrimaryMACAddress(nlTestSuite * inSuite, void * inContext) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -237,7 +223,6 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test ConfigurationMgr::ManufacturingDate", TestConfigurationMgr_ManufacturingDate), NL_TEST_DEF("Test ConfigurationMgr::HardwareVersion", TestConfigurationMgr_HardwareVersion), NL_TEST_DEF("Test ConfigurationMgr::CountryCode", TestConfigurationMgr_CountryCode), - NL_TEST_DEF("Test ConfigurationMgr::Breadcrumb", TestConfigurationMgr_Breadcrumb), NL_TEST_DEF("Test ConfigurationMgr::GetPrimaryMACAddress", TestConfigurationMgr_GetPrimaryMACAddress), NL_TEST_DEF("Test ConfigurationMgr::GetFailSafeArmed", TestConfigurationMgr_GetFailSafeArmed), NL_TEST_SENTINEL() diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index e11d010f474978..f0d0e3b3716b9a 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -179,7 +179,6 @@ class TestList : public Command { printf("TestConstraints\n"); printf("TestDelayCommands\n"); printf("TestDescriptorCluster\n"); - printf("TestGeneralCommissioning\n"); printf("TestGroupsCluster\n"); printf("TestGroupKeyManagementCluster\n"); printf("TestIdentifyCluster\n"); @@ -61456,210 +61455,6 @@ class TestDescriptorCluster : public TestCommandBridge { } }; -class TestGeneralCommissioning : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestGeneralCommissioning() - : TestCommandBridge("TestGeneralCommissioning") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~TestGeneralCommissioning() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestGeneralCommissioning\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestGeneralCommissioning\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write Breadcrumb (1/2)\n"); - err = TestWriteBreadcrumb12_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read back Breadcrumb (1/2)\n"); - err = TestReadBackBreadcrumb12_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write Breadcrumb (2/2)\n"); - err = TestWriteBreadcrumb22_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read back Breadcrumb (2/2)\n"); - err = TestReadBackBreadcrumb22_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Validate presence of SupportsConcurrentConnection\n"); - err = TestValidatePresenceOfSupportsConcurrentConnection_5(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteBreadcrumb12_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id breadcrumbArgument; - breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:137438953472ULL]; - [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Breadcrumb (1/2) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadBackBreadcrumb12_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back Breadcrumb (1/2) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 137438953472ULL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteBreadcrumb22_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id breadcrumbArgument; - breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:81ULL]; - [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Breadcrumb (2/2) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadBackBreadcrumb22_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back Breadcrumb (2/2) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 81ULL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidatePresenceOfSupportsConcurrentConnection_5() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeSupportsConcurrentConnectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate presence of SupportsConcurrentConnection Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("supportsConcurrentConnection", "", "bool")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - class TestGroupsCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -64718,7 +64513,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 5a8d514cbac275..f3d3199fd090fb 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -40695,11 +40695,13 @@ class TestGeneralCommissioningSuite : public TestCommand { public: TestGeneralCommissioningSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("TestGeneralCommissioning", 6, credsIssuerConfig) + TestCommand("TestGeneralCommissioning", 31, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } @@ -40714,6 +40716,8 @@ class TestGeneralCommissioningSuite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; chip::Optional mTimeout; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -40755,6 +40759,175 @@ class TestGeneralCommissioningSuite : public TestCommand } break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 0ULL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 1ULL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 3)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 1ULL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 4)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 1ULL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 2ULL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 4)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 2ULL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 2)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 2ULL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 0ULL)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 3ULL)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("errorCode", value.errorCode, 0)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint64_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("breadcrumb", value, 0ULL)); + } + break; + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -40807,7 +40980,158 @@ class TestGeneralCommissioningSuite : public TestCommand GeneralCommissioning::Attributes::Breadcrumb::Id); } case 5: { - LogStep(5, "Validate presence of SupportsConcurrentConnection"); + LogStep(5, "Reboot to reset Breadcrumb"); + SetIdentity(kIdentityAlpha); + return Reboot(); + } + case 6: { + LogStep(6, "Connect to the device again"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 7: { + LogStep(7, "Read back Breadcrumb after reboot and ensure it was not persisted"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 8: { + LogStep(8, "Set Breadcrumb to nonzero value"); + uint64_t value; + value = 1ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, value); + } + case 9: { + LogStep(9, "Check Breadcrumb set worked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 10: { + LogStep(10, "Send CommissioningComplete without armed fail-safe"); + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::CommissioningComplete::Id, value); + } + case 11: { + LogStep(11, "Check Breadcrumb was not touched by invalid CommissioningComplete"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 12: { + LogStep(12, "Open Commissioning Window from alpha"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 13: { + LogStep(13, "Try to arm fail-safe"); + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 10U; + value.breadcrumb = 5000ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value); + } + case 14: { + LogStep(14, "Check Breadcrumb was not touched by ArmFailSafe with commissioning window open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 15: { + LogStep(15, "Reset Breadcrumb to 0 so we can commission"); + uint64_t value; + value = 0ULL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id, value); + } + case 16: { + LogStep(16, "Commission from beta"); + SetIdentity(kIdentityBeta); + return PairWithQRCode( + 74565, mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + } + case 17: { + LogStep(17, "Wait for the commissioned device to be retrieved for beta"); + SetIdentity(kIdentityBeta); + return WaitForCommissionee(74565); + } + case 18: { + LogStep(18, "Arm fail-safe"); + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 500U; + value.breadcrumb = 2ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value); + } + case 19: { + LogStep(19, "Check Breadcrumb was properly set by ArmFailSafe"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 20: { + LogStep(20, "Try to arm fail-safe from wrong fabric"); + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 10U; + value.breadcrumb = 5000ULL; + return SendCommand(kIdentityBeta, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value); + } + case 21: { + LogStep(21, "Check Breadcrumb was not touched by ArmFailSafe with existing fail-safe armed"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 22: { + LogStep(22, "Send CommissioningComplete from wrong fabric"); + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type value; + return SendCommand(kIdentityBeta, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::CommissioningComplete::Id, value); + } + case 23: { + LogStep(23, "Check Breadcrumb was not touched by CommissioningComplete from wrong fabric"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 24: { + LogStep(24, "Close out the fail-safe gracefully"); + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::CommissioningComplete::Id, value); + } + case 25: { + LogStep(25, "Check Breadcrumb was reset to 0 by CommissioningComplete"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 26: { + LogStep(26, "Arm fail-safe again"); + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 500U; + value.breadcrumb = 3ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value); + } + case 27: { + LogStep(27, "Check Breadcrumb was set by arming fail-safe again"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 28: { + LogStep(28, "Force-expire the fail-safe"); + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type value; + value.expiryLengthSeconds = 0U; + value.breadcrumb = 4ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Commands::ArmFailSafe::Id, value); + } + case 29: { + LogStep(29, "Check Breadcrumb was reset by expiring the fail-safe"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::Breadcrumb::Id); + } + case 30: { + LogStep(30, "Validate presence of SupportsConcurrentConnection"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, GeneralCommissioning::Attributes::SupportsConcurrentConnection::Id); } From 11c49af9dafc43d1f0630b7eaa3a33dc180f6931 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Wed, 27 Apr 2022 16:12:05 -0400 Subject: [PATCH 18/59] Remove duplicate declarations of build variables (#17711) Each argument should be declared in exactly one build file. The args.gni files are for setting arguments, not declaring them. Remove errant declare_args() from args.gni files. Using declare_args() in these files doesn't do anything except for suppress "unused argument" diagnostics, which isn't desirable (those diagnostics are already opt-in). --- config/tizen/chip-gn/args.gni | 5 ----- examples/light-switch-app/efr32/args.gni | 4 +--- examples/lighting-app/bouffalolab/bl602/args.gni | 9 ++++----- examples/lighting-app/efr32/args.gni | 4 +--- examples/lighting-app/nxp/k32w/k32w0/args.gni | 8 +++----- examples/lighting-app/qpg/args.gni | 12 +++++------- examples/lock-app/efr32/args.gni | 4 +--- examples/lock-app/nxp/k32w/k32w0/args.gni | 6 ++---- examples/lock-app/qpg/args.gni | 12 +++++------- examples/ota-requestor-app/cyw30739/args.gni | 4 +--- examples/ota-requestor-app/efr32/args.gni | 4 +--- examples/ota-requestor-app/linux/args.gni | 4 +--- examples/ota-requestor-app/p6/args.gni | 4 +--- examples/persistent-storage/qpg/args.gni | 8 +++----- examples/shell/nxp/k32w/k32w0/args.gni | 4 +--- examples/window-app/efr32/args.gni | 6 ++---- 16 files changed, 32 insertions(+), 66 deletions(-) diff --git a/config/tizen/chip-gn/args.gni b/config/tizen/chip-gn/args.gni index 3bd4f2592fd5c7..7cd1033eecc268 100644 --- a/config/tizen/chip-gn/args.gni +++ b/config/tizen/chip-gn/args.gni @@ -14,11 +14,6 @@ import("//build_overrides/chip.gni") -declare_args() { - # Location of the Tizen SDK. - tizen_sdk_root = "" -} - chip_device_platform = "tizen" chip_build_tests = false diff --git a/examples/light-switch-app/efr32/args.gni b/examples/light-switch-app/efr32/args.gni index 1a0052682125a4..96b6262f50b93e 100644 --- a/examples/light-switch-app/efr32/args.gni +++ b/examples/light-switch-app/efr32/args.gni @@ -18,9 +18,7 @@ import("${chip_root}/src/platform/EFR32/args.gni") efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - chip_enable_ota_requestor = true -} +chip_enable_ota_requestor = true pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lighting-app/bouffalolab/bl602/args.gni b/examples/lighting-app/bouffalolab/bl602/args.gni index 6ac49b227fe402..ab5fb2b420693f 100644 --- a/examples/lighting-app/bouffalolab/bl602/args.gni +++ b/examples/lighting-app/bouffalolab/bl602/args.gni @@ -21,8 +21,7 @@ pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" chip_enable_openthread = false -declare_args() { - # Disable lock tracking, since our FreeRTOS configuration does not set - # INCLUDE_xSemaphoreGetMutexHolder - chip_stack_lock_tracking = "none" -} + +# Disable lock tracking, since our FreeRTOS configuration does not set +# INCLUDE_xSemaphoreGetMutexHolder +chip_stack_lock_tracking = "none" diff --git a/examples/lighting-app/efr32/args.gni b/examples/lighting-app/efr32/args.gni index 1a0052682125a4..96b6262f50b93e 100644 --- a/examples/lighting-app/efr32/args.gni +++ b/examples/lighting-app/efr32/args.gni @@ -18,9 +18,7 @@ import("${chip_root}/src/platform/EFR32/args.gni") efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - chip_enable_ota_requestor = true -} +chip_enable_ota_requestor = true pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lighting-app/nxp/k32w/k32w0/args.gni b/examples/lighting-app/nxp/k32w/k32w0/args.gni index 8bbd1e952f5ab9..5f4766d8429e64 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/args.gni +++ b/examples/lighting-app/nxp/k32w/k32w0/args.gni @@ -18,8 +18,6 @@ import("${chip_root}/examples/platform/nxp/k32w/k32w0/args.gni") # SDK target. This is overridden to add our SDK app_config.h & defines. k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - chip_enable_ota_requestor = true - chip_stack_lock_tracking = "fatal" - chip_enable_ble = true -} +chip_enable_ota_requestor = true +chip_stack_lock_tracking = "fatal" +chip_enable_ble = true diff --git a/examples/lighting-app/qpg/args.gni b/examples/lighting-app/qpg/args.gni index d62d91402aa283..90189de5731270 100644 --- a/examples/lighting-app/qpg/args.gni +++ b/examples/lighting-app/qpg/args.gni @@ -18,14 +18,12 @@ import("${chip_root}/examples/platform/qpg/args.gni") qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - chip_enable_ota_requestor = true - chip_openthread_ftd = true +chip_enable_ota_requestor = true +chip_openthread_ftd = true - # Disable lock tracking, since our FreeRTOS configuration does not set - # INCLUDE_xSemaphoreGetMutexHolder - chip_stack_lock_tracking = "none" -} +# Disable lock tracking, since our FreeRTOS configuration does not set +# INCLUDE_xSemaphoreGetMutexHolder +chip_stack_lock_tracking = "none" pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lock-app/efr32/args.gni b/examples/lock-app/efr32/args.gni index a32b60b7164b44..de1a2fd4f0e9f4 100644 --- a/examples/lock-app/efr32/args.gni +++ b/examples/lock-app/efr32/args.gni @@ -18,9 +18,7 @@ import("${chip_root}/src/platform/EFR32/args.gni") efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - chip_enable_ota_requestor = true -} +chip_enable_ota_requestor = true chip_enable_openthread = true pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" diff --git a/examples/lock-app/nxp/k32w/k32w0/args.gni b/examples/lock-app/nxp/k32w/k32w0/args.gni index aac1d79a737a71..2ace8356337891 100644 --- a/examples/lock-app/nxp/k32w/k32w0/args.gni +++ b/examples/lock-app/nxp/k32w/k32w0/args.gni @@ -18,7 +18,5 @@ import("${chip_root}/examples/platform/nxp/k32w/k32w0/args.gni") # SDK target. This is overridden to add our SDK app_config.h & defines. k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - chip_stack_lock_tracking = "fatal" - chip_enable_ble = true -} +chip_stack_lock_tracking = "fatal" +chip_enable_ble = true diff --git a/examples/lock-app/qpg/args.gni b/examples/lock-app/qpg/args.gni index e6c39ccee5331a..03c7000100c47f 100644 --- a/examples/lock-app/qpg/args.gni +++ b/examples/lock-app/qpg/args.gni @@ -18,14 +18,12 @@ import("${chip_root}/examples/platform/qpg/args.gni") qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - chip_enable_ota_requestor = true - chip_openthread_ftd = false +chip_enable_ota_requestor = true +chip_openthread_ftd = false - # Disable lock tracking, since our FreeRTOS configuration does not set - # INCLUDE_xSemaphoreGetMutexHolder - chip_stack_lock_tracking = "none" -} +# Disable lock tracking, since our FreeRTOS configuration does not set +# INCLUDE_xSemaphoreGetMutexHolder +chip_stack_lock_tracking = "none" pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/ota-requestor-app/cyw30739/args.gni b/examples/ota-requestor-app/cyw30739/args.gni index b56162c2ce097e..28971944353082 100644 --- a/examples/ota-requestor-app/cyw30739/args.gni +++ b/examples/ota-requestor-app/cyw30739/args.gni @@ -23,6 +23,4 @@ chip_openthread_ftd = true chip_progress_logging = false chip_error_logging = false -declare_args() { - chip_enable_ota_requestor = true -} +chip_enable_ota_requestor = true diff --git a/examples/ota-requestor-app/efr32/args.gni b/examples/ota-requestor-app/efr32/args.gni index 6a39a339cf61ea..fde26ca7395bb4 100644 --- a/examples/ota-requestor-app/efr32/args.gni +++ b/examples/ota-requestor-app/efr32/args.gni @@ -27,6 +27,4 @@ chip_openthread_ftd = false # Example will not be maintained in the long term and will be depraceted now that OTA is beeing intagrated into our examples chip_stack_lock_tracking = "None" -declare_args() { - chip_enable_ota_requestor = true -} +chip_enable_ota_requestor = true diff --git a/examples/ota-requestor-app/linux/args.gni b/examples/ota-requestor-app/linux/args.gni index 511f14b2cbbe7b..87c6eb3c1f59de 100644 --- a/examples/ota-requestor-app/linux/args.gni +++ b/examples/ota-requestor-app/linux/args.gni @@ -24,6 +24,4 @@ chip_project_config_include_dirs = [ "${chip_root}/examples/ota-requestor-app/linux/include" ] chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] -declare_args() { - chip_enable_ota_requestor = true -} +chip_enable_ota_requestor = true diff --git a/examples/ota-requestor-app/p6/args.gni b/examples/ota-requestor-app/p6/args.gni index 43c58836f60ddf..8505c08a26d719 100644 --- a/examples/ota-requestor-app/p6/args.gni +++ b/examples/ota-requestor-app/p6/args.gni @@ -16,9 +16,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("${chip_root}/src/platform/P6/args.gni") -declare_args() { - chip_enable_ota_requestor = true -} +chip_enable_ota_requestor = true p6_target_project = get_label_info(":ota_requestor_app_sdk_sources", "label_no_toolchain") diff --git a/examples/persistent-storage/qpg/args.gni b/examples/persistent-storage/qpg/args.gni index c798cd33d785fa..68e1d67d9f4230 100644 --- a/examples/persistent-storage/qpg/args.gni +++ b/examples/persistent-storage/qpg/args.gni @@ -23,8 +23,6 @@ chip_with_lwip = true lwip_debug = false -declare_args() { - # Disable lock tracking, since our FreeRTOS configuration does not set - # INCLUDE_xSemaphoreGetMutexHolder - chip_stack_lock_tracking = "none" -} +# Disable lock tracking, since our FreeRTOS configuration does not set +# INCLUDE_xSemaphoreGetMutexHolder +chip_stack_lock_tracking = "none" diff --git a/examples/shell/nxp/k32w/k32w0/args.gni b/examples/shell/nxp/k32w/k32w0/args.gni index 5f68faa6512372..5c0a2522c3d51d 100644 --- a/examples/shell/nxp/k32w/k32w0/args.gni +++ b/examples/shell/nxp/k32w/k32w0/args.gni @@ -19,6 +19,4 @@ import("${chip_root}/src/platform/nxp/k32w/k32w0/args.gni") k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - chip_enable_ble = true -} +chip_enable_ble = true diff --git a/examples/window-app/efr32/args.gni b/examples/window-app/efr32/args.gni index 8db1cfbfb54ef0..4fbeec81fd8e05 100644 --- a/examples/window-app/efr32/args.gni +++ b/examples/window-app/efr32/args.gni @@ -18,10 +18,8 @@ import("${chip_root}/src/platform/EFR32/args.gni") efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - # TODO fix me - chip_enable_ota_requestor = false -} +# TODO fix me +chip_enable_ota_requestor = false pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" From 7965de7f20ab5aea212fc7c6e8b72c047fe67fc7 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Wed, 27 Apr 2022 20:33:58 -0400 Subject: [PATCH 19/59] Fix crash on removal of accessing fabric (#17815) * Add TestSelfFabricRemoval.yaml test * Fix crash on removal of accessing fabric Because of an access to prior fabric data that is now deleted, in SessionManager::PrepareMessage, while trying to reply to RemoveFabric, applications crash when RemoveFabric is done on the accessing fabric. This crash was awaiting full fix of #16748 to be fixed, but that issue is much bigger scope. We can actually fix the crash with a suggestion made by @turon (https://github.com/project-chip/connectedhomeip/issues/16748#issuecomment-1082228657) to keep the *local node ID* in the SecureSession so that SessionManager does not try to look-back at the FabricTable whenever preparing a CASE message where the fabric may be gone. This is a root cause fix for that very crash, but does not address the other aspects of #16748 which relate to completely cleanly handling fabric removal edge cases. Issue #16748 Fixes #17579 Fixes #17680 Fixes #16729 This PR does the following: - Add local node ID to the SecureSession and fix all associated plumbing - Use the local node ID for nonce generation in PrepareMessage rather than looking-up the fabric table (which may no longer hold the fabric that has that prior node ID) - Improve CASE session establishment logging - Fix the tests needed - Fix bad comments in TestPairingSession tests Testing done: - Added a YAML test (TestSelfFabricRemoval.yaml) for this case - Validated it failed before code fixes with the previously seen crash. - Validated that it passes with the new fixes - Added necessary tests to TestPairingSession for new methods - Unit tests pass - Cert tests pass * Restyled by whitespace * Restyled by clang-format * Regen ZAP after comment * Address review comments * Restyled by clang-format * Reorder one argument used in test-only code * Restyled by clang-format Co-authored-by: Restyled.io --- .../chip-tool-darwin/templates/tests/tests.js | 4 +- examples/chip-tool/templates/tests/tests.js | 1 + scripts/tools/zap_regen_yaml_tests.sh | 3 +- .../operational-credentials-server.cpp | 1 - .../tests/suites/TestSelfFabricRemoval.yaml | 55 ++++++ .../Framework/CHIP/templates/tests/tests.js | 1 + src/protocols/secure_channel/CASESession.cpp | 26 ++- src/protocols/secure_channel/CASESession.h | 2 + src/protocols/secure_channel/PASESession.h | 7 + src/transport/GroupSession.h | 12 +- src/transport/PairingSession.cpp | 3 +- src/transport/PairingSession.h | 1 + src/transport/SecureSession.cpp | 5 - src/transport/SecureSession.h | 40 +++-- src/transport/SecureSessionTable.h | 35 +++- src/transport/Session.h | 1 + src/transport/SessionManager.cpp | 25 +-- src/transport/SessionManager.h | 4 +- src/transport/UnauthenticatedSessionTable.h | 3 +- src/transport/tests/TestPairingSession.cpp | 1 + src/transport/tests/TestPeerConnections.cpp | 95 ++++++----- .../zap-generated/test/Commands.h | 161 ++++++++++++++++++ .../chip-tool/zap-generated/test/Commands.h | 113 ++++++++++++ 23 files changed, 499 insertions(+), 100 deletions(-) create mode 100644 src/app/tests/suites/TestSelfFabricRemoval.yaml diff --git a/examples/chip-tool-darwin/templates/tests/tests.js b/examples/chip-tool-darwin/templates/tests/tests.js index c07769440a5dd3..ca7c68cf2779fb 100644 --- a/examples/chip-tool-darwin/templates/tests/tests.js +++ b/examples/chip-tool-darwin/templates/tests/tests.js @@ -22,8 +22,7 @@ function getManualTests() // clang-format off -function getTests() -{ +function getTests() { const AccessControl = [ 'TestAccessControlCluster', ]; @@ -284,6 +283,7 @@ function getTests() 'TestIdentifyCluster', 'TestLogCommands', 'TestOperationalCredentialsCluster', + 'TestSelfFabricRemoval', 'TestBinding', ]; diff --git a/examples/chip-tool/templates/tests/tests.js b/examples/chip-tool/templates/tests/tests.js index f468db1b4f860e..cad5425c516fd1 100644 --- a/examples/chip-tool/templates/tests/tests.js +++ b/examples/chip-tool/templates/tests/tests.js @@ -547,6 +547,7 @@ function getTests() 'TestIdentifyCluster', 'TestOperationalCredentialsCluster', 'TestModeSelectCluster', + 'TestSelfFabricRemoval', 'TestSystemCommands', 'TestBinding', 'TestUserLabelCluster', diff --git a/scripts/tools/zap_regen_yaml_tests.sh b/scripts/tools/zap_regen_yaml_tests.sh index 2bd5b4cd68f5ca..f572e92be4582c 100755 --- a/scripts/tools/zap_regen_yaml_tests.sh +++ b/scripts/tools/zap_regen_yaml_tests.sh @@ -22,5 +22,4 @@ # rather than all of zap like `./scripts/tools/zap_regen_all.py # -./scripts/tools/zap/generate.py src/controller/data_model/controller-clusters.zap \ - -o zzz_generated/chip-tool/zap-generated -t examples/chip-tool/templates/templates.json +./scripts/tools/zap_regen_all.py --type tests diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 95a2bc73cdecc0..71f935590fb00e 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -468,7 +468,6 @@ bool emberAfOperationalCredentialsClusterRemoveFabricCallback(app::CommandHandle { SendNOCResponse(commandObj, commandPath, OperationalCertStatus::kSuccess, fabricBeingRemoved, CharSpan()); - // Use a more direct getter for FabricIndex from commandObj chip::Messaging::ExchangeContext * ec = commandObj->GetExchangeContext(); FabricIndex currentFabricIndex = commandObj->GetAccessingFabricIndex(); if (currentFabricIndex == fabricBeingRemoved) diff --git a/src/app/tests/suites/TestSelfFabricRemoval.yaml b/src/app/tests/suites/TestSelfFabricRemoval.yaml new file mode 100644 index 00000000000000..4c7dfcf8ff22ab --- /dev/null +++ b/src/app/tests/suites/TestSelfFabricRemoval.yaml @@ -0,0 +1,55 @@ +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Validate removal of the only fabric left does not crash + +config: + nodeId: 0x12344321 + cluster: "Operational Credentials" + endpoint: 0 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read number of commissioned fabrics" + command: "readAttribute" + attribute: "CommissionedFabrics" + response: + value: 1 + constraints: + type: uint8 + + - label: "Read current fabric index" + command: "readAttribute" + attribute: "CurrentFabricIndex" + response: + saveAs: ourFabricIndex + constraints: + type: uint8 + # 0 is not a valid value, but past that we have no idea what the + # other side will claim here. + minValue: 1 + + - label: "Remove single own fabric" + command: "RemoveFabric" + arguments: + values: + - name: "FabricIndex" + value: ourFabricIndex diff --git a/src/darwin/Framework/CHIP/templates/tests/tests.js b/src/darwin/Framework/CHIP/templates/tests/tests.js index b4f0dbdd57df1a..c2bc15fe291f1b 100644 --- a/src/darwin/Framework/CHIP/templates/tests/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests/tests.js @@ -281,6 +281,7 @@ function getTests() 'TestIdentifyCluster', 'TestLogCommands', 'TestOperationalCredentialsCluster', + // 'TestSelfFabricRemoval', --> TODO: Integrate here when Darwin can live with current fabric going away 'TestBinding', 'TestUserLabelCluster', ]; diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index c791a46a5e3a35..acc609a31dc82e 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -156,6 +156,10 @@ void CASESession::Clear() Crypto::ClearSecretData(mIPK); AbortExchange(); + + mLocalNodeId = kUndefinedNodeId; + mPeerNodeId = kUndefinedNodeId; + mFabricInfo = nullptr; } void CASESession::AbortExchange() @@ -250,7 +254,11 @@ CHIP_ERROR CASESession::EstablishSession(SessionManager & sessionManager, Fabric mLocalMRPConfig = mrpConfig; mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout + mExchangeCtxt->GetSessionHandle()->GetAckTimeout()); - mPeerNodeId = peerNodeId; + mPeerNodeId = peerNodeId; + mLocalNodeId = fabric->GetNodeId(); + + ChipLogProgress(SecureChannel, "Initiating session on local FabricIndex %u from 0x" ChipLogFormatX64 " -> 0x" ChipLogFormatX64, + static_cast(fabric->GetFabricIndex()), ChipLogValueX64(mLocalNodeId), ChipLogValueX64(mPeerNodeId)); err = SendSigma1(); SuccessOrExit(err); @@ -343,9 +351,13 @@ CHIP_ERROR CASESession::RecoverInitiatorIpk() size_t ipkIndex = (ipkKeySet.num_keys_used > 1) ? ((ipkKeySet.num_keys_used - 1) - 1) : 0; memcpy(&mIPK[0], ipkKeySet.epoch_keys[ipkIndex].key, sizeof(mIPK)); + // Leaving this logging code for debug, but this cannot be enabled at runtime + // since it leaks private security material. +#if 0 ChipLogProgress(SecureChannel, "RecoverInitiatorIpk: GroupDataProvider %p, Got IPK for FabricIndex %u", mGroupDataProvider, static_cast(mFabricInfo->GetFabricIndex())); ChipLogByteSpan(SecureChannel, ByteSpan(mIPK)); +#endif return CHIP_NO_ERROR; } @@ -497,7 +509,8 @@ CHIP_ERROR CASESession::FindLocalNodeFromDestionationId(const ByteSpan & destina found = true; MutableByteSpan ipkSpan(mIPK); CopySpanToMutableSpan(candidateIpkSpan, ipkSpan); - mFabricInfo = &fabricInfo; + mFabricInfo = &fabricInfo; + mLocalNodeId = nodeId; break; } } @@ -529,7 +542,8 @@ CHIP_ERROR CASESession::TryResumeSession(SessionResumptionStorage::ConstResumpti if (mFabricInfo == nullptr) return CHIP_ERROR_INTERNAL; - mPeerNodeId = node.GetNodeId(); + mPeerNodeId = node.GetNodeId(); + mLocalNodeId = mFabricInfo->GetNodeId(); return CHIP_NO_ERROR; } @@ -578,11 +592,15 @@ CHIP_ERROR CASESession::HandleSigma1(System::PacketBufferHandle && msg) return CHIP_NO_ERROR; } + // Attempt to match the initiator's desired destination based on local fabric table. err = FindLocalNodeFromDestionationId(destinationIdentifier, initiatorRandom); if (err == CHIP_NO_ERROR) { ChipLogProgress(SecureChannel, "CASE matched destination ID: fabricIndex %u, NodeID 0x" ChipLogFormatX64, - static_cast(mFabricInfo->GetFabricIndex()), ChipLogValueX64(mFabricInfo->GetNodeId())); + static_cast(mFabricInfo->GetFabricIndex()), ChipLogValueX64(mLocalNodeId)); + + // Side-effect of FindLocalNodeFromDestionationId success was that mFabricInfo/mLocalNodeId are now + // set to the local fabric and associated NodeId that was targeted by the initiator. } else { diff --git a/src/protocols/secure_channel/CASESession.h b/src/protocols/secure_channel/CASESession.h index ebb5dfb92f9f15..3c40a0e1a0f77a 100644 --- a/src/protocols/secure_channel/CASESession.h +++ b/src/protocols/secure_channel/CASESession.h @@ -64,6 +64,7 @@ class DLL_EXPORT CASESession : public Messaging::UnsolicitedMessageHandler, Transport::SecureSession::Type GetSecureSessionType() const override { return Transport::SecureSession::Type::kCASE; } ScopedNodeId GetPeer() const override { return ScopedNodeId(mPeerNodeId, GetFabricIndex()); } + ScopedNodeId GetLocalScopedNodeId() const override { return ScopedNodeId(mLocalNodeId, GetFabricIndex()); } CATValues GetPeerCATs() const override { return mPeerCATs; }; /** @@ -255,6 +256,7 @@ class DLL_EXPORT CASESession : public Messaging::UnsolicitedMessageHandler, FabricTable * mFabricsTable = nullptr; const FabricInfo * mFabricInfo = nullptr; NodeId mPeerNodeId = kUndefinedNodeId; + NodeId mLocalNodeId = kUndefinedNodeId; CATValues mPeerCATs; SessionResumptionStorage::ResumptionIdStorage mResumeResumptionId; // ResumptionId which is used to resume this session diff --git a/src/protocols/secure_channel/PASESession.h b/src/protocols/secure_channel/PASESession.h index dfa3b826bdaeec..1168be478b4519 100644 --- a/src/protocols/secure_channel/PASESession.h +++ b/src/protocols/secure_channel/PASESession.h @@ -78,6 +78,13 @@ class DLL_EXPORT PASESession : public Messaging::UnsolicitedMessageHandler, { return ScopedNodeId(NodeIdFromPAKEKeyId(kDefaultCommissioningPasscodeId), kUndefinedFabricIndex); } + + ScopedNodeId GetLocalScopedNodeId() const override + { + // For PASE, source is always the undefined node ID + return ScopedNodeId(); + } + CATValues GetPeerCATs() const override { return CATValues(); }; CHIP_ERROR OnUnsolicitedMessageReceived(const PayloadHeader & payloadHeader, ExchangeDelegate *& newDelegate) override; diff --git a/src/transport/GroupSession.h b/src/transport/GroupSession.h index c3118653b9e384..46bcad14b3d9eb 100644 --- a/src/transport/GroupSession.h +++ b/src/transport/GroupSession.h @@ -27,7 +27,7 @@ namespace Transport { class IncomingGroupSession : public Session { public: - IncomingGroupSession(GroupId group, FabricIndex fabricIndex, NodeId sourceNodeId) : mGroupId(group), mSourceNodeId(sourceNodeId) + IncomingGroupSession(GroupId group, FabricIndex fabricIndex, NodeId peerNodeId) : mGroupId(group), mPeerNodeId(peerNodeId) { SetFabricIndex(fabricIndex); } @@ -38,7 +38,8 @@ class IncomingGroupSession : public Session const char * GetSessionTypeString() const override { return "incoming group"; }; #endif - ScopedNodeId GetPeer() const override { return ScopedNodeId(mSourceNodeId, GetFabricIndex()); } + ScopedNodeId GetPeer() const override { return ScopedNodeId(mPeerNodeId, GetFabricIndex()); } + ScopedNodeId GetLocalScopedNodeId() const override { return ScopedNodeId(kUndefinedNodeId, GetFabricIndex()); } Access::SubjectDescriptor GetSubjectDescriptor() const override { @@ -68,11 +69,9 @@ class IncomingGroupSession : public Session GroupId GetGroupId() const { return mGroupId; } - NodeId GetSourceNodeId() const { return mSourceNodeId; } - private: const GroupId mGroupId; - const NodeId mSourceNodeId; + const NodeId mPeerNodeId; }; class OutgoingGroupSession : public Session @@ -86,7 +85,10 @@ class OutgoingGroupSession : public Session const char * GetSessionTypeString() const override { return "outgoing group"; }; #endif + // Peer node ID is unused: users care about the group, not the node ScopedNodeId GetPeer() const override { return ScopedNodeId(); } + // Local node ID is unused: users care about the group, not the node + ScopedNodeId GetLocalScopedNodeId() const override { return ScopedNodeId(); } Access::SubjectDescriptor GetSubjectDescriptor() const override { diff --git a/src/transport/PairingSession.cpp b/src/transport/PairingSession.cpp index b7173a330f3c3d..6eef6c538b95cc 100644 --- a/src/transport/PairingSession.cpp +++ b/src/transport/PairingSession.cpp @@ -48,7 +48,8 @@ CHIP_ERROR PairingSession::ActivateSecureSession(const Transport::PeerAddress & // Call Activate last, otherwise errors on anything after would lead to // a partially valid session. - secureSession->Activate(GetSecureSessionType(), GetPeer(), GetPeerCATs(), peerSessionId, mRemoteMRPConfig); + secureSession->Activate(GetSecureSessionType(), GetLocalScopedNodeId(), GetPeer(), GetPeerCATs(), peerSessionId, + mRemoteMRPConfig); ChipLogDetail(Inet, "New secure session created for device " ChipLogFormatScopedNodeId ", LSID:%d PSID:%d!", ChipLogValueScopedNodeId(GetPeer()), secureSession->GetLocalSessionId(), peerSessionId); diff --git a/src/transport/PairingSession.h b/src/transport/PairingSession.h index c2d7576c20ada9..72318ecd0e79b1 100644 --- a/src/transport/PairingSession.h +++ b/src/transport/PairingSession.h @@ -44,6 +44,7 @@ class DLL_EXPORT PairingSession virtual Transport::SecureSession::Type GetSecureSessionType() const = 0; virtual ScopedNodeId GetPeer() const = 0; + virtual ScopedNodeId GetLocalScopedNodeId() const = 0; virtual CATValues GetPeerCATs() const = 0; Optional GetLocalSessionId() const diff --git a/src/transport/SecureSession.cpp b/src/transport/SecureSession.cpp index 2a55e03e5bbd9a..e2688869bc509a 100644 --- a/src/transport/SecureSession.cpp +++ b/src/transport/SecureSession.cpp @@ -20,11 +20,6 @@ namespace chip { namespace Transport { -ScopedNodeId SecureSession::GetPeer() const -{ - return ScopedNodeId(mPeerNodeId, GetFabricIndex()); -} - Access::SubjectDescriptor SecureSession::GetSubjectDescriptor() const { Access::SubjectDescriptor subjectDescriptor; diff --git a/src/transport/SecureSession.h b/src/transport/SecureSession.h index 49fea973b87127..63afccdd9b6576 100644 --- a/src/transport/SecureSession.h +++ b/src/transport/SecureSession.h @@ -72,11 +72,11 @@ class SecureSession : public Session // TODO: This constructor should be private. Tests should allocate a // kPending session and then call Activate(), just like non-test code does. - SecureSession(Type secureSessionType, uint16_t localSessionId, NodeId peerNodeId, CATValues peerCATs, uint16_t peerSessionId, - FabricIndex fabric, const ReliableMessageProtocolConfig & config) : + SecureSession(Type secureSessionType, uint16_t localSessionId, NodeId localNodeId, NodeId peerNodeId, CATValues peerCATs, + uint16_t peerSessionId, FabricIndex fabric, const ReliableMessageProtocolConfig & config) : mSecureSessionType(secureSessionType), - mPeerNodeId(peerNodeId), mPeerCATs(peerCATs), mLocalSessionId(localSessionId), mPeerSessionId(peerSessionId), - mLastActivityTime(System::SystemClock().GetMonotonicTimestamp()), + mLocalSessionId(localSessionId), mLocalNodeId(localNodeId), mPeerNodeId(peerNodeId), mPeerCATs(peerCATs), + mPeerSessionId(peerSessionId), mLastActivityTime(System::SystemClock().GetMonotonicTimestamp()), mLastPeerActivityTime(System::SystemClock().GetMonotonicTimestamp()), mMRPConfig(config) { SetFabricIndex(fabric); @@ -89,7 +89,8 @@ class SecureSession : public Session * receives a local session ID, but no other state. */ SecureSession(uint16_t localSessionId) : - SecureSession(Type::kPending, localSessionId, kUndefinedNodeId, CATValues{}, 0, kUndefinedFabricIndex, GetLocalMRPConfig()) + SecureSession(Type::kPending, localSessionId, kUndefinedNodeId, kUndefinedNodeId, CATValues{}, 0, kUndefinedFabricIndex, + GetLocalMRPConfig()) {} /** @@ -98,15 +99,26 @@ class SecureSession : public Session * PASE, setting internal state according to the parameters used and * discovered during session establishment. */ - void Activate(Type secureSessionType, const ScopedNodeId & peer, CATValues peerCATs, uint16_t peerSessionId, - const ReliableMessageProtocolConfig & config) + void Activate(Type secureSessionType, const ScopedNodeId & localNode, const ScopedNodeId & peerNode, CATValues peerCATs, + uint16_t peerSessionId, const ReliableMessageProtocolConfig & config) { + VerifyOrDie(peerNode.GetFabricIndex() == localNode.GetFabricIndex()); + + // PASE sessions must always start unassociated with a Fabric! + VerifyOrDie(!((secureSessionType == Type::kPASE) && (peerNode.GetFabricIndex() != kUndefinedFabricIndex))); + // CASE sessions must always start "associated" a given Fabric! + VerifyOrDie(!((secureSessionType == Type::kCASE) && (peerNode.GetFabricIndex() == kUndefinedFabricIndex))); + // CASE sessions can only be activated against operational node IDs! + VerifyOrDie(!((secureSessionType == Type::kCASE) && + (!IsOperationalNodeId(peerNode.GetNodeId()) || !IsOperationalNodeId(localNode.GetNodeId())))); + mSecureSessionType = secureSessionType; - mPeerNodeId = peer.GetNodeId(); + mPeerNodeId = peerNode.GetNodeId(); + mLocalNodeId = localNode.GetNodeId(); mPeerCATs = peerCATs; mPeerSessionId = peerSessionId; mMRPConfig = config; - SetFabricIndex(peer.GetFabricIndex()); + SetFabricIndex(peerNode.GetFabricIndex()); } ~SecureSession() override { NotifySessionReleased(); } @@ -120,7 +132,10 @@ class SecureSession : public Session const char * GetSessionTypeString() const override { return "secure"; }; #endif - ScopedNodeId GetPeer() const override; + ScopedNodeId GetPeer() const override { return ScopedNodeId(mPeerNodeId, GetFabricIndex()); } + + ScopedNodeId GetLocalScopedNodeId() const override { return ScopedNodeId(mLocalNodeId, GetFabricIndex()); } + Access::SubjectDescriptor GetSubjectDescriptor() const override; bool RequireMRP() const override { return GetPeerAddress().GetTransportType() == Transport::Type::kUdp; } @@ -147,6 +162,8 @@ class SecureSession : public Session bool IsPASESession() const { return GetSecureSessionType() == Type::kPASE; } bool IsActiveSession() const { return GetSecureSessionType() != Type::kPending; } NodeId GetPeerNodeId() const { return mPeerNodeId; } + NodeId GetLocalNodeId() const { return mLocalNodeId; } + CATValues GetPeerCATs() const { return mPeerCATs; } void SetMRPConfig(const ReliableMessageProtocolConfig & config) { mMRPConfig = config; } @@ -191,9 +208,10 @@ class SecureSession : public Session private: Type mSecureSessionType; + const uint16_t mLocalSessionId; + NodeId mLocalNodeId; NodeId mPeerNodeId; CATValues mPeerCATs; - const uint16_t mLocalSessionId; uint16_t mPeerSessionId; PeerAddress mPeerAddress; diff --git a/src/transport/SecureSessionTable.h b/src/transport/SecureSessionTable.h index 1804ea412c88d9..06bd80e6ee3f9c 100644 --- a/src/transport/SecureSessionTable.h +++ b/src/transport/SecureSessionTable.h @@ -48,10 +48,11 @@ class SecureSessionTable * * @param secureSessionType secure session type * @param localSessionId unique identifier for the local node's secure unicast session context + * @param localNodeId represents the local Node ID for this node * @param peerNodeId represents peer Node's ID * @param peerCATs represents peer CASE Authenticated Tags * @param peerSessionId represents the encryption key ID assigned by peer node - * @param fabric represents fabric ID for the session + * @param fabricIndex represents fabric index for the session * @param config represents the reliable message protocol configuration * * @note the newly created state will have an 'active' time set based on the current time source. @@ -61,11 +62,35 @@ class SecureSessionTable */ CHECK_RETURN_VALUE Optional CreateNewSecureSessionForTest(SecureSession::Type secureSessionType, uint16_t localSessionId, - NodeId peerNodeId, CATValues peerCATs, uint16_t peerSessionId, - FabricIndex fabric, const ReliableMessageProtocolConfig & config) + NodeId localNodeId, NodeId peerNodeId, CATValues peerCATs, + uint16_t peerSessionId, FabricIndex fabricIndex, + const ReliableMessageProtocolConfig & config) { - SecureSession * result = - mEntries.CreateObject(secureSessionType, localSessionId, peerNodeId, peerCATs, peerSessionId, fabric, config); + if (secureSessionType == SecureSession::Type::kCASE) + { + if ((fabricIndex == kUndefinedFabricIndex) || (localNodeId == kUndefinedNodeId) || (peerNodeId == kUndefinedNodeId)) + { + return Optional::Missing(); + } + } + else if (secureSessionType == SecureSession::Type::kPASE) + { + if ((fabricIndex != kUndefinedFabricIndex) || (localNodeId != kUndefinedNodeId) || (peerNodeId != kUndefinedNodeId)) + { + // TODO: This secure session type is infeasible! We must fix the tests + if (false) + { + return Optional::Missing(); + } + else + { + (void) fabricIndex; + } + } + } + + SecureSession * result = mEntries.CreateObject(secureSessionType, localSessionId, localNodeId, peerNodeId, peerCATs, + peerSessionId, fabricIndex, config); return result != nullptr ? MakeOptional(*result) : Optional::Missing(); } diff --git a/src/transport/Session.h b/src/transport/Session.h index b51c78964cf3d2..17225b57c4a887 100644 --- a/src/transport/Session.h +++ b/src/transport/Session.h @@ -70,6 +70,7 @@ class Session virtual void Release() {} virtual ScopedNodeId GetPeer() const = 0; + virtual ScopedNodeId GetLocalScopedNodeId() const = 0; virtual Access::SubjectDescriptor GetSubjectDescriptor() const = 0; virtual bool RequireMRP() const = 0; virtual const ReliableMessageProtocolConfig & GetMRPConfig() const = 0; diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index f8da0f43a550b3..2dbc71e1a6d569 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -158,7 +158,8 @@ CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, P mGroupClientCounter.IncrementCounter(isControlMsg); packetHeader.SetFlags(Header::SecFlagValues::kPrivacyFlag); packetHeader.SetSessionType(Header::SessionType::kGroupSession); - packetHeader.SetSourceNodeId(fabric->GetNodeId()); + NodeId sourceNodeId = fabric->GetNodeId(); + packetHeader.SetSourceNodeId(sourceNodeId); if (!packetHeader.IsValidGroupMsg()) { @@ -174,7 +175,7 @@ CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, P packetHeader.SetSessionId(keyContext->GetKeyHash()); CryptoContext::NonceStorage nonce; - CryptoContext::BuildNonce(nonce, packetHeader.GetSecurityFlags(), packetHeader.GetMessageCounter(), fabric->GetNodeId()); + CryptoContext::BuildNonce(nonce, packetHeader.GetSecurityFlags(), packetHeader.GetMessageCounter(), sourceNodeId); CHIP_ERROR err = SecureMessageCodec::Encrypt(CryptoContext(keyContext), nonce, payloadHeader, packetHeader, message); keyContext->Release(); ReturnErrorOnFailure(err); @@ -203,18 +204,9 @@ CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, P CHIP_TRACE_MESSAGE_SENT(payloadHeader, packetHeader, message->Start(), message->TotalLength()); CryptoContext::NonceStorage nonce; - if (session->GetSecureSessionType() == SecureSession::Type::kCASE) - { - FabricInfo * fabric = mFabricTable->FindFabricWithIndex(session->GetFabricIndex()); - VerifyOrDie(fabric != nullptr); - CryptoContext::BuildNonce(nonce, packetHeader.GetSecurityFlags(), messageCounter, fabric->GetNodeId()); - } - else - { - // PASE Sessions use the undefined node ID of all zeroes, since there is no node ID to use - // and the key is short-lived and always different for each PASE session. - CryptoContext::BuildNonce(nonce, packetHeader.GetSecurityFlags(), messageCounter, kUndefinedNodeId); - } + NodeId sourceNodeId = session->GetLocalScopedNodeId().GetNodeId(); + CryptoContext::BuildNonce(nonce, packetHeader.GetSecurityFlags(), messageCounter, sourceNodeId); + ReturnErrorOnFailure(SecureMessageCodec::Encrypt(session->GetCryptoContext(), nonce, payloadHeader, packetHeader, message)); ReturnErrorOnFailure(counter.Advance()); @@ -406,9 +398,10 @@ CHIP_ERROR SessionManager::InjectPaseSessionWithTestKey(SessionHolder & sessionH uint16_t peerSessionId, FabricIndex fabric, const Transport::PeerAddress & peerAddress, CryptoContext::SessionRole role) { + NodeId localNodeId = kUndefinedNodeId; Optional session = - mSecureSessions.CreateNewSecureSessionForTest(chip::Transport::SecureSession::Type::kPASE, localSessionId, peerNodeId, - CATValues{}, peerSessionId, fabric, GetLocalMRPConfig()); + mSecureSessions.CreateNewSecureSessionForTest(chip::Transport::SecureSession::Type::kPASE, localSessionId, localNodeId, + peerNodeId, CATValues{}, peerSessionId, fabric, GetLocalMRPConfig()); VerifyOrReturnError(session.HasValue(), CHIP_ERROR_NO_MEMORY); SecureSession * secureSession = session.Value()->AsSecureSession(); secureSession->SetPeerAddress(peerAddress); diff --git a/src/transport/SessionManager.h b/src/transport/SessionManager.h index 9b535229e828f3..260db7866a395b 100644 --- a/src/transport/SessionManager.h +++ b/src/transport/SessionManager.h @@ -158,8 +158,8 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate // Test-only: create a session on the fly. CHIP_ERROR InjectPaseSessionWithTestKey(SessionHolder & sessionHolder, uint16_t localSessionId, NodeId peerNodeId, - uint16_t peerSessionId, FabricIndex fabric, const Transport::PeerAddress & peerAddress, - CryptoContext::SessionRole role); + uint16_t peerSessionId, FabricIndex fabricIndex, + const Transport::PeerAddress & peerAddress, CryptoContext::SessionRole role); /** * @brief diff --git a/src/transport/UnauthenticatedSessionTable.h b/src/transport/UnauthenticatedSessionTable.h index 15a118d47ccdd1..3a7132722c2097 100644 --- a/src/transport/UnauthenticatedSessionTable.h +++ b/src/transport/UnauthenticatedSessionTable.h @@ -82,7 +82,8 @@ class UnauthenticatedSession : public Session, public ReferenceCounted::Retain(); } void Release() override { ReferenceCounted::Release(); } - ScopedNodeId GetPeer() const override { return ScopedNodeId(kUndefinedNodeId, GetFabricIndex()); } + ScopedNodeId GetPeer() const override { return ScopedNodeId(GetPeerNodeId(), kUndefinedFabricIndex); } + ScopedNodeId GetLocalScopedNodeId() const override { return ScopedNodeId(kUndefinedNodeId, kUndefinedFabricIndex); } Access::SubjectDescriptor GetSubjectDescriptor() const override { diff --git a/src/transport/tests/TestPairingSession.cpp b/src/transport/tests/TestPairingSession.cpp index 6ffd2037f02f06..b40c044d4d893a 100644 --- a/src/transport/tests/TestPairingSession.cpp +++ b/src/transport/tests/TestPairingSession.cpp @@ -43,6 +43,7 @@ class TestPairingSession : public PairingSession public: Transport::SecureSession::Type GetSecureSessionType() const override { return Transport::SecureSession::Type::kPASE; } ScopedNodeId GetPeer() const override { return ScopedNodeId(); } + ScopedNodeId GetLocalScopedNodeId() const override { return ScopedNodeId(); } CATValues GetPeerCATs() const override { return CATValues(); }; const ReliableMessageProtocolConfig & GetRemoteMRPConfig() const { return mRemoteMRPConfig; } diff --git a/src/transport/tests/TestPeerConnections.cpp b/src/transport/tests/TestPeerConnections.cpp index 8aea395d003414..d96a5addb0100c 100644 --- a/src/transport/tests/TestPeerConnections.cpp +++ b/src/transport/tests/TestPeerConnections.cpp @@ -44,17 +44,16 @@ PeerAddress AddressFromString(const char * str) return PeerAddress::UDP(addr); } -const PeerAddress kPeer1Addr = AddressFromString("fe80::1"); -const PeerAddress kPeer2Addr = AddressFromString("fe80::2"); -const PeerAddress kPeer3Addr = AddressFromString("fe80::3"); +const PeerAddress kPeer1Addr = AddressFromString("fe80::1"); +const PeerAddress kPeer2Addr = AddressFromString("fe80::2"); +const PeerAddress kPasePeerAddr = AddressFromString("fe80::3"); -const NodeId kPeer1NodeId = 123; -const NodeId kPeer2NodeId = 6; -const NodeId kPeer3NodeId = 81; +const NodeId kLocalNodeId = 0xC439A991071292DB; +const NodeId kCasePeer1NodeId = 123; +const NodeId kCasePeer2NodeId = 6; +const FabricIndex kFabricIndex = 8; -const SecureSession::Type kPeer1SessionType = SecureSession::Type::kCASE; -const SecureSession::Type kPeer2SessionType = SecureSession::Type::kCASE; -const SecureSession::Type kPeer3SessionType = SecureSession::Type::kPASE; +const NodeId kPasePeerNodeId = kUndefinedNodeId; // PASE is always undefined const CATValues kPeer1CATs = { { 0xABCD0001, 0xABCE0100, 0xABCD0020 } }; const CATValues kPeer2CATs = { { 0xABCD0012, kUndefinedCAT, kUndefinedCAT } }; @@ -69,28 +68,34 @@ void TestBasicFunctionality(nlTestSuite * inSuite, void * inContext) clock.SetMonotonic(100_ms64); CATValues peerCATs; - // Node ID 1, peer key 1, local key 2 - auto optionalSession = connections.CreateNewSecureSessionForTest(kPeer1SessionType, 2, kPeer1NodeId, kPeer1CATs, 1, - 0 /* fabricIndex */, GetLocalMRPConfig()); + // First node, peer session id 1, local session id 2 + auto optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kCASE, 2, kLocalNodeId, kCasePeer1NodeId, + kPeer1CATs, 1, kFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, optionalSession.HasValue()); - NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetSecureSessionType() == kPeer1SessionType); - NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetPeerNodeId() == kPeer1NodeId); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetSecureSessionType() == SecureSession::Type::kCASE); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetPeerNodeId() == kCasePeer1NodeId); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetLocalNodeId() == kLocalNodeId); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->GetPeer() == ScopedNodeId(kCasePeer1NodeId, kFabricIndex)); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->GetLocalScopedNodeId() == ScopedNodeId(kLocalNodeId, kFabricIndex)); peerCATs = optionalSession.Value()->AsSecureSession()->GetPeerCATs(); NL_TEST_ASSERT(inSuite, memcmp(&peerCATs, &kPeer1CATs, sizeof(CATValues)) == 0); - // Node ID 2, peer key 3, local key 4 - optionalSession = connections.CreateNewSecureSessionForTest(kPeer2SessionType, 4, kPeer2NodeId, kPeer2CATs, 3, - 0 /* fabricIndex */, GetLocalMRPConfig()); + // Second node, peer session id 3, local session id 4 + optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kCASE, 4, kLocalNodeId, kCasePeer2NodeId, + kPeer2CATs, 3, kFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, optionalSession.HasValue()); - NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetSecureSessionType() == kPeer2SessionType); - NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetPeerNodeId() == kPeer2NodeId); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetSecureSessionType() == SecureSession::Type::kCASE); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetPeerNodeId() == kCasePeer2NodeId); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetLocalNodeId() == kLocalNodeId); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->GetPeer() == ScopedNodeId(kCasePeer2NodeId, kFabricIndex)); + NL_TEST_ASSERT(inSuite, optionalSession.Value()->GetLocalScopedNodeId() == ScopedNodeId(kLocalNodeId, kFabricIndex)); NL_TEST_ASSERT(inSuite, optionalSession.Value()->AsSecureSession()->GetLastActivityTime() == 100_ms64); peerCATs = optionalSession.Value()->AsSecureSession()->GetPeerCATs(); NL_TEST_ASSERT(inSuite, memcmp(&peerCATs, &kPeer2CATs, sizeof(CATValues)) == 0); // Insufficient space for new connections. Object is max size 2 - optionalSession = connections.CreateNewSecureSessionForTest(kPeer3SessionType, 6, kPeer3NodeId, kPeer3CATs, 5, - 0 /* fabricIndex */, GetLocalMRPConfig()); + optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kPASE, 6, kLocalNodeId, kPasePeerNodeId, + kPeer3CATs, 5, kUndefinedFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, !optionalSession.HasValue()); System::Clock::Internal::SetSystemClockForTesting(realClock); } @@ -102,17 +107,17 @@ void TestFindByKeyId(nlTestSuite * inSuite, void * inContext) System::Clock::ClockBase * realClock = &System::SystemClock(); System::Clock::Internal::SetSystemClockForTesting(&clock); - // Node ID 1, peer key 1, local key 2 - auto optionalSession = connections.CreateNewSecureSessionForTest(kPeer1SessionType, 2, kPeer1NodeId, kPeer1CATs, 1, - 0 /* fabricIndex */, GetLocalMRPConfig()); + // First node, peer session id 1, local session id 2 + auto optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kCASE, 2, kLocalNodeId, kCasePeer1NodeId, + kPeer1CATs, 1, kFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, optionalSession.HasValue()); NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(1).HasValue()); NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(2).HasValue()); - // Node ID 2, peer key 3, local key 4 - optionalSession = connections.CreateNewSecureSessionForTest(kPeer2SessionType, 4, kPeer2NodeId, kPeer2CATs, 3, - 0 /* fabricIndex */, GetLocalMRPConfig()); + // Second node, peer session id 3, local session id 4 + optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kCASE, 4, kLocalNodeId, kCasePeer2NodeId, + kPeer2CATs, 3, kFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, optionalSession.HasValue()); NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(3).HasValue()); @@ -139,23 +144,23 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) clock.SetMonotonic(100_ms64); - // Node ID 1, peer key 1, local key 2 - auto optionalSession = connections.CreateNewSecureSessionForTest(kPeer1SessionType, 2, kPeer1NodeId, kPeer1CATs, 1, - 0 /* fabricIndex */, GetLocalMRPConfig()); + // First node, peer session id 1, local session id 2 + auto optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kCASE, 2, kLocalNodeId, kCasePeer1NodeId, + kPeer1CATs, 1, kFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, optionalSession.HasValue()); optionalSession.Value()->AsSecureSession()->SetPeerAddress(kPeer1Addr); clock.SetMonotonic(200_ms64); - // Node ID 2, peer key 3, local key 4 - optionalSession = connections.CreateNewSecureSessionForTest(kPeer2SessionType, 4, kPeer2NodeId, kPeer2CATs, 3, - 0 /* fabricIndex */, GetLocalMRPConfig()); + // Second node, peer session id 3, local session id 4 + optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kCASE, 4, kLocalNodeId, kCasePeer2NodeId, + kPeer2CATs, 3, kFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, optionalSession.HasValue()); optionalSession.Value()->AsSecureSession()->SetPeerAddress(kPeer2Addr); // cannot add before expiry clock.SetMonotonic(300_ms64); - optionalSession = connections.CreateNewSecureSessionForTest(kPeer3SessionType, 6, kPeer3NodeId, kPeer3CATs, 5, - 0 /* fabricIndex */, GetLocalMRPConfig()); + optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kPASE, 6, kLocalNodeId, kPasePeerNodeId, + kPeer3CATs, 5, kFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, !optionalSession.HasValue()); // at time 300, this expires ip addr 1 @@ -165,17 +170,17 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) callInfo.lastCallPeerAddress = state.GetPeerAddress(); }); NL_TEST_ASSERT(inSuite, callInfo.callCount == 1); - NL_TEST_ASSERT(inSuite, callInfo.lastCallNodeId == kPeer1NodeId); + NL_TEST_ASSERT(inSuite, callInfo.lastCallNodeId == kCasePeer1NodeId); NL_TEST_ASSERT(inSuite, callInfo.lastCallPeerAddress == kPeer1Addr); NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(2).HasValue()); // now that the connections were expired, we can add peer3 clock.SetMonotonic(300_ms64); - // Node ID 3, peer key 5, local key 6 - optionalSession = connections.CreateNewSecureSessionForTest(kPeer3SessionType, 6, kPeer3NodeId, kPeer3CATs, 5, - 0 /* fabricIndex */, GetLocalMRPConfig()); + // Third node (PASE session), peer session id 5, local session id 6 + optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kPASE, 6, kLocalNodeId, kPasePeerNodeId, + kPeer3CATs, 5, kFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, optionalSession.HasValue()); - optionalSession.Value()->AsSecureSession()->SetPeerAddress(kPeer3Addr); + optionalSession.Value()->AsSecureSession()->SetPeerAddress(kPasePeerAddr); clock.SetMonotonic(400_ms64); optionalSession = connections.FindSecureSessionByLocalKey(4); @@ -198,15 +203,15 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) // peer 2 stays active NL_TEST_ASSERT(inSuite, callInfo.callCount == 1); - NL_TEST_ASSERT(inSuite, callInfo.lastCallNodeId == kPeer3NodeId); - NL_TEST_ASSERT(inSuite, callInfo.lastCallPeerAddress == kPeer3Addr); + NL_TEST_ASSERT(inSuite, callInfo.lastCallNodeId == kPasePeerNodeId); + NL_TEST_ASSERT(inSuite, callInfo.lastCallPeerAddress == kPasePeerAddr); NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(2).HasValue()); NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(4).HasValue()); NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(6).HasValue()); - // Node ID 1, peer key 1, local key 2 - optionalSession = connections.CreateNewSecureSessionForTest(kPeer1SessionType, 2, kPeer1NodeId, kPeer1CATs, 1, - 0 /* fabricIndex */, GetLocalMRPConfig()); + // First node, peer session id 1, local session id 2 + optionalSession = connections.CreateNewSecureSessionForTest(SecureSession::Type::kCASE, 2, kLocalNodeId, kCasePeer1NodeId, + kPeer1CATs, 1, kFabricIndex, GetLocalMRPConfig()); NL_TEST_ASSERT(inSuite, optionalSession.HasValue()); NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(2).HasValue()); NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(4).HasValue()); diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index f0d0e3b3716b9a..9c3389089f74e6 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -184,6 +184,7 @@ class TestList : public Command { printf("TestIdentifyCluster\n"); printf("TestLogCommands\n"); printf("TestOperationalCredentialsCluster\n"); + printf("TestSelfFabricRemoval\n"); printf("TestBinding\n"); printf("Test_TC_SWDIAG_1_1\n"); printf("Test_TC_SWDIAG_2_1\n"); @@ -63327,6 +63328,165 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { } }; +class TestSelfFabricRemoval : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestSelfFabricRemoval() + : TestCommandBridge("TestSelfFabricRemoval") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TestSelfFabricRemoval() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestSelfFabricRemoval\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestSelfFabricRemoval\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of commissioned fabrics\n"); + err = TestReadNumberOfCommissionedFabrics_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read current fabric index\n"); + err = TestReadCurrentFabricIndex_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Remove single own fabric\n"); + err = TestRemoveSingleOwnFabric_3(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read number of commissioned fabrics Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CommissionedFabrics", actualValue, 1)); + } + + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull ourFabricIndex; + + CHIP_ERROR TestReadCurrentFabricIndex_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current fabric index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1)); + } + { + ourFabricIndex = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRemoveSingleOwnFabric_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.fabricIndex = [ourFabricIndex copy]; + [cluster removeFabricWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove single own fabric Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class TestBinding : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -64518,6 +64678,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index f3d3199fd090fb..9cc3c8429a8574 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -207,6 +207,7 @@ class TestList : public Command printf("TestIdentifyCluster\n"); printf("TestOperationalCredentialsCluster\n"); printf("TestModeSelectCluster\n"); + printf("TestSelfFabricRemoval\n"); printf("TestSystemCommands\n"); printf("TestBinding\n"); printf("TestUserLabelCluster\n"); @@ -41819,6 +41820,117 @@ class TestModeSelectClusterSuite : public TestCommand } }; +class TestSelfFabricRemovalSuite : public TestCommand +{ +public: + TestSelfFabricRemovalSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestSelfFabricRemoval", 4, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestSelfFabricRemovalSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::FabricIndex ourFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissionedFabrics", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::FabricIndex value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1)); + ourFabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 1: { + LogStep(1, "Read number of commissioned fabrics"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CommissionedFabrics::Id); + } + case 2: { + LogStep(2, "Read current fabric index"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id); + } + case 3: { + LogStep(3, "Remove single own fabric"); + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = ourFabricIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value); + } + } + return CHIP_NO_ERROR; + } +}; + class TestSystemCommandsSuite : public TestCommand { public: @@ -57566,6 +57678,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), From ec8137060942c298da5aff188acfbd68bbf17c20 Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Thu, 28 Apr 2022 06:10:52 +0530 Subject: [PATCH 20/59] MF test added Apr 22 (#17667) * Added MF tests TC-MF-1.3 TC-MF-1.5 TC-MF-1.6 TC-MF-1.15 * Added auto generated files --- examples/chip-tool/templates/tests/tests.js | 6 +- .../suites/certification/Test_TC_MF_1_15.yaml | 637 +++--- .../suites/certification/Test_TC_MF_1_3.yaml | 46 +- .../suites/certification/Test_TC_MF_1_5.yaml | 398 ++-- .../suites/certification/Test_TC_MF_1_6.yaml | 83 +- .../chip-tool/zap-generated/test/Commands.h | 2004 +++++++++++------ 6 files changed, 1789 insertions(+), 1385 deletions(-) diff --git a/examples/chip-tool/templates/tests/tests.js b/examples/chip-tool/templates/tests/tests.js index cad5425c516fd1..22f3728a5942cc 100644 --- a/examples/chip-tool/templates/tests/tests.js +++ b/examples/chip-tool/templates/tests/tests.js @@ -143,8 +143,6 @@ function getManualTests() const MultipleFabrics = [ 'Test_TC_MF_1_1', 'Test_TC_MF_1_2', - 'Test_TC_MF_1_3', - 'Test_TC_MF_1_5', 'Test_TC_MF_1_7', 'Test_TC_MF_1_8', 'Test_TC_MF_1_9', @@ -153,7 +151,6 @@ function getManualTests() 'Test_TC_MF_1_12', 'Test_TC_MF_1_13', 'Test_TC_MF_1_14', - 'Test_TC_MF_1_15', 'Test_TC_MF_1_16', 'Test_TC_MF_1_17', 'Test_TC_MF_1_18', @@ -420,8 +417,11 @@ function getTests() ]; const MultipleFabrics = [ + 'Test_TC_MF_1_3', 'Test_TC_MF_1_4', + 'Test_TC_MF_1_5', 'Test_TC_MF_1_6', + 'Test_TC_MF_1_15', ]; const OnOff = [ diff --git a/src/app/tests/suites/certification/Test_TC_MF_1_15.yaml b/src/app/tests/suites/certification/Test_TC_MF_1_15.yaml index ad7de25db1d8e6..0c308e6703fa74 100644 --- a/src/app/tests/suites/certification/Test_TC_MF_1_15.yaml +++ b/src/app/tests/suites/certification/Test_TC_MF_1_15.yaml @@ -19,377 +19,300 @@ name: config: nodeId: 0x12344321 - cluster: "Basic" + timeout: 500 + nodeIdForDuplicateCommissioning: + type: NODE_ID + defaultValue: 0x11 + nodeId2: + type: NODE_ID + defaultValue: 0xCAFE + nodeId3: + type: NODE_ID + defaultValue: 0xC00FEE endpoint: 0 + discriminator: + type: INT16U + defaultValue: 3840 + payload: + type: CHAR_STRING + defaultValue: "MT:-24J0AFN00KA0648G00" tests: - - label: "TH_CR1 starts a commissioning process with DUT_CE" - verification: | - 1. Provision the device using 1st controller chip tool (use above instructions) , - disabled: true - - - label: - "TH_CR1 opens a commissioning window on DUT_CE using BCM and TH_CR3 - Commissions with DUT_CE" - verification: | - On the 1st controller using chip tool, open commissioning window using BCM - - ./chip-tool administratorcommissioning open-basic-commissioning-window 500 1 0 - - [1635924941.016801][9606:9611] CHIP:DMG: InvokeCommand = - [1635924941.016871][9606:9611] CHIP:DMG: { - [1635924941.016926][9606:9611] CHIP:DMG: CommandList = - [1635924941.016987][9606:9611] CHIP:DMG: [ - [1635924941.017047][9606:9611] CHIP:DMG: CommandDataIB = - [1635924941.017115][9606:9611] CHIP:DMG: { - [1635924941.017181][9606:9611] CHIP:DMG: CommandPathIB = - [1635924941.017262][9606:9611] CHIP:DMG: { - [1635924941.017342][9606:9611] CHIP:DMG: EndpointId = 0x0, - [1635924941.017465][9606:9611] CHIP:DMG: ClusterId = 0x3c, - [1635924941.017544][9606:9611] CHIP:DMG: CommandId = 0x1, - [1635924941.017615][9606:9611] CHIP:DMG: }, - [1635924941.017693][9606:9611] CHIP:DMG: - [1635924941.017758][9606:9611] CHIP:DMG: StatusIB = - [1635924941.017834][9606:9611] CHIP:DMG: { - [1635924941.017912][9606:9611] CHIP:DMG: status = 0x0, - [1635924941.017992][9606:9611] CHIP:DMG: }, - [1635924941.018071][9606:9611] CHIP:DMG: - [1635924941.018141][9606:9611] CHIP:DMG: }, - [1635924941.018224][9606:9611] CHIP:DMG: - [1635924941.018283][9606:9611] CHIP:DMG: ], - [1635924941.018354][9606:9611] CHIP:DMG: - [1635924941.018408][9606:9611] CHIP:DMG: } - [1635924941.018506][9606:9611] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1635924941.018574][9606:9611] CHIP:TOO: Default Success Response - - - On 3rd controller using chip tool connect to the accessory - ./chip-tool pairing onnetwork 1 20202021 - disabled: true - - - label: - "TH_CR1 opens a commissioning window on DUT_CE using BCM and TH_CR2 - Commissions with DUT_CE" - verification: | - On the 2nd controller using chip tool, open commissioning window using BCM - - ./chip-tool administratorcommissioning open-basic-commissioning-window 500 1 0 - - [1635924941.016801][9606:9611] CHIP:DMG: InvokeCommand = - [1635924941.016871][9606:9611] CHIP:DMG: { - [1635924941.016926][9606:9611] CHIP:DMG: CommandList = - [1635924941.016987][9606:9611] CHIP:DMG: [ - [1635924941.017047][9606:9611] CHIP:DMG: CommandDataIB = - [1635924941.017115][9606:9611] CHIP:DMG: { - [1635924941.017181][9606:9611] CHIP:DMG: CommandPathIB = - [1635924941.017262][9606:9611] CHIP:DMG: { - [1635924941.017342][9606:9611] CHIP:DMG: EndpointId = 0x0, - [1635924941.017465][9606:9611] CHIP:DMG: ClusterId = 0x3c, - [1635924941.017544][9606:9611] CHIP:DMG: CommandId = 0x1, - [1635924941.017615][9606:9611] CHIP:DMG: }, - [1635924941.017693][9606:9611] CHIP:DMG: - [1635924941.017758][9606:9611] CHIP:DMG: StatusIB = - [1635924941.017834][9606:9611] CHIP:DMG: { - [1635924941.017912][9606:9611] CHIP:DMG: status = 0x0, - [1635924941.017992][9606:9611] CHIP:DMG: }, - [1635924941.018071][9606:9611] CHIP:DMG: - [1635924941.018141][9606:9611] CHIP:DMG: }, - [1635924941.018224][9606:9611] CHIP:DMG: - [1635924941.018283][9606:9611] CHIP:DMG: ], - [1635924941.018354][9606:9611] CHIP:DMG: - [1635924941.018408][9606:9611] CHIP:DMG: } - [1635924941.018506][9606:9611] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1635924941.018574][9606:9611] CHIP:TOO: Default Success Response - + - label: "Reboot target device" + cluster: "SystemCommands" + command: "Reboot" + arguments: + values: + - name: "discriminator" + value: discriminator - On 2nd controller using chip tool connect to the accessory - ./chip-tool pairing onnetwork 1 20202021 - disabled: true - - - label: - "TH_CR1 opens a commissioning window on DUT_CE using a commissioning - timeout of PIXIT_COMM_WIN seconds using BCM" - verification: | - On the 1st controller using chip tool, open commissioning window using BCM - - ./chip-tool administratorcommissioning open-basic-commissioning-window 500 1 0 - - [1635924941.016801][9606:9611] CHIP:DMG: InvokeCommand = - [1635924941.016871][9606:9611] CHIP:DMG: { - [1635924941.016926][9606:9611] CHIP:DMG: CommandList = - [1635924941.016987][9606:9611] CHIP:DMG: [ - [1635924941.017047][9606:9611] CHIP:DMG: CommandDataIB = - [1635924941.017115][9606:9611] CHIP:DMG: { - [1635924941.017181][9606:9611] CHIP:DMG: CommandPathIB = - [1635924941.017262][9606:9611] CHIP:DMG: { - [1635924941.017342][9606:9611] CHIP:DMG: EndpointId = 0x0, - [1635924941.017465][9606:9611] CHIP:DMG: ClusterId = 0x3c, - [1635924941.017544][9606:9611] CHIP:DMG: CommandId = 0x1, - [1635924941.017615][9606:9611] CHIP:DMG: }, - [1635924941.017693][9606:9611] CHIP:DMG: - [1635924941.017758][9606:9611] CHIP:DMG: StatusIB = - [1635924941.017834][9606:9611] CHIP:DMG: { - [1635924941.017912][9606:9611] CHIP:DMG: status = 0x0, - [1635924941.017992][9606:9611] CHIP:DMG: }, - [1635924941.018071][9606:9611] CHIP:DMG: - [1635924941.018141][9606:9611] CHIP:DMG: }, - [1635924941.018224][9606:9611] CHIP:DMG: - [1635924941.018283][9606:9611] CHIP:DMG: ], - [1635924941.018354][9606:9611] CHIP:DMG: - [1635924941.018408][9606:9611] CHIP:DMG: } - [1635924941.018506][9606:9611] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1635924941.018574][9606:9611] CHIP:TOO: Default Success Response - disabled: true - - - label: - "Before the expiration of PIXIT_COMM_WIN seconds, TH_CR1 opens a 2nd - commissioning window on DUT_CE using a commissioning timeout of - PIXIT_COMM_WIN seconds using ECM" - verification: | - On the 1st controller using chip tool, open commissioning window using ECM before timer expiry from above step - - ./chip-tool pairing open-commissioning-window 1 1 200 1000 3840 - - [1635925166.559181][9640:9645] CHIP:SC: Success status report received. Session was established - [1635925166.559219][9640:9645] CHIP:IN: New secure session created for device 0x0000000000000001, key 26!! - [1635925166.559345][9640:9645] CHIP:CTL: OpenCommissioningWindow for device ID 1 - [1635925166.566754][9640:9645] CHIP:DMG: ICR moving to [AddingComm] - [1635925166.566805][9640:9645] CHIP:DMG: ICR moving to [AddedComma] - [1635925166.566924][9640:9645] CHIP:IN: Prepared encrypted message 0xaaaae1dc5d10 to 0x0000000000000001 of type 0x8 and protocolId (0, 1) on exchange 51860i with MessageCounter:0. - [1635925166.566974][9640:9645] CHIP:IN: Sending encrypted msg 0xaaaae1dc5d10 with MessageCounter:0 to 0x0000000000000001 at monotonic time: 12902053 msec - [1635925166.567193][9640:9645] CHIP:DMG: ICR moving to [CommandSen] - [1635925166.567253][9640:9645] CHIP:CTL: Manual pairing code: [36110946855] - [1635925166.567321][9640:9645] CHIP:CTL: SetupQRCode: [MT:00000CQM00C8H-6ON10] - [1635925166.567422][9640:9645] CHIP:EM: Sending Standalone Ack for MessageCounter:1964916532 on exchange 51859i - disabled: true + - label: "TH_CR1 starts a commissioning process with DUT_CE" + identity: "alpha" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH_CR1 opens a commissioning window on DUT_CE" + identity: "alpha" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "Commission from gamma" + identity: "gamma" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeId3 + - name: "payload" + value: payload + + - label: "TH_CR3 starts a commissioning process with DUT_CE" + identity: "gamma" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId3 + + - label: "TH_CR1 opens a commissioning window on DUT_CE" + identity: "alpha" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "Commission from beta" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload + + - label: "TH_CR2 starts a commissioning process with DUT_CE" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId2 + + - label: "TH_CR1 opens a commissioning window on DUT_CE" + identity: "alpha" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "TH_CR1 opens a new commissioning window on DUT_CE" + identity: "alpha" + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEVerifier" + value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" + - name: "discriminator" + value: 3840 + - name: "iterations" + value: 1000 + - name: "salt" + value: "SPAKE2P Key Salt" + response: + error: FAILURE - label: "TH_CR1 reads the list of Fabrics on DUT_CE" - verification: | - on 1st controller using chip tool read fabrics list - - ./chip-tool operationalcredentials read fabrics-list 1 0 - - [1635924252.914294][9545:9550] CHIP:DMG: ReportData = - [1635924252.914337][9545:9550] CHIP:DMG: { - [1635924252.914370][9545:9550] CHIP:DMG: AttributeDataList = - [1635924252.914409][9545:9550] CHIP:DMG: [ - [1635924252.914446][9545:9550] CHIP:DMG: AttributeDataElement = - [1635924252.914490][9545:9550] CHIP:DMG: { - [1635924252.914524][9545:9550] CHIP:DMG: AttributePath = - [1635924252.914570][9545:9550] CHIP:DMG: { - [1635924252.914610][9545:9550] CHIP:DMG: NodeId = 0x1, - [1635924252.914667][9545:9550] CHIP:DMG: EndpointId = 0x0, - [1635924252.914724][9545:9550] CHIP:DMG: ClusterId = 0x3e, - [1635924252.914780][9545:9550] CHIP:DMG: FieldTag = 0x0000_0001, - [1635924252.914828][9545:9550] CHIP:DMG: } - [1635924252.914878][9545:9550] CHIP:DMG: - [1635924252.914919][9545:9550] CHIP:DMG: Data = [ - [1635924252.914966][9545:9550] CHIP:DMG: - [1635924252.915012][9545:9550] CHIP:DMG: { - [1635924252.915063][9545:9550] CHIP:DMG: 0x0 = 1, - [1635924252.915112][9545:9550] CHIP:DMG: 0x1 = [ - [1635924252.915180][9545:9550] CHIP:DMG: 0x4, 0xd6, 0x7d, 0xf1, 0x70, 0x4, 0x8, 0xb0, 0x4b, 0x2b, 0x86, 0xc, 0xe4, 0x28, 0xfa, 0xaa, 0xd5, 0x61, 0x92, 0xf4, 0x53, 0x2, 0xe9, 0xa2, 0x91, 0x17, 0x67, 0x89, 0xe7, 0xdc, 0x81, 0x18, 0x11, 0xe4, 0x41, 0x88, 0xbd, 0xdc, 0x6, 0xee, 0x1, 0x53, 0x63 - [1635924252.915248][9545:9550] CHIP:DMG: ] - [1635924252.915296][9545:9550] CHIP:DMG: 0x2 = 50504, - [1635924252.915345][9545:9550] CHIP:DMG: 0x3 = 0, - [1635924252.915392][9545:9550] CHIP:DMG: 0x4 = 1, - [1635924252.915445][9545:9550] CHIP:DMG: 0x5 = "", - [1635924252.915518][9545:9550] CHIP:DMG: }, - [1635924252.915573][9545:9550] CHIP:DMG: { - [1635924252.915622][9545:9550] CHIP:DMG: 0x0 = 2, - [1635924252.915693][9545:9550] CHIP:DMG: 0x1 = [ - [1635924252.915790][9545:9550] CHIP:DMG: 0x4, 0x79, 0x31, 0x7e, 0x45, 0x90, 0x63, 0xd2, 0x1e, 0x54, 0x63, 0x38, 0x11, 0x6b, 0xb4, 0xd0, 0xcc, 0x5e, 0xad, 0x1d, 0xfe, 0xbb, 0xa6, 0xb3, 0xbf, 0x41, 0x25, 0x47, 0x1f, 0x26, 0x0, 0x5a, 0x80, 0xed, 0xdf, 0x98, 0xcc, 0xe7, 0xf3, 0xac, 0x81, 0x92, - [1635924252.915870][9545:9550] CHIP:DMG: ] - [1635924252.915943][9545:9550] CHIP:DMG: 0x2 = 33608, - [1635924252.915996][9545:9550] CHIP:DMG: 0x3 = 0, - [1635924252.916047][9545:9550] CHIP:DMG: 0x4 = 2, - [1635924252.916098][9545:9550] CHIP:DMG: 0x5 = "", - [1635924252.916150][9545:9550] CHIP:DMG: }, - [1635924252.916205][9545:9550] CHIP:DMG: ], - [1635924252.916257][9545:9550] CHIP:DMG: DataElementVersion = 0x0, - [1635924252.916315][9545:9550] CHIP:DMG: }, - [1635924252.916383][9545:9550] CHIP:DMG: - [1635924252.916427][9545:9550] CHIP:DMG: ], - [1635924252.916492][9545:9550] CHIP:DMG: - [1635924252.916534][9545:9550] CHIP:DMG: } - [1635924252.916707][9545:9550] CHIP:ZCL: ReadAttributesResponse: - [1635924252.916750][9545:9550] CHIP:ZCL: ClusterId: 0x0000_003E - [1635924252.916795][9545:9550] CHIP:ZCL: attributeId: 0x0000_0001 - [1635924252.916836][9545:9550] CHIP:ZCL: status: Success (0x0000) - [1635924252.916882][9545:9550] CHIP:ZCL: attribute TLV Type: 0x16 - 1635924252.916947][9545:9550] CHIP:TOO: OnOperationalCredentialsFabricsListListAttributeResponse: 2 entries - [1635924252.917171][9545:9550] CHIP:TOO: FabricDescriptor[1]: - [1635924252.917214][9545:9550] CHIP:TOO: fabricIndex: 1 - [1635924252.917252][9545:9550] CHIP:ZCL: RootPublicKey: 65 - [1635924252.917289][9545:9550] CHIP:TOO: vendorId: 50504 - [1635924252.917322][9545:9550] CHIP:TOO: fabricId: 0 - [1635924252.917357][9545:9550] CHIP:TOO: nodeId: 1 - [1635924252.917389][9545:9550] CHIP:ZCL: Label: - [1635924252.917485][9545:9550] CHIP:TOO: FabricDescriptor[2]: - [1635924252.917518][9545:9550] CHIP:TOO: fabricIndex: 2 - [1635924252.917548][9545:9550] CHIP:ZCL: RootPublicKey: 65 - [1635924252.917577][9545:9550] CHIP:TOO: vendorId: 33608 - [1635924252.917606][9545:9550] CHIP:TOO: fabricId: 0 - [1635924252.917636][9545:9550] CHIP:TOO: nodeId: 2 - disabled: true + identity: "alpha" + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + fabricFiltered: false + response: + value: + [ + { Label: "", nodeId: nodeId }, + { Label: "", nodeId: nodeId2 }, + { Label: "", nodeID: nodeId3 }, + ] + constraints: + type: list - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" - verification: | - Wait for the expiration of PIXIT_COMM_WIN seconds - disabled: true - - - label: - "TH_CR1 re-opens a commissioning window on DUT_CE using a - commissioning timeout of PIXIT_COMM_WIN seconds using ECM" - verification: | - On the 1st controller using chip tool, open commissioning window using ECM - - - ./chip-tool pairing open-commissioning-window 1 1 200 1000 3840 - - [1635925391.224232][9653:9658] CHIP:SC: Success status report received. Session was established - [1635925391.224273][9653:9658] CHIP:IN: New secure session created for device 0x0000000000000001, key 27!! - [1635925391.224367][9653:9658] CHIP:CTL: OpenCommissioningWindow for device ID 1 - [1635925391.231805][9653:9658] CHIP:DMG: ICR moving to [AddingComm] - [1635925391.231864][9653:9658] CHIP:DMG: ICR moving to [AddedComma] - [1635925391.231996][9653:9658] CHIP:IN: Prepared encrypted message 0xaaaae98fdd10 to 0x0000000000000001 of type 0x8 and protocolId (0, 1) on exchange 61177i with MessageCounter:0. - [1635925391.232051][9653:9658] CHIP:IN: Sending encrypted msg 0xaaaae98fdd10 with MessageCounter:0 to 0x0000000000000001 at monotonic time: 13126718 msec - [1635925391.232180][9653:9658] CHIP:DMG: ICR moving to [CommandSen] - [1635925391.232232][9653:9658] CHIP:CTL: Manual pairing code: [35976646436] - [1635925391.232299][9653:9658] CHIP:CTL: SetupQRCode: [MT:00000CQM0061ZN63N10] - disabled: true - - - label: - "Before the expiration of PIXIT_COMM_WIN seconds, TH_CR3 opens a 2nd - commissioning window on DUT_CE using a commissioning timeout of - PIXIT_COMM_WIN seconds using ECM" - verification: | - On the 3rd controller using chip tool, open commissioning window using ECM + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 + - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 - ./chip-tool pairing open-commissioning-window 1 1 200 1000 3840 + - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 - [1635925391.224232][9653:9658] CHIP:SC: Success status report received. Session was established - [1635925391.224273][9653:9658] CHIP:IN: New secure session created for device 0x0000000000000001, key 27!! - [1635925391.224367][9653:9658] CHIP:CTL: OpenCommissioningWindow for device ID 1 - [1635925391.231805][9653:9658] CHIP:DMG: ICR moving to [AddingComm] - [1635925391.231864][9653:9658] CHIP:DMG: ICR moving to [AddedComma] - [1635925391.231996][9653:9658] CHIP:IN: Prepared encrypted message 0xaaaae98fdd10 to 0x0000000000000001 of type 0x8 and protocolId (0, 1) on exchange 61177i with MessageCounter:0. - [1635925391.232051][9653:9658] CHIP:IN: Sending encrypted msg 0xaaaae98fdd10 with MessageCounter:0 to 0x0000000000000001 at monotonic time: 13126718 msec - [1635925391.232180][9653:9658] CHIP:DMG: ICR moving to [CommandSen] - [1635925391.232232][9653:9658] CHIP:CTL: Manual pairing code: [35976646436] - [1635925391.232299][9653:9658] CHIP:CTL: SetupQRCode: [MT:00000CQM0061ZN63N10] - disabled: true + - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 18000 + + - label: "TH_CR1 re-opens new commissioning window on DUT_CE" + identity: "alpha" + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEVerifier" + value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" + - name: "discriminator" + value: 3840 + - name: "iterations" + value: 1000 + - name: "salt" + value: "SPAKE2P Key Salt" + + - label: "TH_CR3 opens a new commissioning window on DUT_CE" + identity: "gamma" + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEVerifier" + value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" + - name: "discriminator" + value: 3840 + - name: "iterations" + value: 1000 + - name: "salt" + value: "SPAKE2P Key Salt" + response: + error: FAILURE - label: "TH_CR1 reads the list of Fabrics on DUT_CE" - verification: | - On 1st controller using chip tool, read fabrics list - - ./chip-tool operationalcredentials read fabrics-list 1 0 + identity: "alpha" + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + fabricFiltered: false + response: + value: + [ + { Label: "", nodeId: nodeId }, + { Label: "", nodeId: nodeId2 }, + { Label: "", nodeID: nodeId3 }, + ] + constraints: + type: list - [1635925479.101355][9664:9669] CHIP:DMG: ReportData = - [1635925479.101389][9664:9669] CHIP:DMG: { - [1635925479.101465][9664:9669] CHIP:DMG: AttributeDataList = - [1635925479.101506][9664:9669] CHIP:DMG: [ - [1635925479.101542][9664:9669] CHIP:DMG: AttributeDataElement = - [1635925479.101602][9664:9669] CHIP:DMG: { - [1635925479.101656][9664:9669] CHIP:DMG: AttributePath = - [1635925479.101711][9664:9669] CHIP:DMG: { - [1635925479.101758][9664:9669] CHIP:DMG: NodeId = 0x1, - [1635925479.101808][9664:9669] CHIP:DMG: EndpointId = 0x0, - [1635925479.101857][9664:9669] CHIP:DMG: ClusterId = 0x3e, - [1635925479.101911][9664:9669] CHIP:DMG: FieldTag = 0x0000_0001, - [1635925479.101962][9664:9669] CHIP:DMG: } - [1635925479.102012][9664:9669] CHIP:DMG: - [1635925479.102057][9664:9669] CHIP:DMG: Data = [ - [1635925479.102103][9664:9669] CHIP:DMG: - [1635925479.102149][9664:9669] CHIP:DMG: { - [1635925479.102199][9664:9669] CHIP:DMG: 0x0 = 1, - [1635925479.102256][9664:9669] CHIP:DMG: 0x1 = [ - [1635925479.102327][9664:9669] CHIP:DMG: 0x4, 0xd6, 0x7d, 0xf1, 0x70, 0x4, 0x8, 0xb0, 0x4b, 0x2b, 0x86, 0xc, 0xe4, 0x28, 0xfa, 0xaa, 0xd5, 0x61, 0x92, 0xf4, 0x53, 0x2, 0xe9, 0xa2, 0x91, 0x17, 0x67, 0x89, 0xe7, 0xdc, 0x81, 0x18, 0x11, 0xe4, 0x41, 0x88, 0xbd, 0xdc, 0x6, 0xee, 0x1, 0x53, 0x63 - [1635925479.102385][9664:9669] CHIP:DMG: ] - [1635925479.102435][9664:9669] CHIP:DMG: 0x2 = 50504, - [1635925479.102485][9664:9669] CHIP:DMG: 0x3 = 0, - [1635925479.102537][9664:9669] CHIP:DMG: 0x4 = 1, - [1635925479.102590][9664:9669] CHIP:DMG: 0x5 = "", - [1635925479.102660][9664:9669] CHIP:DMG: }, - [1635925479.102725][9664:9669] CHIP:DMG: { - [1635925479.102864][9664:9669] CHIP:DMG: 0x0 = 2, - [1635925479.102947][9664:9669] CHIP:DMG: 0x1 = [ - [1635925479.103056][9664:9669] CHIP:DMG: 0x4, 0x79, 0x31, 0x7e, 0x45, 0x90, 0x63, 0xd2, 0x1e, 0x54, 0x63, 0x38, 0x11, 0x6b, 0xb4, 0xd0, 0xcc, 0x5e, 0xad, 0x1d, 0xfe, 0xbb, 0xa6, 0xb3, 0xbf, 0x41, 0x25, 0x47, 0x1f, 0x26, 0x0, 0x5a, 0x80, 0xed, 0xdf, 0x98, 0xcc, 0xe7, 0xf3, 0xac, 0x81, 0x92, - [1635925479.103146][9664:9669] CHIP:DMG: ] - [1635925479.103207][9664:9669] CHIP:DMG: 0x2 = 33608, - [1635925479.103298][9664:9669] CHIP:DMG: 0x3 = 0, - [1635925479.103390][9664:9669] CHIP:DMG: 0x4 = 2, - [1635925479.103449][9664:9669] CHIP:DMG: 0x5 = "", - [1635925479.103528][9664:9669] CHIP:DMG: }, - [1635925479.103606][9664:9669] CHIP:DMG: ], - [1635925479.103660][9664:9669] CHIP:DMG: DataElementVersion = 0x0, - [1635925479.103727][9664:9669] CHIP:DMG: }, - [1635925479.103797][9664:9669] CHIP:DMG: - [1635925479.103855][9664:9669] CHIP:DMG: ], - [1635925479.103918][9664:9669] CHIP:DMG: - [1635925479.103959][9664:9669] CHIP:DMG: } - [1635925479.104162][9664:9669] CHIP:ZCL: ReadAttributesResponse: - [1635925479.104205][9664:9669] CHIP:ZCL: ClusterId: 0x0000_003E - [1635925479.104266][9664:9669] CHIP:ZCL: attributeId: 0x0000_0001 - [1635925479.104324][9664:9669] CHIP:ZCL: status: Success (0x0000) - [1635925479.104360][9664:9669] CHIP:ZCL: attribute TLV Type: 0x16 - [1635925479.104424][9664:9669] CHIP:TOO: OnOperationalCredentialsFabricsListListAttributeResponse: 2 entries - [1635925479.104563][9664:9669] CHIP:TOO: FabricDescriptor[1]: - [1635925479.104606][9664:9669] CHIP:TOO: fabricIndex: 1 - [1635925479.104644][9664:9669] CHIP:ZCL: RootPublicKey: 65 - [1635925479.104693][9664:9669] CHIP:TOO: vendorId: 50504 - [1635925479.104738][9664:9669] CHIP:TOO: fabricId: 0 - [1635925479.104775][9664:9669] CHIP:TOO: nodeId: 1 - [1635925479.104808][9664:9669] CHIP:ZCL: Label: - [1635925479.104858][9664:9669] CHIP:TOO: FabricDescriptor[2]: - [1635925479.104908][9664:9669] CHIP:TOO: fabricIndex: 2 - [1635925479.104949][9664:9669] CHIP:ZCL: RootPublicKey: 65 - [1635925479.104987][9664:9669] CHIP:TOO: vendorId: 33608 - [1635925479.105035][9664:9669] CHIP:TOO: fabricId: 0 - [1635925479.105068][9664:9669] CHIP:TOO: nodeId: 2 - disabled: true - - - label: - "TH_CR1 opens a commissioning window on DUT_CE using a commissioning - timeout of PIXIT_COMM_WIN seconds using ECM" - verification: | - On the 1st controller using chip tool, open commissioning window using ECM - - - ./chip-tool pairing open-commissioning-window 1 1 100 1000 3840 - - [1635925530.725036][9673:9678] CHIP:SC: Success status report received. Session was established - [1635925530.725071][9673:9678] CHIP:IN: New secure session created for device 0x0000000000000001, key 29!! - [1635925530.725168][9673:9678] CHIP:CTL: OpenCommissioningWindow for device ID 1 - [1635925530.732329][9673:9678] CHIP:DMG: ICR moving to [AddingComm] - [1635925530.732384][9673:9678] CHIP:DMG: ICR moving to [AddedComma] - [1635925530.732503][9673:9678] CHIP:IN: Prepared encrypted message 0xaaab0b9c2d10 to 0x0000000000000001 of type 0x8 and protocolId (0, 1) on exchange 39062i with MessageCounter:0. - [1635925530.732559][9673:9678] CHIP:IN: Sending encrypted msg 0xaaab0b9c2d10 with MessageCounter:0 to 0x0000000000000001 at monotonic time: 13266219 msec - [1635925530.732681][9673:9678] CHIP:DMG: ICR moving to [CommandSen] - [1635925530.732737][9673:9678] CHIP:CTL: Manual pairing code: [35484132896] - [1635925530.732807][9673:9678] CHIP:CTL: SetupQRCode: [MT:00000CQM0008YV45420] - disabled: true - - - label: - "Before the expiration of PIXIT_COMM_WIN seconds, TH_CR2 opens a - second commissioning window on DUT_CE using a commissioning timeout of - PIXIT_COMM_WIN seconds using ECM" - verification: | - On the 2nd controller using chip tool, open commissioning window using ECM and gets busy response + - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 + - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 - ./chip-tool pairing open-commissioning-window 1 1 100 1000 3840 + - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 - [1635925530.725036][9673:9678] CHIP:SC: Success status report received. Session was established - [1635925530.725071][9673:9678] CHIP:IN: New secure session created for device 0x0000000000000001, key 29!! - [1635925530.725168][9673:9678] CHIP:CTL: OpenCommissioningWindow for device ID 1 - [1635925530.732329][9673:9678] CHIP:DMG: ICR moving to [AddingComm] - [1635925530.732384][9673:9678] CHIP:DMG: ICR moving to [AddedComma] - [1635925530.732503][9673:9678] CHIP:IN: Prepared encrypted message 0xaaab0b9c2d10 to 0x0000000000000001 of type 0x8 and protocolId (0, 1) on exchange 39062i with MessageCounter:0. - [1635925530.732559][9673:9678] CHIP:IN: Sending encrypted msg 0xaaab0b9c2d10 with MessageCounter:0 to 0x0000000000000001 at monotonic time: 13266219 msec - [1635925530.732681][9673:9678] CHIP:DMG: ICR moving to [CommandSen] - [1635925530.732737][9673:9678] CHIP:CTL: Manual pairing code: [35247660917] - [1635925530.732807][9673:9678] CHIP:CTL: SetupQRCode: [MT:00000CQM0008YV45420] - disabled: true + - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 18000 + + - label: "TH_CR1 opens a new commissioning window on DUT_CE" + identity: "alpha" + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEVerifier" + value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" + - name: "discriminator" + value: 3840 + - name: "iterations" + value: 1000 + - name: "salt" + value: "SPAKE2P Key Salt" + + - label: "TH_CR2 opens a new commissioning window on DUT_CE" + identity: "beta" + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEVerifier" + value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" + - name: "discriminator" + value: 3840 + - name: "iterations" + value: 1000 + - name: "salt" + value: "SPAKE2P Key Salt" + response: + error: FAILURE diff --git a/src/app/tests/suites/certification/Test_TC_MF_1_3.yaml b/src/app/tests/suites/certification/Test_TC_MF_1_3.yaml index ae7525eb9fc844..be1f7772961de7 100644 --- a/src/app/tests/suites/certification/Test_TC_MF_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_MF_1_3.yaml @@ -42,47 +42,9 @@ tests: arguments: values: - name: "nodeId" - value: 1 + value: nodeId - - label: "Open Commissioning Window with too-short timeout" - cluster: "AdministratorCommissioning" - command: "OpenCommissioningWindow" - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "CommissioningTimeout" - value: 120 - - name: "PAKEVerifier" - value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" - - name: "discriminator" - value: 3840 - - name: "iterations" - value: 1000 - - name: "salt" - value: "SPAKE2P Key Salt" - response: - error: INVALID_COMMAND - - - label: "Open Commissioning Window with too-long timeout" - cluster: "AdministratorCommissioning" - command: "OpenCommissioningWindow" - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "CommissioningTimeout" - value: 1000 - - name: "PAKEVerifier" - value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" - - name: "discriminator" - value: 3840 - - name: "iterations" - value: 1000 - - name: "salt" - value: "SPAKE2P Key Salt" - response: - error: INVALID_COMMAND - - - label: "Open Commissioning Window" + - label: "TH_CR1 opens a commissioning window on DUT_CE" cluster: "AdministratorCommissioning" command: "OpenCommissioningWindow" timedInteractionTimeoutMs: 10000 @@ -127,7 +89,7 @@ tests: arguments: values: - name: "nodeId" - value: 1 + value: nodeId2 - name: "payload" value: payload @@ -138,7 +100,7 @@ tests: arguments: values: - name: "nodeId" - value: 1 + value: nodeId2 - label: "Query fabrics list" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_MF_1_5.yaml b/src/app/tests/suites/certification/Test_TC_MF_1_5.yaml index cf89a40042f37f..89967768a31e53 100644 --- a/src/app/tests/suites/certification/Test_TC_MF_1_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_MF_1_5.yaml @@ -18,228 +18,198 @@ name: config: nodeId: 0x12344321 - cluster: "Basic" + timeout: 300 + nodeIdForDuplicateCommissioning: + type: NODE_ID + defaultValue: 0x11 + nodeId2: + type: NODE_ID + defaultValue: 0xCAFE + nodeId3: + type: NODE_ID + defaultValue: 0xC00FEE endpoint: 0 + discriminator: + type: INT16U + defaultValue: 3840 + payload: + type: CHAR_STRING + defaultValue: "MT:-24J0AFN00KA0648G00" # This value needs to be generated automatically tests: - - label: "TH_CR1 starts a commissioning process with DUT_CE" - verification: | - 1. Provision the device using first python controller on the raspi (use above instructions) - disabled: true - - - label: - "TH_CR1 opens a commissioning window on DUT_CE using a commissioning - timeout of PIXIT_COMM_WIN seconds using ECM" - verification: | - On 1st controller using chip-tool, send the open-commissioning-window CMD for ECM. -t stands for timeout value, -o for OriginalSetupCode/TokenWithRandomPIN/TokenWithProvidedPIN , -d for descriminator -i for iteration count. Ref to cmd help. - - ./chip-tool pairing open-commissioning-window 1 1 200 1000 3840 - [1635864513.699433][3850:3855] CHIP:DMG: ICR moving to [CommandSen] - [1635864513.699489][3850:3855] CHIP:CTL: Manual pairing code: [36177160937] - [1635864513.699566][3850:3855] CHIP:CTL: SetupQRCode: [MT:00000CQM00YZN476420] - [1635864513.699636][3850:3855] CHIP:EM: Sending Standalone Ack for MessageCounter:2599714227 on exchange 60688i - [1635864513.699685][3850:3855] CHIP:IN: Prepared plaintext message 0xffff8a7cd960 to 0x0000000000000000 of type 0x10 and protocolId (0, 0) on exchange 60688i with MessageCounter:3019982536. [1635864513.699737][3850:3855] CHIP:IN: Sending plaintext msg 0xffff8a7cd960 with MessageCounter:3019982536 to 0x0000000000000000 at monotonic time: 6085358 msec - [1635864513.699834][3850:3855] CHIP:EM: Flushed pending ack for MessageCounter:2599714227 on exchange 60688i - - The setup pin code is extracted from the manual pairing code in the log and that will be used when pairing the 2nd admin controller. - disabled: true - - - label: - "TH_CR2 starts a commissioning process with DUT_CE after - PIXIT_COMM_WIN + 10 seconds" - verification: | - 1. On 2nd controller using chip-tool connect using manual code generated by 1st controller. - Below is the example when using chip tool as controller (considering 36177160937 as the manual code generated by 1st controller) - ./chip-tool pairing manualcode 1 36177160937 - disabled: true - - - label: - "TH_CR1 opens a new commissioning window on DUT_CE using a - commissioning timeout of PIXIT_COMM_WIN seconds using ECM" - verification: | - On 1st controller using chip-tool, send the open-commissioning-window CMD for ECM. -t stands for timeout value, -o for OriginalSetupCode/TokenWithRandomPIN/TokenWithProvidedPIN , -d for descriminator -i for iteration count. Ref to cmd help. - - ./chip-tool pairing open-commissioning-window 1 1 200 1000 3840 - [1635864513.699433][3850:3855] CHIP:DMG: ICR moving to [CommandSen] - [1635864513.699489][3850:3855] CHIP:CTL: Manual pairing code: [36177160937] - [1635864513.699566][3850:3855] CHIP:CTL: SetupQRCode: [MT:00000CQM00YZN476420] - [1635864513.699636][3850:3855] CHIP:EM: Sending Standalone Ack for MessageCounter:2599714227 on exchange 60688i - [1635864513.699685][3850:3855] CHIP:IN: Prepared plaintext message 0xffff8a7cd960 to 0x0000000000000000 of type 0x10 and protocolId (0, 0) on exchange 60688i with MessageCounter:3019982536. [1635864513.699737][3850:3855] CHIP:IN: Sending plaintext msg 0xffff8a7cd960 with MessageCounter:3019982536 to 0x0000000000000000 at monotonic time: 6085358 msec - [1635864513.699834][3850:3855] CHIP:EM: Flushed pending ack for MessageCounter:2599714227 on exchange 60688i - - The setup pin code is extracted from the manual pairing code in the log and that will be used when pairing the 2nd admin controller. - disabled: true + - label: "Reboot target device" + cluster: "SystemCommands" + command: "Reboot" + arguments: + values: + - name: "discriminator" + value: discriminator - - label: - "TH_CR1 revokes the commissioning window on DUT_CE using - RevokeCommissioning command" - verification: | - On 1st controller using chip tool, send revoke commissioning command to DUT_CE - - ./chip-tool administratorcommissioning revoke-commissioning 1 0 - - [1635866684.242002][4030:4035] CHIP:DMG: InvokeCommand = - [1635866684.242033][4030:4035] CHIP:DMG: { - [1635866684.242059][4030:4035] CHIP:DMG: CommandList = - [1635866684.242091][4030:4035] CHIP:DMG: [ - [1635866684.242122][4030:4035] CHIP:DMG: CommandDataIB = - [1635866684.242156][4030:4035] CHIP:DMG: { - [1635866684.242188][4030:4035] CHIP:DMG: CommandPathIB = - [1635866684.242225][4030:4035] CHIP:DMG: { - [1635866684.242262][4030:4035] CHIP:DMG: EndpointId = 0x0, - [1635866684.242300][4030:4035] CHIP:DMG: ClusterId = 0x3c, - [1635866684.242339][4030:4035] CHIP:DMG: CommandId = 0x2, - [1635866684.242375][4030:4035] CHIP:DMG: }, - [1635866684.242415][4030:4035] CHIP:DMG: - [1635866684.242447][4030:4035] CHIP:DMG: StatusIB = - [1635866684.242496][4030:4035] CHIP:DMG: { - [1635866684.242547][4030:4035] CHIP:DMG: status = 0x0, - [1635866684.242594][4030:4035] CHIP:DMG: }, - [1635866684.242663][4030:4035] CHIP:DMG: - [1635866684.242700][4030:4035] CHIP:DMG: }, - [1635866684.242746][4030:4035] CHIP:DMG: - [1635866684.242781][4030:4035] CHIP:DMG: ], - [1635866684.242824][4030:4035] CHIP:DMG: - [1635866684.242857][4030:4035] CHIP:DMG: } - [1635866684.242915][4030:4035] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0002 Status=0x0 - [1635866684.242956][4030:4035] CHIP:TOO: Default Success Response - disabled: true + - label: "TH_CR1 starts a commissioning process with DUT_CE" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH_CR1 opens a new commissioning window on DUT_CE" + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEVerifier" + value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" + - name: "discriminator" + value: 3840 + - name: "iterations" + value: 1000 + - name: "salt" + value: "SPAKE2P Key Salt" + + - label: "Wait for PIXIT_COMM_WIN(180) + 10 seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 + + - label: "Wait for PIXIT_COMM_WIN(180) + 10 seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 + + - label: "Wait for PIXIT_COMM_WIN(180) + 10 seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 + + - label: "Wait for PIXIT_COMM_WIN(180) + 10 seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 28000 - label: "TH_CR2 starts a commissioning process with DUT_CE" - verification: | - 1. On 2nd controller using chip-tool connect using manual code generated by 1st controller. - Below is the example when using chip tool as controller (considering 36177160937 as the manual code generated by 1st controller) - ./chip-tool pairing manualcode 1 36177160937 - disabled: true - - - label: - "TH_CR1 revokes the commissioning window on DUT_CE using - RevokeCommissioning command" - verification: | - On 1st controller using chip tool, send revoke commissioning command to DUT_CE - - - ./chip-tool administratorcommissioning revoke-commissioning 1 0 - [1635867701.392315][4074:4079] CHIP:DMG: InvokeCommand = - [1635867701.392357][4074:4079] CHIP:DMG: { - [1635867701.392389][4074:4079] CHIP:DMG: CommandList = - [1635867701.392427][4074:4079] CHIP:DMG: [ - [1635867701.392463][4074:4079] CHIP:DMG: CommandDataIB = - [1635867701.392535][4074:4079] CHIP:DMG: { - [1635867701.392593][4074:4079] CHIP:DMG: CommandPathIB = - [1635867701.392664][4074:4079] CHIP:DMG: { - [1635867701.392723][4074:4079] CHIP:DMG: EndpointId = 0x0, - [1635867701.392777][4074:4079] CHIP:DMG: ClusterId = 0x3c, - [1635867701.392877][4074:4079] CHIP:DMG: CommandId = 0x2, - [1635867701.393046][4074:4079] CHIP:DMG: }, - [1635867701.393108][4074:4079] CHIP:DMG: - [1635867701.393149][4074:4079] CHIP:DMG: StatusIB = - [1635867701.393214][4074:4079] CHIP:DMG: { - [1635867701.393253][4074:4079] CHIP:DMG: status = 0x0, - [1635867701.393316][4074:4079] CHIP:DMG: }, - [1635867701.393378][4074:4079] CHIP:DMG: - [1635867701.393444][4074:4079] CHIP:DMG: }, - [1635867701.393510][4074:4079] CHIP:DMG: - [1635867701.393548][4074:4079] CHIP:DMG: ], - [1635867701.393612][4074:4079] CHIP:DMG: - [1635867701.393649][4074:4079] CHIP:DMG: } - [1635867701.393706][4074:4079] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0002 Status=0x0 - [1635867701.393751][4074:4079] CHIP:TOO: Default Success Response - disabled: true - - - label: - "TH_CR1 writes and reads the Basic Information Clusters NodeLabel - mandatory attribute of DUT_CE" - verification: | - On 1st controller, using chip tool, write and read Basic Information Cluster’s NodeLabel mandatory attribute of DUT_CE - - - ./chip-tool basic write user-label te5new 1 0 - [1635867759.827129][4081:4086] CHIP:DMG: WriteResponse = - [1635867759.827159][4081:4086] CHIP:DMG: { - [1635867759.827186][4081:4086] CHIP:DMG: AttributeStatusList = - [1635867759.827221][4081:4086] CHIP:DMG: [ - [1635867759.827253][4081:4086] CHIP:DMG: AttributeStatusIB = - [1635867759.827291][4081:4086] CHIP:DMG: { - [1635867759.827325][4081:4086] CHIP:DMG: AttributePath = - [1635867759.827387][4081:4086] CHIP:DMG: { - [1635867759.827446][4081:4086] CHIP:DMG: FieldTag = 0x0000_0005, - [1635867759.827491][4081:4086] CHIP:DMG: NodeId = 0x0, - [1635867759.827554][4081:4086] CHIP:DMG: ClusterId = 0x28, - [1635867759.827616][4081:4086] CHIP:DMG: EndpointId = 0x0, - [1635867759.827655][4081:4086] CHIP:DMG: } - [1635867759.827716][4081:4086] CHIP:DMG: - [1635867759.827759][4081:4086] CHIP:DMG: StatusIB = - [1635867759.827828][4081:4086] CHIP:DMG: { - [1635867759.827866][4081:4086] CHIP:DMG: status = 0x0, - [1635867759.827924][4081:4086] CHIP:DMG: }, - [1635867759.827980][4081:4086] CHIP:DMG: - [1635867759.828017][4081:4086] CHIP:DMG: }, - [1635867759.828059][4081:4086] CHIP:DMG: - [1635867759.828092][4081:4086] CHIP:DMG: ], - [1635867759.828131][4081:4086] CHIP:DMG: - [1635867759.828161][4081:4086] CHIP:DMG: } - [1635867759.828250][4081:4086] CHIP:ZCL: WriteResponse: - [1635867759.828299][4081:4086] CHIP:ZCL: status: Success (0x0000) - [1635867759.828334][4081:4086] CHIP:TOO: Default Success Response - - - ./chip-tool basic read user-label 1 0 - [1635867798.990540][4089:4094] CHIP:DMG: { - [1635867798.990575][4089:4094] CHIP:DMG: AttributeDataList = - [1635867798.990614][4089:4094] CHIP:DMG: [ - [1635867798.990651][4089:4094] CHIP:DMG: AttributeDataElement = - [1635867798.990698][4089:4094] CHIP:DMG: { - [1635867798.990741][4089:4094] CHIP:DMG: AttributePath = - [1635867798.990783][4089:4094] CHIP:DMG: { - [1635867798.990840][4089:4094] CHIP:DMG: NodeId = 0x1, - [1635867798.990883][4089:4094] CHIP:DMG: EndpointId = 0x0, - [1635867798.990949][4089:4094] CHIP:DMG: ClusterId = 0x28, - [1635867798.991022][4089:4094] CHIP:DMG: FieldTag = 0x0000_0005, - [1635867798.991083][4089:4094] CHIP:DMG: } - [1635867798.991164][4089:4094] CHIP:DMG: - [1635867798.991225][4089:4094] CHIP:DMG: Data = "te5new", - [1635867798.991280][4089:4094] CHIP:DMG: DataElementVersion = 0x0, - [1635867798.991338][4089:4094] CHIP:DMG: }, - [1635867798.991407][4089:4094] CHIP:DMG: - [1635867798.991459][4089:4094] CHIP:DMG: ], - [1635867798.991521][4089:4094] CHIP:DMG: - [1635867798.991569][4089:4094] CHIP:DMG: } - [1635867798.991711][4089:4094] CHIP:ZCL: ReadAttributesResponse: - [1635867798.991758][4089:4094] CHIP:ZCL: ClusterId: 0x0000_0028 - [1635867798.991809][4089:4094] CHIP:ZCL: attributeId: 0x0000_0005 - [1635867798.991856][4089:4094] CHIP:ZCL: status: Success (0x0000) - [1635867798.991901][4089:4094] CHIP:ZCL: attribute TLV Type: 0x0c - [1635867798.991953][4089:4094] CHIP:TOO: CharString attribute Response: te5new - disabled: true - - - label: - "TH_CR1 opens a new commissioning window on DUT_CE using a - commissioning timeout of PIXIT_COMM_WIN seconds using ECM" - verification: | - On 1st controller using chip-tool, send the open-commissioning-window CMD for ECM. -t stands for timeout value, -o for OriginalSetupCode/TokenWithRandomPIN/TokenWithProvidedPIN , -d for descriminator -i for iteration count. Ref to cmd help. - - ./chip-tool pairing open-commissioning-window 1 1 200 1000 3840 - [1635864513.699433][3850:3855] CHIP:DMG: ICR moving to [CommandSen] - [1635864513.699489][3850:3855] CHIP:CTL: Manual pairing code: [36177160937] - [1635864513.699566][3850:3855] CHIP:CTL: SetupQRCode: [MT:00000CQM00YZN476420] - [1635864513.699636][3850:3855] CHIP:EM: Sending Standalone Ack for MessageCounter:2599714227 on exchange 60688i - [1635864513.699685][3850:3855] CHIP:IN: Prepared plaintext message 0xffff8a7cd960 to 0x0000000000000000 of type 0x10 and protocolId (0, 0) on exchange 60688i with MessageCounter:3019982536. [1635864513.699737][3850:3855] CHIP:IN: Sending plaintext msg 0xffff8a7cd960 with MessageCounter:3019982536 to 0x0000000000000000 at monotonic time: 6085358 msec - [1635864513.699834][3850:3855] CHIP:EM: Flushed pending ack for MessageCounter:2599714227 on exchange 60688i - - The setup pin code is extracted from the manual pairing code in the log and that will be used when pairing the 2nd admin controller. - disabled: true + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload + response: + error: FAILURE + + - label: "TH_CR1 opens a new commissioning window on DUT_CE" + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEVerifier" + value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" + - name: "discriminator" + value: 3840 + - name: "iterations" + value: 1000 + - name: "salt" + value: "SPAKE2P Key Salt" + + - label: "TH_CR1 revokes the commissioning window on DUT_CE" + cluster: "AdministratorCommissioning" + command: "RevokeCommissioning" + timedInteractionTimeoutMs: 10000 - label: "TH_CR2 starts a commissioning process with DUT_CE" - verification: | - 1. On 2nd controller using chip-tool connect using manual code generated by 1st controller. - Below is the example when using chip tool as controller (considering 36177160937 as the manual code generated by 1st controller) - ./chip-tool pairing manualcode 1 36177160937 + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload + response: + error: FAILURE + + - label: "TH_CR1 revokes the commissioning window on DUT_CE" + cluster: "AdministratorCommissioning" + command: "RevokeCommissioning" + timedInteractionTimeoutMs: 10000 + response: + error: FAILURE + + - label: "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE" + cluster: "Basic" + command: "writeAttribute" + attribute: "NodeLabel" + arguments: + value: "chiptest" + + - label: "TH_CR1 read the mandatory attribute NodeLabel of DUT_CE" + cluster: "Basic" + command: "readAttribute" + attribute: "NodeLabel" + response: + value: "chiptest" + + - label: "TH_CR1 opens a new commissioning window on DUT_CE" + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEVerifier" + value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" + - name: "discriminator" + value: 3840 + - name: "iterations" + value: 1000 + - name: "salt" + value: "SPAKE2P Key Salt" + + #Disabled due to issue 17666 + - label: "TH_CR2 starts a commissioning process with DUT_CE" disabled: true + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload - label: "TH_CR3 starts a commissioning process with DUT_CE" - verification: | - 1. On 3rd controller using chip-tool connect using manual code generated by 1st controller. - Below is the example when using chip tool as controller (considering 36177160937 as the manual code generated by 1st controller) - ./chip-tool pairing manualcode 1 36177160937 - disabled: true + identity: "gamma" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeId3 + - name: "payload" + value: payload + response: + error: FAILURE diff --git a/src/app/tests/suites/certification/Test_TC_MF_1_6.yaml b/src/app/tests/suites/certification/Test_TC_MF_1_6.yaml index 257c9058c84dba..7552ac1af9a8dd 100644 --- a/src/app/tests/suites/certification/Test_TC_MF_1_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_MF_1_6.yaml @@ -18,6 +18,7 @@ name: config: nodeId: 0x12344321 + timeout: 300 nodeIdForDuplicateCommissioning: type: NODE_ID defaultValue: 0x11 @@ -62,6 +63,38 @@ tests: - name: "CommissioningTimeout" value: 180 + - label: "Wait for PIXIT_COMM_WIN(180) + 10" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 + + - label: "Wait for PIXIT_COMM_WIN(180) + 10" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 + + - label: "Wait for PIXIT_COMM_WIN(180) + 10" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 54000 + + - label: "Wait for PIXIT_COMM_WIN(180) + 10" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 28000 + - label: "Commission from beta" identity: "beta" cluster: "CommissionerCommands" @@ -72,17 +105,10 @@ tests: value: nodeId2 - name: "payload" value: payload + response: + error: FAILURE - - label: "TH_CR2 starts a commissioning process on DUT_CE" - identity: "beta" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId2 - - - label: "Open Commissioning Window from alpha" + - label: "TH_CR1 opens a commissioning window on DUT_CE" cluster: "AdministratorCommissioning" command: "OpenBasicCommissioningWindow" timedInteractionTimeoutMs: 10000 @@ -96,14 +122,25 @@ tests: command: "RevokeCommissioning" timedInteractionTimeoutMs: 10000 - - label: "TH_CR2 starts a commissioning process on DUT_CE" + - label: "Commission from beta" identity: "beta" - cluster: "DelayCommands" - command: "WaitForCommissionee" + cluster: "CommissionerCommands" + command: "PairWithQRCode" arguments: values: - name: "nodeId" value: nodeId2 + - name: "payload" + value: payload + response: + error: FAILURE + + - label: "TH_CR1 revokes the commissioning window on DUT_CE" + cluster: "AdministratorCommissioning" + command: "RevokeCommissioning" + timedInteractionTimeoutMs: 10000 + response: + error: FAILURE - label: "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE" identity: "alpha" @@ -131,6 +168,17 @@ tests: - name: "CommissioningTimeout" value: 180 + - label: "Commission from beta" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload + - label: "TH_CR2 starts a commissioning process on DUT_CE" identity: "beta" cluster: "DelayCommands" @@ -150,14 +198,5 @@ tests: value: nodeId3 - name: "payload" value: payload - - - label: "Wait for the commissioned device to be retrieved for gamma" - identity: "gamma" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId3 response: error: FAILURE diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 9cc3c8429a8574..f3b50b8207868e 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -124,8 +124,11 @@ class TestList : public Command printf("Test_TC_MC_9_1\n"); printf("Test_TC_MC_10_1\n"); printf("Test_TC_MOD_1_1\n"); + printf("Test_TC_MF_1_3\n"); printf("Test_TC_MF_1_4\n"); + printf("Test_TC_MF_1_5\n"); printf("Test_TC_MF_1_6\n"); + printf("Test_TC_MF_1_15\n"); printf("Test_TC_OCC_1_1\n"); printf("Test_TC_OCC_2_1\n"); printf("Test_TC_OCC_2_2\n"); @@ -315,8 +318,6 @@ class ManualTestList : public Command printf("Test_TC_MC_10_6\n"); printf("Test_TC_MF_1_1\n"); printf("Test_TC_MF_1_2\n"); - printf("Test_TC_MF_1_3\n"); - printf("Test_TC_MF_1_5\n"); printf("Test_TC_MF_1_7\n"); printf("Test_TC_MF_1_8\n"); printf("Test_TC_MF_1_9\n"); @@ -325,7 +326,6 @@ class ManualTestList : public Command printf("Test_TC_MF_1_12\n"); printf("Test_TC_MF_1_13\n"); printf("Test_TC_MF_1_14\n"); - printf("Test_TC_MF_1_15\n"); printf("Test_TC_MF_1_16\n"); printf("Test_TC_MF_1_17\n"); printf("Test_TC_MF_1_18\n"); @@ -15525,6 +15525,237 @@ class Test_TC_MOD_1_1Suite : public TestCommand } }; +class Test_TC_MF_1_3Suite : public TestCommand +{ +public: + Test_TC_MF_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_3", 13, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mNodeId2; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); + VerifyOrReturn(CheckConstraintType("value", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 1)); + VerifyOrReturn(CheckValueAsString("fabrics[1].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 2)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest1", 9))); + VerifyOrReturn(CheckConstraintType("value", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest2", 9))); + VerifyOrReturn(CheckConstraintType("value", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Reboot target device"); + SetIdentity(kIdentityAlpha); + return Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + } + case 1: { + LogStep(1, "TH_CR1 starts a commissioning process with DUT_CE"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 2: { + LogStep(2, "TH_CR1 opens a commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 3: { + LogStep(3, "TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + chip::CharSpan value; + value = chip::Span("chiptestgarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); + } + case 4: { + LogStep(4, "TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); + } + case 5: { + LogStep(5, "Commission from beta"); + SetIdentity(kIdentityBeta); + return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() + : chip::CharSpan::fromCharString("MT:0000000000I31506010")); + } + case 6: { + LogStep(6, "TH_CR2 starts a commissioning process with DUT_CE"); + SetIdentity(kIdentityBeta); + return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); + } + case 7: { + LogStep(7, "Query fabrics list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id); + } + case 8: { + LogStep(8, "Query fabrics list"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, false); + } + case 9: { + LogStep(9, "TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + chip::CharSpan value; + value = chip::Span("chiptest1garbage: not in length on purpose", 9); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); + } + case 10: { + LogStep(10, "TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); + } + case 11: { + LogStep(11, "TH_CR2 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + chip::CharSpan value; + value = chip::Span("chiptest2garbage: not in length on purpose", 9); + return WriteAttribute(kIdentityBeta, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); + } + case 12: { + LogStep(12, "TH_CR2 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_MF_1_4Suite : public TestCommand { public: @@ -15742,37 +15973,34 @@ class Test_TC_MF_1_4Suite : public TestCommand } }; -class Test_TC_MF_1_6Suite : public TestCommand +class Test_TC_MF_1_5Suite : public TestCommand { public: - Test_TC_MF_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_6", 14, credsIssuerConfig) + Test_TC_MF_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_5", 16, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); AddArgument("payload", &mPayload); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_6Suite() {} + ~Test_TC_MF_1_5Suite() {} - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } private: chip::Optional mNodeId; + chip::Optional mTimeout; chip::Optional mNodeIdForDuplicateCommissioning; chip::Optional mNodeId2; chip::Optional mNodeId3; chip::Optional mEndpoint; chip::Optional mDiscriminator; chip::Optional mPayload; - chip::Optional mTimeout; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -15807,12 +16035,14 @@ class Test_TC_MF_1_6Suite : public TestCommand break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; case 8: @@ -15820,24 +16050,29 @@ class Test_TC_MF_1_6Suite : public TestCommand break; case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); - } break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; break; case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; @@ -15867,80 +16102,737 @@ class Test_TC_MF_1_6Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 2: { - LogStep(2, "TH_CR1 opens a commissioning window on DUT_CE"); - chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + LogStep(2, "TH_CR1 opens a new commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, - AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, chip::Optional(10000)); } case 3: { - LogStep(3, "Commission from beta"); + LogStep(3, "Wait for PIXIT_COMM_WIN(180) + 10 seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 4: { + LogStep(4, "Wait for PIXIT_COMM_WIN(180) + 10 seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 5: { + LogStep(5, "Wait for PIXIT_COMM_WIN(180) + 10 seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 6: { + LogStep(6, "Wait for PIXIT_COMM_WIN(180) + 10 seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(28000); + } + case 7: { + LogStep(7, "TH_CR2 starts a commissioning process with DUT_CE"); SetIdentity(kIdentityBeta); return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); } - case 4: { - LogStep(4, "TH_CR2 starts a commissioning process on DUT_CE"); + case 8: { + LogStep(8, "TH_CR1 opens a new commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 9: { + LogStep(9, "TH_CR1 revokes the commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000)); + } + case 10: { + LogStep(10, "TH_CR2 starts a commissioning process with DUT_CE"); SetIdentity(kIdentityBeta); - return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); + return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() + : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); } - case 5: { - LogStep(5, "Open Commissioning Window from alpha"); + case 11: { + LogStep(11, "TH_CR1 revokes the commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000)); + } + case 12: { + LogStep(12, "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE"); + chip::CharSpan value; + value = chip::Span("chiptestgarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); + } + case 13: { + LogStep(13, "TH_CR1 read the mandatory attribute NodeLabel of DUT_CE"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); + } + case 14: { + LogStep(14, "TH_CR1 opens a new commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 15: { + LogStep(15, "TH_CR3 starts a commissioning process with DUT_CE"); + SetIdentity(kIdentityGamma); + return PairWithQRCode(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL, + mPayload.HasValue() ? mPayload.Value() + : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_6Suite : public TestCommand +{ +public: + Test_TC_MF_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_6", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + } + + ~Test_TC_MF_1_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Reboot target device"); + SetIdentity(kIdentityAlpha); + return Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + } + case 1: { + LogStep(1, "TH_CR1 starts a commissioning process with DUT_CE"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 2: { + LogStep(2, "TH_CR1 opens a commissioning window on DUT_CE"); chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; value.commissioningTimeout = 180U; return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, chip::Optional(10000)); } + case 3: { + LogStep(3, "Wait for PIXIT_COMM_WIN(180) + 10"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 4: { + LogStep(4, "Wait for PIXIT_COMM_WIN(180) + 10"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 5: { + LogStep(5, "Wait for PIXIT_COMM_WIN(180) + 10"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } case 6: { - LogStep(6, "TH_CR1 revokes the commissioning window on DUT_CE"); + LogStep(6, "Wait for PIXIT_COMM_WIN(180) + 10"); + SetIdentity(kIdentityAlpha); + return WaitForMs(28000); + } + case 7: { + LogStep(7, "Commission from beta"); + SetIdentity(kIdentityBeta); + return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() + : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + } + case 8: { + LogStep(8, "TH_CR1 opens a commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 9: { + LogStep(9, "TH_CR1 revokes the commissioning window on DUT_CE"); chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, chip::Optional(10000)); } - case 7: { - LogStep(7, "TH_CR2 starts a commissioning process on DUT_CE"); + case 10: { + LogStep(10, "Commission from beta"); SetIdentity(kIdentityBeta); - return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); + return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() + : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); } - case 8: { - LogStep(8, "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE"); + case 11: { + LogStep(11, "TH_CR1 revokes the commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000)); + } + case 12: { + LogStep(12, "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE"); chip::CharSpan value; value = chip::Span("chiptestgarbage: not in length on purpose", 8); return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); } - case 9: { - LogStep(9, "TH_CR1 read the mandatory attribute NodeLabel of DUT_CE"); + case 13: { + LogStep(13, "TH_CR1 read the mandatory attribute NodeLabel of DUT_CE"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); } - case 10: { - LogStep(10, "TH_CR1 opens a commissioning window on DUT_CE"); + case 14: { + LogStep(14, "TH_CR1 opens a commissioning window on DUT_CE"); chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; value.commissioningTimeout = 180U; return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, chip::Optional(10000)); } - case 11: { - LogStep(11, "TH_CR2 starts a commissioning process on DUT_CE"); + case 15: { + LogStep(15, "Commission from beta"); + SetIdentity(kIdentityBeta); + return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() + : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + } + case 16: { + LogStep(16, "TH_CR2 starts a commissioning process on DUT_CE"); SetIdentity(kIdentityBeta); return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); } - case 12: { - LogStep(12, "TH_CR3 starts a commissioning process with DUT_CE"); + case 17: { + LogStep(17, "TH_CR3 starts a commissioning process with DUT_CE"); SetIdentity(kIdentityGamma); return PairWithQRCode(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL, mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); } - case 13: { - LogStep(13, "Wait for the commissioned device to be retrieved for gamma"); + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_15Suite : public TestCommand +{ +public: + Test_TC_MF_1_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_15", 24, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + } + + ~Test_TC_MF_1_15Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(500)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 1)); + VerifyOrReturn(CheckValueAsString("fabrics[1].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 2)); + VerifyOrReturn(CheckValueAsString("fabrics[2].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 3)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 1)); + VerifyOrReturn(CheckValueAsString("fabrics[1].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 2)); + VerifyOrReturn(CheckValueAsString("fabrics[2].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 3)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Reboot target device"); + SetIdentity(kIdentityAlpha); + return Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + } + case 1: { + LogStep(1, "TH_CR1 starts a commissioning process with DUT_CE"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 2: { + LogStep(2, "TH_CR1 opens a commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 3: { + LogStep(3, "Commission from gamma"); + SetIdentity(kIdentityGamma); + return PairWithQRCode(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL, + mPayload.HasValue() ? mPayload.Value() + : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + } + case 4: { + LogStep(4, "TH_CR3 starts a commissioning process with DUT_CE"); SetIdentity(kIdentityGamma); return WaitForCommissionee(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL); } + case 5: { + LogStep(5, "TH_CR1 opens a commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 6: { + LogStep(6, "Commission from beta"); + SetIdentity(kIdentityBeta); + return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() + : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + } + case 7: { + LogStep(7, "TH_CR2 starts a commissioning process with DUT_CE"); + SetIdentity(kIdentityBeta); + return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); + } + case 8: { + LogStep(8, "TH_CR1 opens a commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 9: { + LogStep(9, "TH_CR1 opens a new commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 10: { + LogStep(10, "TH_CR1 reads the list of Fabrics on DUT_CE"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, false); + } + case 11: { + LogStep(11, "Wait for the expiration of PIXIT_COMM_WIN seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 12: { + LogStep(12, "Wait for the expiration of PIXIT_COMM_WIN seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 13: { + LogStep(13, "Wait for the expiration of PIXIT_COMM_WIN seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 14: { + LogStep(14, "Wait for the expiration of PIXIT_COMM_WIN seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(18000); + } + case 15: { + LogStep(15, "TH_CR1 re-opens new commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 16: { + LogStep(16, "TH_CR3 opens a new commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityGamma, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 17: { + LogStep(17, "TH_CR1 reads the list of Fabrics on DUT_CE"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, false); + } + case 18: { + LogStep(18, "Wait for the expiration of PIXIT_COMM_WIN seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 19: { + LogStep(19, "Wait for the expiration of PIXIT_COMM_WIN seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 20: { + LogStep(20, "Wait for the expiration of PIXIT_COMM_WIN seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(54000); + } + case 21: { + LogStep(21, "Wait for the expiration of PIXIT_COMM_WIN seconds"); + SetIdentity(kIdentityAlpha); + return WaitForMs(18000); + } + case 22: { + LogStep(22, "TH_CR1 opens a new commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000)); + } + case 23: { + LogStep(23, "TH_CR2 opens a new commissioning window on DUT_CE"); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityBeta, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000)); + } } return CHIP_NO_ERROR; } @@ -50358,181 +51250,29 @@ class TestGroupDemoConfigSuite : public TestCommand switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("status", value.status, 0)); - - VerifyOrReturn(CheckValue("groupId", value.groupId, 257U)); - } - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - } - case 1: { - LogStep(1, "Add Group 1 - endpoint 1"); - chip::app::Clusters::Groups::Commands::AddGroup::Type value; - value.groupId = 257U; - value.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); - return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value); - } - case 2: { - LogStep(2, "KeySet Write 1"); - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNonNull(); - value.groupKeySet.epochKey2.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 1110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value); - } - case 3: { - LogStep(3, "Map Group Key Set to group ID on a given fabric"); - ListFreer listFreer; - chip::app::DataModel::List value; - - { - auto * listHolder_0 = new ListHolder(1); - listFreer.add(listHolder_0); - - listHolder_0->mList[0].groupId = 257U; - listHolder_0->mList[0].groupKeySetID = 417U; - listHolder_0->mList[0].fabricIndex = 1; - - value = chip::app::DataModel::List( - listHolder_0->mList, 1); - } - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, value); - } - case 4: { - LogStep(4, "Install ACLs for test"); - ListFreer listFreer; - chip::app::DataModel::List value; - - { - auto * listHolder_0 = new ListHolder(2); - listFreer.add(listHolder_0); - - listHolder_0->mList[0].privilege = static_cast(5); - listHolder_0->mList[0].authMode = static_cast(2); - listHolder_0->mList[0].subjects.SetNull(); - listHolder_0->mList[0].targets.SetNull(); - listHolder_0->mList[0].fabricIndex = 1; - - listHolder_0->mList[1].privilege = static_cast(3); - listHolder_0->mList[1].authMode = static_cast(3); - listHolder_0->mList[1].subjects.SetNonNull(); - - { - auto * listHolder_3 = new ListHolder(1); - listFreer.add(listHolder_3); - listHolder_3->mList[0] = 257ULL; - listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); - } - listHolder_0->mList[1].targets.SetNull(); - listHolder_0->mList[1].fabricIndex = 1; - - value = chip::app::DataModel::List( - listHolder_0->mList, 2); - } - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_BDX_1_1Suite : public TestCommand -{ -public: - Test_TC_BDX_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_BDX_1_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0)); + + VerifyOrReturn(CheckValue("groupId", value.groupId, 257U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -50548,127 +51288,111 @@ class Test_TC_BDX_1_1Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_BDX_1_2Suite : public TestCommand -{ -public: - Test_TC_BDX_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_2", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_BDX_1_2Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + case 1: { + LogStep(1, "Add Group 1 - endpoint 1"); + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupId = 257U; + value.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value); } + case 2: { + LogStep(2, "KeySet Write 1"); + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } + value.groupKeySet.groupKeySetID = 417U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 1110000ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 1110001ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 1110002ULL; - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { + return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Commands::KeySetWrite::Id, value); } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_BDX_1_3Suite : public TestCommand -{ -public: - Test_TC_BDX_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_3", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } + case 3: { + LogStep(3, "Map Group Key Set to group ID on a given fabric"); + ListFreer listFreer; + chip::app::DataModel::List value; - ~Test_TC_BDX_1_3Suite() {} + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + listHolder_0->mList[0].groupId = 257U; + listHolder_0->mList[0].groupKeySetID = 417U; + listHolder_0->mList[0].fabricIndex = 1; -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupKeyMap::Id, value); + } + case 4: { + LogStep(4, "Install ACLs for test"); + ListFreer listFreer; + chip::app::DataModel::List value; - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); - // - // Tests methods - // + listHolder_0->mList[0].privilege = static_cast(5); + listHolder_0->mList[0].authMode = static_cast(2); + listHolder_0->mList[0].subjects.SetNull(); + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = 1; - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; + listHolder_0->mList[1].privilege = static_cast(3); + listHolder_0->mList[1].authMode = static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 257ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = 1; - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value); } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { } return CHIP_NO_ERROR; } }; -class Test_TC_BDX_1_5Suite : public TestCommand +class Test_TC_BDX_1_1Suite : public TestCommand { public: - Test_TC_BDX_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_5", 0, credsIssuerConfig) + Test_TC_BDX_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -50676,7 +51400,7 @@ class Test_TC_BDX_1_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_1_5Suite() {} + ~Test_TC_BDX_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -50721,10 +51445,10 @@ class Test_TC_BDX_1_5Suite : public TestCommand } }; -class Test_TC_BDX_1_6Suite : public TestCommand +class Test_TC_BDX_1_2Suite : public TestCommand { public: - Test_TC_BDX_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_6", 0, credsIssuerConfig) + Test_TC_BDX_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -50732,7 +51456,7 @@ class Test_TC_BDX_1_6Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_1_6Suite() {} + ~Test_TC_BDX_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -50777,10 +51501,10 @@ class Test_TC_BDX_1_6Suite : public TestCommand } }; -class Test_TC_BDX_2_1Suite : public TestCommand +class Test_TC_BDX_1_3Suite : public TestCommand { public: - Test_TC_BDX_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_1", 0, credsIssuerConfig) + Test_TC_BDX_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -50788,7 +51512,7 @@ class Test_TC_BDX_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_1Suite() {} + ~Test_TC_BDX_1_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -50833,10 +51557,10 @@ class Test_TC_BDX_2_1Suite : public TestCommand } }; -class Test_TC_BDX_2_2Suite : public TestCommand +class Test_TC_BDX_1_5Suite : public TestCommand { public: - Test_TC_BDX_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_2", 0, credsIssuerConfig) + Test_TC_BDX_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -50844,7 +51568,7 @@ class Test_TC_BDX_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_2Suite() {} + ~Test_TC_BDX_1_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -50889,10 +51613,10 @@ class Test_TC_BDX_2_2Suite : public TestCommand } }; -class Test_TC_BDX_2_3Suite : public TestCommand +class Test_TC_BDX_1_6Suite : public TestCommand { public: - Test_TC_BDX_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_3", 0, credsIssuerConfig) + Test_TC_BDX_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -50900,7 +51624,7 @@ class Test_TC_BDX_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_3Suite() {} + ~Test_TC_BDX_1_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -50945,10 +51669,10 @@ class Test_TC_BDX_2_3Suite : public TestCommand } }; -class Test_TC_BDX_2_4Suite : public TestCommand +class Test_TC_BDX_2_1Suite : public TestCommand { public: - Test_TC_BDX_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_4", 0, credsIssuerConfig) + Test_TC_BDX_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -50956,7 +51680,7 @@ class Test_TC_BDX_2_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_4Suite() {} + ~Test_TC_BDX_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51001,10 +51725,10 @@ class Test_TC_BDX_2_4Suite : public TestCommand } }; -class Test_TC_BDX_2_5Suite : public TestCommand +class Test_TC_BDX_2_2Suite : public TestCommand { public: - Test_TC_BDX_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_5", 0, credsIssuerConfig) + Test_TC_BDX_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51012,7 +51736,7 @@ class Test_TC_BDX_2_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_5Suite() {} + ~Test_TC_BDX_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51057,10 +51781,10 @@ class Test_TC_BDX_2_5Suite : public TestCommand } }; -class Test_TC_BR_1Suite : public TestCommand +class Test_TC_BDX_2_3Suite : public TestCommand { public: - Test_TC_BR_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_1", 0, credsIssuerConfig) + Test_TC_BDX_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51068,7 +51792,7 @@ class Test_TC_BR_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BR_1Suite() {} + ~Test_TC_BDX_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51113,10 +51837,10 @@ class Test_TC_BR_1Suite : public TestCommand } }; -class Test_TC_BR_2Suite : public TestCommand +class Test_TC_BDX_2_4Suite : public TestCommand { public: - Test_TC_BR_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_2", 0, credsIssuerConfig) + Test_TC_BDX_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51124,7 +51848,7 @@ class Test_TC_BR_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BR_2Suite() {} + ~Test_TC_BDX_2_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51169,10 +51893,10 @@ class Test_TC_BR_2Suite : public TestCommand } }; -class Test_TC_BR_3Suite : public TestCommand +class Test_TC_BDX_2_5Suite : public TestCommand { public: - Test_TC_BR_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_3", 0, credsIssuerConfig) + Test_TC_BDX_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51180,7 +51904,7 @@ class Test_TC_BR_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BR_3Suite() {} + ~Test_TC_BDX_2_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51225,10 +51949,10 @@ class Test_TC_BR_3Suite : public TestCommand } }; -class Test_TC_BRAC_2_1Suite : public TestCommand +class Test_TC_BR_1Suite : public TestCommand { public: - Test_TC_BRAC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BRAC_2_1", 0, credsIssuerConfig) + Test_TC_BR_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51236,7 +51960,7 @@ class Test_TC_BRAC_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BRAC_2_1Suite() {} + ~Test_TC_BR_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51281,10 +52005,10 @@ class Test_TC_BRAC_2_1Suite : public TestCommand } }; -class Test_TC_BRAC_2_2Suite : public TestCommand +class Test_TC_BR_2Suite : public TestCommand { public: - Test_TC_BRAC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BRAC_2_2", 0, credsIssuerConfig) + Test_TC_BR_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51292,7 +52016,7 @@ class Test_TC_BRAC_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BRAC_2_2Suite() {} + ~Test_TC_BR_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51337,10 +52061,10 @@ class Test_TC_BRAC_2_2Suite : public TestCommand } }; -class Test_TC_DM_1_2Suite : public TestCommand +class Test_TC_BR_3Suite : public TestCommand { public: - Test_TC_DM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_1_2", 0, credsIssuerConfig) + Test_TC_BR_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51348,7 +52072,7 @@ class Test_TC_DM_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_1_2Suite() {} + ~Test_TC_BR_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51393,10 +52117,10 @@ class Test_TC_DM_1_2Suite : public TestCommand } }; -class Test_TC_DM_1_4Suite : public TestCommand +class Test_TC_BRAC_2_1Suite : public TestCommand { public: - Test_TC_DM_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_1_4", 0, credsIssuerConfig) + Test_TC_BRAC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BRAC_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51404,7 +52128,7 @@ class Test_TC_DM_1_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_1_4Suite() {} + ~Test_TC_BRAC_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51449,10 +52173,10 @@ class Test_TC_DM_1_4Suite : public TestCommand } }; -class Test_TC_DM_2_3Suite : public TestCommand +class Test_TC_BRAC_2_2Suite : public TestCommand { public: - Test_TC_DM_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_2_3", 0, credsIssuerConfig) + Test_TC_BRAC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BRAC_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51460,7 +52184,7 @@ class Test_TC_DM_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_2_3Suite() {} + ~Test_TC_BRAC_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51505,10 +52229,10 @@ class Test_TC_DM_2_3Suite : public TestCommand } }; -class Test_TC_DM_2_4Suite : public TestCommand +class Test_TC_DM_1_2Suite : public TestCommand { public: - Test_TC_DM_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_2_4", 0, credsIssuerConfig) + Test_TC_DM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51516,7 +52240,7 @@ class Test_TC_DM_2_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_2_4Suite() {} + ~Test_TC_DM_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51561,10 +52285,10 @@ class Test_TC_DM_2_4Suite : public TestCommand } }; -class Test_TC_DM_3_2Suite : public TestCommand +class Test_TC_DM_1_4Suite : public TestCommand { public: - Test_TC_DM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_3_2", 0, credsIssuerConfig) + Test_TC_DM_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_1_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51572,7 +52296,7 @@ class Test_TC_DM_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_3_2Suite() {} + ~Test_TC_DM_1_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51617,10 +52341,10 @@ class Test_TC_DM_3_2Suite : public TestCommand } }; -class Test_TC_DM_3_4Suite : public TestCommand +class Test_TC_DM_2_3Suite : public TestCommand { public: - Test_TC_DM_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_3_4", 0, credsIssuerConfig) + Test_TC_DM_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51628,7 +52352,7 @@ class Test_TC_DM_3_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_3_4Suite() {} + ~Test_TC_DM_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51673,11 +52397,10 @@ class Test_TC_DM_3_4Suite : public TestCommand } }; -class Test_TC_DIAG_LOG_1_1Suite : public TestCommand +class Test_TC_DM_2_4Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_1", 0, credsIssuerConfig) + Test_TC_DM_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_2_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51685,7 +52408,7 @@ class Test_TC_DIAG_LOG_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DIAG_LOG_1_1Suite() {} + ~Test_TC_DM_2_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51730,11 +52453,10 @@ class Test_TC_DIAG_LOG_1_1Suite : public TestCommand } }; -class Test_TC_DIAG_LOG_1_2Suite : public TestCommand +class Test_TC_DM_3_2Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_2", 0, credsIssuerConfig) + Test_TC_DM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51742,7 +52464,7 @@ class Test_TC_DIAG_LOG_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DIAG_LOG_1_2Suite() {} + ~Test_TC_DM_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51787,11 +52509,10 @@ class Test_TC_DIAG_LOG_1_2Suite : public TestCommand } }; -class Test_TC_DIAG_LOG_1_3Suite : public TestCommand +class Test_TC_DM_3_4Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_3", 0, credsIssuerConfig) + Test_TC_DM_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_3_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51799,7 +52520,7 @@ class Test_TC_DIAG_LOG_1_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DIAG_LOG_1_3Suite() {} + ~Test_TC_DM_3_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51844,10 +52565,11 @@ class Test_TC_DIAG_LOG_1_3Suite : public TestCommand } }; -class Test_TC_DESC_1_1Suite : public TestCommand +class Test_TC_DIAG_LOG_1_1Suite : public TestCommand { public: - Test_TC_DESC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_1_1", 0, credsIssuerConfig) + Test_TC_DIAG_LOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_LOG_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51855,7 +52577,7 @@ class Test_TC_DESC_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DESC_1_1Suite() {} + ~Test_TC_DIAG_LOG_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51900,11 +52622,11 @@ class Test_TC_DESC_1_1Suite : public TestCommand } }; -class Test_TC_ETHDIAG_1_2Suite : public TestCommand +class Test_TC_DIAG_LOG_1_2Suite : public TestCommand { public: - Test_TC_ETHDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ETHDIAG_1_2", 0, credsIssuerConfig) + Test_TC_DIAG_LOG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_LOG_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51912,7 +52634,7 @@ class Test_TC_ETHDIAG_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ETHDIAG_1_2Suite() {} + ~Test_TC_DIAG_LOG_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -51957,10 +52679,11 @@ class Test_TC_ETHDIAG_1_2Suite : public TestCommand } }; -class Test_TC_GC_1_2Suite : public TestCommand +class Test_TC_DIAG_LOG_1_3Suite : public TestCommand { public: - Test_TC_GC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_2", 0, credsIssuerConfig) + Test_TC_DIAG_LOG_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_LOG_1_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -51968,7 +52691,7 @@ class Test_TC_GC_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GC_1_2Suite() {} + ~Test_TC_DIAG_LOG_1_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52013,10 +52736,10 @@ class Test_TC_GC_1_2Suite : public TestCommand } }; -class Test_TC_GC_1_3Suite : public TestCommand +class Test_TC_DESC_1_1Suite : public TestCommand { public: - Test_TC_GC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_3", 0, credsIssuerConfig) + Test_TC_DESC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52024,7 +52747,7 @@ class Test_TC_GC_1_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GC_1_3Suite() {} + ~Test_TC_DESC_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52069,11 +52792,11 @@ class Test_TC_GC_1_3Suite : public TestCommand } }; -class Test_TC_GENDIAG_1_1Suite : public TestCommand +class Test_TC_ETHDIAG_1_2Suite : public TestCommand { public: - Test_TC_GENDIAG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GENDIAG_1_1", 0, credsIssuerConfig) + Test_TC_ETHDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ETHDIAG_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52081,7 +52804,7 @@ class Test_TC_GENDIAG_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GENDIAG_1_1Suite() {} + ~Test_TC_ETHDIAG_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52126,11 +52849,10 @@ class Test_TC_GENDIAG_1_1Suite : public TestCommand } }; -class Test_TC_GENDIAG_1_2Suite : public TestCommand +class Test_TC_GC_1_2Suite : public TestCommand { public: - Test_TC_GENDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GENDIAG_1_2", 0, credsIssuerConfig) + Test_TC_GC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52138,7 +52860,7 @@ class Test_TC_GENDIAG_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GENDIAG_1_2Suite() {} + ~Test_TC_GC_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52183,11 +52905,10 @@ class Test_TC_GENDIAG_1_2Suite : public TestCommand } }; -class Test_TC_GENDIAG_2_1Suite : public TestCommand +class Test_TC_GC_1_3Suite : public TestCommand { public: - Test_TC_GENDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GENDIAG_2_1", 0, credsIssuerConfig) + Test_TC_GC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52195,7 +52916,7 @@ class Test_TC_GENDIAG_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GENDIAG_2_1Suite() {} + ~Test_TC_GC_1_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52240,10 +52961,11 @@ class Test_TC_GENDIAG_2_1Suite : public TestCommand } }; -class Test_TC_I_2_2Suite : public TestCommand +class Test_TC_GENDIAG_1_1Suite : public TestCommand { public: - Test_TC_I_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_2_2", 0, credsIssuerConfig) + Test_TC_GENDIAG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GENDIAG_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52251,7 +52973,7 @@ class Test_TC_I_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_I_2_2Suite() {} + ~Test_TC_GENDIAG_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52296,10 +53018,11 @@ class Test_TC_I_2_2Suite : public TestCommand } }; -class Test_TC_ILL_2_2Suite : public TestCommand +class Test_TC_GENDIAG_1_2Suite : public TestCommand { public: - Test_TC_ILL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_2_2", 0, credsIssuerConfig) + Test_TC_GENDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GENDIAG_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52307,7 +53030,7 @@ class Test_TC_ILL_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ILL_2_2Suite() {} + ~Test_TC_GENDIAG_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52352,10 +53075,11 @@ class Test_TC_ILL_2_2Suite : public TestCommand } }; -class Test_TC_IDM_1_1Suite : public TestCommand +class Test_TC_GENDIAG_2_1Suite : public TestCommand { public: - Test_TC_IDM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_1_1", 0, credsIssuerConfig) + Test_TC_GENDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GENDIAG_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52363,7 +53087,7 @@ class Test_TC_IDM_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_1_1Suite() {} + ~Test_TC_GENDIAG_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52408,10 +53132,10 @@ class Test_TC_IDM_1_1Suite : public TestCommand } }; -class Test_TC_IDM_1_2Suite : public TestCommand +class Test_TC_I_2_2Suite : public TestCommand { public: - Test_TC_IDM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_1_2", 0, credsIssuerConfig) + Test_TC_I_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52419,7 +53143,7 @@ class Test_TC_IDM_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_1_2Suite() {} + ~Test_TC_I_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52464,10 +53188,10 @@ class Test_TC_IDM_1_2Suite : public TestCommand } }; -class Test_TC_IDM_2_1Suite : public TestCommand +class Test_TC_ILL_2_2Suite : public TestCommand { public: - Test_TC_IDM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_1", 0, credsIssuerConfig) + Test_TC_ILL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52475,7 +53199,7 @@ class Test_TC_IDM_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_2_1Suite() {} + ~Test_TC_ILL_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52520,10 +53244,10 @@ class Test_TC_IDM_2_1Suite : public TestCommand } }; -class Test_TC_IDM_2_2Suite : public TestCommand +class Test_TC_IDM_1_1Suite : public TestCommand { public: - Test_TC_IDM_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_2", 0, credsIssuerConfig) + Test_TC_IDM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52531,7 +53255,7 @@ class Test_TC_IDM_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_2_2Suite() {} + ~Test_TC_IDM_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52576,10 +53300,10 @@ class Test_TC_IDM_2_2Suite : public TestCommand } }; -class Test_TC_IDM_3_1Suite : public TestCommand +class Test_TC_IDM_1_2Suite : public TestCommand { public: - Test_TC_IDM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_1", 0, credsIssuerConfig) + Test_TC_IDM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52587,7 +53311,7 @@ class Test_TC_IDM_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_3_1Suite() {} + ~Test_TC_IDM_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52632,10 +53356,10 @@ class Test_TC_IDM_3_1Suite : public TestCommand } }; -class Test_TC_IDM_3_2Suite : public TestCommand +class Test_TC_IDM_2_1Suite : public TestCommand { public: - Test_TC_IDM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_2", 0, credsIssuerConfig) + Test_TC_IDM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52643,7 +53367,7 @@ class Test_TC_IDM_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_3_2Suite() {} + ~Test_TC_IDM_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52688,10 +53412,10 @@ class Test_TC_IDM_3_2Suite : public TestCommand } }; -class Test_TC_IDM_4_1Suite : public TestCommand +class Test_TC_IDM_2_2Suite : public TestCommand { public: - Test_TC_IDM_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_1", 0, credsIssuerConfig) + Test_TC_IDM_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52699,7 +53423,7 @@ class Test_TC_IDM_4_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_4_1Suite() {} + ~Test_TC_IDM_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52744,10 +53468,10 @@ class Test_TC_IDM_4_1Suite : public TestCommand } }; -class Test_TC_IDM_4_2Suite : public TestCommand +class Test_TC_IDM_3_1Suite : public TestCommand { public: - Test_TC_IDM_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_2", 0, credsIssuerConfig) + Test_TC_IDM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52755,7 +53479,7 @@ class Test_TC_IDM_4_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_4_2Suite() {} + ~Test_TC_IDM_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52800,10 +53524,10 @@ class Test_TC_IDM_4_2Suite : public TestCommand } }; -class Test_TC_IDM_5_1Suite : public TestCommand +class Test_TC_IDM_3_2Suite : public TestCommand { public: - Test_TC_IDM_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_1", 0, credsIssuerConfig) + Test_TC_IDM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52811,7 +53535,7 @@ class Test_TC_IDM_5_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_5_1Suite() {} + ~Test_TC_IDM_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52856,10 +53580,10 @@ class Test_TC_IDM_5_1Suite : public TestCommand } }; -class Test_TC_IDM_5_2Suite : public TestCommand +class Test_TC_IDM_4_1Suite : public TestCommand { public: - Test_TC_IDM_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_2", 0, credsIssuerConfig) + Test_TC_IDM_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52867,7 +53591,7 @@ class Test_TC_IDM_5_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_5_2Suite() {} + ~Test_TC_IDM_4_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52912,10 +53636,10 @@ class Test_TC_IDM_5_2Suite : public TestCommand } }; -class Test_TC_IDM_6_1Suite : public TestCommand +class Test_TC_IDM_4_2Suite : public TestCommand { public: - Test_TC_IDM_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_1", 0, credsIssuerConfig) + Test_TC_IDM_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52923,7 +53647,7 @@ class Test_TC_IDM_6_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_6_1Suite() {} + ~Test_TC_IDM_4_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52968,10 +53692,10 @@ class Test_TC_IDM_6_1Suite : public TestCommand } }; -class Test_TC_IDM_6_2Suite : public TestCommand +class Test_TC_IDM_5_1Suite : public TestCommand { public: - Test_TC_IDM_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_2", 0, credsIssuerConfig) + Test_TC_IDM_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52979,7 +53703,7 @@ class Test_TC_IDM_6_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_6_2Suite() {} + ~Test_TC_IDM_5_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53024,10 +53748,10 @@ class Test_TC_IDM_6_2Suite : public TestCommand } }; -class Test_TC_IDM_6_3Suite : public TestCommand +class Test_TC_IDM_5_2Suite : public TestCommand { public: - Test_TC_IDM_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_3", 0, credsIssuerConfig) + Test_TC_IDM_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53035,7 +53759,7 @@ class Test_TC_IDM_6_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_6_3Suite() {} + ~Test_TC_IDM_5_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53080,10 +53804,10 @@ class Test_TC_IDM_6_3Suite : public TestCommand } }; -class Test_TC_IDM_6_4Suite : public TestCommand +class Test_TC_IDM_6_1Suite : public TestCommand { public: - Test_TC_IDM_6_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_4", 0, credsIssuerConfig) + Test_TC_IDM_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53091,7 +53815,7 @@ class Test_TC_IDM_6_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_6_4Suite() {} + ~Test_TC_IDM_6_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53136,10 +53860,10 @@ class Test_TC_IDM_6_4Suite : public TestCommand } }; -class Test_TC_MC_3_12Suite : public TestCommand +class Test_TC_IDM_6_2Suite : public TestCommand { public: - Test_TC_MC_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_12", 0, credsIssuerConfig) + Test_TC_IDM_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53147,7 +53871,7 @@ class Test_TC_MC_3_12Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_3_12Suite() {} + ~Test_TC_IDM_6_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53192,10 +53916,10 @@ class Test_TC_MC_3_12Suite : public TestCommand } }; -class Test_TC_MC_3_13Suite : public TestCommand +class Test_TC_IDM_6_3Suite : public TestCommand { public: - Test_TC_MC_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_13", 0, credsIssuerConfig) + Test_TC_IDM_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53203,7 +53927,7 @@ class Test_TC_MC_3_13Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_3_13Suite() {} + ~Test_TC_IDM_6_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53248,10 +53972,10 @@ class Test_TC_MC_3_13Suite : public TestCommand } }; -class Test_TC_MC_4_1Suite : public TestCommand +class Test_TC_IDM_6_4Suite : public TestCommand { public: - Test_TC_MC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_4_1", 0, credsIssuerConfig) + Test_TC_IDM_6_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53259,7 +53983,7 @@ class Test_TC_MC_4_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_4_1Suite() {} + ~Test_TC_IDM_6_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53304,10 +54028,10 @@ class Test_TC_MC_4_1Suite : public TestCommand } }; -class Test_TC_MC_8_2Suite : public TestCommand +class Test_TC_MC_3_12Suite : public TestCommand { public: - Test_TC_MC_8_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_8_2", 0, credsIssuerConfig) + Test_TC_MC_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_12", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53315,7 +54039,7 @@ class Test_TC_MC_8_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_8_2Suite() {} + ~Test_TC_MC_3_12Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53360,10 +54084,10 @@ class Test_TC_MC_8_2Suite : public TestCommand } }; -class Test_TC_MC_9_2Suite : public TestCommand +class Test_TC_MC_3_13Suite : public TestCommand { public: - Test_TC_MC_9_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_9_2", 0, credsIssuerConfig) + Test_TC_MC_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_13", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53371,7 +54095,7 @@ class Test_TC_MC_9_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_9_2Suite() {} + ~Test_TC_MC_3_13Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53416,10 +54140,10 @@ class Test_TC_MC_9_2Suite : public TestCommand } }; -class Test_TC_MC_10_2Suite : public TestCommand +class Test_TC_MC_4_1Suite : public TestCommand { public: - Test_TC_MC_10_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_2", 0, credsIssuerConfig) + Test_TC_MC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_4_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53427,7 +54151,7 @@ class Test_TC_MC_10_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_2Suite() {} + ~Test_TC_MC_4_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53472,10 +54196,10 @@ class Test_TC_MC_10_2Suite : public TestCommand } }; -class Test_TC_MC_10_3Suite : public TestCommand +class Test_TC_MC_8_2Suite : public TestCommand { public: - Test_TC_MC_10_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_3", 0, credsIssuerConfig) + Test_TC_MC_8_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_8_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53483,7 +54207,7 @@ class Test_TC_MC_10_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_3Suite() {} + ~Test_TC_MC_8_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53528,10 +54252,10 @@ class Test_TC_MC_10_3Suite : public TestCommand } }; -class Test_TC_MC_10_4Suite : public TestCommand +class Test_TC_MC_9_2Suite : public TestCommand { public: - Test_TC_MC_10_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_4", 0, credsIssuerConfig) + Test_TC_MC_9_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_9_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53539,7 +54263,7 @@ class Test_TC_MC_10_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_4Suite() {} + ~Test_TC_MC_9_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53584,10 +54308,10 @@ class Test_TC_MC_10_4Suite : public TestCommand } }; -class Test_TC_MC_10_5Suite : public TestCommand +class Test_TC_MC_10_2Suite : public TestCommand { public: - Test_TC_MC_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_5", 0, credsIssuerConfig) + Test_TC_MC_10_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53595,7 +54319,7 @@ class Test_TC_MC_10_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_5Suite() {} + ~Test_TC_MC_10_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53640,10 +54364,10 @@ class Test_TC_MC_10_5Suite : public TestCommand } }; -class Test_TC_MC_10_6Suite : public TestCommand +class Test_TC_MC_10_3Suite : public TestCommand { public: - Test_TC_MC_10_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_6", 0, credsIssuerConfig) + Test_TC_MC_10_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53651,7 +54375,7 @@ class Test_TC_MC_10_6Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_6Suite() {} + ~Test_TC_MC_10_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53696,10 +54420,10 @@ class Test_TC_MC_10_6Suite : public TestCommand } }; -class Test_TC_MF_1_1Suite : public TestCommand +class Test_TC_MC_10_4Suite : public TestCommand { public: - Test_TC_MF_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_1", 0, credsIssuerConfig) + Test_TC_MC_10_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53707,7 +54431,7 @@ class Test_TC_MF_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_1Suite() {} + ~Test_TC_MC_10_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53752,10 +54476,10 @@ class Test_TC_MF_1_1Suite : public TestCommand } }; -class Test_TC_MF_1_2Suite : public TestCommand +class Test_TC_MC_10_5Suite : public TestCommand { public: - Test_TC_MF_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_2", 0, credsIssuerConfig) + Test_TC_MC_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53763,7 +54487,7 @@ class Test_TC_MF_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_2Suite() {} + ~Test_TC_MC_10_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53808,20 +54532,18 @@ class Test_TC_MF_1_2Suite : public TestCommand } }; -class Test_TC_MF_1_3Suite : public TestCommand +class Test_TC_MC_10_6Suite : public TestCommand { public: - Test_TC_MF_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_3", 15, credsIssuerConfig) + Test_TC_MC_10_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); - AddArgument("payload", &mPayload); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_3Suite() {} + ~Test_TC_MC_10_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53830,10 +54552,8 @@ class Test_TC_MF_1_3Suite : public TestCommand private: chip::Optional mNodeId; - chip::Optional mNodeId2; + chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mDiscriminator; - chip::Optional mPayload; chip::Optional mTimeout; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -53848,104 +54568,6 @@ class Test_TC_MF_1_3Suite : public TestCommand switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); - VerifyOrReturn(CheckConstraintType("value", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); - } - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> - value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); - VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); - VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); - } - VerifyOrReturn(CheckConstraintType("value", "", "list")); - } - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> - value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); - VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); - VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 1)); - VerifyOrReturn(CheckValueAsString("fabrics[1].label", iter_0.GetValue().label, chip::CharSpan("", 0))); - VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 2)); - } - VerifyOrReturn(CheckConstraintType("value", "", "list")); - } - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest1", 9))); - VerifyOrReturn(CheckConstraintType("value", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); - } - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest2", 9))); - VerifyOrReturn(CheckConstraintType("value", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); - } - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -53961,127 +54583,15 @@ class Test_TC_MF_1_3Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { - case 0: { - LogStep(0, "Reboot target device"); - SetIdentity(kIdentityAlpha); - return Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); - } - case 1: { - LogStep(1, "TH_CR1 starts a commissioning process with DUT_CE"); - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(1); - } - case 2: { - LogStep(2, "Open Commissioning Window with too-short timeout"); - chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; - value.commissioningTimeout = 120U; - value.PAKEVerifier = chip::ByteSpan( - chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" - "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" - "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" - "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), - 97); - value.discriminator = 3840U; - value.iterations = 1000UL; - value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); - return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, - AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, - chip::Optional(10000)); - } - case 3: { - LogStep(3, "Open Commissioning Window with too-long timeout"); - chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; - value.commissioningTimeout = 1000U; - value.PAKEVerifier = chip::ByteSpan( - chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" - "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" - "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" - "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), - 97); - value.discriminator = 3840U; - value.iterations = 1000UL; - value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); - return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, - AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, - chip::Optional(10000)); - } - case 4: { - LogStep(4, "Open Commissioning Window"); - chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; - value.commissioningTimeout = 180U; - value.PAKEVerifier = chip::ByteSpan( - chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" - "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" - "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" - "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), - 97); - value.discriminator = 3840U; - value.iterations = 1000UL; - value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); - return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, - AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, - chip::Optional(10000)); - } - case 5: { - LogStep(5, "TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); - chip::CharSpan value; - value = chip::Span("chiptestgarbage: not in length on purpose", 8); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); - } - case 6: { - LogStep(6, "TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); - } - case 7: { - LogStep(7, "Commission from beta"); - SetIdentity(kIdentityBeta); - return PairWithQRCode( - 1, mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:0000000000I31506010")); - } - case 8: { - LogStep(8, "TH_CR2 starts a commissioning process with DUT_CE"); - SetIdentity(kIdentityBeta); - return WaitForCommissionee(1); - } - case 9: { - LogStep(9, "Query fabrics list"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, - OperationalCredentials::Attributes::Fabrics::Id); - } - case 10: { - LogStep(10, "Query fabrics list"); - return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, - OperationalCredentials::Attributes::Fabrics::Id, false); - } - case 11: { - LogStep(11, "TH_CR1 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); - chip::CharSpan value; - value = chip::Span("chiptest1garbage: not in length on purpose", 9); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); - } - case 12: { - LogStep(12, "TH_CR1 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); - } - case 13: { - LogStep(13, "TH_CR2 writes the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); - chip::CharSpan value; - value = chip::Span("chiptest2garbage: not in length on purpose", 9); - return WriteAttribute(kIdentityBeta, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value); - } - case 14: { - LogStep(14, "TH_CR2 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE"); - return ReadAttribute(kIdentityBeta, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id); - } } return CHIP_NO_ERROR; } }; -class Test_TC_MF_1_5Suite : public TestCommand +class Test_TC_MF_1_1Suite : public TestCommand { public: - Test_TC_MF_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_5", 0, credsIssuerConfig) + Test_TC_MF_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54089,7 +54599,7 @@ class Test_TC_MF_1_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_5Suite() {} + ~Test_TC_MF_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54134,10 +54644,10 @@ class Test_TC_MF_1_5Suite : public TestCommand } }; -class Test_TC_MF_1_7Suite : public TestCommand +class Test_TC_MF_1_2Suite : public TestCommand { public: - Test_TC_MF_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_7", 0, credsIssuerConfig) + Test_TC_MF_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54145,7 +54655,7 @@ class Test_TC_MF_1_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_7Suite() {} + ~Test_TC_MF_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54190,10 +54700,10 @@ class Test_TC_MF_1_7Suite : public TestCommand } }; -class Test_TC_MF_1_8Suite : public TestCommand +class Test_TC_MF_1_7Suite : public TestCommand { public: - Test_TC_MF_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_8", 0, credsIssuerConfig) + Test_TC_MF_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54201,7 +54711,7 @@ class Test_TC_MF_1_8Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_8Suite() {} + ~Test_TC_MF_1_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54246,10 +54756,10 @@ class Test_TC_MF_1_8Suite : public TestCommand } }; -class Test_TC_MF_1_9Suite : public TestCommand +class Test_TC_MF_1_8Suite : public TestCommand { public: - Test_TC_MF_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_9", 0, credsIssuerConfig) + Test_TC_MF_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_8", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54257,7 +54767,7 @@ class Test_TC_MF_1_9Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_9Suite() {} + ~Test_TC_MF_1_8Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54302,10 +54812,10 @@ class Test_TC_MF_1_9Suite : public TestCommand } }; -class Test_TC_MF_1_10Suite : public TestCommand +class Test_TC_MF_1_9Suite : public TestCommand { public: - Test_TC_MF_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_10", 0, credsIssuerConfig) + Test_TC_MF_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_9", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54313,7 +54823,7 @@ class Test_TC_MF_1_10Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_10Suite() {} + ~Test_TC_MF_1_9Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54358,10 +54868,10 @@ class Test_TC_MF_1_10Suite : public TestCommand } }; -class Test_TC_MF_1_11Suite : public TestCommand +class Test_TC_MF_1_10Suite : public TestCommand { public: - Test_TC_MF_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_11", 0, credsIssuerConfig) + Test_TC_MF_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_10", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54369,7 +54879,7 @@ class Test_TC_MF_1_11Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_11Suite() {} + ~Test_TC_MF_1_10Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54414,10 +54924,10 @@ class Test_TC_MF_1_11Suite : public TestCommand } }; -class Test_TC_MF_1_12Suite : public TestCommand +class Test_TC_MF_1_11Suite : public TestCommand { public: - Test_TC_MF_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_12", 0, credsIssuerConfig) + Test_TC_MF_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_11", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54425,7 +54935,7 @@ class Test_TC_MF_1_12Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_12Suite() {} + ~Test_TC_MF_1_11Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54470,10 +54980,10 @@ class Test_TC_MF_1_12Suite : public TestCommand } }; -class Test_TC_MF_1_13Suite : public TestCommand +class Test_TC_MF_1_12Suite : public TestCommand { public: - Test_TC_MF_1_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_13", 0, credsIssuerConfig) + Test_TC_MF_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_12", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54481,7 +54991,7 @@ class Test_TC_MF_1_13Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_13Suite() {} + ~Test_TC_MF_1_12Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54526,10 +55036,10 @@ class Test_TC_MF_1_13Suite : public TestCommand } }; -class Test_TC_MF_1_14Suite : public TestCommand +class Test_TC_MF_1_13Suite : public TestCommand { public: - Test_TC_MF_1_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_14", 0, credsIssuerConfig) + Test_TC_MF_1_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_13", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54537,7 +55047,7 @@ class Test_TC_MF_1_14Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_14Suite() {} + ~Test_TC_MF_1_13Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54582,10 +55092,10 @@ class Test_TC_MF_1_14Suite : public TestCommand } }; -class Test_TC_MF_1_15Suite : public TestCommand +class Test_TC_MF_1_14Suite : public TestCommand { public: - Test_TC_MF_1_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_15", 0, credsIssuerConfig) + Test_TC_MF_1_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_14", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54593,7 +55103,7 @@ class Test_TC_MF_1_15Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_15Suite() {} + ~Test_TC_MF_1_14Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57595,8 +58105,11 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -57775,8 +58288,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -57785,7 +58296,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), From 8c8f6e263dff5c34d20502be912eff4ecefc379a Mon Sep 17 00:00:00 2001 From: kowsisoundhar12 <57476670+kowsisoundhar12@users.noreply.github.com> Date: Thu, 28 Apr 2022 06:11:11 +0530 Subject: [PATCH 21/59] Added User prompt scripts-Test_Added_Apr19 (#17523) * Added user promot scripts * Added Auto generated files * Restyled by whitespace * Restyled by prettier-yaml * PR comments addressed. * Restyled by prettier-yaml Co-authored-by: Restyled.io Co-authored-by: kvikrambhat --- src/app/tests/suites/certification/PICS.yaml | 3 + .../certification/Test_TC_BOOL_1_1.yaml | 44 +- .../suites/certification/Test_TC_CC_1_1.yaml | 77 +- .../suites/certification/Test_TC_FLW_1_1.yaml | 57 +- .../suites/certification/Test_TC_ILL_1_1.yaml | 46 +- .../suites/certification/Test_TC_I_1_1.yaml | 46 +- .../suites/certification/Test_TC_LVL_1_1.yaml | 73 +- .../suites/certification/Test_TC_OCC_1_1.yaml | 50 +- .../suites/certification/Test_TC_PRS_1_1.yaml | 167 +-- .../suites/certification/Test_TC_PS_1_1.yaml | 38 +- .../tests/suites/certification/ci-pics-values | 1 + .../Framework/CHIP/templates/tests/tests.js | 9 - .../Framework/CHIPTests/CHIPClustersTests.m | 975 +----------- .../zap-generated/test/Commands.h | 1327 +++++++++++++---- .../chip-tool/zap-generated/test/Commands.h | 815 ++++++++-- 15 files changed, 2068 insertions(+), 1660 deletions(-) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index ff16126e6c3998..872ccf446bbebd 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -312,3 +312,6 @@ PICS: - label: "Prompts user for input. Unable to run in CI" id: PICS_USER_PROMPT + + - label: "Skip sample app" + id: PICS_SKIP_SAMPLE_APP diff --git a/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml index 22d0f995647186..af3e1c20f0905d 100644 --- a/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml @@ -34,7 +34,7 @@ tests: response: value: 1 - - label: "Read the global attribute constraints: ClusterRevision" + - label: "Read the global attribute constraints : ClusterRevision" command: "readAttribute" attribute: "ClusterRevision" response: @@ -45,22 +45,31 @@ tests: command: "readAttribute" attribute: "AttributeList" response: + value: [0, 65528, 65529, 65531, 65533] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [] constraints: type: list @@ -68,5 +77,22 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list + + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + ./chip-tool booleanstate read feature-map 1 1(Not implemented in SDK) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml index 3326292a2c1b93..90985a2acaffce 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml @@ -29,11 +29,10 @@ tests: value: nodeId - label: "read the global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: - value: 4 + value: 5 - label: "Read the global attribute constraints : ClusterRevision" command: "readAttribute" @@ -48,16 +47,15 @@ tests: command: "writeAttribute" attribute: "ClusterRevision" arguments: - value: 4 + value: 5 response: error: UNSUPPORTED_WRITE - label: "reads back global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: - value: 4 + value: 5 - label: "Read the global attribute: AttributeList" command: "readAttribute" @@ -66,17 +64,23 @@ tests: constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -84,41 +88,24 @@ tests: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: constraints: type: list - #Disabled due to issue #13442 - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 - - - label: "write the default values to optional global attribute: FeatureMap" - disabled: true - command: "writeAttribute" - attribute: "FeatureMap" + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml index e359a19fe3ca0c..4f9a0b86f9dd61 100644 --- a/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml @@ -28,13 +28,11 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 3 but expecting 1 - label: "read the global attribute: ClusterRevision" command: "readAttribute" - disabled: true attribute: "ClusterRevision" response: - value: 2 + value: 3 - label: "Read the global attribute constraints: ClusterRevision" command: "readAttribute" @@ -49,16 +47,15 @@ tests: command: "writeAttribute" attribute: "ClusterRevision" arguments: - value: 2 + value: 3 response: error: UNSUPPORTED_WRITE - label: "reads back global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: - value: 2 + value: 3 - label: "Read the global attribute: AttributeList" command: "readAttribute" @@ -67,17 +64,23 @@ tests: constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -85,18 +88,24 @@ tests: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: constraints: type: list - #Disabled due to issue #13442 - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml index 50544be9e7a145..cf007bb4226457 100644 --- a/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml @@ -28,15 +28,13 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 3 but expecting 2 - label: "read the global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: value: 3 - - label: "Read the global attribute constraints: ClusterRevision" + - label: "Read the global attribute constraints : ClusterRevision" command: "readAttribute" attribute: "ClusterRevision" response: @@ -47,22 +45,31 @@ tests: command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2, 3, 4, 65528, 65529, 65531, 65533] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [] constraints: type: list @@ -70,5 +77,22 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list + + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml index 36de49ee4fac4b..f0928b6c2d9e01 100644 --- a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml @@ -28,15 +28,13 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 4 but expecting 2 - label: "TH reads the ClusterRevision attribute from the DUT" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: value: 4 - - label: "Reads constraints of ClusterRevision attribute" + - label: "Read the global attribute constraints : ClusterRevision" command: "readAttribute" attribute: "ClusterRevision" response: @@ -47,6 +45,7 @@ tests: command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 65528, 65529, 65531, 65533] constraints: type: list @@ -54,6 +53,7 @@ tests: command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0, 1, 64] constraints: type: list @@ -61,14 +61,38 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [0] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml index 5a12491b2ef7fb..3d0fba4fa0fa2b 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml @@ -34,56 +34,43 @@ tests: response: value: 5 - - label: "Read the global attribute constraints: ClusterRevision" + - label: "Read the global attribute constraints : ClusterRevision" command: "readAttribute" attribute: "ClusterRevision" response: constraints: type: uint16 - - label: - "write the default values to mandatory global attribute: - ClusterRevision" - command: "writeAttribute" - attribute: "ClusterRevision" - arguments: - value: 4 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back global attribute: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 5 - - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16384] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: - constraints: - type: list - - - label: "Read the global attribute: GeneratedCommandList" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: + value: [0, 1, 2, 3, 4, 5, 6, 7] constraints: type: list @@ -92,25 +79,3 @@ tests: attribute: "FeatureMap" response: value: 3 - - - label: "Read the optional global attribute : FeatureMap" - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 - - - label: "write the default values to optional global attribute: FeatureMap" - command: "writeAttribute" - attribute: "FeatureMap" - arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back optional global attribute: FeatureMap" - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml index 1d65733754c8cb..b10a243d0926e3 100644 --- a/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml @@ -28,9 +28,7 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 3 but expecting 2 - label: "read the global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: @@ -54,7 +52,6 @@ tests: error: UNSUPPORTED_WRITE - label: "reads back global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: @@ -67,17 +64,23 @@ tests: constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -85,17 +88,24 @@ tests: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: constraints: type: list - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml index cf4b51fcdbe449..797f90deeeba53 100644 --- a/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml @@ -28,9 +28,7 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 3 but expecting 2 - label: "Read the global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: @@ -54,118 +52,89 @@ tests: error: UNSUPPORTED_WRITE - label: "Reads back global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: value: 3 - - label: "Read the mandatory global attribute: AttributeList" - disabled: true - command: "readAttribute" - attribute: "AttributeList" - response: - value: 0 - - - label: "Read the global attribute constraints: AttributeList" + - label: "Read the global mandatory attribute constraints: AttributeList" command: "readAttribute" attribute: "AttributeList" response: constraints: type: list + #issue #15011 - label: - "Write the default values to mandatory global attribute: AttributeList" - disabled: true - command: "writeAttribute" - attribute: "AttributeList" + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "Reads back mandatory global attribute: AttributeList" - disabled: true - command: "readAttribute" - attribute: "AttributeList" - response: - value: 0 - - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the mandatory global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - value: 0 - - - label: "Read the global attribute constraints: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Write the default values to mandatory global attribute: EventList" - disabled: true - command: "writeAttribute" - attribute: "EventList" + #issue #17484 + - label: + "Read AcceptedCommandList attribute from the DUT and Verify that the + DUT response" + verification: | + ./chip-tool pressuremeasurement read accepted-command-list 1 1 + + Verify response: + [1650367843.973086][4114:4119] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0403 Attribute 0x0000_FFF9 DataVersion: 2248280323 + [1650367843.973242][4114:4119] CHIP:TOO: AcceptedCommandList: 0 entries + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "Reads back mandatory global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - value: 0 - - - label: "Read the global attribute: AcceptedCommandList" - disabled: true - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - - - label: "Read the global attribute: GeneratedCommandList" - disabled: true - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - - - label: "Read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute constraints: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Write the default values to optional global attribute: FeatureMap" - disabled: true - command: "writeAttribute" - attribute: "FeatureMap" + - label: + "Read GeneratedCommandList attribute from the DUT and Verify that the + DUT response" + verification: | + ./chip-tool pressuremeasurement read generated-command-list 1 1 + + Verify response: + [1650367913.285053][4120:4125] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0403 Attribute 0x0000_FFF8 DataVersion: 2248280323 + [1650367913.285193][4120:4125] CHIP:TOO: GeneratedCommandList: 0 entries + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Reads back optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response" + verification: | + ./chip-tool pressuremeasurement read feature-map 1 1 + Verify response: + cluster id: 0x0403 + Attribute: 0xFFFC + PressureMeasurement.FeatureMap response: 0 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml index bcb6f0990f6b8e..7272dfde8e463e 100644 --- a/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml @@ -34,26 +34,43 @@ tests: response: value: 1 - - label: "Read the global attribute: AttributeList" + - label: "Read the global attribute constraints: ClusterRevision" command: "readAttribute" - attribute: "AttributeList" + attribute: "ClusterRevision" response: constraints: - type: list + type: uint16 - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true + - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "EventList" + attribute: "AttributeList" response: + value: [0, 1, 2, 5, 11, 12, 13, 14, 15, 16, 19, 26, 28, 25] constraints: type: list + #issue #11053 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [] constraints: type: list @@ -61,5 +78,12 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list + + - label: "read the optional global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index e1fc672fc6f74a..b2560457a98292 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -83,3 +83,4 @@ RI_KEY=1 PH_KEY=1 PI_KEY=1 PICS_USER_PROMPT=0 +PICS_SKIP_SAMPLE_APP=0 diff --git a/src/darwin/Framework/CHIP/templates/tests/tests.js b/src/darwin/Framework/CHIP/templates/tests/tests.js index c2bc15fe291f1b..a05cbde60eae2d 100644 --- a/src/darwin/Framework/CHIP/templates/tests/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests/tests.js @@ -33,7 +33,6 @@ function getTests() ]; const BooleanState = [ - 'Test_TC_BOOL_1_1', 'Test_TC_BOOL_2_1', ]; @@ -42,7 +41,6 @@ function getTests() ]; const ColorControl = [ - 'Test_TC_CC_1_1', 'Test_TC_CC_2_1', 'Test_TC_CC_3_1', 'Test_TC_CC_3_2', @@ -94,7 +92,6 @@ function getTests() ]; const FlowMeasurement = [ - 'Test_TC_FLW_1_1', 'Test_TC_FLW_2_1', 'Test_TC_FLW_2_2', ]; @@ -104,24 +101,20 @@ function getTests() ]; const Identify = [ - 'Test_TC_I_1_1', 'Test_TC_I_2_1', 'Test_TC_I_2_3', ]; const IlluminanceMeasurement = [ - 'Test_TC_ILL_1_1', 'Test_TC_ILL_2_1', ]; const OccupancySensing = [ - 'Test_TC_OCC_1_1', 'Test_TC_OCC_2_1', 'Test_TC_OCC_2_2', ]; const LevelControl = [ - 'Test_TC_LVL_1_1', 'Test_TC_LVL_2_1', 'Test_TC_LVL_2_2', 'Test_TC_LVL_3_1', @@ -179,12 +172,10 @@ function getTests() ]; const PowerSource = [ - 'Test_TC_PS_1_1', 'Test_TC_PS_2_1', ]; const PressureMeasurement = [ - 'Test_TC_PRS_1_1', 'Test_TC_PRS_2_1', ]; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 1bdb545620108c..f1ba031228ddbd 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -2084,115 +2084,6 @@ - (void)testSendClusterTest_TC_BI_2_2_000008_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BOOL_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_BOOL_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -2355,76 +2246,6 @@ - (void)testSendClusterTest_TC_BRAC_1_1_000005_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints : ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_1_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_CC_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -12970,76 +12791,6 @@ - (void)testSendClusterTest_TC_ETHDIAG_2_1_000000_WaitForCommissionee [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_FLW_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_1_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:2U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_FLW_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -13544,7 +13295,7 @@ - (void)testSendClusterTest_TC_GC_1_1_000005_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_I_1_1_000000_WaitForCommissionee +- (void)testSendClusterTest_TC_I_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -13552,17 +13303,17 @@ - (void)testSendClusterTest_TC_I_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue, 305414945); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_I_1_1_000001_ReadAttribute +- (void)testSendClusterTest_TC_I_2_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of ClusterRevision attribute"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyTime attribute from the DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of ClusterRevision attribute Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -13571,102 +13322,17 @@ - (void)testSendClusterTest_TC_I_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_I_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_I_2_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyType attribute from the DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_I_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyTime attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyType attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); + [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -14050,99 +13716,6 @@ - (void)testSendClusterTest_TC_I_2_3_000020_UserPrompt [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_ILL_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_ILL_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -14221,291 +13794,51 @@ - (void)testSendClusterTest_TC_ILL_2_1_000002_ReadAttribute } - (void)testSendClusterTest_TC_ILL_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads Tolerance attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads LightSensorType attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_LVL_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 5U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000003_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 5U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 3UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional global attribute : FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional global attribute : FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000010_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to optional global attribute: FeatureMap"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads Tolerance attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_1_1_000011_ReadAttribute +- (void)testSendClusterTest_TC_ILL_2_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back optional global attribute: FeatureMap"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads LightSensorType attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -18021,76 +17354,6 @@ - (void)testSendClusterTest_TC_MOD_1_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OCC_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_1_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_OCC_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -20134,96 +19397,6 @@ - (void)testSendClusterTest_TC_OO_2_3_000046_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PS_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_PS_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -20462,76 +19635,6 @@ - (void)testSendClusterTest_TC_PS_2_1_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PRS_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_1_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_PRS_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 9c3389089f74e6..d66d76477ebde2 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -2505,7 +2505,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: @@ -2513,12 +2513,32 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); break; } @@ -2535,7 +2555,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -2577,7 +2597,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -2599,6 +2619,16 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -2606,7 +2636,13 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -2617,6 +2653,11 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -2624,7 +2665,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -2635,12 +2676,23 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_BOOL_2_1 : public TestCommandBridge { @@ -2990,17 +3042,53 @@ class Test_TC_CC_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints : ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress( + chipTool, " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9(); break; } @@ -3017,7 +3105,7 @@ class Test_TC_CC_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -3030,7 +3118,29 @@ class Test_TC_CC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -3048,14 +3158,14 @@ class Test_TC_CC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U]; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:5U]; [cluster writeAttributeClusterRevisionWithValue:clusterRevisionArgument completionHandler:^(NSError * _Nullable err) { @@ -3069,7 +3179,29 @@ class Test_TC_CC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -3086,6 +3218,54 @@ class Test_TC_CC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_CC_2_1 : public TestCommandBridge { @@ -16551,17 +16731,53 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress( + chipTool, " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9(); break; } @@ -16578,7 +16794,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -16591,7 +16807,29 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -16609,14 +16847,14 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:2U]; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; [cluster writeAttributeClusterRevisionWithValue:clusterRevisionArgument completionHandler:^(NSError * _Nullable err) { @@ -16630,27 +16868,97 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_FLW_2_1 : public TestCommandBridge { -public: + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLW_2_1 : public TestCommandBridge { +public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced Test_TC_FLW_2_1() : TestCommandBridge("Test_TC_FLW_2_1") @@ -17416,20 +17724,44 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); break; } @@ -17446,7 +17778,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -17459,7 +17791,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device @@ -17468,7 +17800,31 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -17479,7 +17835,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device @@ -17492,6 +17848,20 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(9))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -17499,7 +17869,13 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_3() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device @@ -17512,6 +17888,11 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -17519,7 +17900,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device @@ -17532,12 +17913,23 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_ILL_2_1 : public TestCommandBridge { @@ -17771,20 +18163,44 @@ class Test_TC_I_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads constraints of ClusterRevision attribute\n"); - err = TestReadsConstraintsOfClusterRevisionAttribute_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); + err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); break; } @@ -17801,7 +18217,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -17814,14 +18230,36 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfClusterRevisionAttribute_1() + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of ClusterRevision attribute Error: %@", err); + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -17832,7 +18270,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -17843,6 +18281,17 @@ class Test_TC_I_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -17850,7 +18299,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_3() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -17861,6 +18310,14 @@ class Test_TC_I_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 64UL)); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -17868,7 +18325,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -17879,12 +18336,30 @@ class Test_TC_I_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_I_2_1 : public TestCommandBridge { @@ -18529,45 +19004,34 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional global attribute : FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : write the default values to optional global attribute: FeatureMap\n"); - err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : reads back optional global attribute: FeatureMap\n"); - err = TestReadsBackOptionalGlobalAttributeFeatureMap_11(); + ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); break; } @@ -18577,95 +19041,34 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { } } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -18680,131 +19083,114 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(14))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 16384UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); - NextTest(); - }]; - + UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_8() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 3UL)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(8))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_9() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional global attribute : FeatureMap Error: %@", err); + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_10() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_11() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 3UL)); + } - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; @@ -25415,17 +25801,52 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress( + chipTool, " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); break; } @@ -25440,22 +25861,113 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device @@ -25463,19 +25975,25 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device @@ -25483,22 +26001,19 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device @@ -25506,17 +26021,23 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_OCC_2_1 : public TestCommandBridge { @@ -28351,16 +28872,38 @@ class Test_TC_PS_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_7(); break; } @@ -28377,7 +28920,7 @@ class Test_TC_PS_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -28412,7 +28955,25 @@ class Test_TC_PS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -28423,6 +28984,25 @@ class Test_TC_PS_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(14))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 16UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 19UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 26UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 28UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 25UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -28430,7 +29010,13 @@ class Test_TC_PS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_3() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -28441,6 +29027,11 @@ class Test_TC_PS_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -28448,7 +29039,7 @@ class Test_TC_PS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -28459,12 +29050,39 @@ class Test_TC_PS_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_PS_2_1 : public TestCommandBridge { @@ -28807,17 +29425,62 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : Write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute constraints: AttributeList\n"); - err = TestReadTheGlobalAttributeConstraintsAttributeList_3(); + ChipLogProgress( + chipTool, " ***** Test Step 3 : Write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global mandatory attribute constraints: AttributeList\n"); + err = TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read AcceptedCommandList attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Read GeneratedCommandList attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); break; } @@ -28834,7 +29497,7 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -28847,7 +29510,31 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device @@ -28867,7 +29554,7 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device @@ -28890,7 +29577,31 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsAttributeList_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device @@ -28899,7 +29610,7 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: AttributeList Error: %@", err); + NSLog(@"Read the global mandatory attribute constraints: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -28909,6 +29620,30 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_PRS_2_1 : public TestCommandBridge { diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index f3b50b8207868e..f8817ac66e4116 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -1871,7 +1871,7 @@ class Test_TC_BI_2_2Suite : public TestCommand class Test_TC_BOOL_1_1Suite : public TestCommand { public: - Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 6, credsIssuerConfig) + Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -1929,25 +1929,55 @@ class Test_TC_BOOL_1_1Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 5)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 5: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -1973,7 +2003,7 @@ class Test_TC_BOOL_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute constraints: ClusterRevision"); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::ClusterRevision::Id); } case 3: { @@ -1981,15 +2011,30 @@ class Test_TC_BOOL_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "Read the global attribute: AcceptedCommandList"); + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AcceptedCommandList::Id); } - case 5: { - LogStep(5, "Read the global attribute: GeneratedCommandList"); + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::GeneratedCommandList::Id); } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -2216,7 +2261,7 @@ class Test_TC_BRAC_1_1Suite : public TestCommand class Test_TC_CC_1_1Suite : public TestCommand { public: - Test_TC_CC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_1_1", 4, credsIssuerConfig) + Test_TC_CC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_1_1", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -2258,13 +2303,29 @@ class Test_TC_CC_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 5U)); } break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 5U)); + } + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -2272,6 +2333,30 @@ class Test_TC_CC_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -2293,20 +2378,53 @@ class Test_TC_CC_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints : ClusterRevision"); + LogStep(1, "read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "write the default values to mandatory global attribute: ClusterRevision"); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ClusterRevision::Id); + } + case 3: { + LogStep(3, "write the default values to mandatory global attribute: ClusterRevision"); uint16_t value; - value = 4U; + value = 5U; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ClusterRevision::Id, value); } - case 3: { - LogStep(3, "Read the global attribute: AttributeList"); + case 4: { + LogStep(4, "reads back global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ClusterRevision::Id); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::GeneratedCommandList::Id); + } + case 9: { + LogStep(9, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -9357,7 +9475,7 @@ class Test_TC_ETHDIAG_2_1Suite : public TestCommand class Test_TC_FLW_1_1Suite : public TestCommand { public: - Test_TC_FLW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_1_1", 4, credsIssuerConfig) + Test_TC_FLW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_1_1", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -9399,13 +9517,29 @@ class Test_TC_FLW_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); } break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + } + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -9413,6 +9547,30 @@ class Test_TC_FLW_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -9434,22 +9592,57 @@ class Test_TC_FLW_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); + LogStep(1, "read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, FlowMeasurement::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "write the default values to mandatory global attribute: ClusterRevision"); + LogStep(2, "Read the global attribute constraints: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::ClusterRevision::Id); + } + case 3: { + LogStep(3, "write the default values to mandatory global attribute: ClusterRevision"); uint16_t value; - value = 2U; + value = 3U; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, FlowMeasurement::Attributes::ClusterRevision::Id, value); } - case 3: { - LogStep(3, "Read the global attribute: AttributeList"); + case 4: { + LogStep(4, "reads back global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::ClusterRevision::Id); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, FlowMeasurement::Attributes::AttributeList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::AcceptedCommandList::Id); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::GeneratedCommandList::Id); + } + case 9: { + LogStep(9, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -9914,7 +10107,7 @@ class Test_TC_GC_1_1Suite : public TestCommand class Test_TC_I_1_1Suite : public TestCommand { public: - Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 5, credsIssuerConfig) + Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -9956,33 +10149,81 @@ class Test_TC_I_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); } break; case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } + break; + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 6)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 3: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 64UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 3)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 4: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -10004,21 +10245,40 @@ class Test_TC_I_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Reads constraints of ClusterRevision attribute"); + LogStep(1, "TH reads the ClusterRevision attribute from the DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AttributeList::Id); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::ClusterRevision::Id); } case 3: { - LogStep(3, "Read the global attribute: AcceptedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id); + LogStep(3, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "Read the global attribute: GeneratedCommandList"); + LogStep(4, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id); + } + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::GeneratedCommandList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -10393,7 +10653,7 @@ class Test_TC_I_2_3Suite : public TestCommand class Test_TC_ILL_1_1Suite : public TestCommand { public: - Test_TC_ILL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_1_1", 5, credsIssuerConfig) + Test_TC_ILL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_1_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -10435,33 +10695,79 @@ class Test_TC_ILL_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 9)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -10483,25 +10789,45 @@ class Test_TC_ILL_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); + LogStep(1, "read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, IlluminanceMeasurement::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute: AttributeList"); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, - IlluminanceMeasurement::Attributes::AttributeList::Id); + IlluminanceMeasurement::Attributes::ClusterRevision::Id); } case 3: { - LogStep(3, "Read the global attribute: AcceptedCommandList"); + LogStep(3, "Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, - IlluminanceMeasurement::Attributes::AcceptedCommandList::Id); + IlluminanceMeasurement::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "Read the global attribute: GeneratedCommandList"); + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, IlluminanceMeasurement::Attributes::GeneratedCommandList::Id); } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -10633,7 +10959,7 @@ class Test_TC_ILL_2_1Suite : public TestCommand class Test_TC_LVL_1_1Suite : public TestCommand { public: - Test_TC_LVL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_1_1", 12, credsIssuerConfig) + Test_TC_LVL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_1_1", 7, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -10687,41 +11013,78 @@ class Test_TC_LVL_1_1Suite : public TestCommand } break; case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 5U)); - } - break; - case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 10UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); + VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 12UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); + VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 13UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); + VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 14UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 12)); + VerifyOrReturn(CheckValue("attributeList[12]", iter_0.GetValue(), 15UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 13)); + VerifyOrReturn(CheckValue("attributeList[13]", iter_0.GetValue(), 16384UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 14)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 6: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "list")); - } + shouldContinue = true; break; - case 7: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 3)); + VerifyOrReturn(CheckValue("acceptedCommandList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 4)); + VerifyOrReturn(CheckValue("acceptedCommandList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 5)); + VerifyOrReturn(CheckValue("acceptedCommandList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 6)); + VerifyOrReturn(CheckValue("acceptedCommandList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 7)); + VerifyOrReturn(CheckValue("acceptedCommandList[7]", iter_0.GetValue(), 7UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 8)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 8: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -10729,25 +11092,6 @@ class Test_TC_LVL_1_1Suite : public TestCommand VerifyOrReturn(CheckValue("featureMap", value, 3UL)); } break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint32_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "map32")); - } - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint32_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "map32")); - } - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -10773,51 +11117,28 @@ class Test_TC_LVL_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute constraints: ClusterRevision"); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::ClusterRevision::Id); } case 3: { - LogStep(3, "write the default values to mandatory global attribute: ClusterRevision"); - uint16_t value; - value = 4U; - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::ClusterRevision::Id, - value); + LogStep(3, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "reads back global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::ClusterRevision::Id); + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } case 5: { - LogStep(5, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id); - } - case 6: { - LogStep(6, "Read the global attribute: AcceptedCommandList"); + LogStep(5, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AcceptedCommandList::Id); } - case 7: { - LogStep(7, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, - LevelControl::Attributes::GeneratedCommandList::Id); - } - case 8: { - LogStep(8, "read the optional global attribute: FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id); - } - case 9: { - LogStep(9, "Read the optional global attribute : FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id); - } - case 10: { - LogStep(10, "write the default values to optional global attribute: FeatureMap"); - uint32_t value; - value = 0UL; - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id, - value); - } - case 11: { - LogStep(11, "reads back optional global attribute: FeatureMap"); + case 6: { + LogStep(6, "read the optional global attribute: FeatureMap"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id); } } @@ -16841,7 +17162,7 @@ class Test_TC_MF_1_15Suite : public TestCommand class Test_TC_OCC_1_1Suite : public TestCommand { public: - Test_TC_OCC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_1_1", 4, credsIssuerConfig) + Test_TC_OCC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_1_1", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -16883,13 +17204,29 @@ class Test_TC_OCC_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); } break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + } + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -16897,6 +17234,30 @@ class Test_TC_OCC_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -16918,22 +17279,55 @@ class Test_TC_OCC_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); + LogStep(1, "read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "write the default values to mandatory global attribute: ClusterRevision"); + LogStep(2, "Read the global attribute constraints: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::ClusterRevision::Id); + } + case 3: { + LogStep(3, "write the default values to mandatory global attribute: ClusterRevision"); uint16_t value; value = 3U; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::ClusterRevision::Id, value); } - case 3: { - LogStep(3, "Read the global attribute: AttributeList"); + case 4: { + LogStep(4, "reads back global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::ClusterRevision::Id); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::AttributeList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::AcceptedCommandList::Id); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::GeneratedCommandList::Id); + } + case 9: { + LogStep(9, "Read FeatureMap attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -18708,7 +19102,7 @@ class Test_TC_OO_2_4Suite : public TestCommand class Test_TC_PS_1_1Suite : public TestCommand { public: - Test_TC_PS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_1_1", 5, credsIssuerConfig) + Test_TC_PS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_1_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -18754,29 +19148,89 @@ class Test_TC_PS_1_1Suite : public TestCommand } break; case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } + break; + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 12UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 13UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 14UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 15UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); + VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 16UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); + VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 19UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); + VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 26UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 12)); + VerifyOrReturn(CheckValue("attributeList[12]", iter_0.GetValue(), 28UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 13)); + VerifyOrReturn(CheckValue("attributeList[13]", iter_0.GetValue(), 25UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 14)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 3: + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 4: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -18802,18 +19256,34 @@ class Test_TC_PS_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id); + LogStep(2, "Read the global attribute constraints: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::ClusterRevision::Id); } case 3: { - LogStep(3, "Read the global attribute: AcceptedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AcceptedCommandList::Id); + LogStep(3, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "Read the global attribute: GeneratedCommandList"); + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::GeneratedCommandList::Id); } + case 7: { + LogStep(7, "read the optional global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::FeatureMap::Id); + } } return CHIP_NO_ERROR; } @@ -19005,7 +19475,7 @@ class Test_TC_PS_2_1Suite : public TestCommand class Test_TC_PRS_1_1Suite : public TestCommand { public: - Test_TC_PRS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_1_1", 4, credsIssuerConfig) + Test_TC_PRS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_1_1", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -19047,13 +19517,29 @@ class Test_TC_PRS_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); } break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + } + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -19061,6 +19547,22 @@ class Test_TC_PRS_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -19082,22 +19584,57 @@ class Test_TC_PRS_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); + LogStep(1, "Read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, PressureMeasurement::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Write the default values to mandatory global attribute: ClusterRevision"); + LogStep(2, "Read the global attribute constraints: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::ClusterRevision::Id); + } + case 3: { + LogStep(3, "Write the default values to mandatory global attribute: ClusterRevision"); uint16_t value; value = 3U; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, PressureMeasurement::Attributes::ClusterRevision::Id, value); } - case 3: { - LogStep(3, "Read the global attribute constraints: AttributeList"); + case 4: { + LogStep(4, "Reads back global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::ClusterRevision::Id); + } + case 5: { + LogStep(5, "Read the global mandatory attribute constraints: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, PressureMeasurement::Attributes::AttributeList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, "Read AcceptedCommandList attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 8: { + LogStep(8, "Read GeneratedCommandList attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 9: { + LogStep(9, "Read FeatureMap attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } From 10bb2fdf68b077796828279c473a8b4dfede8d67 Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk <66371704+kkasperczyk-no@users.noreply.github.com> Date: Thu, 28 Apr 2022 03:21:18 +0200 Subject: [PATCH 22/59] Added support for Thread Synchronized Sleepy End Devices (#17803) Thread 1.2 allows to use Synchronized Sleepy End Devices that doesn't need to poll parent for data like traditional SED, but wakes up in scheduled time slots to listen for messages without transmitting requests to parent. * Refactored naming for sleepy end devices, as everywhere the polling mechanism is assumed. Basically renamed polling intervals to intervals and fast/slow polling mode to active/idle mode. * Added CHIP_DEVICE_CONFIG_THREAD_SSED that allows to enable Thread SSED support. * Added new Thread kThreadDeviceType_SynchronizedSleepyEndDevice device type * Added calculating communication intervals for Thread SSED based on CSL period instead of poll period. --- .../Kconfig.multiprotocol_rpmsg.defaults | 4 + config/zephyr/Kconfig | 6 ++ .../main/include/CHIPProjectConfig.h | 2 +- .../main/include/CHIPProjectConfig.h | 2 +- .../main/include/CHIPProjectConfig.h | 2 +- .../k32w/k32w0/include/CHIPProjectConfig.h | 4 +- src/app/server/CommissioningWindowManager.cpp | 4 +- src/app/server/Dnssd.cpp | 2 +- src/include/platform/CHIPDeviceConfig.h | 26 +++-- src/include/platform/CHIPDeviceEvent.h | 6 +- src/include/platform/ConnectivityManager.h | 61 ++++++------ src/include/platform/ThreadStackManager.h | 30 +++--- .../GenericConnectivityManagerImpl_NoThread.h | 16 +-- .../GenericConnectivityManagerImpl_Thread.h | 20 ++-- src/messaging/ExchangeContext.cpp | 22 ++--- src/messaging/ExchangeContext.h | 16 +-- src/messaging/ReliableMessageContext.h | 20 ++-- .../ReliableMessageProtocolConfig.cpp | 10 +- src/platform/Linux/ThreadStackManagerImpl.cpp | 16 +-- src/platform/Linux/ThreadStackManagerImpl.h | 6 +- ...nericThreadStackManagerImpl_OpenThread.cpp | 97 ++++++++++++------- ...GenericThreadStackManagerImpl_OpenThread.h | 14 +-- .../nrfconnect/CHIPDevicePlatformConfig.h | 1 + 23 files changed, 219 insertions(+), 168 deletions(-) diff --git a/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.defaults b/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.defaults index ae993ca7ef63fc..18d3e7889ae1a2 100644 --- a/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.defaults +++ b/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.defaults @@ -97,3 +97,7 @@ config NRF_802154_SER_RADIO config NRF_RTC_TIMER_USER_CHAN_COUNT int default 2 + +config NRF_802154_ENCRYPTION + bool + default y diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 748047ca5a85d7..b47aa808439ea2 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -139,6 +139,12 @@ config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT help Enables Thread Sleepy End Device support in Matter. +config CHIP_THREAD_SSED + bool "Enable Thread Synchronized Sleepy End Device support" + depends on OPENTHREAD_CSL_RECEIVER && CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT + help + Enables Thread Synchronized Sleepy End Device support in Matter. + config CHIP_OTA_REQUESTOR bool "Enable OTA requestor" help diff --git a/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h index 625dd7ae7b361a..59863c6a38949e 100644 --- a/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -30,6 +30,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -#define CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL 2000_ms32 +#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32 #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h index 862c63c8b5c02e..3360f4cb60d62e 100644 --- a/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -30,5 +30,5 @@ /* Use a default pairing code if one hasn't been provisioned in flash. */ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -#define CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL 2000_ms32 +#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32 #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h index 4dfcd9bb79779b..1eb34c2c8eb0bb 100644 --- a/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -31,6 +31,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -#define CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL 2000_ms32 +#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32 #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 839dd07cc42a06..e353245107691c 100644 --- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -139,8 +139,8 @@ #define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 -#define CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL 1000_ms32 -#define CHIP_DEVICE_CONFIG_SED_FAST_POLLING_INTERVAL 100_ms32 +#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 1000_ms32 +#define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL 100_ms32 /** * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 455337c5de8d9a..f9e1c639ef598e 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -339,7 +339,7 @@ CHIP_ERROR CommissioningWindowManager::StartAdvertisement() #if CHIP_DEVICE_CONFIG_ENABLE_SED if (!mIsBLE && mWindowStatus == AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen) { - DeviceLayer::ConnectivityMgr().RequestSEDFastPollingMode(true); + DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(true); } #endif @@ -381,7 +381,7 @@ CHIP_ERROR CommissioningWindowManager::StopAdvertisement(bool aShuttingDown) #if CHIP_DEVICE_CONFIG_ENABLE_SED if (!mIsBLE && mWindowStatus != AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen) { - DeviceLayer::ConnectivityMgr().RequestSEDFastPollingMode(false); + DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(false); } #endif diff --git a/src/app/server/Dnssd.cpp b/src/app/server/Dnssd.cpp index 3f8bf616cf5700..96e409030c45d8 100644 --- a/src/app/server/Dnssd.cpp +++ b/src/app/server/Dnssd.cpp @@ -47,7 +47,7 @@ void OnPlatformEvent(const DeviceLayer::ChipDeviceEvent * event) { if (event->Type == DeviceLayer::DeviceEventType::kDnssdPlatformInitialized #if CHIP_DEVICE_CONFIG_ENABLE_SED - || event->Type == DeviceLayer::DeviceEventType::kSEDPollingIntervalChange + || event->Type == DeviceLayer::DeviceEventType::kSEDIntervalChange #endif ) { diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index 4b45de6424aa42..105cf23e25af52 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -126,23 +126,23 @@ #endif /** - * CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL + * CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL * - * The default amount of time in milliseconds that the sleepy end device will use as a slow-polling interval. + * The default amount of time in milliseconds that the sleepy end device will use as an idle interval. * This interval is used by the device to periodically wake up and poll the data in the idle mode. */ -#ifndef CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL -#define CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL 5000_ms32 +#ifndef CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL +#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 5000_ms32 #endif /** - * CHIP_DEVICE_CONFIG_SED_FAST_POLLING_INTERVAL + * CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL * - * The default amount of time in milliseconds that the sleepy end device will use as a fast-polling interval. + * The default amount of time in milliseconds that the sleepy end device will use as an active interval. * This interval is used by the device to periodically wake up and poll the data in the active mode. */ -#ifndef CHIP_DEVICE_CONFIG_SED_FAST_POLLING_INTERVAL -#define CHIP_DEVICE_CONFIG_SED_FAST_POLLING_INTERVAL 200_ms32 +#ifndef CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL +#define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL 200_ms32 #endif // -------------------- Device Identification Configuration -------------------- @@ -691,6 +691,16 @@ #define CHIP_DEVICE_CONFIG_THREAD_FTD 1 #endif +/** + * CHIP_DEVICE_CONFIG_THREAD_SSED + * + * Enable support for Thread Synchronized Sleepy End Device behavior. + * + */ +#ifndef CHIP_DEVICE_CONFIG_THREAD_SSED +#define CHIP_DEVICE_CONFIG_THREAD_SSED 0 +#endif + /** * CHIP_DEVICE_CONFIG_THREAD_TASK_NAME * diff --git a/src/include/platform/CHIPDeviceEvent.h b/src/include/platform/CHIPDeviceEvent.h index f5988a7a4ffc4d..2ff9526b58ce28 100644 --- a/src/include/platform/CHIPDeviceEvent.h +++ b/src/include/platform/CHIPDeviceEvent.h @@ -161,11 +161,11 @@ enum PublicEventTypes kTimeSyncChange, /** - * SED Polling Interval Change + * SED Interval Change * - * Signals a change to the sleepy end device polling interval. + * Signals a change to the sleepy end device interval. */ - kSEDPollingIntervalChange, + kSEDIntervalChange, /** * Security Session Established diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 32824e2fd6462e..105f70a74ee506 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -133,11 +133,12 @@ class ConnectivityManager enum ThreadDeviceType { - kThreadDeviceType_NotSupported = 0, - kThreadDeviceType_Router = 1, - kThreadDeviceType_FullEndDevice = 2, - kThreadDeviceType_MinimalEndDevice = 3, - kThreadDeviceType_SleepyEndDevice = 4, + kThreadDeviceType_NotSupported = 0, + kThreadDeviceType_Router = 1, + kThreadDeviceType_FullEndDevice = 2, + kThreadDeviceType_MinimalEndDevice = 3, + kThreadDeviceType_SleepyEndDevice = 4, + kThreadDeviceType_SynchronizedSleepyEndDevice = 5, }; enum BLEAdvertisingMode @@ -146,13 +147,13 @@ class ConnectivityManager kSlowAdvertising = 1, }; - enum class SEDPollingMode + enum class SEDIntervalMode { Idle = 0, Active = 1, }; - struct SEDPollingConfig; + struct SEDIntervalsConfig; void SetDelegate(ConnectivityManagerDelegate * delegate) { mDelegate = delegate; } ConnectivityManagerDelegate * GetDelegate() const { return mDelegate; } @@ -195,24 +196,24 @@ class ConnectivityManager // Sleepy end device methods #if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR GetSEDPollingConfig(SEDPollingConfig & pollingConfig); + CHIP_ERROR GetSEDIntervalsConfig(SEDIntervalsConfig & intervalsConfig); /** - * Sets Sleepy End Device polling configuration and posts kSEDPollingIntervalChange event to inform other software + * Sets Sleepy End Device intervals configuration and posts kSEDIntervalChange event to inform other software * modules about the change. * - * @param[in] pollingConfig polling intervals configuration to be set + * @param[in] intervalsConfig intervals configuration to be set */ - CHIP_ERROR SetSEDPollingConfig(const SEDPollingConfig & pollingConfig); + CHIP_ERROR SetSEDIntervalsConfig(const SEDIntervalsConfig & intervalsConfig); /** - * Requests setting Sleepy End Device fast polling interval on or off. - * Every method call with onOff parameter set to true or false results in incrementing or decrementing the fast polling - * consumers counter. Fast polling mode is set if the consumers counter is bigger than 0. + * Requests setting Sleepy End Device active interval on or off. + * Every method call with onOff parameter set to true or false results in incrementing or decrementing the active mode + * consumers counter. Active mode is set if the consumers counter is bigger than 0. * - * @param[in] onOff true if fast polling should be enabled and false otherwise. + * @param[in] onOff true if active mode should be enabled and false otherwise. */ - CHIP_ERROR RequestSEDFastPollingMode(bool onOff); + CHIP_ERROR RequestSEDActiveMode(bool onOff); #endif // CHIPoBLE service methods @@ -271,17 +272,17 @@ class ConnectivityManager }; /** - * Information describing the desired polling behavior of a sleepy end device (SED). + * Information describing the desired intervals for a sleepy end device (SED). */ -struct ConnectivityManager::SEDPollingConfig +struct ConnectivityManager::SEDIntervalsConfig { - /** Interval at which the device polls its parent when there are active chip exchanges in progress. Only meaningful when the - * device is acting as a sleepy end node. */ - System::Clock::Milliseconds32 FastPollingIntervalMS; + /** Interval at which the device is able to communicate with its parent when there are active chip exchanges in progress. Only + * meaningful when the device is acting as a sleepy end node. */ + System::Clock::Milliseconds32 ActiveIntervalMS; - /** Interval at which the device polls its parent when there are NO active chip exchanges in progress. Only meaningful when the - * device is acting as a sleepy end node. */ - System::Clock::Milliseconds32 SlowPollingIntervalMS; + /** Interval at which the device is able to communicate with its parent when there are NO active chip exchanges in progress. + * Only meaningful when the device is acting as a sleepy end node. */ + System::Clock::Milliseconds32 IdleIntervalMS; }; /** @@ -442,19 +443,19 @@ inline CHIP_ERROR ConnectivityManager::SetThreadDeviceType(ThreadDeviceType devi } #if CHIP_DEVICE_CONFIG_ENABLE_SED -inline CHIP_ERROR ConnectivityManager::GetSEDPollingConfig(SEDPollingConfig & pollingConfig) +inline CHIP_ERROR ConnectivityManager::GetSEDIntervalsConfig(SEDIntervalsConfig & intervalsConfig) { - return static_cast(this)->_GetSEDPollingConfig(pollingConfig); + return static_cast(this)->_GetSEDIntervalsConfig(intervalsConfig); } -inline CHIP_ERROR ConnectivityManager::SetSEDPollingConfig(const SEDPollingConfig & pollingConfig) +inline CHIP_ERROR ConnectivityManager::SetSEDIntervalsConfig(const SEDIntervalsConfig & intervalsConfig) { - return static_cast(this)->_SetSEDPollingConfig(pollingConfig); + return static_cast(this)->_SetSEDIntervalsConfig(intervalsConfig); } -inline CHIP_ERROR ConnectivityManager::RequestSEDFastPollingMode(bool onOff) +inline CHIP_ERROR ConnectivityManager::RequestSEDActiveMode(bool onOff) { - return static_cast(this)->_RequestSEDFastPollingMode(onOff); + return static_cast(this)->_RequestSEDActiveMode(onOff); } #endif diff --git a/src/include/platform/ThreadStackManager.h b/src/include/platform/ThreadStackManager.h index f236835f832d1e..5ce7ec1dd09ea6 100644 --- a/src/include/platform/ThreadStackManager.h +++ b/src/include/platform/ThreadStackManager.h @@ -163,24 +163,24 @@ class ThreadStackManager CHIP_ERROR SetThreadDeviceType(ConnectivityManager::ThreadDeviceType threadRole); #if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig); + CHIP_ERROR GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); /** - * Sets Sleepy End Device polling configuration and posts kSEDPollingIntervalChange event to inform other software + * Sets Sleepy End Device intervals configuration and posts kSEDIntervalChange event to inform other software * modules about the change. * - * @param[in] pollingConfig polling intervals configuration to be set + * @param[in] intervalsConfig intervals configuration to be set */ - CHIP_ERROR SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig); + CHIP_ERROR SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); /** - * Requests setting Sleepy End Device fast polling interval on or off. - * Every method call with onOff parameter set to true or false results in incrementing or decrementing the fast polling - * consumers counter. Fast polling mode is set if the consumers counter is bigger than 0. + * Requests setting Sleepy End Device active interval on or off. + * Every method call with onOff parameter set to true or false results in incrementing or decrementing the active mode + * consumers counter. Active mode is set if the consumers counter is bigger than 0. * - * @param[in] onOff true if fast polling should be enabled and false otherwise. + * @param[in] onOff true if active mode should be enabled and false otherwise. */ - CHIP_ERROR RequestSEDFastPollingMode(bool onOff); + CHIP_ERROR RequestSEDActiveMode(bool onOff); #endif bool HaveMeshConnectivity(); @@ -390,19 +390,19 @@ inline CHIP_ERROR ThreadStackManager::SetThreadDeviceType(ConnectivityManager::T } #if CHIP_DEVICE_CONFIG_ENABLE_SED -inline CHIP_ERROR ThreadStackManager::GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig) +inline CHIP_ERROR ThreadStackManager::GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { - return static_cast(this)->_GetSEDPollingConfig(pollingConfig); + return static_cast(this)->_GetSEDIntervalsConfig(intervalsConfig); } -inline CHIP_ERROR ThreadStackManager::SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig) +inline CHIP_ERROR ThreadStackManager::SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { - return static_cast(this)->_SetSEDPollingConfig(pollingConfig); + return static_cast(this)->_SetSEDIntervalsConfig(intervalsConfig); } -inline CHIP_ERROR ThreadStackManager::RequestSEDFastPollingMode(bool onOff) +inline CHIP_ERROR ThreadStackManager::RequestSEDActiveMode(bool onOff) { - return static_cast(this)->_RequestSEDFastPollingMode(onOff); + return static_cast(this)->_RequestSEDActiveMode(onOff); } #endif diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_NoThread.h b/src/include/platform/internal/GenericConnectivityManagerImpl_NoThread.h index e25dcb4ff8aea4..e4bb6cf9f31e80 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_NoThread.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_NoThread.h @@ -50,9 +50,9 @@ class GenericConnectivityManagerImpl_NoThread bool _IsThreadApplicationControlled(void); ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(void); CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); - CHIP_ERROR _GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _RequestSEDFastPollingMode(bool onOff); + CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); + CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); + CHIP_ERROR _RequestSEDActiveMode(bool onOff); bool _IsThreadAttached(void); bool _IsThreadProvisioned(void); void _ErasePersistentInfo(void); @@ -116,21 +116,21 @@ GenericConnectivityManagerImpl_NoThread::_SetThreadDeviceType(Connect } template -inline CHIP_ERROR -GenericConnectivityManagerImpl_NoThread::_GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig) +inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread::_GetSEDIntervalsConfig( + ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } template -inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread::_SetSEDPollingConfig( - const ConnectivityManager::SEDPollingConfig & pollingConfig) +inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread::_SetSEDIntervalsConfig( + const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } template -inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread::_RequestSEDFastPollingMode(bool onOff) +inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread::_RequestSEDActiveMode(bool onOff) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h index 2c34aa81b921f8..84cf4f04da31aa 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h @@ -64,9 +64,9 @@ class GenericConnectivityManagerImpl_Thread ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(); CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); #if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _RequestSEDFastPollingMode(bool onOff); + CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); + CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); + CHIP_ERROR _RequestSEDActiveMode(bool onOff); #endif bool _IsThreadAttached(); bool _IsThreadProvisioned(); @@ -144,22 +144,22 @@ GenericConnectivityManagerImpl_Thread::_SetThreadDeviceType(Connectiv #if CHIP_DEVICE_CONFIG_ENABLE_SED template inline CHIP_ERROR -GenericConnectivityManagerImpl_Thread::_GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig) +GenericConnectivityManagerImpl_Thread::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { - return ThreadStackMgrImpl().GetSEDPollingConfig(pollingConfig); + return ThreadStackMgrImpl().GetSEDIntervalsConfig(intervalsConfig); } template -inline CHIP_ERROR -GenericConnectivityManagerImpl_Thread::_SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig) +inline CHIP_ERROR GenericConnectivityManagerImpl_Thread::_SetSEDIntervalsConfig( + const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { - return ThreadStackMgrImpl().SetSEDPollingConfig(pollingConfig); + return ThreadStackMgrImpl().SetSEDIntervalsConfig(intervalsConfig); } template -inline CHIP_ERROR GenericConnectivityManagerImpl_Thread::_RequestSEDFastPollingMode(bool onOff) +inline CHIP_ERROR GenericConnectivityManagerImpl_Thread::_RequestSEDActiveMode(bool onOff) { - return ThreadStackMgrImpl().RequestSEDFastPollingMode(onOff); + return ThreadStackMgrImpl().RequestSEDActiveMode(onOff); } #endif diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index c75c687ea5e5e2..28592c19457d06 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -85,13 +85,13 @@ void ExchangeContext::SetResponseTimeout(Timeout timeout) } #if CONFIG_DEVICE_LAYER && CHIP_DEVICE_CONFIG_ENABLE_SED -void ExchangeContext::UpdateSEDPollingMode() +void ExchangeContext::UpdateSEDIntervalMode() { if (!HasSessionHandle()) { // After the session has been deleted, no further communication can occur on the exchange, - // so withdraw a SED fast-polling mode request. - UpdateSEDPollingMode(false); + // so withdraw a SED active mode request. + UpdateSEDIntervalMode(false); return; } @@ -110,15 +110,15 @@ void ExchangeContext::UpdateSEDPollingMode() } VerifyOrReturn(address.GetTransportType() != Transport::Type::kBle); - UpdateSEDPollingMode(IsResponseExpected() || IsSendExpected() || IsMessageNotAcked()); + UpdateSEDIntervalMode(IsResponseExpected() || IsSendExpected() || IsMessageNotAcked()); } -void ExchangeContext::UpdateSEDPollingMode(bool fastPollingMode) +void ExchangeContext::UpdateSEDIntervalMode(bool activeMode) { - if (fastPollingMode != IsRequestingFastPollingMode()) + if (activeMode != IsRequestingActiveMode()) { - SetRequestingFastPollingMode(fastPollingMode); - DeviceLayer::ConnectivityMgr().RequestSEDFastPollingMode(fastPollingMode); + SetRequestingActiveMode(activeMode); + DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(activeMode); } } #endif @@ -301,8 +301,8 @@ ExchangeContext::~ExchangeContext() VerifyOrDie(!IsAckPending()); #if CONFIG_DEVICE_LAYER && CHIP_DEVICE_CONFIG_ENABLE_SED - // Make sure that the exchange withdraws the request for Sleepy End Device fast-polling mode. - UpdateSEDPollingMode(false); + // Make sure that the exchange withdraws the request for Sleepy End Device active mode. + UpdateSEDIntervalMode(false); #endif // Ideally, in this scenario, the retransmit table should @@ -482,7 +482,7 @@ CHIP_ERROR ExchangeContext::HandleMessage(uint32_t messageCounter, const Payload void ExchangeContext::MessageHandled() { #if CONFIG_DEVICE_LAYER && CHIP_DEVICE_CONFIG_ENABLE_SED - UpdateSEDPollingMode(); + UpdateSEDIntervalMode(); #endif if (mFlags.Has(Flags::kFlagClosed) || IsResponseExpected() || IsSendExpected()) diff --git a/src/messaging/ExchangeContext.h b/src/messaging/ExchangeContext.h index 94a75200f3500b..ec4b4916070038 100644 --- a/src/messaging/ExchangeContext.h +++ b/src/messaging/ExchangeContext.h @@ -240,23 +240,23 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, void MessageHandled(); /** - * Updates Sleepy End Device polling mode in the following way: + * Updates Sleepy End Device intervals mode in the following way: * - does nothing for exchanges over Bluetooth LE - * - requests fast-polling (active) mode if there are more messages, + * - requests active mode if there are more messages, * including MRP acknowledgements, expected to be sent or received on * this exchange. - * - withdraws the request for fast-polling (active) mode, otherwise. + * - withdraws the request for active mode, otherwise. */ - void UpdateSEDPollingMode(); + void UpdateSEDIntervalMode(); /** - * Requests or withdraws the request for Sleepy End Device fast-polling mode + * Requests or withdraws the request for Sleepy End Device active mode * based on the argument value. * - * Note that the device switches to the slow-polling (idle) mode if no - * exchange nor other component requests the fast-polling mode. + * Note that the device switches to the idle mode if no + * exchange nor other component requests the active mode. */ - void UpdateSEDPollingMode(bool fastPollingMode); + void UpdateSEDIntervalMode(bool activeMode); }; } // namespace Messaging diff --git a/src/messaging/ReliableMessageContext.h b/src/messaging/ReliableMessageContext.h index f82e94201d8a64..804b358ea294cb 100644 --- a/src/messaging/ReliableMessageContext.h +++ b/src/messaging/ReliableMessageContext.h @@ -135,11 +135,11 @@ class ReliableMessageContext /// Set whether there is a message hasn't been acknowledged. void SetMessageNotAcked(bool messageNotAcked); - /// Set if this exchange is requesting Sleepy End Device fast-polling mode - void SetRequestingFastPollingMode(bool fastPollingMode); + /// Set if this exchange is requesting Sleepy End Device active mode + void SetRequestingActiveMode(bool activeMode); - /// Determine whether this exchange is requesting Sleepy End Device fast-polling mode - bool IsRequestingFastPollingMode() const; + /// Determine whether this exchange is requesting Sleepy End Device active mode + bool IsRequestingActiveMode() const; /** * Get the reliable message manager that corresponds to this reliable @@ -180,8 +180,8 @@ class ReliableMessageContext /// When set, we have had Close() or Abort() called on us already. kFlagClosed = (1u << 8), - /// When set, signifies that the exchange is requesting Sleepy End Device fast-polling mode. - kFlagFastPollingMode = (1u << 9), + /// When set, signifies that the exchange is requesting Sleepy End Device active mode. + kFlagActiveMode = (1u << 9), }; BitFlags mFlags; // Internal state flags @@ -238,9 +238,9 @@ inline bool ReliableMessageContext::HasPiggybackAckPending() const return mFlags.Has(Flags::kFlagAckMessageCounterIsValid); } -inline bool ReliableMessageContext::IsRequestingFastPollingMode() const +inline bool ReliableMessageContext::IsRequestingActiveMode() const { - return mFlags.Has(Flags::kFlagFastPollingMode); + return mFlags.Has(Flags::kFlagActiveMode); } inline void ReliableMessageContext::SetAutoRequestAck(bool autoReqAck) @@ -263,9 +263,9 @@ inline void ReliableMessageContext::SetMessageNotAcked(bool messageNotAcked) mFlags.Set(Flags::kFlagMessageNotAcked, messageNotAcked); } -inline void ReliableMessageContext::SetRequestingFastPollingMode(bool fastPollingMode) +inline void ReliableMessageContext::SetRequestingActiveMode(bool activeMode) { - mFlags.Set(Flags::kFlagFastPollingMode, fastPollingMode); + mFlags.Set(Flags::kFlagActiveMode, activeMode); } } // namespace Messaging diff --git a/src/messaging/ReliableMessageProtocolConfig.cpp b/src/messaging/ReliableMessageProtocolConfig.cpp index 3404ad97623957..6132a240cbaed3 100644 --- a/src/messaging/ReliableMessageProtocolConfig.cpp +++ b/src/messaging/ReliableMessageProtocolConfig.cpp @@ -37,14 +37,14 @@ ReliableMessageProtocolConfig GetLocalMRPConfig() CHIP_CONFIG_MRP_DEFAULT_ACTIVE_RETRY_INTERVAL); #if CHIP_DEVICE_CONFIG_ENABLE_SED - DeviceLayer::ConnectivityManager::SEDPollingConfig sedPollingConfig; + DeviceLayer::ConnectivityManager::SEDIntervalsConfig sedIntervalsConfig; - if (DeviceLayer::ConnectivityMgr().GetSEDPollingConfig(sedPollingConfig) == CHIP_NO_ERROR) + if (DeviceLayer::ConnectivityMgr().GetSEDIntervalsConfig(sedIntervalsConfig) == CHIP_NO_ERROR) { - // Increase default MRP retry intervals by SED polling intervals. That is, intervals for + // Increase default MRP retry intervals by SED intervals. That is, intervals for // which the device can be at sleep and not be able to receive any messages). - config.mIdleRetransTimeout += sedPollingConfig.SlowPollingIntervalMS; - config.mActiveRetransTimeout += sedPollingConfig.FastPollingIntervalMS; + config.mIdleRetransTimeout += sedIntervalsConfig.IdleIntervalMS; + config.mActiveRetransTimeout += sedIntervalsConfig.ActiveIntervalMS; } #endif diff --git a/src/platform/Linux/ThreadStackManagerImpl.cpp b/src/platform/Linux/ThreadStackManagerImpl.cpp index 1b547bf02198a5..b02e14d9d37930 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.cpp +++ b/src/platform/Linux/ThreadStackManagerImpl.cpp @@ -480,27 +480,27 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadDeviceType(ConnectivityManager::Thr } #if CHIP_DEVICE_CONFIG_ENABLE_SED -CHIP_ERROR ThreadStackManagerImpl::_GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig) +CHIP_ERROR ThreadStackManagerImpl::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { - (void) pollingConfig; + (void) intervalsConfig; - ChipLogError(DeviceLayer, "Polling config is not supported on linux"); + ChipLogError(DeviceLayer, "SED intervals config is not supported on linux"); return CHIP_ERROR_NOT_IMPLEMENTED; } -CHIP_ERROR ThreadStackManagerImpl::_SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig) +CHIP_ERROR ThreadStackManagerImpl::_SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { - (void) pollingConfig; + (void) intervalsConfig; - ChipLogError(DeviceLayer, "Polling config is not supported on linux"); + ChipLogError(DeviceLayer, "SED intervals config is not supported on linux"); return CHIP_ERROR_NOT_IMPLEMENTED; } -CHIP_ERROR ThreadStackManagerImpl::_RequestSEDFastPollingMode(bool onOff) +CHIP_ERROR ThreadStackManagerImpl::_RequestSEDActiveMode(bool onOff) { (void) onOff; - ChipLogError(DeviceLayer, "Polling config is not supported on linux"); + ChipLogError(DeviceLayer, "SED intervals config is not supported on linux"); return CHIP_ERROR_NOT_IMPLEMENTED; } #endif diff --git a/src/platform/Linux/ThreadStackManagerImpl.h b/src/platform/Linux/ThreadStackManagerImpl.h index f112c065a65de5..cb86c1e9e695c8 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.h +++ b/src/platform/Linux/ThreadStackManagerImpl.h @@ -87,9 +87,9 @@ class ThreadStackManagerImpl : public ThreadStackManager CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); #if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _RequestSEDFastPollingMode(bool onOff); + CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); + CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); + CHIP_ERROR _RequestSEDActiveMode(bool onOff); #endif bool _HaveMeshConnectivity(); diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp index a43809ff08fba7..5d786ca9815ce2 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp @@ -467,6 +467,11 @@ ConnectivityManager::ThreadDeviceType GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec #endif case ConnectivityManager::kThreadDeviceType_MinimalEndDevice: case ConnectivityManager::kThreadDeviceType_SleepyEndDevice: +#if CHIP_DEVICE_CONFIG_THREAD_SSED + case ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice: +#endif break; default: ExitNow(err = CHIP_ERROR_INVALID_ARGUMENT); @@ -512,6 +520,11 @@ GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec case ConnectivityManager::kThreadDeviceType_SleepyEndDevice: deviceTypeStr = "SLEEPY END DEVICE"; break; +#if CHIP_DEVICE_CONFIG_THREAD_SSED + case ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice: + deviceTypeStr = "SYNCHRONIZED SLEEPY END DEVICE"; + break; +#endif default: deviceTypeStr = "(unknown)"; break; @@ -540,6 +553,7 @@ GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec linkMode.mRxOnWhenIdle = true; break; case ConnectivityManager::kThreadDeviceType_SleepyEndDevice: + case ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice: linkMode.mDeviceType = false; linkMode.mRxOnWhenIdle = false; break; @@ -1634,14 +1648,14 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::DoInit(otInstanc mOTInst = otInst; #if CHIP_DEVICE_CONFIG_ENABLE_SED - ConnectivityManager::SEDPollingConfig sedPollingConfig; + ConnectivityManager::SEDIntervalsConfig sedIntervalsConfig; using namespace System::Clock::Literals; - sedPollingConfig.FastPollingIntervalMS = CHIP_DEVICE_CONFIG_SED_FAST_POLLING_INTERVAL; - sedPollingConfig.SlowPollingIntervalMS = CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL; - err = _SetSEDPollingConfig(sedPollingConfig); + sedIntervalsConfig.ActiveIntervalMS = CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL; + sedIntervalsConfig.IdleIntervalMS = CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL; + err = _SetSEDIntervalsConfig(sedIntervalsConfig); if (err != CHIP_NO_ERROR) { - ChipLogError(DeviceLayer, "Sleepy end device polling config set failed: %s", ErrorStr(err)); + ChipLogError(DeviceLayer, "Failed to set sleepy end device intervals: %s", ErrorStr(err)); } SuccessOrExit(err); #endif @@ -1680,6 +1694,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::DoInit(otInstanc initNetworkCommissioningThreadDriver(); exit: + ChipLogProgress(DeviceLayer, "OpenThread started: %s", otThreadErrorToString(otErr)); return err; } @@ -1699,31 +1714,31 @@ bool GenericThreadStackManagerImpl_OpenThread::IsThreadInterfaceUpNoL #if CHIP_DEVICE_CONFIG_ENABLE_SED template -CHIP_ERROR -GenericThreadStackManagerImpl_OpenThread::_GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig) +CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetSEDIntervalsConfig( + ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { - pollingConfig = mPollingConfig; + intervalsConfig = mIntervalsConfig; return CHIP_NO_ERROR; } template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetSEDPollingConfig( - const ConnectivityManager::SEDPollingConfig & pollingConfig) +CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetSEDIntervalsConfig( + const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) { using namespace System::Clock::Literals; - if ((pollingConfig.SlowPollingIntervalMS < pollingConfig.FastPollingIntervalMS) || - (pollingConfig.SlowPollingIntervalMS == 0_ms32) || (pollingConfig.FastPollingIntervalMS == 0_ms32)) + if ((intervalsConfig.IdleIntervalMS < intervalsConfig.ActiveIntervalMS) || (intervalsConfig.IdleIntervalMS == 0_ms32) || + (intervalsConfig.ActiveIntervalMS == 0_ms32)) { return CHIP_ERROR_INVALID_ARGUMENT; } - mPollingConfig = pollingConfig; + mIntervalsConfig = intervalsConfig; - CHIP_ERROR err = SetSEDPollingMode(mPollingMode); + CHIP_ERROR err = SetSEDIntervalMode(mIntervalsMode); if (err == CHIP_NO_ERROR) { ChipDeviceEvent event; - event.Type = DeviceEventType::kSEDPollingIntervalChange; + event.Type = DeviceEventType::kSEDIntervalChange; err = chip::DeviceLayer::PlatformMgr().PostEvent(&event); } @@ -1731,65 +1746,79 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetSEDPollingCo } template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::SetSEDPollingMode(ConnectivityManager::SEDPollingMode pollingType) +CHIP_ERROR +GenericThreadStackManagerImpl_OpenThread::SetSEDIntervalMode(ConnectivityManager::SEDIntervalMode intervalType) { CHIP_ERROR err = CHIP_NO_ERROR; System::Clock::Milliseconds32 interval; - if (pollingType == ConnectivityManager::SEDPollingMode::Idle) + if (intervalType == ConnectivityManager::SEDIntervalMode::Idle) { - interval = mPollingConfig.SlowPollingIntervalMS; + interval = mIntervalsConfig.IdleIntervalMS; } - else if (pollingType == ConnectivityManager::SEDPollingMode::Active) + else if (intervalType == ConnectivityManager::SEDIntervalMode::Active) { - interval = mPollingConfig.FastPollingIntervalMS; + interval = mIntervalsConfig.ActiveIntervalMS; } else { return CHIP_ERROR_INVALID_ARGUMENT; } - mPollingMode = pollingType; + mIntervalsMode = intervalType; Impl()->LockThreadStack(); - uint32_t curPollingIntervalMS = otLinkGetPollPeriod(mOTInst); +// For Thread devices, the intervals are defined as: +// * poll period for SED devices that poll the parent for data +// * CSL period for SSED devices that listen for messages in scheduled time slots. +#if CHIP_DEVICE_CONFIG_THREAD_SSED + // Get CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds. + uint32_t curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000; +#else + uint32_t curIntervalMS = otLinkGetPollPeriod(mOTInst); +#endif - if (interval.count() != curPollingIntervalMS) + if (interval.count() != curIntervalMS) { +#if CHIP_DEVICE_CONFIG_THREAD_SSED + // Set CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds. + otError otErr = otLinkCslSetPeriod(mOTInst, interval.count() * 1000 / OT_US_PER_TEN_SYMBOLS); +#else otError otErr = otLinkSetPollPeriod(mOTInst, interval.count()); - err = MapOpenThreadError(otErr); +#endif + err = MapOpenThreadError(otErr); } Impl()->UnlockThreadStack(); - if (interval.count() != curPollingIntervalMS) + if (interval.count() != curIntervalMS) { - ChipLogProgress(DeviceLayer, "OpenThread polling interval set to %" PRId32 "ms", interval.count()); + ChipLogProgress(DeviceLayer, "OpenThread SED interval set to %" PRId32 "ms", interval.count()); } return err; } template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_RequestSEDFastPollingMode(bool onOff) +CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_RequestSEDActiveMode(bool onOff) { CHIP_ERROR err = CHIP_NO_ERROR; - ConnectivityManager::SEDPollingMode mode; + ConnectivityManager::SEDIntervalMode mode; if (onOff) { - mFastPollingConsumers++; + mActiveModeConsumers++; } else { - if (mFastPollingConsumers > 0) - mFastPollingConsumers--; + if (mActiveModeConsumers > 0) + mActiveModeConsumers--; } - mode = mFastPollingConsumers > 0 ? ConnectivityManager::SEDPollingMode::Active : ConnectivityManager::SEDPollingMode::Idle; + mode = mActiveModeConsumers > 0 ? ConnectivityManager::SEDIntervalMode::Active : ConnectivityManager::SEDIntervalMode::Idle; - if (mPollingMode != mode) - err = SetSEDPollingMode(mode); + if (mIntervalsMode != mode) + err = SetSEDIntervalMode(mode); return err; } diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h index e3395ec147145c..397658b146ee5f 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h @@ -101,9 +101,9 @@ class GenericThreadStackManagerImpl_OpenThread void _UpdateNetworkStatus(); #if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _RequestSEDFastPollingMode(bool onOff); + CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); + CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); + CHIP_ERROR _RequestSEDActiveMode(bool onOff); #endif bool _HaveMeshConnectivity(void); @@ -157,9 +157,9 @@ class GenericThreadStackManagerImpl_OpenThread NetworkCommissioning::Internal::BaseDriver::NetworkStatusChangeCallback * mpStatusChangeCallback = nullptr; #if CHIP_DEVICE_CONFIG_ENABLE_SED - ConnectivityManager::SEDPollingConfig mPollingConfig; - ConnectivityManager::SEDPollingMode mPollingMode = ConnectivityManager::SEDPollingMode::Idle; - uint32_t mFastPollingConsumers = 0; + ConnectivityManager::SEDIntervalsConfig mIntervalsConfig; + ConnectivityManager::SEDIntervalMode mIntervalsMode = ConnectivityManager::SEDIntervalMode::Idle; + uint32_t mActiveModeConsumers = 0; #endif #if CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT @@ -271,7 +271,7 @@ class GenericThreadStackManagerImpl_OpenThread void OnJoinerComplete(otError aError); #if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR SetSEDPollingMode(ConnectivityManager::SEDPollingMode pollingType); + CHIP_ERROR SetSEDIntervalMode(ConnectivityManager::SEDIntervalMode intervalType); #endif inline ImplClass * Impl() { return static_cast(this); } diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index 52479283b23825..0861f7ebc79527 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -116,6 +116,7 @@ #ifdef CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 +#define CHIP_DEVICE_CONFIG_THREAD_SSED CONFIG_CHIP_THREAD_SSED #endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT #ifdef CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE From fdf51628f6c45c9dbb38ef98cf3e131ed6ae4d59 Mon Sep 17 00:00:00 2001 From: carricdsilva-apple <59451741+carricdsilva-apple@users.noreply.github.com> Date: Wed, 27 Apr 2022 21:32:25 -0700 Subject: [PATCH 23/59] Allow modifying the window covering cluster and power source cluster attrs from the M5Stack (#17792) --- .../esp32/main/DeviceWithDisplay.cpp | 75 ++++++++++++++++++- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp index a829d17cada279..939046533ff7a7 100644 --- a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp @@ -196,6 +196,30 @@ class EditAttributeListModel : public TouchesMatterStackModel ESP_LOGI(TAG, "SystemMode changed to : %d", n); app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::Set(1, n); } + else if (name == "Current Lift") + { + // update the current lift here for hardcoded endpoint 1 + ESP_LOGI(TAG, "Current position lift percent 100ths changed to : %d", n * 100); + app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Set(1, static_cast(n * 100)); + } + else if (name == "Current Tilt") + { + // update the current tilt here for hardcoded endpoint 1 + ESP_LOGI(TAG, "Current position tilt percent 100ths changed to : %d", n * 100); + app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Set(1, static_cast(n * 100)); + } + else if (name == "Opr Status") + { + // update the operational status here for hardcoded endpoint 1 + ESP_LOGI(TAG, "Operational status changed to : %d", n); + app::Clusters::WindowCovering::Attributes::OperationalStatus::Set(1, static_cast(n)); + } + else if (name == "Bat remaining") + { + // update the battery percent remaining here for hardcoded endpoint 1 + ESP_LOGI(TAG, "Battery percent remaining changed to : %d", n); + app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::Set(1, static_cast(n * 2)); + } value = buffer; } else if (IsBooleanAttribute()) @@ -223,18 +247,47 @@ class EditAttributeListModel : public TouchesMatterStackModel else { auto & name = std::get<0>(attribute); - auto & cluster = std::get<0>(std::get<1>(std::get<1>(devices[deviceIndex])[endpointIndex])[i]); + auto & cluster = std::get<0>(std::get<1>(std::get<1>(devices[deviceIndex])[endpointIndex])[0]); ESP_LOGI(TAG, "editing attribute as string: '%s' (%s)", value.c_str(), i == 0 ? "+" : "-"); - value = (value == "Closed") ? "Open" : "Closed"; ESP_LOGI(TAG, "name and cluster: '%s' (%s)", name.c_str(), cluster.c_str()); if (name == "State" && cluster == "Lock") { + value = (value == "Closed") ? "Open" : "Closed"; using namespace chip::app::Clusters; // update the doorlock attribute here auto attributeValue = value == "Closed" ? DoorLock::DlLockState::kLocked : DoorLock::DlLockState::kUnlocked; DoorLock::Attributes::LockState::Set(DOOR_LOCK_SERVER_ENDPOINT, attributeValue); } + else if (name == "Charge level" && cluster == "Power Source") + { + using namespace chip::app::Clusters::PowerSource; + auto attributeValue = BatChargeLevel::kOk; + + if (value == "OK") + { + value = "Warning"; + attributeValue = BatChargeLevel::kWarning; + } + else if (value == "Warning") + { + value = "Critical"; + attributeValue = BatChargeLevel::kCritical; + } + else + { + value = "OK"; + attributeValue = BatChargeLevel::kOk; + } + + // update the battery charge level here for hardcoded endpoint 1 + ESP_LOGI(TAG, "Battery charge level changed to : %u", static_cast(attributeValue)); + app::Clusters::PowerSource::Attributes::BatteryChargeLevel::Set(1, static_cast(attributeValue)); + } + else + { + value = (value == "Closed") ? "Open" : "Closed"; + } } } }; @@ -520,6 +573,24 @@ void SetupPretendDevices() app::Clusters::ColorControl::Attributes::CurrentHue::Set(1, 200); AddAttribute("Current Saturation\n", "150"); app::Clusters::ColorControl::Attributes::CurrentSaturation::Set(1, 150); + + AddDevice("Window Covering"); + AddEndpoint("1"); + AddCluster("Window Covering"); + AddAttribute("Current Lift", "5"); + app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Set(1, static_cast(5 * 100)); + AddAttribute("Current Tilt", "5"); + app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Set(1, static_cast(5 * 100)); + AddAttribute("Opr Status", "0"); + app::Clusters::WindowCovering::Attributes::OperationalStatus::Set(1, static_cast(0)); + + AddDevice("Battery"); + AddEndpoint("1"); + AddCluster("Power Source"); + AddAttribute("Bat remaining", "70"); + app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::Set(1, static_cast(70 * 2)); + AddAttribute("Charge level", "0"); + app::Clusters::PowerSource::Attributes::BatteryChargeLevel::Set(1, static_cast(0)); } esp_err_t InitM5Stack(std::string qrCodeText) From 8c836f1fc0c868bea9cd89e99f9e20e9bb7e7ded Mon Sep 17 00:00:00 2001 From: PSONALl <77670766+PSONALl@users.noreply.github.com> Date: Thu, 28 Apr 2022 11:22:19 +0530 Subject: [PATCH 24/59] [ESP32] Handling Wifi-diagnostic events at esp32 side (#17631) * Handling Wifi-diagnostic events at esp32 side * Address review comments Co-authored-by: Boris Zbarsky Co-authored-by: Boris Zbarsky --- .../ESP32/ConnectivityManagerImpl_WiFi.cpp | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp index fe21b21f665d52..8ebc260031e872 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp +++ b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -661,6 +662,13 @@ void ConnectivityManagerImpl::OnStationConnected() event.Type = DeviceEventType::kWiFiConnectivityChange; event.WiFiConnectivityChange.Result = kConnectivity_Established; PlatformMgr().PostEventOrDie(&event); + WiFiDiagnosticsDelegate * delegate = GetDiagnosticDataProvider().GetWiFiDiagnosticsDelegate(); + + if (delegate) + { + delegate->OnConnectionStatusChanged( + chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::WiFiConnectionStatus::kConnected)); + } UpdateInternetConnectivityState(); } @@ -674,6 +682,70 @@ void ConnectivityManagerImpl::OnStationDisconnected() event.Type = DeviceEventType::kWiFiConnectivityChange; event.WiFiConnectivityChange.Result = kConnectivity_Lost; PlatformMgr().PostEventOrDie(&event); + WiFiDiagnosticsDelegate * delegate = GetDiagnosticDataProvider().GetWiFiDiagnosticsDelegate(); + uint16_t reason = NetworkCommissioning::ESPWiFiDriver::GetInstance().GetLastDisconnectReason(); + uint8_t associationFailureCause = + chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::AssociationFailureCause::kUnknown); + + switch (reason) + { + case WIFI_REASON_ASSOC_TOOMANY: + case WIFI_REASON_NOT_ASSOCED: + case WIFI_REASON_ASSOC_NOT_AUTHED: + case WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT: + case WIFI_REASON_GROUP_CIPHER_INVALID: + case WIFI_REASON_UNSUPP_RSN_IE_VERSION: + case WIFI_REASON_AKMP_INVALID: + case WIFI_REASON_CIPHER_SUITE_REJECTED: + case WIFI_REASON_PAIRWISE_CIPHER_INVALID: + associationFailureCause = + chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::AssociationFailureCause::kAssociationFailed); + if (delegate) + { + delegate->OnAssociationFailureDetected(associationFailureCause, reason); + } + break; + case WIFI_REASON_NOT_AUTHED: + case WIFI_REASON_MIC_FAILURE: + case WIFI_REASON_IE_IN_4WAY_DIFFERS: + case WIFI_REASON_INVALID_RSN_IE_CAP: + case WIFI_REASON_INVALID_PMKID: + case WIFI_REASON_802_1X_AUTH_FAILED: + associationFailureCause = + chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::AssociationFailureCause::kAuthenticationFailed); + if (delegate) + { + delegate->OnAssociationFailureDetected(associationFailureCause, reason); + } + break; + case WIFI_REASON_NO_AP_FOUND: + associationFailureCause = + chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::AssociationFailureCause::kSsidNotFound); + if (delegate) + { + delegate->OnAssociationFailureDetected(associationFailureCause, reason); + } + case WIFI_REASON_BEACON_TIMEOUT: + case WIFI_REASON_AUTH_EXPIRE: + case WIFI_REASON_AUTH_LEAVE: + case WIFI_REASON_ASSOC_LEAVE: + case WIFI_REASON_ASSOC_EXPIRE: + break; + + default: + if (delegate) + { + delegate->OnAssociationFailureDetected(associationFailureCause, reason); + } + break; + } + + if (delegate) + { + delegate->OnDisconnectionDetected(reason); + delegate->OnConnectionStatusChanged( + chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::WiFiConnectionStatus::kNotConnected)); + } UpdateInternetConnectivityState(); } From 3f026bc07db4bf235a20b3986e07b6f76cd1fbcb Mon Sep 17 00:00:00 2001 From: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> Date: Thu, 28 Apr 2022 18:14:05 +0530 Subject: [PATCH 25/59] Feature/ci ncp mg12 wifi (#17696) * added CI for wifi cases * Added wf200 and rs911x with mg12 in CI * renamed lock to lighting in .out file * CI for wf200 and rs911x wifi * Reverting darwin-tests.yaml --- .github/workflows/examples-efr32.yaml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 50aefb9d7c143e..18d4cfc29083bf 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -95,13 +95,18 @@ jobs: 'import("//with_pw_rpc.gni")' .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rpc lighting-app \ out/lighting_app_debug_rpc/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ - # Disabled until Flash usage is reduced - # - name: Build example EFR32+WF200 WiFi Lock app for BRD4161A - # timeout-minutes: 10 - # run: | - # scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_wifi_wf200 BRD4161A --wifi wf200 - # .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+wf200 lock-app \ - # out/lock_app_wifi_wf200/BRD4161A/chip-efr32-lock-example.out /tmp/bloat_reports/ + - name: Build example EFR32+WF200 WiFi Lock app for BRD4161A + timeout-minutes: 10 + run: | + scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_wifi_wf200 BRD4161A is_debug=false --wifi wf200 + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+wf200 lock-app \ + out/lock_app_wifi_wf200/BRD4161A/chip-efr32-lock-example.out /tmp/bloat_reports/ + - name: Build example EFR32+RS911x WiFi Lighting app for BRD4161A + timeout-minutes: 10 + run: | + scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_wifi_rs911x BRD4161A --wifi rs911x + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rs911x lighting-app \ + out/lighting_app_wifi_rs911x/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} From cfc35951be66a664a6efdadea56d1b8ea6e63e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Thu, 28 Apr 2022 15:20:48 +0200 Subject: [PATCH 26/59] Revert "[linux] Use BLE notification instead of indication (#17692)" (#17836) This reverts commit 6160935fa23987c90f2f6e3ac24ce70de82d37df. --- src/platform/Linux/bluez/Helper.cpp | 30 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/platform/Linux/bluez/Helper.cpp b/src/platform/Linux/bluez/Helper.cpp index c0711db3a81b1b..81f59af086276c 100644 --- a/src/platform/Linux/bluez/Helper.cpp +++ b/src/platform/Linux/bluez/Helper.cpp @@ -627,6 +627,18 @@ static gboolean BluezCharacteristicStopNotify(BluezGattCharacteristic1 * aChar, return isSuccess ? TRUE : FALSE; } +static gboolean BluezCharacteristicConfirm(BluezGattCharacteristic1 * aChar, GDBusMethodInvocation * aInvocation, + gpointer apClosure) +{ + BluezEndpoint * endpoint = static_cast(apClosure); + BluezConnection * conn = GetBluezConnectionViaDevice(endpoint); + + ChipLogDetail(Ble, "Indication confirmation, %p", conn); + BLEManagerImpl::HandleTXComplete(conn); + + return TRUE; +} + static gboolean BluezCharacteristicStopNotifyError(BluezGattCharacteristic1 * aChar, GDBusMethodInvocation * aInvocation) { g_dbus_method_invocation_return_dbus_error(aInvocation, "org.bluez.Error.Failed", @@ -1223,7 +1235,7 @@ static void BluezPeripheralObjectsSetup(gpointer apClosure) { static const char * const c1_flags[] = { "write", nullptr }; - static const char * const c2_flags[] = { "read", "notify", nullptr }; + static const char * const c2_flags[] = { "read", "indicate", nullptr }; static const char * const c3_flags[] = { "read", nullptr }; BluezEndpoint * endpoint = static_cast(apClosure); @@ -1252,7 +1264,7 @@ static void BluezPeripheralObjectsSetup(gpointer apClosure) g_signal_connect(endpoint->mpC2, "handle-acquire-notify", G_CALLBACK(BluezCharacteristicAcquireNotify), apClosure); g_signal_connect(endpoint->mpC2, "handle-start-notify", G_CALLBACK(BluezCharacteristicStartNotify), apClosure); g_signal_connect(endpoint->mpC2, "handle-stop-notify", G_CALLBACK(BluezCharacteristicStopNotify), apClosure); - g_signal_connect(endpoint->mpC2, "handle-confirm", G_CALLBACK(BluezCharacteristicConfirmError), apClosure); + g_signal_connect(endpoint->mpC2, "handle-confirm", G_CALLBACK(BluezCharacteristicConfirm), apClosure); ChipLogDetail(DeviceLayer, "CHIP BTP C1 %s", bluez_gatt_characteristic1_get_service(endpoint->mpC1)); ChipLogDetail(DeviceLayer, "CHIP BTP C2 %s", bluez_gatt_characteristic1_get_service(endpoint->mpC2)); @@ -1269,7 +1281,7 @@ static void BluezPeripheralObjectsSetup(gpointer apClosure) g_signal_connect(endpoint->mpC3, "handle-acquire-notify", G_CALLBACK(BluezCharacteristicAcquireNotify), apClosure); g_signal_connect(endpoint->mpC3, "handle-start-notify", G_CALLBACK(BluezCharacteristicStartNotify), apClosure); g_signal_connect(endpoint->mpC3, "handle-stop-notify", G_CALLBACK(BluezCharacteristicStopNotify), apClosure); - g_signal_connect(endpoint->mpC3, "handle-confirm", G_CALLBACK(BluezCharacteristicConfirmError), apClosure); + g_signal_connect(endpoint->mpC3, "handle-confirm", G_CALLBACK(BluezCharacteristicConfirm), apClosure); // update the characteristic value UpdateAdditionalDataCharacteristic(endpoint->mpC3); ChipLogDetail(DeviceLayer, "CHIP BTP C3 %s", bluez_gatt_characteristic1_get_service(endpoint->mpC3)); @@ -1357,7 +1369,7 @@ static int StartupEndpointBindings(BluezEndpoint * endpoint) return 0; } -static gboolean BluezC2Notify(ConnectionDataBundle * closure) +static gboolean BluezC2Indicate(ConnectionDataBundle * closure) { BluezConnection * conn = nullptr; GError * error = nullptr; @@ -1369,7 +1381,7 @@ static gboolean BluezC2Notify(ConnectionDataBundle * closure) conn = closure->mpConn; VerifyOrExit(conn != nullptr, ChipLogError(DeviceLayer, "BluezConnection is NULL in %s", __func__)); - VerifyOrExit(conn->mpC2 != nullptr, ChipLogError(DeviceLayer, "FAIL: C2 Notify: %s", "NULL C2")); + VerifyOrExit(conn->mpC2 != nullptr, ChipLogError(DeviceLayer, "FAIL: C2 Indicate: %s", "NULL C2")); if (bluez_gatt_characteristic1_get_notify_acquired(conn->mpC2) == TRUE) { @@ -1380,7 +1392,7 @@ static gboolean BluezC2Notify(ConnectionDataBundle * closure) g_variant_unref(closure->mpVal); closure->mpVal = nullptr; - VerifyOrExit(status == G_IO_STATUS_NORMAL, ChipLogError(DeviceLayer, "FAIL: C2 Notify: %s", error->message)); + VerifyOrExit(status == G_IO_STATUS_NORMAL, ChipLogError(DeviceLayer, "FAIL: C2 Indicate: %s", error->message)); } else { @@ -1388,8 +1400,6 @@ static gboolean BluezC2Notify(ConnectionDataBundle * closure) closure->mpVal = nullptr; } - BLEManagerImpl::HandleTXComplete(conn); - exit: if (closure != nullptr) { @@ -1420,7 +1430,7 @@ bool SendBluezIndication(BLE_CONNECTION_OBJECT apConn, chip::System::PacketBuffe VerifyOrExit(!apBuf.IsNull(), ChipLogError(DeviceLayer, "apBuf is NULL in %s", __func__)); - success = MainLoop::Instance().Schedule(BluezC2Notify, MakeConnectionDataBundle(apConn, apBuf)); + success = MainLoop::Instance().Schedule(BluezC2Indicate, MakeConnectionDataBundle(apConn, apBuf)); exit: return success; @@ -1673,7 +1683,7 @@ static gboolean SubscribeCharacteristicImpl(BluezConnection * connection) VerifyOrExit(connection->mpC2 != nullptr, ChipLogError(DeviceLayer, "C2 is NULL in %s", __func__)); c2 = BLUEZ_GATT_CHARACTERISTIC1(connection->mpC2); - // Get notifications on the TX characteristic change (e.g. notification is received) + // Get notifications on the TX characteristic change (e.g. indication is received) g_signal_connect(c2, "g-properties-changed", G_CALLBACK(OnCharacteristicChanged), connection); bluez_gatt_characteristic1_call_start_notify(connection->mpC2, nullptr, SubscribeCharacteristicDone, connection); From fb68954f39d46fea37e7c0bcc9e9da7f8ea7f71a Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 28 Apr 2022 16:39:40 +0200 Subject: [PATCH 27/59] [IM] Subscribing to an event crashes (#17841) * [IM] Crash when trying to subscribe to an event * [YAML] Update TestEvents.yaml to use subscribeEvent * Fix ClusterTestGeneration.js to make it possible to wait for an event report * Update generated test code --- src/app/InteractionModelEngine.cpp | 4 +- src/app/tests/suites/TestEvents.yaml | 34 +++++++++ .../common/ClusterTestGeneration.js | 8 ++- .../chip-tool/zap-generated/test/Commands.h | 69 ++++++++++++++++++- 4 files changed, 110 insertions(+), 5 deletions(-) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index f0f4d3925e32de..78c17ef2ccfabb 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -312,8 +312,8 @@ CHIP_ERROR InteractionModelEngine::OnReadInitialRequest(Messaging::ExchangeConte if (err == CHIP_NO_ERROR) { TLV::TLVReader pathReader; - attributePathListParser.GetReader(&pathReader); - TLV::Utilities::Count(pathReader, requestedAttributePathCount, false); + eventpathListParser.GetReader(&pathReader); + TLV::Utilities::Count(pathReader, requestedEventPathCount, false); } else if (err != CHIP_ERROR_END_OF_TLV) { diff --git a/src/app/tests/suites/TestEvents.yaml b/src/app/tests/suites/TestEvents.yaml index d8c978af53b92a..cc0b6be7d6594e 100644 --- a/src/app/tests/suites/TestEvents.yaml +++ b/src/app/tests/suites/TestEvents.yaml @@ -85,3 +85,37 @@ tests: - value: { arg1: 1, arg2: 2, arg3: true } - values: - value: { arg1: 3, arg2: 4, arg3: false } + + - label: "Subscribe to the event" + command: "subscribeEvent" + event: "TestEvent" + minInterval: 3 + maxInterval: 5 + response: + - values: + - value: { arg1: 1, arg2: 2, arg3: true } + - values: + - value: { arg1: 3, arg2: 4, arg3: false } + + - label: "Generate a third event on the accessory" + command: "TestEmitTestEventRequest" + arguments: + values: + - name: "arg1" + value: 4 + - name: "arg2" + value: 5 + - name: "arg3" + value: true + response: + values: + - name: "value" + value: eventNumber + 2 + + - label: "Check for event report" + command: "waitForReport" + event: "TestEvent" + response: + values: + - name: "TestEvent" + value: { arg1: 4, arg2: 5, arg3: true } diff --git a/src/app/zap-templates/common/ClusterTestGeneration.js b/src/app/zap-templates/common/ClusterTestGeneration.js index d013afde283dd6..f40d1f479b3252 100644 --- a/src/app/zap-templates/common/ClusterTestGeneration.js +++ b/src/app/zap-templates/common/ClusterTestGeneration.js @@ -173,8 +173,12 @@ function setDefaultTypeForCommand(test) break; case 'waitForReport': - test.commandName = 'WaitForReport'; - test.isAttribute = true; + test.commandName = 'WaitForReport'; + if ('attribute' in test) { + test.isAttribute = true; + } else if ('event' in test) { + test.isEvent = true; + } test.isWaitForReport = true; break; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index f8817ac66e4116..9b72041e97ad4e 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -39456,7 +39456,7 @@ class TestDelayCommandsSuite : public TestCommand class TestEventsSuite : public TestCommand { public: - TestEventsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestEvents", 7, credsIssuerConfig) + TestEventsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestEvents", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -39566,6 +39566,55 @@ class TestEventsSuite : public TestCommand break; } break; + case 7: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 1)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 2)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, true)); + } + mTestSubStepIndex++; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 3)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 4)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, false)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Commands::TestEmitTestEventResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("value", value.value, eventNumber + 2)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEvent.arg1", value.arg1, 4)); + VerifyOrReturn(CheckValue("testEvent.arg2", value.arg2, 5)); + VerifyOrReturn(CheckValue("testEvent.arg3", value.arg3, true)); + } + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -39629,6 +39678,24 @@ class TestEventsSuite : public TestCommand ); } + case 7: { + LogStep(7, "Subscribe to the event"); + mTestSubStepCount = 2; + return SubscribeEvent(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Events::TestEvent::Id, 3, 5, false); + } + case 8: { + LogStep(8, "Generate a third event on the accessory"); + chip::app::Clusters::TestCluster::Commands::TestEmitTestEventRequest::Type value; + value.arg1 = 4; + value.arg2 = static_cast(5); + value.arg3 = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Commands::TestEmitTestEventRequest::Id, + value); + } + case 9: { + LogStep(9, "Check for event report"); + return WaitForReport(); + } } return CHIP_NO_ERROR; } From d63d36046ee5732d12b18fd3ec090935afe10e7f Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Thu, 28 Apr 2022 23:49:27 +0530 Subject: [PATCH 28/59] Test Modified Apr 17 (#17513) * Modified scripts TC-MC-1.1 TC-MC-1.2 TC-MC-1.3 TC-MC-1.4 TC-MC-1.5 TC-MC-1.6 TC-MC-1.7 TC-MC-1.8 TC-MC-1.9 TC-MC-1.10 TC-MC-1.11 TC-MC-1.12 TC-MC-3.1 TC-MC-3.2 TC-MC-3.3 TC-MC-3.4 TC-MC-3.5 TC-OO-1.1 TC-RH-1.1 TC-RH-2.1 TC-TM-1.1 TC-TSUIC-1.1 * Added auto generated files * Restyled by whitespace * Modified JS file * Auto generated files Co-authored-by: Restyled.io --- src/app/tests/suites/certification/PICS.yaml | 3 + .../suites/certification/Test_TC_MC_1_1.yaml | 62 +- .../suites/certification/Test_TC_MC_1_10.yaml | 62 +- .../suites/certification/Test_TC_MC_1_11.yaml | 64 +- .../suites/certification/Test_TC_MC_1_12.yaml | 61 +- .../suites/certification/Test_TC_MC_1_2.yaml | 60 +- .../suites/certification/Test_TC_MC_1_3.yaml | 56 +- .../suites/certification/Test_TC_MC_1_4.yaml | 68 +- .../suites/certification/Test_TC_MC_1_5.yaml | 58 +- .../suites/certification/Test_TC_MC_1_6.yaml | 69 +- .../suites/certification/Test_TC_MC_1_7.yaml | 46 +- .../suites/certification/Test_TC_MC_1_8.yaml | 63 +- .../suites/certification/Test_TC_MC_1_9.yaml | 60 +- .../suites/certification/Test_TC_MC_3_1.yaml | 31 +- .../suites/certification/Test_TC_MC_3_2.yaml | 5 +- .../suites/certification/Test_TC_MC_3_3.yaml | 19 +- .../suites/certification/Test_TC_MC_3_4.yaml | 21 +- .../suites/certification/Test_TC_MC_3_5.yaml | 7 +- .../suites/certification/Test_TC_OO_1_1.yaml | 71 +- .../suites/certification/Test_TC_RH_1_1.yaml | 75 +- .../suites/certification/Test_TC_RH_2_1.yaml | 3 +- .../suites/certification/Test_TC_TM_1_1.yaml | 103 +- .../certification/Test_TC_TSUIC_1_1.yaml | 58 +- .../tests/suites/certification/ci-pics-values | 1 + .../Framework/CHIP/templates/tests/tests.js | 23 +- .../Framework/CHIPTests/CHIPClustersTests.m | 1629 +------- .../zap-generated/test/Commands.h | 3614 ++++++++++++++--- .../chip-tool/zap-generated/test/Commands.h | 2337 +++++++++-- 28 files changed, 5774 insertions(+), 2955 deletions(-) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 872ccf446bbebd..da79250fd26d1e 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -315,3 +315,6 @@ PICS: - label: "Skip sample app" id: PICS_SKIP_SAMPLE_APP + + - label: "Level Control for Lighting" + id: OO_LT diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml index 4109f53fc0c5f1..1caf76737e8992 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml @@ -33,11 +33,6 @@ tests: attribute: "ClusterRevision" response: value: 1 - - - label: "Read the global attribute constraints: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: constraints: type: uint16 @@ -45,45 +40,54 @@ tests: command: "readAttribute" attribute: "AttributeList" response: + value: [65528, 65529, 65531, 65533] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0] constraints: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates either value 0 or throws a general error if the + attribute is not supported" + verification: | + ./chip-tool lowpower read feature-map 1 1 + [1645780669.465220][5069:5074] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_10.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_10.yaml index 718f068bcc2e5f..d5f1ae876dc0ee 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_10.yaml @@ -43,49 +43,65 @@ tests: constraints: type: uint16 + #Issue 10988 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2, 3, 4, 5, 6, 7, 65528, 65529, 65531, 65533] constraints: type: list #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + #Issue 10988 - label: "Read the global attribute: AcceptedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0, 1] constraints: type: list + #Issue 17459 - label: "Read the global attribute: GeneratedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [2] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + - label: + "Read FeatureMap attribute from the DUT and verify response has the + value 0 or throws a general error if the attribute is not supported.." + verification: | + ./chip-tool targetnavigator read feature-map 1 3 + [1646117330.365338][8706:8711] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + [1646117330.365410][8706:8711] CHIP:EM: Sending Standalone Ack for MessageCounter:10744435 on exchange 3932i + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_11.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_11.yaml index 3e67fdd0f0f541..9b25e74c2b92cc 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_11.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_11.yaml @@ -43,49 +43,67 @@ tests: constraints: type: uint16 + #Issue 10988 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 65528, 65529, 65531, 65533] constraints: type: list #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + #Issue 17460 - label: "Read the global attribute: AcceptedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0] constraints: type: list + #Issue 17460 - label: "Read the global attribute: GeneratedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [1] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + - label: + "Read FeatureMap attribute from the DUT values based on feature/PICS + support: Bit 0 - Set to 1 if the DUT supports Content Search + (PICS_CONTENTSEARCH is true) Bit 1 - Set to 1 if the DUT supports URL + Playback (PICS_URLPLAYBACK is true)" + verification: | + ./chip-tool contentlauncher read feature-map 1 1 + [1646119133.092519][9106:9111] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + [1646119133.092543][9106:9111] CHIP:EM: Sending Standalone Ack for MessageCounter:13579575 on exchange 33783 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_12.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_12.yaml index 9c71e958935cc8..9826b2f2e30a25 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_12.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_12.yaml @@ -47,45 +47,60 @@ tests: command: "readAttribute" attribute: "AttributeList" response: + value: [65528, 65529, 65531, 65533] constraints: type: list #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + #issue 17461 - label: "Read the global attribute: AcceptedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0, 2, 3] constraints: type: list + #issue 17461 - label: "Read the global attribute: GeneratedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [1] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response" + verification: | + ./chip-tool accountlogin read feature-map 1 3 + [1646119386.505037][9184:9189] CHIP:DMG: } + [1646119386.505073][9184:9189] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + [1646119386.505096][9184:9189] CHIP:EM: Sending Standalone Ack for MessageCounter:5632577 on exchange 37257 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_2.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_2.yaml index 476dd82ab38f18..61f37b08a0ca69 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_2.yaml @@ -42,49 +42,61 @@ tests: constraints: type: uint16 + #Issue 17453 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [65528, 65529, 65531, 65532, 65533] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0] constraints: type: list + #Disabled due to issue 17453 - label: "Read the global attribute: GeneratedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [1] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response" + verification: | + ./chip-tool lowpower read feature-map 1 1 + [1645780669.465220][5069:5074] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_3.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_3.yaml index 94b697e8431725..250a57d646010e 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_3.yaml @@ -43,41 +43,67 @@ tests: constraints: type: uint16 + #Issue 10988 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 65528, 65529, 65531, 65532, 65533] constraints: type: list #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + #Issue 17454 - label: "Read the global attribute: AcceptedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0, 1, 2] constraints: type: list + #Issue 17454 - label: "Read the global attribute: GeneratedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [3] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 + - label: + "Read attribute Feature map and verify that DUT response indicates + that the FeatureMap attribute has bit 0 set to 1 if the DUT supports + the Application Platform feature (PICS_AP_S is true)." + verification: | + ./chip-tool applicationlauncher read feature-map 1 1 + Verify we are getting feature-map values based on features or pic supported sent in the above command + [1649661177918] [67258:746649] CHIP: [TOO] Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + [1649661177918] [67258:746649] CHIP: [EM] Sending Standalone Ack for MessageCounter:16467393 on exchange 63291i + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_4.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_4.yaml index 7b031cccf58d3d..987843332653cd 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_4.yaml @@ -42,49 +42,71 @@ tests: constraints: type: uint16 + #Issue 10988 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 65528, 65529, 65531, 65532, 65533] constraints: type: list #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0, 1, 2, 3] constraints: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + - label: + "Read attribute Feature map and Verify that the DUT response indicates + that the FeatureMap attribute has bit 0 set to 1 if the DUT supports + the Name Updates feature PICS_NU_S is true" + verification: | + ./chip-tool mediainput read feature-map 1 1 + [1649662558973] [67411:752539] CHIP: [DMG] AttributePathIB = + [1649662558973] [67411:752539] CHIP: [DMG] { + [1649662558973] [67411:752539] CHIP: [DMG] Endpoint = 0x1, + [1649662558973] [67411:752539] CHIP: [DMG] Cluster = 0x507, + [1649662558973] [67411:752539] CHIP: [DMG] Attribute = 0x0000_FFFC, + [1649662558973] [67411:752539] CHIP: [DMG] } + [1649662558973] [67411:752539] CHIP: [DMG] + [1649662558973] [67411:752539] CHIP: [DMG] StatusIB = + [1649662558973] [67411:752539] CHIP: [DMG] { + [1649662558973] [67411:752539] CHIP: [DMG] status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1649662558973] [67411:752539] CHIP: [DMG] }, + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_5.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_5.yaml index 29db37a6672e3e..ab918e6dfd922c 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_5.yaml @@ -42,49 +42,61 @@ tests: constraints: type: uint16 + #Issue 10988 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 65528, 65529, 65531, 65533] constraints: type: list #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [] constraints: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + #Issue 10988 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response" + verification: | + ./chip-tool lowpower read feature-map 1 1 + [1645780669.465220][5069:5074] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_6.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_6.yaml index 7a8ef9dce06f3a..21fc28f659e0db 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_6.yaml @@ -41,49 +41,72 @@ tests: constraints: type: uint16 + #Issue 10988 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2, 65528, 65529, 65531, 65532, 65533] constraints: type: list #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + #Issue 10988 - label: "Read the global attribute: AcceptedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AcceptedCommandList" response: constraints: type: list + #Issue 10988 - label: "Read the global attribute: GeneratedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "GeneratedCommandList" response: constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + #Issue 10988 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response values based on feature/PICS support Bit 0 - Set to 1 if the + DUT supports Channel Lists (PICS_CL_S is true) Bit 1 - Set to 1 if the + DUT supports Lineup Info (PICS_LI_S is true)" + verification: | + ./chip-tool channel read feature-map 1 1 + [[1649662622709] [67419:752862] CHIP: [DMG] Endpoint = 0x1, + [1649662622709] [67419:752862] CHIP: [DMG] Cluster = 0x504, + [1649662622709] [67419:752862] CHIP: [DMG] Attribute = 0x0000_FFFC, + [1649662622709] [67419:752862] CHIP: [DMG] } + [1649662622709] [67419:752862] CHIP: [DMG] + [1649662622709] [67419:752862] CHIP: [DMG] StatusIB = + [1649662622709] [67419:752862] CHIP: [DMG] { + [1649662622709] [67419:752862] CHIP: [DMG] status = 0x86 (UNSUPPORTED_ATTRIBUTE), + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_7.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_7.yaml index 9501b042061282..f20a12dde38604 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_7.yaml @@ -43,10 +43,13 @@ tests: constraints: type: uint16 + #Issue 10988 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2, 3, 4, 5, 6, 65528, 65529, 65531, 65532, 65533] constraints: type: list @@ -59,33 +62,44 @@ tests: constraints: type: list + ##Issue 10988 - label: "Read the global attribute: AcceptedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11] constraints: type: list + #Issue 17455 - label: "Read the global attribute: GeneratedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [10] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT values + based on feature/PICS support:Bit 0 - Set to 1 if the DUT supports + Advanced Seek (PICS_ADVANCEDSEEK is true) Bit 1 - Set to 1 if the DUT + supports Variable Speed (PICS_VARIABLESPEED is true)" + verification: | + ./chip-tool mediaplayback read feature-map 1 3 + [1646115004.682978][8139:8144] CHIP:DMG: SuppressResponse = true, + [1646115004.682994][8139:8144] CHIP:DMG: InteractionModelRevision = 1 + [1646115004.683010][8139:8144] CHIP:DMG: } + [1646115004.683125][8139:8144] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + [1646115004.683189][8139:8144] CHIP:EM: Sending Standalone Ack for MessageCounter:712796 on exchange 9659i + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_8.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_8.yaml index f5fb369bbbe2d0..3bc8dc9c77a66d 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_8.yaml @@ -42,49 +42,66 @@ tests: constraints: type: uint16 + #Issue 17457 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 65528, 65529, 65531, 65532, 65533] constraints: type: list #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + #Issue 17457 - label: "Read the global attribute: AcceptedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0] constraints: type: list + #Issue 17457 - label: "Read the global attribute: GeneratedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [1] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT has + bit 1 set to 1 if the device supports Name Updates PICS_NAMEUPDATES is + true" + verification: | + ./chip-tool audiooutput read feature-map 1 2 + [1646116153.890111][8447:8452] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + [1646116153.890132][8447:8452] CHIP:EM: Sending Standalone Ack for MessageCounter:6248385 on exchange 46369i + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_9.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_9.yaml index 63eee81bb80e5b..3cd66582317599 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_9.yaml @@ -43,49 +43,63 @@ tests: constraints: type: uint16 + ##Issue 10988 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 65528, 65529, 65531, 65533] constraints: type: list #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0] constraints: type: list + # Issue 17458 - label: "Read the global attribute: GeneratedCommandList" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [1] constraints: type: list - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + - label: + "Read FeatureMap attribute from the DUT and verify response has the + value 0 or throws a general error if the attribute is not supported.." + verification: | + ./chip-tool targetnavigator read feature-map 1 1 + [1646117330.365338][8706:8711] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + [1646117330.365410][8706:8711] CHIP:EM: Sending Standalone Ack for MessageCounter:10744435 on exchange 3932i + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_1.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_1.yaml index a6df7e19cde11c..10d0cb590c549c 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_3_1.yaml @@ -28,8 +28,9 @@ tests: - name: "nodeId" value: nodeId + #Issue 17510 - label: "Send Select" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -37,7 +38,7 @@ tests: value: 0x00 - label: "Send Up" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -45,7 +46,7 @@ tests: value: 0x01 - label: "Send Down" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -53,14 +54,14 @@ tests: value: 0x02 - label: "Send Left" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: - name: "keyCode" value: 0x03 - label: "Send Right" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -68,7 +69,7 @@ tests: value: 0x04 - label: "Send RightUp" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -76,7 +77,7 @@ tests: value: 0x05 - label: "Send RightDown" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -84,7 +85,7 @@ tests: value: 0x06 - label: "Send LeftUp" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -92,7 +93,7 @@ tests: value: 0x07 - label: "Send LeftDown" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -100,7 +101,7 @@ tests: value: 0x08 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -108,7 +109,7 @@ tests: value: 0x09 - label: "Send SetupMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -116,7 +117,7 @@ tests: value: 0x0A - label: "Send ContentsMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -124,7 +125,7 @@ tests: value: 0x0B - label: "Send FavoriteMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -132,7 +133,7 @@ tests: value: 0x0C - label: "Send Exit" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -140,7 +141,7 @@ tests: value: 0x0D - label: "Send Invalid" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_2.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_2.yaml index 6cce9fa1ae21b1..c7ace0bd551a06 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_3_2.yaml @@ -28,8 +28,9 @@ tests: - name: "nodeId" value: nodeId + #Issue 17510 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -37,7 +38,7 @@ tests: value: 0x09 - label: "Send SetupMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_3.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_3.yaml index e2a541634df695..f0b1557b961252 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_3_3.yaml @@ -28,8 +28,9 @@ tests: - name: "nodeId" value: nodeId + #Issue 17510 - label: "Send Numbers1" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -37,7 +38,7 @@ tests: value: 0x21 - label: "Send Numbers2" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -45,7 +46,7 @@ tests: value: 0x22 - label: "Send Numbers3" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -53,7 +54,7 @@ tests: value: 0x23 - label: "Send Numbers4" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -61,7 +62,7 @@ tests: value: 0x24 - label: "Send Numbers5" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -69,7 +70,7 @@ tests: value: 0x25 - label: "Send Numbers6" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -77,7 +78,7 @@ tests: value: 0x26 - label: "Send Numbers7" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -85,7 +86,7 @@ tests: value: 0x27 - label: "Send Numbers8" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -93,7 +94,7 @@ tests: value: 0x28 - label: "Send Numbers9" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_4.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_4.yaml index 7350242c41c942..c9bd6d3a02d8b1 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_3_4.yaml @@ -28,8 +28,9 @@ tests: - name: "nodeId" value: nodeId + #Issue 17510 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -37,7 +38,7 @@ tests: value: 0x09 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -45,7 +46,7 @@ tests: value: 0x09 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -53,7 +54,7 @@ tests: value: 0x09 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -61,7 +62,7 @@ tests: value: 0x09 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -69,7 +70,7 @@ tests: value: 0x09 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -77,7 +78,7 @@ tests: value: 0x09 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -85,7 +86,7 @@ tests: value: 0x09 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -93,7 +94,7 @@ tests: value: 0x09 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: @@ -101,7 +102,7 @@ tests: value: 0x09 - label: "Send RootMenu" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "SendKey" arguments: values: diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_5.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_5.yaml index 950494ed5febc1..7f624150024411 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_3_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_3_5.yaml @@ -28,10 +28,9 @@ tests: - name: "nodeId" value: nodeId - # TODO: Need to enable when we can properly verify vendor id and uint16 - - label: "Read launch list attribute." - disabled: true + - label: "Read CatalogList attribute." command: "readAttribute" attribute: "CatalogList" response: - value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml index 2f9c62473d4624..73e9da144c5121 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml @@ -33,85 +33,56 @@ tests: attribute: "ClusterRevision" response: value: 4 - - - label: "Read the global attribute constraints: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: constraints: type: uint16 - - label: - "write the default values to mandatory global attribute: - ClusterRevision" - command: "writeAttribute" - attribute: "ClusterRevision" - arguments: - value: 3 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back global attribute: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 4 - + #issue 17495 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 16384, 16385, 16386, 16387] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" + PICS: OO_LT response: + value: [0, 1, 2, 64, 65, 66] constraints: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list - label: "read the optional global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" + PICS: OO_LT response: value: 1 - - - label: "Read the optional global attribute : FeatureMap" - command: "readAttribute" - attribute: "FeatureMap" - response: constraints: type: map32 - - - label: "write the default values to optional global attribute: FeatureMap" - command: "writeAttribute" - attribute: "FeatureMap" - arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back optional global attribute: FeatureMap" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml index 539203a2829f1b..45532f1eacee03 100644 --- a/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml @@ -28,42 +28,54 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 3 but expecting 2 - #referring default value of Water Content Measurement - - label: "read the global attribute: ClusterRevision" - disabled: true - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 3 - - - label: "Read the global attribute constraints: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - constraints: - type: uint16 + - label: + "Read ClusterRevision attribute from the DUT and Verify that the DUT + response indicates ClusterRevision attribute has the value 3" + verification: | + ./chip-tool relativehumiditymeasurement read cluster-revision 1 1 + verify that you see something like this: + [1643287333.135402][12177:12182] CHIP:DMG: Data = 3, + [1643287333.135504][12177:12182] CHIP:DMG: } + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Enter the Value" + - name: "expectedValue" + value: 3 + #Disabled due to issue 17462 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [] constraints: type: list @@ -71,5 +83,22 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list + + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response" + verification: | + ./chip-tool lowpower read feature-map 1 1 + [1645780669.465220][5069:5074] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter FeatureMap attribute value" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml index 475f27782fb633..4fb1522a8e0fea 100644 --- a/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml @@ -46,8 +46,9 @@ tests: minValue: 0 maxValue: 9999 + #Issue 14703 - label: "Reads constraints of attribute: MaxMeasuredValue" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "max measured value" response: diff --git a/src/app/tests/suites/certification/Test_TC_TM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TM_1_1.yaml index cacf105243a499..072571139806ff 100644 --- a/src/app/tests/suites/certification/Test_TC_TM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TM_1_1.yaml @@ -28,49 +28,80 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 4 but expecting 3 - - label: "read the global attribute: ClusterRevision" - disabled: true - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 4 - - - label: "Read the global attribute constraints: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - constraints: - type: uint16 + - label: + "Read ClusterRevision attribute from the DUT and Verify that the DUT + response indicates ClusterRevision attribute has the value 4" + verification: | + chip-tool temperaturemeasurement read cluster-revision 12345 1 + verify that you see something like this: + [1643287333.135402][12177:12182] CHIP:DMG: Data = 4, + [1643287333.135504][12177:12182] CHIP:DMG: } + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter ClusterRevision attribute value" + - name: "expectedValue" + value: 4 + #Issue 17463 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2, 3] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not supported in SDK yet + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Read the global attribute: AcceptedCommandList" - disabled: true - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list + - label: + "Read AcceptedCommandList attribute from the DUT and Verify that the + DUT response provides a list of supported commands,This list SHALL + include all the mandatory commands." + verification: | + ./chip-tool temperaturemeasurement read -command-list 12345 1 + [1646099169.759707][39879:39884] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0402 Attribute 0x0000_FFF9DataVersion: 1905470969 + [1646099169.759782][39879:39884] CHIP:TOO: AcceptedCommandList: 0 entries + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Read the global attribute: GeneratedCommandList" - disabled: true - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list + - label: + "Read GeneratedCommandList attribute from the DUT and Verify that the + DUT response provides a list of supported commands." + verification: | + ./chip-tool temperaturemeasurement read generated-command-list 12345 1 + [1646099269.732363][39895:39900] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0402 Attribute 0x0000_FFF8DataVersion: 1905470969 + [1646099269.732449][39895:39900] CHIP:TOO: GeneratedCommandList: 0 entries + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml index fee98f83989075..a94d949a5317f4 100644 --- a/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml @@ -28,41 +28,54 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 2 but expecting 1 - - label: "read the global attribute: ClusterRevision" - disabled: true - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - - - label: "Read the global attribute constraints: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - constraints: - type: uint16 + - label: + "Read ClusterRevision attribute from the DUT and Verify that the DUT + response indicates ClusterRevision attribute has the value 2" + verification: | + ./chip-tool thermostatuserinterfaceconfiguration read cluster-revision 12345 1 + [...] + [1646160162.271548][44516:44521] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0204 Attribute 0x0000_FFFDDataVersion: 3978864668 + [1646160162.271619][44516:44521] CHIP:TOO: ClusterRevision: 1 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter ClusterRevision attribute value" + - name: "expectedValue" + value: 2 + # Issue 17464 - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [] constraints: type: list @@ -70,5 +83,6 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index b2560457a98292..91d6c956f2137a 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -84,3 +84,4 @@ PH_KEY=1 PI_KEY=1 PICS_USER_PROMPT=0 PICS_SKIP_SAMPLE_APP=0 +OO_LT=1 diff --git a/src/darwin/Framework/CHIP/templates/tests/tests.js b/src/darwin/Framework/CHIP/templates/tests/tests.js index a05cbde60eae2d..270878ced0ff93 100644 --- a/src/darwin/Framework/CHIP/templates/tests/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests/tests.js @@ -124,24 +124,7 @@ function getTests() ]; const MediaControl = [ - 'Test_TC_MC_1_1', - 'Test_TC_MC_1_2', - 'Test_TC_MC_1_3', - 'Test_TC_MC_1_4', - 'Test_TC_MC_1_5', - 'Test_TC_MC_1_6', - 'Test_TC_MC_1_7', - 'Test_TC_MC_1_8', - 'Test_TC_MC_1_9', - 'Test_TC_MC_1_10', - 'Test_TC_MC_1_11', - 'Test_TC_MC_1_12', 'Test_TC_MC_2_1', - 'Test_TC_MC_3_1', - 'Test_TC_MC_3_2', - 'Test_TC_MC_3_3', - 'Test_TC_MC_3_4', - 'Test_TC_MC_3_5', 'Test_TC_MC_3_6', 'Test_TC_MC_3_7', 'Test_TC_MC_3_8', @@ -167,7 +150,7 @@ function getTests() ]; const OnOff = [ - 'Test_TC_OO_1_1', 'Test_TC_OO_2_1', 'Test_TC_OO_2_2', 'Test_TC_OO_2_3', + 'Test_TC_OO_2_1', 'Test_TC_OO_2_2', 'Test_TC_OO_2_3', // 'Test_TC_OO_2_4', Disable this Test for now as Darwin does not support reboot commands currently ]; @@ -192,8 +175,6 @@ function getTests() ]; const RelativeHumidityMeasurement = [ - 'Test_TC_RH_1_1', - 'Test_TC_RH_2_1', 'Test_TC_RH_2_2', ]; @@ -203,7 +184,6 @@ function getTests() ]; const TemperatureMeasurement = [ - 'Test_TC_TM_1_1', 'Test_TC_TM_2_1', 'Test_TC_TM_2_2', ]; @@ -215,7 +195,6 @@ function getTests() ]; const ThermostatUserConfiguration = [ - 'Test_TC_TSUIC_1_1', 'Test_TC_TSUIC_2_1', 'Test_TC_TSUIC_2_2', ]; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index f1ba031228ddbd..50d4b8a4d56c1c 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -15643,858 +15643,6 @@ - (void)testSendClusterTest_TC_LVL_6_1_000011_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_MC_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_3_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_3_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_4_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_4_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_4_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_4_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_5_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_5_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_5_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_5_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_6_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_6_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_6_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_6_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_7_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_7_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_7_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_7_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_8_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_8_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_8_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_8_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_9_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_9_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_9_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_9_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_10_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_10_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_10_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_10_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_11_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_11_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_11_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_11_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_1_12_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_12_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_12_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_1_12_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_MC_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -16523,51 +15671,6 @@ - (void)testSendClusterTest_TC_MC_2_1_000001_Sleep [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_MC_3_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_4_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_5_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_MC_3_6_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -17606,265 +16709,58 @@ - (void)testSendClusterTest_TC_OCC_2_1_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OCC_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull OccupancyValue; -- (void)testSendClusterTest_TC_OCC_2_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads Occupancy attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads Occupancy attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = value; - OccupancyValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back Occupancy attribute from DUT after few seconds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back Occupancy attribute from DUT after few seconds Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_OO_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 4U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_1_1_000003_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 4U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_1_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 1UL); - } - - [expectation fulfill]; - }]; +- (void)testSendClusterTest_TC_OCC_2_2_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000007_ReadAttribute +NSNumber * _Nonnull OccupancyValue; +- (void)testSendClusterTest_TC_OCC_2_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional global attribute : FeatureMap"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads Occupancy attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional global attribute : FeatureMap Error: %@", err); + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads Occupancy attribute from DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + { + id actualValue = value; + OccupancyValue = actualValue; + } + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000008_WriteAttribute +- (void)testSendClusterTest_TC_OCC_2_2_000002_ReadAttribute { XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to optional global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_1_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back optional global attribute: FeatureMap"]; + [self expectationWithDescription:@"Reads back Occupancy attribute from DUT after few seconds"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back Occupancy attribute from DUT after few seconds Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 1UL); - } - [expectation fulfill]; }]; @@ -22153,273 +21049,74 @@ - (void)testSendClusterTest_TC_PCC_2_4_000011_WriteAttribute queue:queue]; XCTAssertNotNil(cluster); - id lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:3UL]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 3 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 3UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_PSCFG_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Commission DUT to TH"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PSCFG_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the ClusterRevision attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PSCFG_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the AttributeList attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PSCFG_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the AcceptedCommandList attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AcceptedCommandList attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PSCFG_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the GeneratedCommandList attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the GeneratedCommandList attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_RH_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_RH_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_RH_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_RH_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + id lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:3UL]; + [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 3 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_RH_1_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_PCC_2_4_000012_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedIntValue], 3UL); + } + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_RH_2_1_000000_WaitForCommissionee +- (void)testSendClusterTest_TC_PSCFG_1_1_000000_WaitForCommissionee { - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Commission DUT to TH"]; dispatch_queue_t queue = dispatch_get_main_queue(); WaitForCommissionee(expectation, queue, 305414945); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_RH_2_1_000001_ReadAttribute +- (void)testSendClusterTest_TC_PSCFG_1_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of attribute: MeasuredValue"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the ClusterRevision attribute from the DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device + endpoint:0 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of attribute: MeasuredValue Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); - } + XCTAssertEqual([actualValue unsignedShortValue], 1U); } [expectation fulfill]; @@ -22427,73 +21124,63 @@ - (void)testSendClusterTest_TC_RH_2_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_RH_2_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_PSCFG_1_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of attribute: MinMeasuredValue"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the AttributeList attribute from the DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device + endpoint:0 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of attribute: MinMeasuredValue Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 9999U); - } - } - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_RH_2_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_PSCFG_1_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of attribute: Tolerance"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the AcceptedCommandList attribute from the DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device + endpoint:0 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of attribute: Tolerance Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the AcceptedCommandList attribute from the DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U); - } - } + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PSCFG_1_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the GeneratedCommandList attribute from the DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the GeneratedCommandList attribute from the DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); [expectation fulfill]; }]; @@ -23096,57 +21783,6 @@ - (void)testSendClusterTest_TC_SWTCH_2_2_000037_UserPrompt [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_TM_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -25479,95 +24115,6 @@ - (void)testSendClusterTest_TC_TSTAT_2_2_000049_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_TSUIC_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index d66d76477ebde2..a6a807e8f3f568 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -21590,12 +21590,36 @@ class Test_TC_MC_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates either " + "value 0 or throws a general error if the attribute is not supported\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesEitherValue0OrThrowsAGeneralErrorIfTheAttributeIsNotSupported_6(); break; } @@ -21612,7 +21636,7 @@ class Test_TC_MC_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -21641,47 +21665,99 @@ class Test_TC_MC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); } + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65533UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR + TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesEitherValue0OrThrowsAGeneralErrorIfTheAttributeIsNotSupported_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } }; class Test_TC_MC_1_2 : public TestCommandBridge { @@ -21736,8 +21812,43 @@ class Test_TC_MC_1_2 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -21753,7 +21864,7 @@ class Test_TC_MC_1_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -21817,12 +21928,82 @@ class Test_TC_MC_1_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } }; class Test_TC_MC_1_3 : public TestCommandBridge { @@ -21877,8 +22058,48 @@ class Test_TC_MC_1_3 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read attribute Feature map and verify that DUT response indicates that the FeatureMap " + "attribute has bit 0 set to 1 if the DUT supports the Application Platform feature (PICS_AP_S is true).\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadAttributeFeatureMapAndVerifyThatDutResponseIndicatesThatTheFeatureMapAttributeHasBit0SetTo1IfTheDutSupportsTheApplicationPlatformFeaturePicsApSIsTrue_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -21894,7 +22115,7 @@ class Test_TC_MC_1_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -21964,34 +22185,113 @@ class Test_TC_MC_1_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(7))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_MC_1_4 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_1_4() - : TestCommandBridge("Test_TC_MC_1_4") - , mTestIndex(0) + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_MC_1_4() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 3UL)); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadAttributeFeatureMapAndVerifyThatDutResponseIndicatesThatTheFeatureMapAttributeHasBit0SetTo1IfTheDutSupportsTheApplicationPlatformFeaturePicsApSIsTrue_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_1_4 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MC_1_4() + : TestCommandBridge("Test_TC_MC_1_4") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MC_1_4() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_4\n"); @@ -22024,8 +22324,40 @@ class Test_TC_MC_1_4 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read attribute Feature map and Verify that the DUT response indicates that the FeatureMap " + "attribute has bit 0 set to 1 if the DUT supports the Name Updates feature PICS_NU_S is true\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadAttributeFeatureMapAndVerifyThatTheDutResponseIndicatesThatTheFeatureMapAttributeHasBit0SetTo1IfTheDutSupportsTheNameUpdatesFeaturePicsNuSIsTrue_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -22041,7 +22373,7 @@ class Test_TC_MC_1_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -22105,12 +22437,87 @@ class Test_TC_MC_1_4 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(7))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadAttributeFeatureMapAndVerifyThatTheDutResponseIndicatesThatTheFeatureMapAttributeHasBit0SetTo1IfTheDutSupportsTheNameUpdatesFeaturePicsNuSIsTrue_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } }; class Test_TC_MC_1_5 : public TestCommandBridge { @@ -22165,8 +22572,39 @@ class Test_TC_MC_1_5 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -22182,7 +22620,7 @@ class Test_TC_MC_1_5 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -22246,160 +22684,88 @@ class Test_TC_MC_1_5 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_MC_1_6 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_1_6() - : TestCommandBridge("Test_TC_MC_1_6") - , mTestIndex(0) + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_MC_1_6() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_6\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_6\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_7() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - }]; - + UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } }; -class Test_TC_MC_1_7 : public TestCommandBridge { +class Test_TC_MC_1_6 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_1_7() - : TestCommandBridge("Test_TC_MC_1_7") + Test_TC_MC_1_6() + : TestCommandBridge("Test_TC_MC_1_6") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -22409,7 +22775,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_1_7() {} + ~Test_TC_MC_1_6() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -22417,11 +22783,11 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_7\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_6\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_7\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_6\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -22447,8 +22813,49 @@ class Test_TC_MC_1_7 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response values based on " + "feature/PICS support Bit 0 - Set to 1 if the DUT supports Channel Lists (PICS_CL_S is true) Bit 1 - Set to 1 if " + "the DUT supports Lineup Info (PICS_LI_S is true)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseValuesBasedOnFeaturePicsSupportBit0SetTo1IfTheDutSupportsChannelListsPicsClSIsTrueBit1SetTo1IfTheDutSupportsLineupInfoPicsLiSIsTrue_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -22464,7 +22871,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -22480,7 +22887,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -22502,7 +22909,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -22520,7 +22927,7 @@ class Test_TC_MC_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -22528,19 +22935,81 @@ class Test_TC_MC_1_7 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(8))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseValuesBasedOnFeaturePicsSupportBit0SetTo1IfTheDutSupportsChannelListsPicsClSIsTrueBit1SetTo1IfTheDutSupportsLineupInfoPicsLiSIsTrue_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } }; -class Test_TC_MC_1_8 : public TestCommandBridge { +class Test_TC_MC_1_7 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_1_8() - : TestCommandBridge("Test_TC_MC_1_8") + Test_TC_MC_1_7() + : TestCommandBridge("Test_TC_MC_1_7") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -22550,7 +23019,7 @@ class Test_TC_MC_1_8 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_1_8() {} + ~Test_TC_MC_1_7() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -22558,11 +23027,11 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_8\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_7\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_8\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_7\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -22588,8 +23057,39 @@ class Test_TC_MC_1_8 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read FeatureMap attribute from the DUT and Verify that the DUT values based on feature/PICS " + "support:Bit 0 - Set to 1 if the DUT supports Advanced Seek (PICS_ADVANCEDSEEK is true) Bit 1 - Set to 1 if the " + "DUT supports Variable Speed (PICS_VARIABLESPEED is true)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutValuesBasedOnFeaturePicsSupportBit0SetTo1IfTheDutSupportsAdvancedSeekPicsAdvancedseekIsTrueBit1SetTo1IfTheDutSupportsVariableSpeedPicsVariablespeedIsTrue_6(); + break; } if (CHIP_NO_ERROR != err) { @@ -22605,7 +23105,7 @@ class Test_TC_MC_1_8 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -22621,7 +23121,7 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -22643,7 +23143,7 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -22661,7 +23161,7 @@ class Test_TC_MC_1_8 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -22669,19 +23169,101 @@ class Test_TC_MC_1_8 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(12))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 65533UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(11))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 8UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 9UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 11UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 10UL)); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + CHIP_ERROR + TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutValuesBasedOnFeaturePicsSupportBit0SetTo1IfTheDutSupportsAdvancedSeekPicsAdvancedseekIsTrueBit1SetTo1IfTheDutSupportsVariableSpeedPicsVariablespeedIsTrue_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } }; -class Test_TC_MC_1_9 : public TestCommandBridge { +class Test_TC_MC_1_8 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_1_9() - : TestCommandBridge("Test_TC_MC_1_9") + Test_TC_MC_1_8() + : TestCommandBridge("Test_TC_MC_1_8") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -22691,7 +23273,7 @@ class Test_TC_MC_1_9 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_1_9() {} + ~Test_TC_MC_1_8() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -22699,11 +23281,11 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_9\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_8\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_9\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_8\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -22729,8 +23311,48 @@ class Test_TC_MC_1_9 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT has bit 1 set to 1 if the " + "device supports Name Updates PICS_NAMEUPDATES is true\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutHasBit1SetTo1IfTheDeviceSupportsNameUpdatesPicsNameupdatesIsTrue_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -22746,7 +23368,7 @@ class Test_TC_MC_1_9 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -22762,7 +23384,7 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -22784,7 +23406,7 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -22802,7 +23424,7 @@ class Test_TC_MC_1_9 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -22810,19 +23432,92 @@ class Test_TC_MC_1_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(7))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutHasBit1SetTo1IfTheDeviceSupportsNameUpdatesPicsNameupdatesIsTrue_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } }; -class Test_TC_MC_1_10 : public TestCommandBridge { +class Test_TC_MC_1_9 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_1_10() - : TestCommandBridge("Test_TC_MC_1_10") + Test_TC_MC_1_9() + : TestCommandBridge("Test_TC_MC_1_9") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -22832,7 +23527,7 @@ class Test_TC_MC_1_10 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_1_10() {} + ~Test_TC_MC_1_9() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -22840,11 +23535,11 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_10\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_9\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_10\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_9\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -22870,8 +23565,44 @@ class Test_TC_MC_1_10 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and verify response has the value 0 or throws a " + "general error if the attribute is not supported..\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyResponseHasTheValue0OrThrowsAGeneralErrorIfTheAttributeIsNotSupported_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -22887,7 +23618,7 @@ class Test_TC_MC_1_10 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -22903,9 +23634,7 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -22927,9 +23656,7 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -22947,9 +23674,7 @@ class Test_TC_MC_1_10 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -22957,19 +23682,91 @@ class Test_TC_MC_1_10 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadFeatureMapAttributeFromTheDutAndVerifyResponseHasTheValue0OrThrowsAGeneralErrorIfTheAttributeIsNotSupported_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } }; -class Test_TC_MC_1_11 : public TestCommandBridge { +class Test_TC_MC_1_10 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_1_11() - : TestCommandBridge("Test_TC_MC_1_11") + Test_TC_MC_1_10() + : TestCommandBridge("Test_TC_MC_1_10") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -22979,7 +23776,7 @@ class Test_TC_MC_1_11 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_1_11() {} + ~Test_TC_MC_1_10() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -22987,11 +23784,11 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_11\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_10\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_11\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_10\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -23017,8 +23814,48 @@ class Test_TC_MC_1_11 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and verify response has the value 0 or throws a " + "general error if the attribute is not supported..\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyResponseHasTheValue0OrThrowsAGeneralErrorIfTheAttributeIsNotSupported_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -23034,7 +23871,7 @@ class Test_TC_MC_1_11 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -23050,7 +23887,9 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -23072,7 +23911,9 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -23090,7 +23931,9 @@ class Test_TC_MC_1_11 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -23098,19 +23941,102 @@ class Test_TC_MC_1_11 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(12))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 2UL)); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadFeatureMapAttributeFromTheDutAndVerifyResponseHasTheValue0OrThrowsAGeneralErrorIfTheAttributeIsNotSupported_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } }; -class Test_TC_MC_1_12 : public TestCommandBridge { +class Test_TC_MC_1_11 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_1_12() - : TestCommandBridge("Test_TC_MC_1_12") + Test_TC_MC_1_11() + : TestCommandBridge("Test_TC_MC_1_11") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -23120,7 +24046,7 @@ class Test_TC_MC_1_12 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_1_12() {} + ~Test_TC_MC_1_11() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -23128,11 +24054,11 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_12\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_11\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_12\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_11\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -23158,8 +24084,49 @@ class Test_TC_MC_1_12 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT values based on feature/PICS support: Bit 0 - Set to " + "1 if the DUT supports Content Search (PICS_CONTENTSEARCH is true) Bit 1 - Set to 1 if the DUT supports URL " + "Playback (PICS_URLPLAYBACK is true)\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutValuesBasedOnFeaturePicsSupportBit0SetTo1IfTheDutSupportsContentSearchPicsContentsearchIsTrueBit1SetTo1IfTheDutSupportsUrlPlaybackPicsUrlplaybackIsTrue_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -23175,7 +24142,7 @@ class Test_TC_MC_1_12 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -23191,7 +24158,7 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -23213,7 +24180,7 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -23231,7 +24198,7 @@ class Test_TC_MC_1_12 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -23239,111 +24206,91 @@ class Test_TC_MC_1_12 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_MC_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_2_1() - : TestCommandBridge("Test_TC_MC_2_1") - , mTestIndex(0) + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_MC_2_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Put the device into low power mode\n"); - err = TestPutTheDeviceIntoLowPowerMode_1(); - break; - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + VerifyOrReturn(CheckValue("status", err, 0)); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestPutTheDeviceIntoLowPowerMode_1() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster sleepWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Put the device into low power mode Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR + TestReadFeatureMapAttributeFromTheDutValuesBasedOnFeaturePicsSupportBit0SetTo1IfTheDutSupportsContentSearchPicsContentsearchIsTrueBit1SetTo1IfTheDutSupportsUrlPlaybackPicsUrlplaybackIsTrue_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } }; -class Test_TC_MC_3_1 : public TestCommandBridge { +class Test_TC_MC_1_12 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_3_1() - : TestCommandBridge("Test_TC_MC_3_1") + Test_TC_MC_1_12() + : TestCommandBridge("Test_TC_MC_1_12") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -23353,7 +24300,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_3_1() {} + ~Test_TC_MC_1_12() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -23361,11 +24308,11 @@ class Test_TC_MC_3_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_12\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_12\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -23381,6 +24328,53 @@ class Test_TC_MC_3_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -23396,7 +24390,7 @@ class Test_TC_MC_3_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -23408,84 +24402,1174 @@ class Test_TC_MC_3_1 : public TestCommandBridge { WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } -}; - -class Test_TC_MC_3_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_3_2() - : TestCommandBridge("Test_TC_MC_3_2") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_MC_3_2() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_2\n"); - } + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65533UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 3UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MC_2_1() + : TestCommandBridge("Test_TC_MC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Put the device into low power mode\n"); + err = TestPutTheDeviceIntoLowPowerMode_1(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPutTheDeviceIntoLowPowerMode_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster sleepWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Put the device into low power mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_3_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MC_3_1() + : TestCommandBridge("Test_TC_MC_3_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MC_3_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Select\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendSelect_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send Up\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendUp_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send Down\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendDown_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Send Left\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendLeft_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Send Right\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRight_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Send RightUp\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRightUp_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Send RightDown\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRightDown_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Send LeftUp\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendLeftUp_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Send LeftDown\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendLeftDown_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Send SetupMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendSetupMenu_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Send ContentsMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendContentsMenu_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Send FavoriteMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendFavoriteMenu_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Send Exit\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendExit_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Send Invalid\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendInvalid_15(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 16; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendSelect_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:0]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Select Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendUp_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:1]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Up Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendDown_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:2]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Down Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendLeft_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:3]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Left Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRight_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:4]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Right Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRightUp_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:5]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RightUp Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRightDown_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:6]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RightDown Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendLeftUp_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:7]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send LeftUp Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendLeftDown_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:8]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send LeftDown Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendSetupMenu_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:10]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send SetupMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendContentsMenu_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:11]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send ContentsMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendFavoriteMenu_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:12]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send FavoriteMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendExit_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:13]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Exit Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendInvalid_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:255]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Invalid Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_3_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MC_3_2() + : TestCommandBridge("Test_TC_MC_3_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MC_3_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send SetupMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendSetupMenu_2(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendSetupMenu_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:10]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send SetupMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_3_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MC_3_3() + : TestCommandBridge("Test_TC_MC_3_3") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MC_3_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Numbers1\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendNumbers1_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send Numbers2\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendNumbers2_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send Numbers3\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendNumbers3_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Send Numbers4\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendNumbers4_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Send Numbers5\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendNumbers5_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Send Numbers6\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendNumbers6_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Send Numbers7\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendNumbers7_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Send Numbers8\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendNumbers8_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Send Numbers9\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendNumbers9_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendNumbers1_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:33]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers1 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendNumbers2_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:34]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers2 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendNumbers3_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:35]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendNumbers4_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:36]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers4 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendNumbers5_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:37]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers5 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendNumbers6_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:38]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers6 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendNumbers7_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:39]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers7 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendNumbers8_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:40]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers8 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendNumbers9_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:41]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers9 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } }; -class Test_TC_MC_3_3 : public TestCommandBridge { +class Test_TC_MC_3_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_3_3() - : TestCommandBridge("Test_TC_MC_3_3") + Test_TC_MC_3_4() + : TestCommandBridge("Test_TC_MC_3_4") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -23495,7 +25579,7 @@ class Test_TC_MC_3_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MC_3_3() {} + ~Test_TC_MC_3_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -23503,11 +25587,11 @@ class Test_TC_MC_3_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -23523,6 +25607,86 @@ class Test_TC_MC_3_3 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Send RootMenu\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestSendRootMenu_10(); + break; } if (CHIP_NO_ERROR != err) { @@ -23538,87 +25702,216 @@ class Test_TC_MC_3_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 11; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } -}; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendRootMenu_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; -class Test_TC_MC_3_4 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MC_3_4() - : TestCommandBridge("Test_TC_MC_3_4") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_MC_3_4() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestSendRootMenu_9() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_4\n"); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_4\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err, 0)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestSendRootMenu_10() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send RootMenu Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } }; @@ -23665,6 +25958,10 @@ class Test_TC_MC_3_5 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read CatalogList attribute.\n"); + err = TestReadCatalogListAttribute_1(); + break; } if (CHIP_NO_ERROR != err) { @@ -23680,7 +25977,7 @@ class Test_TC_MC_3_5 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 2; chip::Optional mNodeId; chip::Optional mCluster; @@ -23692,6 +25989,26 @@ class Test_TC_MC_3_5 : public TestCommandBridge { WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadCatalogListAttribute_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCatalogListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CatalogList attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("catalogList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_MC_3_6 : public TestCommandBridge { @@ -26553,38 +28870,43 @@ class Test_TC_OO_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("OO_LT")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional global attribute: FeatureMap\n"); + if (ShouldSkip("OO_LT")) { + NextTest(); + return; + } err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional global attribute : FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : write the default values to optional global attribute: FeatureMap\n"); - err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : reads back optional global attribute: FeatureMap\n"); - err = TestReadsBackOptionalGlobalAttributeFeatureMap_9(); - break; } if (CHIP_NO_ERROR != err) { @@ -26600,7 +28922,7 @@ class Test_TC_OO_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -26629,23 +28951,6 @@ class Test_TC_OO_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); } - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; @@ -26653,134 +28958,100 @@ class Test_TC_OO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 16384UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 16385UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 16386UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 16387UL)); } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - }]; - + UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(6))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 64UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 66UL)); } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_7() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional global attribute : FeatureMap Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_8() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_9() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -26789,6 +29060,7 @@ class Test_TC_OO_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; @@ -33110,20 +35382,49 @@ class Test_TC_RH_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates " + "ClusterRevision attribute has the value 3\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue3_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_6(); break; } @@ -33140,7 +35441,7 @@ class Test_TC_RH_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -33153,23 +35454,10 @@ class Test_TC_RH_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR + TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue3_1() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; - + UserPrompt(@"Enter the Value", @"3"); return CHIP_NO_ERROR; } @@ -33186,6 +35474,14 @@ class Test_TC_RH_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -33193,7 +35489,13 @@ class Test_TC_RH_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_3() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device @@ -33206,6 +35508,11 @@ class Test_TC_RH_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -33213,7 +35520,7 @@ class Test_TC_RH_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device @@ -33226,12 +35533,23 @@ class Test_TC_RH_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_6() + { + UserPrompt(@"Please enter FeatureMap attribute value", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_RH_2_1 : public TestCommandBridge { @@ -33285,8 +35603,16 @@ class Test_TC_RH_2_1 : public TestCommandBridge { err = TestReadsConstraintsOfAttributeMinMeasuredValue_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads constraints of attribute: Tolerance\n"); - err = TestReadsConstraintsOfAttributeTolerance_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads constraints of attribute: MaxMeasuredValue\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadsConstraintsOfAttributeMaxMeasuredValue_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads constraints of attribute: Tolerance\n"); + err = TestReadsConstraintsOfAttributeTolerance_4(); break; } @@ -33303,7 +35629,7 @@ class Test_TC_RH_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -33370,7 +35696,34 @@ class Test_TC_RH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfAttributeTolerance_3() + CHIP_ERROR TestReadsConstraintsOfAttributeMaxMeasuredValue_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of attribute: MaxMeasuredValue Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 10000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsConstraintsOfAttributeTolerance_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device @@ -34311,13 +36664,53 @@ class Test_TC_TM_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates " + "ClusterRevision attribute has the value 4\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue4_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_2(); break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read AcceptedCommandList attribute from the DUT and Verify that the DUT response provides a " + "list of supported commands,This list SHALL include all the mandatory commands.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommandsThisListShallIncludeAllTheMandatoryCommands_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Read GeneratedCommandList attribute from the DUT and Verify that the DUT response provides a " + "list of supported commands.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommands_5(); + break; } if (CHIP_NO_ERROR != err) { @@ -34333,7 +36726,7 @@ class Test_TC_TM_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -34346,23 +36739,10 @@ class Test_TC_TM_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR + TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue4_1() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; - + UserPrompt(@"Please enter ClusterRevision attribute value", @"4"); return CHIP_NO_ERROR; } @@ -34379,12 +36759,40 @@ class Test_TC_TM_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommandsThisListShallIncludeAllTheMandatoryCommands_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedCommands_5() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } }; class Test_TC_TM_2_1 : public TestCommandBridge { @@ -37304,20 +39712,40 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates " + "ClusterRevision attribute has the value 2\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue2_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); break; } @@ -37334,7 +39762,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -37347,22 +39775,10 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR + TestReadClusterRevisionAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesClusterRevisionAttributeHasTheValue2_1() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; - + UserPrompt(@"Please enter ClusterRevision attribute value", @"2"); return CHIP_NO_ERROR; } @@ -37378,6 +39794,14 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -37385,7 +39809,13 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_3() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_3() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostatUserInterfaceConfiguration * cluster = @@ -37397,6 +39827,11 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -37404,7 +39839,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestThermostatUserInterfaceConfiguration * cluster = @@ -37416,6 +39851,11 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 9b72041e97ad4e..f667dc7c50d713 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -12535,7 +12535,7 @@ class Test_TC_LVL_6_1Suite : public TestCommand class Test_TC_MC_1_1Suite : public TestCommand { public: - Test_TC_MC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_1", 4, credsIssuerConfig) + Test_TC_MC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_1", 7, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -12578,24 +12578,63 @@ class Test_TC_MC_1_1Suite : public TestCommand uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 4)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -12621,12 +12660,31 @@ class Test_TC_MC_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::ClusterRevision::Id); + LogStep(2, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::AttributeList::Id); } case 3: { - LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::AttributeList::Id); + LogStep(3, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::AcceptedCommandList::Id); + } + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Attributes::GeneratedCommandList::Id); + } + case 6: { + LogStep(6, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates either value 0 or throws a " + "general error if the attribute is not supported"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } } return CHIP_NO_ERROR; @@ -12636,7 +12694,7 @@ class Test_TC_MC_1_1Suite : public TestCommand class Test_TC_MC_1_2Suite : public TestCommand { public: - Test_TC_MC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_2", 4, credsIssuerConfig) + Test_TC_MC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_2", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -12694,9 +12752,59 @@ class Test_TC_MC_1_2Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 5)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -12727,8 +12835,32 @@ class Test_TC_MC_1_2Suite : public TestCommand } case 3: { LogStep(3, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::AttributeList::Id); } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, + KeypadInput::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, "Read FeatureMap attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } } return CHIP_NO_ERROR; } @@ -12737,7 +12869,7 @@ class Test_TC_MC_1_2Suite : public TestCommand class Test_TC_MC_1_3Suite : public TestCommand { public: - Test_TC_MC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_3", 4, credsIssuerConfig) + Test_TC_MC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_3", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -12795,9 +12927,67 @@ class Test_TC_MC_1_3Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 7)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 3)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -12830,9 +13020,37 @@ class Test_TC_MC_1_3Suite : public TestCommand } case 3: { LogStep(3, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Attributes::AttributeList::Id); } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, + "Read attribute Feature map and verify that DUT response indicates that the FeatureMap attribute has bit 0 set " + "to 1 if the DUT supports the Application Platform feature (PICS_AP_S is true)."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } } return CHIP_NO_ERROR; } @@ -12841,7 +13059,7 @@ class Test_TC_MC_1_3Suite : public TestCommand class Test_TC_MC_1_4Suite : public TestCommand { public: - Test_TC_MC_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_4", 4, credsIssuerConfig) + Test_TC_MC_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_4", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -12899,109 +13117,66 @@ class Test_TC_MC_1_4Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 7)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - } - case 1: { - LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::ClusterRevision::Id); - } - case 2: { - LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::ClusterRevision::Id); - } - case 3: { - LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::AttributeList::Id); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_MC_1_5Suite : public TestCommand -{ -public: - Test_TC_MC_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_5", 4, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_MC_1_5Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 0: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 1: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 3)); + VerifyOrReturn(CheckValue("acceptedCommandList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 4)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 2: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 3: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "list")); - } + shouldContinue = true; break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); @@ -13025,25 +13200,49 @@ class Test_TC_MC_1_5Suite : public TestCommand } case 1: { LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::ClusterRevision::Id); } case 2: { LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::ClusterRevision::Id); } case 3: { LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::AttributeList::Id); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::AttributeList::Id); + } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, + "Read attribute Feature map and Verify that the DUT response indicates that the FeatureMap attribute has bit 0 " + "set to 1 if the DUT supports the Name Updates feature PICS_NU_S is true"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } } return CHIP_NO_ERROR; } }; -class Test_TC_MC_1_6Suite : public TestCommand +class Test_TC_MC_1_5Suite : public TestCommand { public: - Test_TC_MC_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_6", 4, credsIssuerConfig) + Test_TC_MC_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_5", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13051,7 +13250,7 @@ class Test_TC_MC_1_6Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_1_6Suite() {} + ~Test_TC_MC_1_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -13101,9 +13300,57 @@ class Test_TC_MC_1_6Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 6)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13126,25 +13373,47 @@ class Test_TC_MC_1_6Suite : public TestCommand } case 1: { LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::ClusterRevision::Id); } case 2: { LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::ClusterRevision::Id); } case 3: { LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AttributeList::Id); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::AttributeList::Id); + } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, "Read FeatureMap attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } } return CHIP_NO_ERROR; } }; -class Test_TC_MC_1_7Suite : public TestCommand +class Test_TC_MC_1_6Suite : public TestCommand { public: - Test_TC_MC_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_7", 4, credsIssuerConfig) + Test_TC_MC_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_6", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13152,7 +13421,7 @@ class Test_TC_MC_1_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_1_7Suite() {} + ~Test_TC_MC_1_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -13202,9 +13471,53 @@ class Test_TC_MC_1_7Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 8)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13227,25 +13540,52 @@ class Test_TC_MC_1_7Suite : public TestCommand } case 1: { LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ClusterRevision::Id); } case 2: { LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ClusterRevision::Id); } case 3: { LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AttributeList::Id); + } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and Verify that the DUT response values based on feature/PICS support " + "Bit 0 - Set to 1 if the DUT supports Channel Lists (PICS_CL_S is true) Bit 1 - Set to 1 if the DUT supports " + "Lineup Info (PICS_LI_S is true)"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } } return CHIP_NO_ERROR; } }; -class Test_TC_MC_1_8Suite : public TestCommand +class Test_TC_MC_1_7Suite : public TestCommand { public: - Test_TC_MC_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_8", 4, credsIssuerConfig) + Test_TC_MC_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_7", 7, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13253,7 +13593,7 @@ class Test_TC_MC_1_8Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_1_8Suite() {} + ~Test_TC_MC_1_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -13303,13 +13643,93 @@ class Test_TC_MC_1_8Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "list")); - } - break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); + VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); + VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); + VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 12)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 3)); + VerifyOrReturn(CheckValue("acceptedCommandList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 4)); + VerifyOrReturn(CheckValue("acceptedCommandList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 5)); + VerifyOrReturn(CheckValue("acceptedCommandList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 6)); + VerifyOrReturn(CheckValue("acceptedCommandList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 7)); + VerifyOrReturn(CheckValue("acceptedCommandList[7]", iter_0.GetValue(), 7UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 8)); + VerifyOrReturn(CheckValue("acceptedCommandList[8]", iter_0.GetValue(), 8UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 9)); + VerifyOrReturn(CheckValue("acceptedCommandList[9]", iter_0.GetValue(), 9UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 10)); + VerifyOrReturn(CheckValue("acceptedCommandList[10]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 11)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 10UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + if (shouldContinue) { ContinueOnChipMainThread(CHIP_NO_ERROR); @@ -13328,25 +13748,47 @@ class Test_TC_MC_1_8Suite : public TestCommand } case 1: { LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::ClusterRevision::Id); } case 2: { LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::ClusterRevision::Id); } case 3: { LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::AttributeList::Id); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::AttributeList::Id); + } + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::AcceptedCommandList::Id); + } + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, + MediaPlayback::Attributes::GeneratedCommandList::Id); + } + case 6: { + LogStep(6, + "Read FeatureMap attribute from the DUT and Verify that the DUT values based on feature/PICS support:Bit 0 - " + "Set to 1 if the DUT supports Advanced Seek (PICS_ADVANCEDSEEK is true) Bit 1 - Set to 1 if the DUT supports " + "Variable Speed (PICS_VARIABLESPEED is true)"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } } return CHIP_NO_ERROR; } }; -class Test_TC_MC_1_9Suite : public TestCommand +class Test_TC_MC_1_8Suite : public TestCommand { public: - Test_TC_MC_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_9", 4, credsIssuerConfig) + Test_TC_MC_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_8", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13354,7 +13796,7 @@ class Test_TC_MC_1_9Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_1_9Suite() {} + ~Test_TC_MC_1_8Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -13404,9 +13846,63 @@ class Test_TC_MC_1_9Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 7)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13429,28 +13925,52 @@ class Test_TC_MC_1_9Suite : public TestCommand } case 1: { LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, - TargetNavigator::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::ClusterRevision::Id); } case 2: { LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, - TargetNavigator::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::ClusterRevision::Id); } case 3: { LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, - TargetNavigator::Attributes::AttributeList::Id); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::AttributeList::Id); + } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, AudioOutput::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AudioOutput::Id, + AudioOutput::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and Verify that the DUT has bit 1 set to 1 if the device supports Name " + "Updates PICS_NAMEUPDATES is true"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } } return CHIP_NO_ERROR; } }; -class Test_TC_MC_1_10Suite : public TestCommand +class Test_TC_MC_1_9Suite : public TestCommand { public: - Test_TC_MC_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_10", 4, credsIssuerConfig) + Test_TC_MC_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_9", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13458,7 +13978,7 @@ class Test_TC_MC_1_10Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_1_10Suite() {} + ~Test_TC_MC_1_9Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -13508,9 +14028,61 @@ class Test_TC_MC_1_10Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 6)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13533,28 +14105,55 @@ class Test_TC_MC_1_10Suite : public TestCommand } case 1: { LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationBasic::Id, - ApplicationBasic::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::ClusterRevision::Id); } case 2: { LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationBasic::Id, - ApplicationBasic::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::ClusterRevision::Id); } case 3: { LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationBasic::Id, - ApplicationBasic::Attributes::AttributeList::Id); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::AttributeList::Id); } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } - return CHIP_NO_ERROR; - } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, + TargetNavigator::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and verify response has the value 0 or throws a general error if the " + "attribute is not supported.."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + } + return CHIP_NO_ERROR; + } }; -class Test_TC_MC_1_11Suite : public TestCommand +class Test_TC_MC_1_10Suite : public TestCommand { public: - Test_TC_MC_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_11", 4, credsIssuerConfig) + Test_TC_MC_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_10", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13562,7 +14161,7 @@ class Test_TC_MC_1_11Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_1_11Suite() {} + ~Test_TC_MC_1_10Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -13612,9 +14211,75 @@ class Test_TC_MC_1_11Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 7UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); + VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); + VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); + VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 12)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 2)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13637,28 +14302,56 @@ class Test_TC_MC_1_11Suite : public TestCommand } case 1: { LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, - ContentLauncher::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationBasic::Id, + ApplicationBasic::Attributes::ClusterRevision::Id); } case 2: { LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, - ContentLauncher::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationBasic::Id, + ApplicationBasic::Attributes::ClusterRevision::Id); } case 3: { LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, - ContentLauncher::Attributes::AttributeList::Id); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationBasic::Id, + ApplicationBasic::Attributes::AttributeList::Id); + } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationBasic::Id, + ApplicationBasic::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationBasic::Id, + ApplicationBasic::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and verify response has the value 0 or throws a general error if the " + "attribute is not supported.."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } } return CHIP_NO_ERROR; } }; -class Test_TC_MC_1_12Suite : public TestCommand +class Test_TC_MC_1_11Suite : public TestCommand { public: - Test_TC_MC_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_12", 4, credsIssuerConfig) + Test_TC_MC_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_11", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13666,7 +14359,7 @@ class Test_TC_MC_1_12Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_1_12Suite() {} + ~Test_TC_MC_1_11Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -13716,9 +14409,61 @@ class Test_TC_MC_1_12Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 6)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13741,25 +14486,57 @@ class Test_TC_MC_1_12Suite : public TestCommand } case 1: { LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AccountLogin::Id, AccountLogin::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::ClusterRevision::Id); } case 2: { LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AccountLogin::Id, AccountLogin::Attributes::ClusterRevision::Id); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::ClusterRevision::Id); } case 3: { LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AccountLogin::Id, AccountLogin::Attributes::AttributeList::Id); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::AttributeList::Id); + } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, + ContentLauncher::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT values based on feature/PICS support: Bit 0 - Set to 1 if the DUT " + "supports Content Search (PICS_CONTENTSEARCH is true) Bit 1 - Set to 1 if the DUT supports URL Playback " + "(PICS_URLPLAYBACK is true)"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } } return CHIP_NO_ERROR; } }; -class Test_TC_MC_2_1Suite : public TestCommand +class Test_TC_MC_1_12Suite : public TestCommand { public: - Test_TC_MC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_2_1", 2, credsIssuerConfig) + Test_TC_MC_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_1_12", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13767,7 +14544,7 @@ class Test_TC_MC_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_2_1Suite() {} + ~Test_TC_MC_1_12Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -13798,50 +14575,499 @@ class Test_TC_MC_2_1Suite : public TestCommand break; case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + } break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - } - case 1: { - LogStep(1, "Put the device into low power mode"); - chip::app::Clusters::LowPower::Commands::Sleep::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Commands::Sleep::Id, value); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_MC_3_1Suite : public TestCommand -{ -public: - Test_TC_MC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_1", 1, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_MC_3_1Suite() {} - + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 4)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 3)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 1: { + LogStep(1, "read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AccountLogin::Id, AccountLogin::Attributes::ClusterRevision::Id); + } + case 2: { + LogStep(2, "Read the global attribute constraints: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AccountLogin::Id, AccountLogin::Attributes::ClusterRevision::Id); + } + case 3: { + LogStep(3, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AccountLogin::Id, AccountLogin::Attributes::AttributeList::Id); + } + case 4: { + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AccountLogin::Id, + AccountLogin::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), AccountLogin::Id, + AccountLogin::Attributes::GeneratedCommandList::Id); + } + case 7: { + LogStep(7, "Read FeatureMap attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_2_1Suite : public TestCommand +{ +public: + Test_TC_MC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_2_1", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 1: { + LogStep(1, "Put the device into low power mode"); + chip::app::Clusters::LowPower::Commands::Sleep::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Commands::Sleep::Id, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_3_1Suite : public TestCommand +{ +public: + Test_TC_MC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_1", 16, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 1: { + LogStep(1, "Send Select"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 2: { + LogStep(2, "Send Up"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(1); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 3: { + LogStep(3, "Send Down"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(2); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 4: { + LogStep(4, "Send Left"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(3); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 5: { + LogStep(5, "Send Right"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(4); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 6: { + LogStep(6, "Send RightUp"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(5); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 7: { + LogStep(7, "Send RightDown"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 8: { + LogStep(8, "Send LeftUp"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(7); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 9: { + LogStep(9, "Send LeftDown"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(8); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 10: { + LogStep(10, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 11: { + LogStep(11, "Send SetupMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(10); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 12: { + LogStep(12, "Send ContentsMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(11); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 13: { + LogStep(13, "Send FavoriteMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(12); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 14: { + LogStep(14, "Send Exit"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(13); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 15: { + LogStep(15, "Send Invalid"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(255); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_3_2Suite : public TestCommand +{ +public: + Test_TC_MC_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_2", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_3_2Suite() {} + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); @@ -13869,6 +15095,20 @@ class Test_TC_MC_3_1Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13889,15 +15129,29 @@ class Test_TC_MC_3_1Suite : public TestCommand SetIdentity(kIdentityAlpha); return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } + case 1: { + LogStep(1, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 2: { + LogStep(2, "Send SetupMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(10); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } } return CHIP_NO_ERROR; } }; -class Test_TC_MC_3_2Suite : public TestCommand +class Test_TC_MC_3_3Suite : public TestCommand { public: - Test_TC_MC_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_2", 1, credsIssuerConfig) + Test_TC_MC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_3", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13905,7 +15159,7 @@ class Test_TC_MC_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_3_2Suite() {} + ~Test_TC_MC_3_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -13934,6 +15188,69 @@ class Test_TC_MC_3_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13954,70 +15271,68 @@ class Test_TC_MC_3_2Suite : public TestCommand SetIdentity(kIdentityAlpha); return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } + case 1: { + LogStep(1, "Send Numbers1"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(33); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_MC_3_3Suite : public TestCommand -{ -public: - Test_TC_MC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_3", 1, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_MC_3_3Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + case 2: { + LogStep(2, "Send Numbers2"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(34); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); + case 3: { + LogStep(3, "Send Numbers3"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(35); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + case 4: { + LogStep(4, "Send Numbers4"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(36); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 5: { + LogStep(5, "Send Numbers5"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(37); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 6: { + LogStep(6, "Send Numbers6"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(38); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 7: { + LogStep(7, "Send Numbers7"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(39); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 8: { + LogStep(8, "Send Numbers8"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(40); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 9: { + LogStep(9, "Send Numbers9"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(41); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); } } return CHIP_NO_ERROR; @@ -14027,7 +15342,7 @@ class Test_TC_MC_3_3Suite : public TestCommand class Test_TC_MC_3_4Suite : public TestCommand { public: - Test_TC_MC_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_4", 1, credsIssuerConfig) + Test_TC_MC_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_4", 11, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -14064,6 +15379,76 @@ class Test_TC_MC_3_4Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -14084,6 +15469,76 @@ class Test_TC_MC_3_4Suite : public TestCommand SetIdentity(kIdentityAlpha); return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } + case 1: { + LogStep(1, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 2: { + LogStep(2, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 3: { + LogStep(3, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 4: { + LogStep(4, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 5: { + LogStep(5, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 6: { + LogStep(6, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 7: { + LogStep(7, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 8: { + LogStep(8, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 9: { + LogStep(9, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } + case 10: { + LogStep(10, "Send RootMenu"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + chip::app::Clusters::KeypadInput::Commands::SendKey::Type value; + value.keyCode = static_cast(9); + return SendCommand(kIdentityAlpha, GetEndpoint(1), KeypadInput::Id, KeypadInput::Commands::SendKey::Id, value); + } } return CHIP_NO_ERROR; } @@ -14092,7 +15547,7 @@ class Test_TC_MC_3_4Suite : public TestCommand class Test_TC_MC_3_5Suite : public TestCommand { public: - Test_TC_MC_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_5", 1, credsIssuerConfig) + Test_TC_MC_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_5", 2, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -14129,6 +15584,14 @@ class Test_TC_MC_3_5Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -14149,6 +15612,11 @@ class Test_TC_MC_3_5Suite : public TestCommand SetIdentity(kIdentityAlpha); return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } + case 1: { + LogStep(1, "Read CatalogList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, + ApplicationLauncher::Attributes::CatalogList::Id); + } } return CHIP_NO_ERROR; } @@ -17607,7 +19075,7 @@ class Test_TC_OCC_2_2Suite : public TestCommand class Test_TC_OO_1_1Suite : public TestCommand { public: - Test_TC_OO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_1_1", 10, credsIssuerConfig) + Test_TC_OO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_1_1", 7, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -17644,66 +19112,84 @@ class Test_TC_OO_1_1Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); - } - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); - } - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 4: + case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; - case 5: + case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 16384UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 16385UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 16386UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 16387UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 5)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 6: + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint32_t value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 3)); + VerifyOrReturn(CheckValue("acceptedCommandList[3]", iter_0.GetValue(), 64UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 4)); + VerifyOrReturn(CheckValue("acceptedCommandList[4]", iter_0.GetValue(), 65UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 5)); + VerifyOrReturn(CheckValue("acceptedCommandList[5]", iter_0.GetValue(), 66UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 6)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 7: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint32_t value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "map32")); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 9: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + VerifyOrReturn(CheckConstraintType("value", "", "map32")); } break; default: @@ -17731,39 +19217,29 @@ class Test_TC_OO_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::ClusterRevision::Id); + LogStep(2, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AttributeList::Id); } case 3: { - LogStep(3, "write the default values to mandatory global attribute: ClusterRevision"); - uint16_t value; - value = 3U; - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::ClusterRevision::Id, value); + LogStep(3, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } case 4: { - LogStep(4, "reads back global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::ClusterRevision::Id); + LogStep(4, "Read the global attribute: AcceptedCommandList"); + VerifyOrdo(!ShouldSkip("OO_LT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AcceptedCommandList::Id); } case 5: { - LogStep(5, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AttributeList::Id); + LogStep(5, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GeneratedCommandList::Id); } case 6: { LogStep(6, "read the optional global attribute: FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::FeatureMap::Id); - } - case 7: { - LogStep(7, "Read the optional global attribute : FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::FeatureMap::Id); - } - case 8: { - LogStep(8, "write the default values to optional global attribute: FeatureMap"); - uint32_t value; - value = 0UL; - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::FeatureMap::Id, value); - } - case 9: { - LogStep(9, "reads back optional global attribute: FeatureMap"); + VerifyOrdo(!ShouldSkip("OO_LT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::FeatureMap::Id); } } @@ -21565,7 +23041,7 @@ class Test_TC_PSCFG_1_1Suite : public TestCommand class Test_TC_RH_1_1Suite : public TestCommand { public: - Test_TC_RH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_1_1", 5, credsIssuerConfig) + Test_TC_RH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_1_1", 7, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -21604,36 +23080,58 @@ class Test_TC_RH_1_1Suite : public TestCommand break; case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); - } + shouldContinue = true; break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 3)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 4: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -21655,25 +23153,42 @@ class Test_TC_RH_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, - RelativeHumidityMeasurement::Attributes::ClusterRevision::Id); + LogStep(1, + "Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates ClusterRevision " + "attribute has the value 3"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Enter the Value", "3"); } case 2: { LogStep(2, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, RelativeHumidityMeasurement::Attributes::AttributeList::Id); } case 3: { - LogStep(3, "Read the global attribute: AcceptedCommandList"); + LogStep(3, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, RelativeHumidityMeasurement::Attributes::AcceptedCommandList::Id); } - case 4: { - LogStep(4, "Read the global attribute: GeneratedCommandList"); + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, RelativeHumidityMeasurement::Attributes::GeneratedCommandList::Id); } + case 6: { + LogStep(6, "Read FeatureMap attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter FeatureMap attribute value", "0"); + } } return CHIP_NO_ERROR; } @@ -21682,7 +23197,7 @@ class Test_TC_RH_1_1Suite : public TestCommand class Test_TC_RH_2_1Suite : public TestCommand { public: - Test_TC_RH_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_2_1", 4, credsIssuerConfig) + Test_TC_RH_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_2_1", 5, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -21740,6 +23255,16 @@ class Test_TC_RH_2_1Suite : public TestCommand } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + } + break; + case 4: if (IsUnsupported(status.mStatus)) { return; @@ -21784,7 +23309,13 @@ class Test_TC_RH_2_1Suite : public TestCommand RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id); } case 3: { - LogStep(3, "Reads constraints of attribute: Tolerance"); + LogStep(3, "Reads constraints of attribute: MaxMeasuredValue"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id); + } + case 4: { + LogStep(4, "Reads constraints of attribute: Tolerance"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, RelativeHumidityMeasurement::Attributes::Tolerance::Id); } @@ -22827,7 +24358,7 @@ class Test_TC_SWTCH_2_2Suite : public TestCommand class Test_TC_TM_1_1Suite : public TestCommand { public: - Test_TC_TM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TM_1_1", 3, credsIssuerConfig) + Test_TC_TM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TM_1_1", 6, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -22866,20 +24397,40 @@ class Test_TC_TM_1_1Suite : public TestCommand break; case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); - } + shouldContinue = true; break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 4)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -22901,15 +24452,42 @@ class Test_TC_TM_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, - TemperatureMeasurement::Attributes::ClusterRevision::Id); + LogStep(1, + "Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates ClusterRevision " + "attribute has the value 4"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter ClusterRevision attribute value", "4"); } case 2: { LogStep(2, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, TemperatureMeasurement::Attributes::AttributeList::Id); } + case 3: { + LogStep(3, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 4: { + LogStep(4, + "Read AcceptedCommandList attribute from the DUT and Verify that the DUT response provides a list of supported " + "commands,This list SHALL include all the mandatory commands."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, + "Read GeneratedCommandList attribute from the DUT and Verify that the DUT response provides a list of " + "supported commands."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } } return CHIP_NO_ERROR; } @@ -24362,7 +25940,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand class Test_TC_TSUIC_1_1Suite : public TestCommand { public: - Test_TC_TSUIC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSUIC_1_1", 5, credsIssuerConfig) + Test_TC_TSUIC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSUIC_1_1", 6, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -24401,33 +25979,51 @@ class Test_TC_TSUIC_1_1Suite : public TestCommand break; case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); - } + shouldContinue = true; break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 3)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 4: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; @@ -24452,22 +26048,33 @@ class Test_TC_TSUIC_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, - ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::Id); + LogStep(1, + "Read ClusterRevision attribute from the DUT and Verify that the DUT response indicates ClusterRevision " + "attribute has the value 2"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter ClusterRevision attribute value", "2"); } case 2: { LogStep(2, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, ThermostatUserInterfaceConfiguration::Attributes::AttributeList::Id); } case 3: { - LogStep(3, "Read the global attribute: AcceptedCommandList"); + LogStep(3, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, ThermostatUserInterfaceConfiguration::Attributes::AcceptedCommandList::Id); } - case 4: { - LogStep(4, "Read the global attribute: GeneratedCommandList"); + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ThermostatUserInterfaceConfiguration::Id, ThermostatUserInterfaceConfiguration::Attributes::GeneratedCommandList::Id); } From 6d67737115877b670eaba3584583ea40b28d5c5d Mon Sep 17 00:00:00 2001 From: kowsisoundhar12 <57476670+kowsisoundhar12@users.noreply.github.com> Date: Thu, 28 Apr 2022 23:49:44 +0530 Subject: [PATCH 29/59] Test added apr7 (#17165) * Added manual scripts * Added auto generatedfiles * Restyled by whitespace * Restyled by prettier-yaml * updated additional comments Co-authored-by: Restyled.io --- examples/chip-tool/templates/tests/tests.js | 134 + .../suites/certification/Test_TC_BDX_1_4.yaml | 48 + .../certification/Test_TC_BOOL_2_2.yaml | 138 + .../certification/Test_TC_BOOL_3_1.yaml | 67 + .../certification/Test_TC_BRAC_3_1.yaml | 119 + .../suites/certification/Test_TC_CC_2_2.yaml | 77 + .../suites/certification/Test_TC_CC_3_4.yaml | 221 + .../suites/certification/Test_TC_CC_4_5.yaml | 235 + .../suites/certification/Test_TC_CC_5_4.yaml | 73 + .../suites/certification/Test_TC_CC_6_4.yaml | 65 + .../suites/certification/Test_TC_CC_7_5.yaml | 62 + .../suites/certification/Test_TC_CC_9_4.yaml | 97 + .../suites/certification/Test_TC_DD_1_11.yaml | 79 + .../suites/certification/Test_TC_DD_1_12.yaml | 100 + .../suites/certification/Test_TC_DD_2_1.yaml | 25 +- .../suites/certification/Test_TC_DD_2_2.yaml | 3 +- .../suites/certification/Test_TC_DD_3_3.yaml | 605 ++ .../suites/certification/Test_TC_DD_3_4.yaml | 605 ++ .../suites/certification/Test_TC_DD_3_7.yaml | 38 + .../suites/certification/Test_TC_DD_3_8.yaml | 31 + .../suites/certification/Test_TC_DL_1_1.yaml | 264 + .../suites/certification/Test_TC_DL_1_10.yaml | 72 + .../suites/certification/Test_TC_DL_1_11.yaml | 85 + .../suites/certification/Test_TC_DL_1_13.yaml | 94 + .../suites/certification/Test_TC_DL_1_14.yaml | 140 + .../suites/certification/Test_TC_DL_1_15.yaml | 68 + .../suites/certification/Test_TC_DL_1_16.yaml | 87 + .../suites/certification/Test_TC_DL_1_17.yaml | 187 + .../suites/certification/Test_TC_DL_1_2.yaml | 83 + .../suites/certification/Test_TC_DL_1_4.yaml | 36 + .../suites/certification/Test_TC_DL_1_5.yaml | 74 + .../suites/certification/Test_TC_DL_1_6.yaml | 103 + .../suites/certification/Test_TC_DL_1_7.yaml | 51 + .../suites/certification/Test_TC_DL_1_8.yaml | 75 + .../suites/certification/Test_TC_DM_2_1.yaml | 103 + .../suites/certification/Test_TC_DM_2_3.yaml | 15 + .../suites/certification/Test_TC_GC_1_4.yaml | 145 + .../suites/certification/Test_TC_IDM_7_1.yaml | 41 + .../suites/certification/Test_TC_ILL_3_1.yaml | 54 + .../suites/certification/Test_TC_I_3_1.yaml | 114 + .../suites/certification/Test_TC_I_3_2.yaml | 171 + .../suites/certification/Test_TC_LC_1_1.yaml | 57 + .../suites/certification/Test_TC_LC_1_3.yaml | 35 + .../suites/certification/Test_TC_LC_1_4.yaml | 33 + .../suites/certification/Test_TC_LC_1_5.yaml | 36 + .../suites/certification/Test_TC_LO_1_1.yaml | 197 + .../suites/certification/Test_TC_LVL_2_3.yaml | 294 + .../suites/certification/Test_TC_MC_10_7.yaml | 125 + .../suites/certification/Test_TC_MC_2_2.yaml | 57 + .../suites/certification/Test_TC_MOD_1_3.yaml | 102 + .../suites/certification/Test_TC_NC_1_1.yaml | 205 + .../suites/certification/Test_TC_NC_1_10.yaml | 55 + .../suites/certification/Test_TC_NC_1_11.yaml | 56 + .../suites/certification/Test_TC_NC_1_12.yaml | 66 + .../suites/certification/Test_TC_NC_1_13.yaml | 56 + .../suites/certification/Test_TC_NC_1_14.yaml | 42 + .../suites/certification/Test_TC_NC_1_15.yaml | 42 + .../suites/certification/Test_TC_NC_1_16.yaml | 62 + .../suites/certification/Test_TC_NC_1_17.yaml | 61 + .../suites/certification/Test_TC_NC_1_18.yaml | 45 + .../suites/certification/Test_TC_NC_1_2.yaml | 203 + .../suites/certification/Test_TC_NC_1_3.yaml | 184 + .../suites/certification/Test_TC_NC_1_4.yaml | 59 + .../suites/certification/Test_TC_NC_1_5.yaml | 49 + .../suites/certification/Test_TC_NC_1_6.yaml | 49 + .../suites/certification/Test_TC_NC_1_7.yaml | 89 + .../suites/certification/Test_TC_NC_1_8.yaml | 62 + .../suites/certification/Test_TC_NC_1_9.yaml | 46 + .../suites/certification/Test_TC_OCC_3_2.yaml | 78 + .../suites/certification/Test_TC_OO_3_1.yaml | 99 + .../suites/certification/Test_TC_OO_3_2.yaml | 234 + .../suites/certification/Test_TC_PRS_3_1.yaml | 81 + .../certification/Test_TC_PSCFG_2_2.yaml | 46 + .../certification/Test_TC_PSCFG_3_1.yaml | 62 +- .../suites/certification/Test_TC_PS_3_1.yaml | 75 + .../suites/certification/Test_TC_RH_3_1.yaml | 74 + .../suites/certification/Test_TC_SC_4_1.yaml | 117 + .../suites/certification/Test_TC_SC_4_10.yaml | 38 + .../suites/certification/Test_TC_SC_4_3.yaml | 59 + .../suites/certification/Test_TC_SC_4_4.yaml | 74 + .../suites/certification/Test_TC_SC_4_6.yaml | 42 + .../suites/certification/Test_TC_SC_4_7.yaml | 37 +- .../suites/certification/Test_TC_SC_4_8.yaml | 23 +- .../certification/Test_TC_SWTCH_1_1.yaml | 60 + .../certification/Test_TC_SWTCH_3_1.yaml | 103 + .../suites/certification/Test_TC_TM_3_1.yaml | 80 + .../certification/Test_TC_TSTAT_3_1.yaml | 102 + .../certification/Test_TC_TSTAT_3_2.yaml | 136 + .../certification/Test_TC_TSUIC_3_1.yaml | 103 + .../certification/Test_TC_WNCV_4_5.yaml | 1 + .../certification/Test_TC_WNCV_5_1.yaml | 172 + .../certification/Test_TC_WNCV_7_1.yaml | 107 + .../chip-tool/zap-generated/test/Commands.h | 5924 +++++++++++++++-- 93 files changed, 14558 insertions(+), 620 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_BDX_1_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_BOOL_2_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_BOOL_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_BRAC_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_2_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_3_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_4_5.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_5_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_6_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_7_5.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_9_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DD_1_11.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DD_1_12.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DD_3_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DD_3_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DD_3_7.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DD_3_8.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_10.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_11.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_13.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_14.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_15.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_16.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_17.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_5.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_6.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_7.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DL_1_8.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DM_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_GC_1_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_ILL_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_I_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_I_3_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_LC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_LC_1_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_LC_1_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_LC_1_5.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_LO_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_LVL_2_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_10_7.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_2_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_10.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_11.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_12.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_13.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_14.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_15.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_16.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_17.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_18.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_5.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_6.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_7.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_8.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NC_1_9.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OCC_3_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OO_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OO_3_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PRS_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PSCFG_2_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PS_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_RH_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_SC_4_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_SC_4_10.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_SC_4_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_SC_4_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_SWTCH_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_SWTCH_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TM_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TSTAT_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TSTAT_3_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TSUIC_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_WNCV_5_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_WNCV_7_1.yaml diff --git a/examples/chip-tool/templates/tests/tests.js b/examples/chip-tool/templates/tests/tests.js index 22f3728a5942cc..6e6eeeece2f40b 100644 --- a/examples/chip-tool/templates/tests/tests.js +++ b/examples/chip-tool/templates/tests/tests.js @@ -24,12 +24,18 @@ function getManualTests() 'Test_TC_DD_1_8', 'Test_TC_DD_1_9', 'Test_TC_DD_1_10', + 'Test_TC_DD_1_11', + 'Test_TC_DD_1_12', 'Test_TC_DD_2_1', 'Test_TC_DD_2_2', 'Test_TC_DD_3_1', 'Test_TC_DD_3_2', + 'Test_TC_DD_3_3', + 'Test_TC_DD_3_4', 'Test_TC_DD_3_5', 'Test_TC_DD_3_6', + 'Test_TC_DD_3_7', + 'Test_TC_DD_3_8', 'Test_TC_DD_3_9', 'Test_TC_DD_3_10', 'Test_TC_DD_3_11', @@ -48,6 +54,7 @@ function getManualTests() 'Test_TC_BDX_1_1', 'Test_TC_BDX_1_2', 'Test_TC_BDX_1_3', + 'Test_TC_BDX_1_4', 'Test_TC_BDX_1_5', 'Test_TC_BDX_1_6', 'Test_TC_BDX_2_1', @@ -66,11 +73,13 @@ function getManualTests() const BridgedActions = [ 'Test_TC_BRAC_2_1', 'Test_TC_BRAC_2_2', + 'Test_TC_BRAC_3_1', ]; const DeviceManagement = [ 'Test_TC_DM_1_2', 'Test_TC_DM_1_4', + 'Test_TC_DM_2_1', 'Test_TC_DM_2_3', 'Test_TC_DM_2_4', 'Test_TC_DM_3_2', @@ -94,6 +103,7 @@ function getManualTests() const GeneralCommissioning = [ 'Test_TC_GC_1_2', 'Test_TC_GC_1_3', + 'Test_TC_GC_1_4', ]; const GeneralDiagnostics = [ @@ -104,10 +114,13 @@ function getManualTests() const Identify = [ 'Test_TC_I_2_2', + 'Test_TC_I_3_1', + 'Test_TC_I_3_2', ]; const IlluminanceMeasurement = [ 'Test_TC_ILL_2_2', + 'Test_TC_ILL_3_1', ]; const InteractionDataModel = [ @@ -125,9 +138,11 @@ function getManualTests() 'Test_TC_IDM_6_2', 'Test_TC_IDM_6_3', 'Test_TC_IDM_6_4', + 'Test_TC_IDM_7_1', ]; const MediaControl = [ + 'Test_TC_MC_2_2', 'Test_TC_MC_3_12', 'Test_TC_MC_3_13', 'Test_TC_MC_4_1', @@ -138,6 +153,7 @@ function getManualTests() 'Test_TC_MC_10_4', 'Test_TC_MC_10_5', 'Test_TC_MC_10_6', + 'Test_TC_MC_10_7', ]; const MultipleFabrics = [ @@ -168,6 +184,7 @@ function getManualTests() const ModeSelect = [ 'Test_TC_MOD_1_2', + 'Test_TC_MOD_1_3', 'Test_TC_MOD_2_1', 'Test_TC_MOD_2_2', 'Test_TC_MOD_3_1', @@ -194,15 +211,20 @@ function getManualTests() const PowerSourceConfiguration = [ 'Test_TC_PSCFG_2_1', + 'Test_TC_PSCFG_2_2', 'Test_TC_PSCFG_3_1', ]; const SecureChannel = [ + 'Test_TC_SC_4_1', + 'Test_TC_SC_4_3', + 'Test_TC_SC_4_4', 'Test_TC_SC_4_5', 'Test_TC_SC_4_6', 'Test_TC_SC_4_7', 'Test_TC_SC_4_8', 'Test_TC_SC_4_9', + 'Test_TC_SC_4_10', ]; const SoftwareDiagnostics = [ @@ -216,6 +238,7 @@ function getManualTests() const WindowCovering = [ 'Test_TC_WNCV_6_1', + 'Test_TC_WNCV_7_1', ]; const FlowMeasurement = [ @@ -226,15 +249,113 @@ function getManualTests() 'Test_TC_OCC_2_3', 'Test_TC_OCC_2_4', 'Test_TC_OCC_3_1', + 'Test_TC_OCC_3_2', ]; const PressureMeasurement = [ 'Test_TC_PRS_2_2', 'Test_TC_PRS_2_3', + 'Test_TC_PRS_3_1', ]; const PowerSource = [ 'Test_TC_PS_2_2', + 'Test_TC_PS_3_1', + ]; + + const BooleanState = [ + 'Test_TC_BOOL_2_2', + 'Test_TC_BOOL_3_1', + ]; + + const ColorControl = [ + 'Test_TC_CC_2_2', + 'Test_TC_CC_3_4', + 'Test_TC_CC_4_5', + 'Test_TC_CC_5_4', + 'Test_TC_CC_6_4', + 'Test_TC_CC_7_5', + 'Test_TC_CC_9_4', + ]; + + const DoorLock = [ + 'Test_TC_DL_1_1', + 'Test_TC_DL_1_2', + 'Test_TC_DL_1_4', + 'Test_TC_DL_1_5', + 'Test_TC_DL_1_6', + 'Test_TC_DL_1_7', + 'Test_TC_DL_1_8', + 'Test_TC_DL_1_10', + 'Test_TC_DL_1_11', + 'Test_TC_DL_1_13', + 'Test_TC_DL_1_14', + 'Test_TC_DL_1_15', + 'Test_TC_DL_1_16', + 'Test_TC_DL_1_17', + ]; + + const UserLabel = [ + 'Test_TC_LC_1_1', + 'Test_TC_LC_1_3', + 'Test_TC_LC_1_4', + 'Test_TC_LC_1_5', + ]; + + const LocalizationConfiguration = [ + 'Test_TC_LO_1_1', + ]; + + const LevelControl = [ + 'Test_TC_LVL_2_3', + ]; + + const NetworkCommissioning = [ + 'Test_TC_NC_1_1', + 'Test_TC_NC_1_2', + 'Test_TC_NC_1_3', + 'Test_TC_NC_1_4', + 'Test_TC_NC_1_5', + 'Test_TC_NC_1_6', + 'Test_TC_NC_1_7', + 'Test_TC_NC_1_8', + 'Test_TC_NC_1_9', + 'Test_TC_NC_1_10', + 'Test_TC_NC_1_11', + 'Test_TC_NC_1_12', + 'Test_TC_NC_1_13', + 'Test_TC_NC_1_14', + 'Test_TC_NC_1_15', + 'Test_TC_NC_1_16', + 'Test_TC_NC_1_17', + 'Test_TC_NC_1_18', + ]; + + const OnOff = [ + 'Test_TC_OO_3_1', + 'Test_TC_OO_3_2', + ]; + + const RelativeHumidityMeasurement = [ + 'Test_TC_RH_3_1', + ]; + + const Switch = [ + 'Test_TC_SWTCH_1_1', + 'Test_TC_SWTCH_3_1', + ]; + + const TemperatureMeasurement = [ + 'Test_TC_TM_3_1', + ]; + + const Thermostat = [ + 'Test_TC_TSTAT_3_1', + 'Test_TC_TSTAT_3_2', + ]; + + const ThermostatUserConfiguration = [ + 'Test_TC_TSUIC_3_1', ]; const tests = [ @@ -265,6 +386,19 @@ function getManualTests() OccupancySensing, // PressureMeasurement, // PowerSource, // + BooleanState, // + ColorControl, // + DoorLock, // + UserLabel, // + LocalizationConfiguration, // + LevelControl, // + NetworkCommissioning, // + OnOff, // + RelativeHumidityMeasurement, // + Switch, // + TemperatureMeasurement, // + Thermostat, // + ThermostatUserConfiguration, // ]; return tests.flat(1); diff --git a/src/app/tests/suites/certification/Test_TC_BDX_1_4.yaml b/src/app/tests/suites/certification/Test_TC_BDX_1_4.yaml new file mode 100644 index 00000000000000..0b75d0a45a9a49 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_BDX_1_4.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 28.1.4. [TC-BDX-1.4] Response to Receiver Initiated BDX Transfer session + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH sends a ReceiveInit message to DUT + DUT sends a ReceiveAccept + message back to TH" + verification: | + 1. Verify that the OTA Reference Requester App logs show ReceiveAccept message from DUT and compare field values against ReceiveInit + + [1636410922200] [59208:62970584] CHIP: [ATM] Handling received BDX Message + [1636410922200] [59208:62970584] CHIP: [ATM] ReceiveAccept + [1636410922200] [59208:62970584] CHIP: [ATM] Transfer Control: 0x20 + [1636410922200] [59208:62970584] CHIP: [ATM] Range Control: 0x0 + [1636410922200] [59208:62970584] CHIP: [ATM] Max Block Size: 1024 + [1636410922200] [59208:62970584] CHIP: [ATM] Length: 0x0000000000000000 + + Compare with + + [1636410920973] [59208:62970584] CHIP: [ATM] Sending BDX Message + [1636410920973] [59208:62970584] CHIP: [ATM] ReceiveInit + [1636410920973] [59208:62970584] CHIP: [ATM] Proposed Transfer Control: 0x20 + [1636410920973] [59208:62970584] CHIP: [ATM] Range Control: 0x0 + [1636410920973] [59208:62970584] CHIP: [ATM] Proposed Max Block Size: 1024 + [1636410920973] [59208:62970584] CHIP: [ATM] Start Offset: 0x0000000000000000 + [1636410920973] [59208:62970584] CHIP: [ATM] Proposed Max Length: 0x0000000000000000 + [1636410920973] [59208:62970584] CHIP: [ATM] File Designator Length: 8 + [1636410920973] [59208:62970584] CHIP: [ATM] File Designator: test.txt + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_BOOL_2_2.yaml b/src/app/tests/suites/certification/Test_TC_BOOL_2_2.yaml new file mode 100644 index 00000000000000..67c89012db9cdd --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_BOOL_2_2.yaml @@ -0,0 +1,138 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 68.2.2. [TC-BOOL-2.2] Primary functionality with server as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Commission DUT to TH" + verification: | + + disabled: true + + - label: "Bring the DUT into a state so StateValue is FALSE" + verification: | + Manual operation + disabled: true + + - label: "TH reads the StateValue attribute from the DUT" + verification: | + ./chip-tool booleanstate read state-value 1 1 + + [1646118838.087500][3279:3284] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0045 Attribute 0x0000_0000DataVersion: 2127727071 + [1646118838.087536][3279:3284] CHIP:TOO: StateValue: FALSE + disabled: true + + - label: "Bring the DUT into a state so StateValue is TRUE" + verification: | + + disabled: true + + - label: "TH reads the StateValue attribute from the DUT" + verification: | + ./chip-tool booleanstate read state-value 1 1 + + [1646118838.087500][3279:3284] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0045 Attribute 0x0000_0000DataVersion: 2127727071 + [1646118838.087536][3279:3284] CHIP:TOO: StateValue: TRUE + disabled: true + + - label: "Set up subscription to StateChange event" + verification: | + ./chip-tool booleanstate subscribe state-value 1 100 1 1 1 + disabled: true + + - label: "Bring the DUT into a state so StateValue is FALSE" + verification: | + [1646119162.627309][3311:3316] CHIP:DMG: ReportDataMessage = + [1646119162.627342][3311:3316] CHIP:DMG: { + [1646119162.627370][3311:3316] CHIP:DMG: SubscriptionId = 0xb3476ff99df21d7f, + [1646119162.627397][3311:3316] CHIP:DMG: AttributeReportIBs = + [1646119162.627432][3311:3316] CHIP:DMG: [ + [1646119162.627454][3311:3316] CHIP:DMG: AttributeReportIB = + [1646119162.627483][3311:3316] CHIP:DMG: { + [1646119162.627505][3311:3316] CHIP:DMG: AttributeDataIB = + [1646119162.627530][3311:3316] CHIP:DMG: { + [1646119162.627562][3311:3316] CHIP:DMG: DataVersion = 0x7ed289df, + [1646119162.627592][3311:3316] CHIP:DMG: AttributePathIB = + [1646119162.627623][3311:3316] CHIP:DMG: { + [1646119162.627654][3311:3316] CHIP:DMG: Endpoint = 0x1, + [1646119162.627685][3311:3316] CHIP:DMG: Cluster = 0x45, + [1646119162.627721][3311:3316] CHIP:DMG: Attribute = 0x0000_0000, + [1646119162.627759][3311:3316] CHIP:DMG: } + [1646119162.627794][3311:3316] CHIP:DMG: + [1646119162.627830][3311:3316] CHIP:DMG: Data = false, + [1646119162.627860][3311:3316] CHIP:DMG: }, + [1646119162.627888][3311:3316] CHIP:DMG: + [1646119162.627909][3311:3316] CHIP:DMG: }, + [1646119162.627938][3311:3316] CHIP:DMG: + [1646119162.627960][3311:3316] CHIP:DMG: ], + [1646119162.627991][3311:3316] CHIP:DMG: + [1646119162.628013][3311:3316] CHIP:DMG: InteractionModelRevision = 1 + [1646119162.628035][3311:3316] CHIP:DMG: } + [1646119162.628169][3311:3316] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0045 Attribute 0x0000_0000DataVersion: 2127727071 + [1646119162.628207][3311:3316] CHIP:TOO: StateValue: FALSE + disabled: true + + - label: "TH reads the StateValue attribute from the DUT" + verification: | + ./chip-tool booleanstate read state-value 1 1 + + [1646118838.087500][3279:3284] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0045 Attribute 0x0000_0000DataVersion: 2127727071 + [1646118838.087536][3279:3284] CHIP:TOO: StateValue: FALSE + disabled: true + + - label: "Bring the DUT into a state so StateValue is TRUE" + verification: | + [1646119162.627309][3311:3316] CHIP:DMG: ReportDataMessage = + [1646119162.627342][3311:3316] CHIP:DMG: { + [1646119162.627370][3311:3316] CHIP:DMG: SubscriptionId = 0xb3476ff99df21d7f, + [1646119162.627397][3311:3316] CHIP:DMG: AttributeReportIBs = + [1646119162.627432][3311:3316] CHIP:DMG: [ + [1646119162.627454][3311:3316] CHIP:DMG: AttributeReportIB = + [1646119162.627483][3311:3316] CHIP:DMG: { + [1646119162.627505][3311:3316] CHIP:DMG: AttributeDataIB = + [1646119162.627530][3311:3316] CHIP:DMG: { + [1646119162.627562][3311:3316] CHIP:DMG: DataVersion = 0x7ed289df, + [1646119162.627592][3311:3316] CHIP:DMG: AttributePathIB = + [1646119162.627623][3311:3316] CHIP:DMG: { + [1646119162.627654][3311:3316] CHIP:DMG: Endpoint = 0x1, + [1646119162.627685][3311:3316] CHIP:DMG: Cluster = 0x45, + [1646119162.627721][3311:3316] CHIP:DMG: Attribute = 0x0000_0000, + [1646119162.627759][3311:3316] CHIP:DMG: } + [1646119162.627794][3311:3316] CHIP:DMG: + [1646119162.627830][3311:3316] CHIP:DMG: Data = true, + [1646119162.627860][3311:3316] CHIP:DMG: }, + [1646119162.627888][3311:3316] CHIP:DMG: + [1646119162.627909][3311:3316] CHIP:DMG: }, + [1646119162.627938][3311:3316] CHIP:DMG: + [1646119162.627960][3311:3316] CHIP:DMG: ], + [1646119162.627991][3311:3316] CHIP:DMG: + [1646119162.628013][3311:3316] CHIP:DMG: InteractionModelRevision = 1 + [1646119162.628035][3311:3316] CHIP:DMG: } + [1646119162.628169][3311:3316] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0045 Attribute 0x0000_0000DataVersion: 2127727071 + [1646119162.628207][3311:3316] CHIP:TOO: StateValue: TRUE + disabled: true + + - label: "TH reads the StateValue attribute from the DUT" + verification: | + ./chip-tool booleanstate read state-value 1 1 + + [1646118838.087500][3279:3284] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0045 Attribute 0x0000_0000DataVersion: 2127727071 + [1646118838.087536][3279:3284] CHIP:TOO: StateValue: TRUE + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_BOOL_3_1.yaml b/src/app/tests/suites/certification/Test_TC_BOOL_3_1.yaml new file mode 100644 index 00000000000000..b6c5f6ea82458d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_BOOL_3_1.yaml @@ -0,0 +1,67 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 68.3.1. [TC-BOOL-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received read of state-value (id 0) looks like this: + + [CHIP:DMG: ReadRequestMessage = + [1646667214.092121][11498:11498] CHIP:DMG: { + [1646667214.092142][11498:11498] CHIP:DMG: AttributePathIBs = + [1646667214.092179][11498:11498] CHIP:DMG: [ + [1646667214.092204][11498:11498] CHIP:DMG: AttributePathIB = + [1646667214.092242][11498:11498] CHIP:DMG: { + [1646667214.092279][11498:11498] CHIP:DMG: Endpoint = 0x1, + [1646667214.092319][11498:11498] CHIP:DMG: Cluster = 0x45, + [1646667214.092359][11498:11498] CHIP:DMG: Attribute = 0x0000_0000, + [1646667214.092391][11498:11498] CHIP:DMG: } + [1646667214.092430][11498:11498] CHIP:DMG: + [1646667214.092456][11498:11498] CHIP:DMG: ], + [1646667214.092494][11498:11498] CHIP:DMG: + [1646667214.092529][11498:11498] CHIP:DMG: isFabricFiltered = true, + [1646667214.092555][11498:11498] CHIP:DMG: InteractionModelRevision = 1 + [1646667214.092577][11498:11498] CHIP:DMG: }, + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + see above + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + No writable attributes + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + No writable attributes + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_BRAC_3_1.yaml b/src/app/tests/suites/certification/Test_TC_BRAC_3_1.yaml new file mode 100644 index 00000000000000..fc57d3b0becb5a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_BRAC_3_1.yaml @@ -0,0 +1,119 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 75.3.1. [TC-BRAC-3.1] Global attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Read ClusterRevision (global attribute 65533)" + verification: | + ./chip-tool bridgedactions read cluster-revision 123123 1 + [1636523867.768278][6769:6774] CHIP:DMG: ReportDataMessage = + [1636523867.768305][6769:6774] CHIP:DMG: { + [1636523867.768325][6769:6774] CHIP:DMG: AttributeDataList = + [1636523867.768352][6769:6774] CHIP:DMG: [ + [1636523867.768401][6769:6774] CHIP:DMG: AttributeDataElement = + [1636523867.768427][6769:6774] CHIP:DMG: { + [1636523867.768460][6769:6774] CHIP:DMG: AttributePathIB = + [1636523867.768499][6769:6774] CHIP:DMG: { + [1636523867.768532][6769:6774] CHIP:DMG: Endpoint = 0x1, + [1636523867.768570][6769:6774] CHIP:DMG: Cluster = 0x25, + [1636523867.768606][6769:6774] CHIP:DMG: Attribute = 0x0000_FFFD, + [1636523867.768642][6769:6774] CHIP:DMG: } + [1636523867.768677][6769:6774] CHIP:DMG: + [1636523867.768713][6769:6774] CHIP:DMG: Data = 1, + [1636523867.768747][6769:6774] CHIP:DMG: DataElementVersion = 0x0, + [1636523867.768777][6769:6774] CHIP:DMG: }, + [1636523867.768810][6769:6774] CHIP:DMG: + [1636523867.768834][6769:6774] CHIP:DMG: ], + [1636523867.768863][6769:6774] CHIP:DMG: + [1636523867.768885][6769:6774] CHIP:DMG: } + [1636523867.768962][6769:6774] CHIP:ZCL: ReadAttributesResponse: + [1636523867.768985][6769:6774] CHIP:ZCL: ClusterId: 0x0000_0025 + [1636523867.769007][6769:6774] CHIP:ZCL: attributeId: 0x0000_FFFD + [1636523867.769024][6769:6774] CHIP:ZCL: status: Success (0x0000) + [1636523867.769045][6769:6774] CHIP:ZCL: attribute TLV Type: 0x04 + disabled: true + + - label: "Read FeatureMap (global attribute 65532)" + verification: | + ./chip-tool bridgedactions read feature-map 1 1 + disabled: true + + - label: "Read AttributeList (global attribute 65531)" + verification: | + ./chip-tool bridgedactions read attribute-list 1 1 + + CHIP:DMG: } + [1646373429.891352][2806:2811] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_FFFBDataVersion: 856698549 + [1646373429.891424][2806:2811] CHIP:TOO: AttributeList: 7 entries + [1646373429.891455][2806:2811] CHIP:TOO: [1]: 0 + [1646373429.891480][2806:2811] CHIP:TOO: [2]: 1 + [1646373429.891504][2806:2811] CHIP:TOO: [3]: 2 + [1646373429.891566][2806:2811] CHIP:TOO: [4]: 65528 + [1646373429.891602][2806:2811] CHIP:TOO: [5]: 65529 + [1646373429.891627][2806:2811] CHIP:TOO: [6]: 65531 + [1646373429.891650][2806:2811] CHIP:TOO: [7]: 65533 + [1646373429.891804][2806:2811] CHIP:EM: Sending Standalone Ack for MessageCounter:7501179 on exchange 10092i + disabled: true + + - label: "Read EventList (global attribute 65530)" + verification: | + ./chip-tool bridgedactions read event-list 1 1 + disabled: true + + - label: + "Read ClientGeneratedCommandList (global attribute 65529) ; retain + this list for reference in test [TC-BRAC-2.2] step 4d" + verification: | + ./chip-tool bridgedactions read client-generated-command-list 1 1 + + + [1646373541.187195][2825:2830] CHIP:DMG: ReportDataMessage = + [1646373541.187261][2825:2830] CHIP:DMG: { + [1646373541.187314][2825:2830] CHIP:DMG: AttributeReportIBs = + [1646373541.187389][2825:2830] CHIP:DMG: [ + [1646373541.187449][2825:2830] CHIP:DMG: AttributeReportIB = + [1646373541.187566][2825:2830] CHIP:DMG: { + [1646373541.187643][2825:2830] CHIP:DMG: AttributeDataIB = + [1646373541.187754][2825:2830] CHIP:DMG: { + [1646373541.187870][2825:2830] CHIP:DMG: DataVersion = 0x33102eb5, + [1646373541.187987][2825:2830] CHIP:DMG: AttributePathIB = + [1646373541.188106][2825:2830] CHIP:DMG: { + [1646373541.188227][2825:2830] CHIP:DMG: Endpoint = 0x1, + [1646373541.188351][2825:2830] CHIP:DMG: Cluster = 0x25, + [1646373541.188474][2825:2830] CHIP:DMG: Attribute = 0x0000_FFF9, + [1646373541.188591][2825:2830] CHIP:DMG: } + [1646373541.188714][2825:2830] CHIP:DMG: + [1646373541.188831][2825:2830] CHIP:DMG: Data = [ + [1646373541.188951][2825:2830] CHIP:DMG: + [1646373541.189073][2825:2830] CHIP:DMG: ], + [1646373541.189188][2825:2830] CHIP:DMG: }, + [1646373541.189302][2825:2830] CHIP:DMG: + [1646373541.189374][2825:2830] CHIP:DMG: }, + [1646373541.189478][2825:2830] CHIP:DMG: + [1646373541.189541][2825:2830] CHIP:DMG: ], + [1646373541.189615][2825:2830] CHIP:DMG: + [1646373541.189676][2825:2830] CHIP:DMG: SuppressResponse = true, + [1646373541.189739][2825:2830] CHIP:DMG: InteractionModelRevision = 1 + [1646373541.189797][2825:2830] CHIP:DMG: } + [1646373541.190706][2825:2830] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0025 Attribute 0x0000_FFF9DataVersion: 856698549 + [1646373541.191015][2825:2830] CHIP:TOO: ClientGeneratedCommandList: 0 entries + [1646373541.191227][2825:2830] CHIP:EM: Sending Standalone Ack for MessageCounter:1836804 on exchange 43002i + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CC_2_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_2_2.yaml new file mode 100644 index 00000000000000..2a66839f76ea4a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_2_2.yaml @@ -0,0 +1,77 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.1.3. [TC-CC-2.2] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + ./chip-tool colorcontrol read current-hue 1 1 + ./chip-tool colorcontrol read current-saturation 1 1 + ./chip-tool colorcontrol read current-x 1 1 + ./chip-tool colorcontrol read current-y 1 1 + ./chip-tool colorcontrol read color-temperature 1 1 + ./chip-tool colorcontrol read color-mode 1 1 + ./chip-tool colorcontrol read color-control-options 1 1 + ./chip-tool colorcontrol read enhanced-current-hue 1 1 + ./chip-tool colorcontrol read enhanced-color-mode 1 1 + ./chip-tool colorcontrol read color-loop-active 1 1 + ./chip-tool colorcontrol read color-loop-direction 1 1 + ./chip-tool colorcontrol read color-loop-time 1 1 + ./chip-tool colorcontrol read color-loop-start-enhanced-hue 1 1 + ./chip-tool colorcontrol read color-loop-stored-enhanced-hue 1 1 + ./chip-tool colorcontrol read color-capabilities 1 1 + ./chip-tool colorcontrol read color-temp-physical-min 1 1 + ./chip-tool colorcontrol read color-temp-physical-max 1 1 + ./chip-tool colorcontrol read couple-color-temp-to-level-min-mireds 1 1 + ./chip-tool colorcontrol read start-up-color-temperature-mireds 1 1 + ./chip-tool colorcontrol read number-of-primaries 1 1 + + depending on the value of number-of-primaries, primary#x, primary#y, primary#intensity are mandatory (not all devices implemented this) + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + ./chip-tool colorcontrol read remaining-time 1 1 + ./chip-tool colorcontrol read drift-compensation 1 1 + ./chip-tool colorcontrol read compensation-text 1 1 + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + Expect pass: + ./chip-tool colorcontrol write color-control-options 12 1 1 + ./chip-tool colorcontrol write start-up-color-temperature-mireds 12 1 1 + + All other write command to mandatory attributes expects Failures. + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + write optional attributes if implemented on device + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml new file mode 100644 index 00000000000000..9badd915a1d66a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml @@ -0,0 +1,221 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.2.4. [TC-CC-3.4] Hue functionality with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT sends MoveToHue command to TH an Hue with _TransitionTime 200." + verification: | + ./chip-tool colorcontrol move-to-hue 1 0 200 0 0 1 1 + [1646210342.550556][2190:2190] CHIP:DMG: InvokeRequestMessage = + [1646210342.550627][2190:2190] CHIP:DMG: { + [1646210342.550679][2190:2190] CHIP:DMG: suppressResponse = false, + [1646210342.550714][2190:2190] CHIP:DMG: timedRequest = false, + [1646210342.550744][2190:2190] CHIP:DMG: InvokeRequests = + [1646210342.550784][2190:2190] CHIP:DMG: [ + [1646210342.550813][2190:2190] CHIP:DMG: CommandDataIB = + [1646210342.550852][2190:2190] CHIP:DMG: { + [1646210342.550883][2190:2190] CHIP:DMG: CommandPathIB = + [1646210342.550922][2190:2190] CHIP:DMG: { + [1646210342.550961][2190:2190] CHIP:DMG: EndpointId = 0x1, + [1646210342.551004][2190:2190] CHIP:DMG: ClusterId = 0x300, + [1646210342.551048][2190:2190] CHIP:DMG: CommandId = 0x0, + [1646210342.551085][2190:2190] CHIP:DMG: }, + [1646210342.551124][2190:2190] CHIP:DMG: + [1646210342.551158][2190:2190] CHIP:DMG: CommandData = + [1646210342.551195][2190:2190] CHIP:DMG: { + [1646210342.551234][2190:2190] CHIP:DMG: 0x0 = 1, + [1646210342.551275][2190:2190] CHIP:DMG: 0x1 = 0, + [1646210342.551315][2190:2190] CHIP:DMG: 0x2 = 200, + [1646210342.551356][2190:2190] CHIP:DMG: 0x3 = 0, + [1646210342.551396][2190:2190] CHIP:DMG: 0x4 = 0, + [1646210342.551434][2190:2190] CHIP:DMG: }, + [1646210342.551469][2190:2190] CHIP:DMG: }, + [1646210342.551508][2190:2190] CHIP:DMG: + [1646210342.551537][2190:2190] CHIP:DMG: ], + [1646210342.551575][2190:2190] CHIP:DMG: + [1646210342.551604][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210342.551632][2190:2190] CHIP:DMG: }, + disabled: true + + - label: + "Over TransitionTime, DUT reads CurrentHue attribute from TH + periodically." + verification: | + ./chip-tool colorcontrol read current-hue 1 1 + [1646210292.985313][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646210292.985373][2190:2190] CHIP:DMG: { + [1646210292.985402][2190:2190] CHIP:DMG: AttributePathIBs = + [1646210292.985436][2190:2190] CHIP:DMG: [ + [1646210292.985467][2190:2190] CHIP:DMG: AttributePathIB = + [1646210292.985657][2190:2190] CHIP:DMG: { + [1646210292.985849][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646210292.985935][2190:2190] CHIP:DMG: Cluster = 0x300, + [1646210292.986063][2190:2190] CHIP:DMG: Attribute = 0x0000_0000, + [1646210292.986124][2190:2190] CHIP:DMG: } + [1646210292.986183][2190:2190] CHIP:DMG: + [1646210292.986219][2190:2190] CHIP:DMG: ], + [1646210292.986257][2190:2190] CHIP:DMG: + [1646210292.986291][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646210292.986324][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210292.986355][2190:2190] CHIP:DMG: }, + disabled: true + + - label: "DUT sends MoveHue command to TH" + verification: | + ./chip-tool colorcontrol move-hue 1 10 0 0 1 1 + [1646210493.976737][2190:2190] CHIP:EM: Handling via exchange: 36870r, Delegate: 0xaaaad04530c8 + [1646210493.976986][2190:2190] CHIP:DMG: InvokeRequestMessage = + [1646210493.977019][2190:2190] CHIP:DMG: { + [1646210493.977047][2190:2190] CHIP:DMG: suppressResponse = false, + [1646210493.977079][2190:2190] CHIP:DMG: timedRequest = false, + [1646210493.977109][2190:2190] CHIP:DMG: InvokeRequests = + [1646210493.977147][2190:2190] CHIP:DMG: [ + [1646210493.977173][2190:2190] CHIP:DMG: CommandDataIB = + [1646210493.977222][2190:2190] CHIP:DMG: { + [1646210493.977267][2190:2190] CHIP:DMG: CommandPathIB = + [1646210493.977320][2190:2190] CHIP:DMG: { + [1646210493.977376][2190:2190] CHIP:DMG: EndpointId = 0x1, + [1646210493.977443][2190:2190] CHIP:DMG: ClusterId = 0x300, + [1646210493.977478][2190:2190] CHIP:DMG: CommandId = 0x1, + [1646210493.977536][2190:2190] CHIP:DMG: }, + [1646210493.977572][2190:2190] CHIP:DMG: + [1646210493.977628][2190:2190] CHIP:DMG: CommandData = + [1646210493.977671][2190:2190] CHIP:DMG: { + [1646210493.977711][2190:2190] CHIP:DMG: 0x0 = 1, + [1646210493.977755][2190:2190] CHIP:DMG: 0x1 = 10, + [1646210493.978098][2190:2190] CHIP:DMG: 0x2 = 0, + [1646210493.978286][2190:2190] CHIP:DMG: 0x3 = 0, + [1646210493.978369][2190:2190] CHIP:DMG: }, + [1646210493.978405][2190:2190] CHIP:DMG: }, + [1646210493.978469][2190:2190] CHIP:DMG: + [1646210493.978499][2190:2190] CHIP:DMG: ], + [1646210493.978536][2190:2190] CHIP:DMG: + [1646210493.978565][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210493.978595][2190:2190] CHIP:DMG: }, + disabled: true + + - label: "DUT reads CurrentHue attribute from TH several times." + verification: | + ./chip-tool colorcontrol read current-hue 1 1 + [1646210292.985313][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646210292.985373][2190:2190] CHIP:DMG: { + [1646210292.985402][2190:2190] CHIP:DMG: AttributePathIBs = + [1646210292.985436][2190:2190] CHIP:DMG: [ + [1646210292.985467][2190:2190] CHIP:DMG: AttributePathIB = + [1646210292.985657][2190:2190] CHIP:DMG: { + [1646210292.985849][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646210292.985935][2190:2190] CHIP:DMG: Cluster = 0x300, + [1646210292.986063][2190:2190] CHIP:DMG: Attribute = 0x0000_0000, + [1646210292.986124][2190:2190] CHIP:DMG: } + [1646210292.986183][2190:2190] CHIP:DMG: + [1646210292.986219][2190:2190] CHIP:DMG: ], + [1646210292.986257][2190:2190] CHIP:DMG: + [1646210292.986291][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646210292.986324][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210292.986355][2190:2190] CHIP:DMG: }, + disabled: true + + - label: "DUT sends StepHue command to TH" + verification: | + ./chip-tool colorcontrol step-hue 1 10 200 0 0 1 1 + [1646210571.683401][2190:2190] CHIP:DMG: InvokeRequestMessage = + [1646210571.683444][2190:2190] CHIP:DMG: { + [1646210571.683475][2190:2190] CHIP:DMG: suppressResponse = false, + [1646210571.683530][2190:2190] CHIP:DMG: timedRequest = false, + [1646210571.683565][2190:2190] CHIP:DMG: InvokeRequests = + [1646210571.683608][2190:2190] CHIP:DMG: [ + [1646210571.683641][2190:2190] CHIP:DMG: CommandDataIB = + [1646210571.683726][2190:2190] CHIP:DMG: { + [1646210571.683799][2190:2190] CHIP:DMG: CommandPathIB = + [1646210571.683908][2190:2190] CHIP:DMG: { + [1646210571.683953][2190:2190] CHIP:DMG: EndpointId = 0x1, + [1646210571.684011][2190:2190] CHIP:DMG: ClusterId = 0x300, + [1646210571.684058][2190:2190] CHIP:DMG: CommandId = 0x2, + [1646210571.684102][2190:2190] CHIP:DMG: }, + [1646210571.684146][2190:2190] CHIP:DMG: + [1646210571.684183][2190:2190] CHIP:DMG: CommandData = + [1646210571.684228][2190:2190] CHIP:DMG: { + [1646210571.684275][2190:2190] CHIP:DMG: 0x0 = 1, + [1646210571.684323][2190:2190] CHIP:DMG: 0x1 = 10, + [1646210571.684370][2190:2190] CHIP:DMG: 0x2 = 200, + [1646210571.684414][2190:2190] CHIP:DMG: 0x3 = 0, + [1646210571.684458][2190:2190] CHIP:DMG: 0x4 = 0, + [1646210571.684501][2190:2190] CHIP:DMG: }, + [1646210571.684539][2190:2190] CHIP:DMG: }, + [1646210571.684582][2190:2190] CHIP:DMG: + [1646210571.684613][2190:2190] CHIP:DMG: ], + [1646210571.684653][2190:2190] CHIP:DMG: + [1646210571.684684][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210571.684715][2190:2190] CHIP:DMG: }, + disabled: true + + - label: "Over TransitionTime, DUT reads CurrentHue attribute from TH." + verification: | + ./chip-tool colorcontrol read current-hue 1 1 + [1646210292.985313][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646210292.985373][2190:2190] CHIP:DMG: { + [1646210292.985402][2190:2190] CHIP:DMG: AttributePathIBs = + [1646210292.985436][2190:2190] CHIP:DMG: [ + [1646210292.985467][2190:2190] CHIP:DMG: AttributePathIB = + [1646210292.985657][2190:2190] CHIP:DMG: { + [1646210292.985849][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646210292.985935][2190:2190] CHIP:DMG: Cluster = 0x300, + [1646210292.986063][2190:2190] CHIP:DMG: Attribute = 0x0000_0000, + [1646210292.986124][2190:2190] CHIP:DMG: } + [1646210292.986183][2190:2190] CHIP:DMG: + [1646210292.986219][2190:2190] CHIP:DMG: ], + [1646210292.986257][2190:2190] CHIP:DMG: + [1646210292.986291][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646210292.986324][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210292.986355][2190:2190] CHIP:DMG: }, + disabled: true + + - label: "DUT sends StopMoveStep command to TH." + verification: | + ./chip-tool colorcontrol stop-move-step 0 0 1 1 + [1646210677.870562][2190:2190] CHIP:DMG: InvokeRequestMessage = + [1646210677.870594][2190:2190] CHIP:DMG: { + [1646210677.870618][2190:2190] CHIP:DMG: suppressResponse = false, + [1646210677.870666][2190:2190] CHIP:DMG: timedRequest = false, + [1646210677.870696][2190:2190] CHIP:DMG: InvokeRequests = + [1646210677.870728][2190:2190] CHIP:DMG: [ + [1646210677.870754][2190:2190] CHIP:DMG: CommandDataIB = + [1646210677.870792][2190:2190] CHIP:DMG: { + [1646210677.870820][2190:2190] CHIP:DMG: CommandPathIB = + [1646210677.870854][2190:2190] CHIP:DMG: { + [1646210677.870889][2190:2190] CHIP:DMG: EndpointId = 0x1, + [1646210677.870926][2190:2190] CHIP:DMG: ClusterId = 0x300, + [1646210677.870960][2190:2190] CHIP:DMG: CommandId = 0x47, + [1646210677.870992][2190:2190] CHIP:DMG: }, + [1646210677.871027][2190:2190] CHIP:DMG: + [1646210677.871056][2190:2190] CHIP:DMG: CommandData = + [1646210677.871088][2190:2190] CHIP:DMG: { + [1646210677.871124][2190:2190] CHIP:DMG: 0x0 = 0, + [1646210677.871159][2190:2190] CHIP:DMG: 0x1 = 0, + [1646210677.871196][2190:2190] CHIP:DMG: }, + [1646210677.871225][2190:2190] CHIP:DMG: }, + [1646210677.871259][2190:2190] CHIP:DMG: + [1646210677.871286][2190:2190] CHIP:DMG: ], + [1646210677.871317][2190:2190] CHIP:DMG: + [1646210677.871342][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210677.871368][2190:2190] CHIP:DMG: }, + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_5.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_5.yaml new file mode 100644 index 00000000000000..b9bed0d9aac0e9 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_4_5.yaml @@ -0,0 +1,235 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.2.9. [TC-CC-4.5] Saturation functionality with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Test Step" + verification: | + Verification Steps + disabled: true + + - label: + "DUT sends MoveToSaturation command to TH a Saturation with + _TransitionTime 300." + verification: | + ./chip-tool colorcontrol move-to-saturation 200 300 0 0 1 1 + + [1648101474.910794][2480:2480] CHIP:EM: Handling via exchange: 53143r, Delegate: 0xaaaab8814368 + [1648101474.910970][2480:2480] CHIP:DMG: InvokeRequestMessage = + [1648101474.911016][2480:2480] CHIP:DMG: { + [1648101474.911055][2480:2480] CHIP:DMG: suppressResponse = false, + [1648101474.911099][2480:2480] CHIP:DMG: timedRequest = false, + [1648101474.911140][2480:2480] CHIP:DMG: InvokeRequests = + [1648101474.911191][2480:2480] CHIP:DMG: [ + [1648101474.911232][2480:2480] CHIP:DMG: CommandDataIB = + [1648101474.911287][2480:2480] CHIP:DMG: { + [1648101474.911330][2480:2480] CHIP:DMG: CommandPathIB = + [1648101474.911412][2480:2480] CHIP:DMG: { + [1648101474.911467][2480:2480] CHIP:DMG: EndpointId = 0x1, + [1648101474.911523][2480:2480] CHIP:DMG: ClusterId = 0x300, + [1648101474.911577][2480:2480] CHIP:DMG: CommandId = 0x3, + [1648101474.911628][2480:2480] CHIP:DMG: }, + [1648101474.911681][2480:2480] CHIP:DMG: + [1648101474.911728][2480:2480] CHIP:DMG: CommandData = + [1648101474.911783][2480:2480] CHIP:DMG: { + [1648101474.911837][2480:2480] CHIP:DMG: 0x0 = 200, + [1648101474.911897][2480:2480] CHIP:DMG: 0x1 = 300, + [1648101474.911952][2480:2480] CHIP:DMG: 0x2 = 0, + [1648101474.912012][2480:2480] CHIP:DMG: 0x3 = 0, + [1648101474.912069][2480:2480] CHIP:DMG: }, + [1648101474.912117][2480:2480] CHIP:DMG: }, + [1648101474.912172][2480:2480] CHIP:DMG: + [1648101474.912211][2480:2480] CHIP:DMG: ], + [1648101474.912263][2480:2480] CHIP:DMG: + [1648101474.912302][2480:2480] CHIP:DMG: InteractionModelRevision = 1 + [1648101474.912341][2480:2480] CHIP:DMG: }, + [1648101474.912442][2480:2480] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0300 e=1 p=o + [1648101474.912507][2480:2480] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0300 Command=0x0000_0003 + [1648101474.912605][2480:2480] CHIP:DMG: Endpoint 1, Cluster 0x0000_0300 update version to 6143bba0 + disabled: true + + - label: + "Over TransitionTime, DUT reads CurrentSaturation attribute from TH + periodically." + verification: | + ./chip-tool colorcontrol read current-saturation 1 1 + [1646210970.309403][2190:2190] CHIP:IM: Received Read request + [1646210970.309465][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646210970.309495][2190:2190] CHIP:DMG: { + [1646210970.309514][2190:2190] CHIP:DMG: AttributePathIBs = + [1646210970.309541][2190:2190] CHIP:DMG: [ + [1646210970.309567][2190:2190] CHIP:DMG: AttributePathIB = + [1646210970.309599][2190:2190] CHIP:DMG: { + [1646210970.309629][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646210970.309664][2190:2190] CHIP:DMG: Cluster = 0x300, + [1646210970.309691][2190:2190] CHIP:DMG: Attribute = 0x0000_0001, + [1646210970.309720][2190:2190] CHIP:DMG: } + [1646210970.309750][2190:2190] CHIP:DMG: + [1646210970.309779][2190:2190] CHIP:DMG: ], + [1646210970.309815][2190:2190] CHIP:DMG: + [1646210970.309844][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646210970.309871][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210970.309892][2190:2190] CHIP:DMG: }, + disabled: true + + - label: "DUT sends MoveSaturation command to TH" + verification: | + ./chip-tool colorcontrol move-saturation 1 10 0 0 1 1 + + [1646211062.545513][2190:2190] CHIP:DMG: InvokeRequestMessage = + [1646211062.545543][2190:2190] CHIP:DMG: { + [1646211062.545565][2190:2190] CHIP:DMG: suppressResponse = false, + [1646211062.545596][2190:2190] CHIP:DMG: timedRequest = false, + [1646211062.545625][2190:2190] CHIP:DMG: InvokeRequests = + [1646211062.545657][2190:2190] CHIP:DMG: [ + [1646211062.545681][2190:2190] CHIP:DMG: CommandDataIB = + [1646211062.545711][2190:2190] CHIP:DMG: { + [1646211062.545737][2190:2190] CHIP:DMG: CommandPathIB = + [1646211062.545771][2190:2190] CHIP:DMG: { + [1646211062.545806][2190:2190] CHIP:DMG: EndpointId = 0x1, + [1646211062.545840][2190:2190] CHIP:DMG: ClusterId = 0x300, + [1646211062.545872][2190:2190] CHIP:DMG: CommandId = 0x4, + [1646211062.545902][2190:2190] CHIP:DMG: }, + [1646211062.545933][2190:2190] CHIP:DMG: + [1646211062.545960][2190:2190] CHIP:DMG: CommandData = + [1646211062.545991][2190:2190] CHIP:DMG: { + [1646211062.546025][2190:2190] CHIP:DMG: 0x0 = 1, + [1646211062.546060][2190:2190] CHIP:DMG: 0x1 = 10, + [1646211062.546095][2190:2190] CHIP:DMG: 0x2 = 0, + [1646211062.546126][2190:2190] CHIP:DMG: 0x3 = 0, + [1646211062.546158][2190:2190] CHIP:DMG: }, + [1646211062.546185][2190:2190] CHIP:DMG: }, + [1646211062.546218][2190:2190] CHIP:DMG: + [1646211062.546243][2190:2190] CHIP:DMG: ], + [1646211062.546274][2190:2190] CHIP:DMG: + [1646211062.546297][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646211062.546320][2190:2190] CHIP:DMG: }, + disabled: true + + - label: "DUT reads CurrentSaturation attribute from TH several times." + verification: | + ./chip-tool colorcontrol read current-saturation 1 1 + [1646210970.309403][2190:2190] CHIP:IM: Received Read request + [1646210970.309465][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646210970.309495][2190:2190] CHIP:DMG: { + [1646210970.309514][2190:2190] CHIP:DMG: AttributePathIBs = + [1646210970.309541][2190:2190] CHIP:DMG: [ + [1646210970.309567][2190:2190] CHIP:DMG: AttributePathIB = + [1646210970.309599][2190:2190] CHIP:DMG: { + [1646210970.309629][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646210970.309664][2190:2190] CHIP:DMG: Cluster = 0x300, + [1646210970.309691][2190:2190] CHIP:DMG: Attribute = 0x0000_0001, + [1646210970.309720][2190:2190] CHIP:DMG: } + [1646210970.309750][2190:2190] CHIP:DMG: + [1646210970.309779][2190:2190] CHIP:DMG: ], + [1646210970.309815][2190:2190] CHIP:DMG: + [1646210970.309844][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646210970.309871][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210970.309892][2190:2190] CHIP:DMG: }, + disabled: true + + - label: "DUT sends StepSaturation command to TH" + verification: | + ./chip-tool colorcontrol step-saturation 1 10 200 0 0 1 1 + [1646211149.169696][2190:2190] CHIP:DMG: InvokeRequestMessage = + [1646211149.169731][2190:2190] CHIP:DMG: { + [1646211149.169757][2190:2190] CHIP:DMG: suppressResponse = false, + [1646211149.169788][2190:2190] CHIP:DMG: timedRequest = false, + [1646211149.169816][2190:2190] CHIP:DMG: InvokeRequests = + [1646211149.169852][2190:2190] CHIP:DMG: [ + [1646211149.169879][2190:2190] CHIP:DMG: CommandDataIB = + [1646211149.169914][2190:2190] CHIP:DMG: { + [1646211149.169943][2190:2190] CHIP:DMG: CommandPathIB = + [1646211149.169979][2190:2190] CHIP:DMG: { + [1646211149.170014][2190:2190] CHIP:DMG: EndpointId = 0x1, + [1646211149.170055][2190:2190] CHIP:DMG: ClusterId = 0x300, + [1646211149.170095][2190:2190] CHIP:DMG: CommandId = 0x5, + [1646211149.170129][2190:2190] CHIP:DMG: }, + [1646211149.170165][2190:2190] CHIP:DMG: + [1646211149.170196][2190:2190] CHIP:DMG: CommandData = + [1646211149.170234][2190:2190] CHIP:DMG: { + [1646211149.170269][2190:2190] CHIP:DMG: 0x0 = 1, + [1646211149.170310][2190:2190] CHIP:DMG: 0x1 = 10, + [1646211149.170344][2190:2190] CHIP:DMG: 0x2 = 200, + [1646211149.170379][2190:2190] CHIP:DMG: 0x3 = 0, + [1646211149.170409][2190:2190] CHIP:DMG: 0x4 = 0, + [1646211149.170451][2190:2190] CHIP:DMG: }, + [1646211149.170481][2190:2190] CHIP:DMG: }, + [1646211149.170516][2190:2190] CHIP:DMG: + [1646211149.170542][2190:2190] CHIP:DMG: ], + [1646211149.170576][2190:2190] CHIP:DMG: + [1646211149.170603][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646211149.170629][2190:2190] CHIP:DMG: }, + disabled: true + + - label: + "Over TransitionTime, DUT reads CurrentSaturation attribute from TH." + verification: | + ./chip-tool colorcontrol read current-saturation 1 1 + [1646210970.309403][2190:2190] CHIP:IM: Received Read request + [1646210970.309465][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646210970.309495][2190:2190] CHIP:DMG: { + [1646210970.309514][2190:2190] CHIP:DMG: AttributePathIBs = + [1646210970.309541][2190:2190] CHIP:DMG: [ + [1646210970.309567][2190:2190] CHIP:DMG: AttributePathIB = + [1646210970.309599][2190:2190] CHIP:DMG: { + [1646210970.309629][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646210970.309664][2190:2190] CHIP:DMG: Cluster = 0x300, + [1646210970.309691][2190:2190] CHIP:DMG: Attribute = 0x0000_0001, + [1646210970.309720][2190:2190] CHIP:DMG: } + [1646210970.309750][2190:2190] CHIP:DMG: + [1646210970.309779][2190:2190] CHIP:DMG: ], + [1646210970.309815][2190:2190] CHIP:DMG: + [1646210970.309844][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646210970.309871][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646210970.309892][2190:2190] CHIP:DMG: }, + disabled: true + + - label: "DUT sends StopMoveStep command to TH." + verification: | + ./chip-tool colorcontrol stop-move-step 0 0 1 1 + [1646211221.659999][2190:2190] CHIP:DMG: InvokeRequestMessage = + [1646211221.660038][2190:2190] CHIP:DMG: { + [1646211221.660076][2190:2190] CHIP:DMG: suppressResponse = false, + [1646211221.660110][2190:2190] CHIP:DMG: timedRequest = false, + [1646211221.660138][2190:2190] CHIP:DMG: InvokeRequests = + [1646211221.660174][2190:2190] CHIP:DMG: [ + [1646211221.660199][2190:2190] CHIP:DMG: CommandDataIB = + [1646211221.660234][2190:2190] CHIP:DMG: { + [1646211221.660266][2190:2190] CHIP:DMG: CommandPathIB = + [1646211221.660301][2190:2190] CHIP:DMG: { + [1646211221.660342][2190:2190] CHIP:DMG: EndpointId = 0x1, + [1646211221.660381][2190:2190] CHIP:DMG: ClusterId = 0x300, + [1646211221.660420][2190:2190] CHIP:DMG: CommandId = 0x47, + [1646211221.660460][2190:2190] CHIP:DMG: }, + [1646211221.660502][2190:2190] CHIP:DMG: + [1646211221.660535][2190:2190] CHIP:DMG: CommandData = + [1646211221.660572][2190:2190] CHIP:DMG: { + [1646211221.660612][2190:2190] CHIP:DMG: 0x0 = 0, + [1646211221.660652][2190:2190] CHIP:DMG: 0x1 = 0, + [1646211221.660691][2190:2190] CHIP:DMG: }, + [1646211221.660724][2190:2190] CHIP:DMG: }, + [1646211221.660759][2190:2190] CHIP:DMG: + [1646211221.660788][2190:2190] CHIP:DMG: ], + [1646211221.660823][2190:2190] CHIP:DMG: + [1646211221.660849][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646211221.660877][2190:2190] CHIP:DMG: }, + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CC_5_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_5_4.yaml new file mode 100644 index 00000000000000..4cfa346909a9d8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_5_4.yaml @@ -0,0 +1,73 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.2.13. [TC-CC-5.4] Color functionality with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT sends MoveToColor command to TH a Color with _TransitionTime 300." + verification: | + ./chip-tool colorcontrol move-to-color 400 500 300 0 0 1 1 + disabled: true + + - label: "Over TransitionTime, DUT reads CurrentX attribute from TH." + verification: | + ./chip-tool colorcontrol read current-x 1 1 + disabled: true + + - label: "Over TransitionTime, DUT reads CurrentY attribute from TH." + verification: | + ./chip-tool colorcontrol read current-y 1 1 + disabled: true + + - label: "DUT sends MoveColor command to TH" + verification: | + ./chip-tool colorcontrol move-color 10 20 0 0 1 1 + disabled: true + + - label: "DUT reads CurrentX attribute from TH." + verification: | + ./chip-tool colorcontrol read current-x 1 1 + disabled: true + + - label: "DUT reads CurrentY attribute from TH." + verification: | + ./chip-tool colorcontrol read current-y 1 1 + disabled: true + + - label: "DUT sends StepColor command to TH" + verification: | + ./chip-tool colorcontrol step-color 100 100 200 0 0 1 1 + disabled: true + + - label: "Over TransitionTime, DUT reads CurrentX attribute from TH." + verification: | + ./chip-tool colorcontrol read current-x 1 1 + disabled: true + + - label: "Over TransitionTime, DUT reads CurrentY attribute from TH." + verification: | + ./chip-tool colorcontrol read current-y 1 1 + disabled: true + + - label: "DUT sends StopMoveStep command to TH." + verification: | + ./chip-tool colorcontrol stop-move-step 0 0 1 1 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_4.yaml new file mode 100644 index 00000000000000..2b142d1e3938cf --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_6_4.yaml @@ -0,0 +1,65 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.2.17. [TC-CC-6.4] Color Temperature functionality with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT sends MoveToColorTemperature command to TH an + ColorTemperatureMireds with _TransitionTime 300." + verification: | + ./chip-tool colorcontrol move-to-color-temperature 150 300 0 0 1 1 + disabled: true + + - label: + "Over TransitionTime, DUT reads CurrentColorTemperatureMireds + attribute from TH periodically." + verification: | + ./chip-tool colorcontrol read color-temperature 1 1 + disabled: true + + - label: "DUT sends MoveColorTemperatureMireds command to TH" + verification: | + ./chip-tool colorcontrol move-color-temperature 1 10 5 250 0 0 1 1 + disabled: true + + - label: + "DUT reads CurrentColorTemperatureMireds attribute from TH several + times." + verification: | + ./chip-tool colorcontrol read color-temperature 1 1 + disabled: true + + - label: "DUT sends StepColorTemperature command to TH" + verification: | + ./chip-tool colorcontrol step-color-temperature 1 10 200 5 250 0 0 1 1 + disabled: true + + - label: + "Over TransitionTime, DUT reads ColorTemperatureMireds attribute from + TH." + verification: | + ./chip-tool colorcontrol read color-temperature 1 1 + disabled: true + + - label: "DUT sends StopMoveStep command to TH." + verification: | + ./chip-tool colorcontrol stop-move-step 0 0 1 1 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_5.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_5.yaml new file mode 100644 index 00000000000000..b1dd2715f20bbb --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_7_5.yaml @@ -0,0 +1,62 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.2.22. [TC-CC-7.5] Enhanced Hue functionality with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT sends MoveToEnhancedHue command to TH an EnhancedHue with + _TransitionTime 300." + verification: | + ./chip-tool colorcontrol enhanced-move-to-hue 1000 3 200 0 0 1 1 + disabled: true + + - label: + "Over TransitionTime, DUT reads CurrentEnhanced Hue attribute from TH + periodically." + verification: | + ./chip-tool colorcontrol read enhanced-current-hue 1 1 + disabled: true + + - label: "DUT sends MoveEnhanced Hue command to TH" + verification: | + ./chip-tool colorcontrol enhanced-move-hue 0 100 0 0 1 1 + disabled: true + + - label: "DUT reads CurrentEnhanced Hue attribute from TH several times." + verification: | + ./chip-tool colorcontrol read enhanced-current-hue 1 1 + disabled: true + + - label: "DUT sends StepEnhanced Hue command to TH" + verification: | + ./chip-tool colorcontrol enhanced-step-hue 1 1000 200 0 0 1 1 + disabled: true + + - label: + "Over TransitionTime, DUT reads CurrentEnhanced Hue attribute from TH." + verification: | + ./chip-tool colorcontrol read enhanced-current-hue 1 1 + disabled: true + + - label: "DUT sends StopMoveStep command to TH." + verification: | + ./chip-tool colorcontrol stop-move-step 0 0 1 1 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CC_9_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_9_4.yaml new file mode 100644 index 00000000000000..907f96815c0c95 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_9_4.yaml @@ -0,0 +1,97 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.2.27. [TC-CC-9.4] ColorLoopSet Validation with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT sends ColorLoopSet command to with UpdateFlag attribute to 0xF, + action attribute to 0x0, direction attribute to 0x0, time attribute to + 30, and startHue attribute to 0xA0 to TH." + verification: | + ./chip-tool colorcontrol color-loop-set 15 0 0 30 160 0 0 1 1 + disabled: true + + - label: "DUT read ColorLoopActive attribute from TH." + verification: | + ./chip-tool colorcontrol read color-loop-active 1 1 + disabled: true + + - label: "DUT read ColorLoopDirection attribute from TH." + verification: | + ./chip-tool colorcontrol read color-loop-direction 1 1 + disabled: true + + - label: "DUT read ColorLoopTime attribute from TH." + verification: | + ./chip-tool colorcontrol read color-loop-time 1 1 + disabled: true + + - label: "DUT read ColorLoopStartEnhancedHue attribute from TH." + verification: | + ./chip-tool colorcontrol read color-loop-start-enhanced-hue 1 1 + disabled: true + + - label: + "DUT sends ColorLoopSet command to with UpdateFlag attribute to 0x1 + and Action attribute to 0x1 to TH." + verification: | + ./chip-tool colorcontrol color-loop-set 1 1 0 0 0 0 0 1 1 + disabled: true + + - label: "DUT read ColorLoopActive attribute from TH." + verification: | + ./chip-tool colorcontrol read color-loop-active 1 1 + disabled: true + + - label: "DUT read ColorLoopStoredEnhancedHue attribute from TH." + verification: | + ./chip-tool colorcontrol read color-loop-stored-enhanced-hue 1 1 + disabled: true + + - label: + "Over next 30 seconds, DUT read EnhancedCurrentHue attribute from TH." + verification: | + ./chip-tool colorcontrol read enhanced-current-hue 1 1 + disabled: true + + - label: + "Continue another 30 seconds, DUT read EnhancedCurrentHue attribute + from TH." + verification: | + ./chip-tool colorcontrol read enhanced-current-hue 1 1 + disabled: true + + - label: + "DUT sends ColorLoopSet command to with UpdateFlag attribute to 0x1 + and Action attribute to 0x0 to TH." + verification: | + ./chip-tool colorcontrol color-loop-set 1 0 0 0 0 0 0 1 1 + disabled: true + + - label: "DUT read ColorLoopActive attribute from TH." + verification: | + ./chip-tool colorcontrol read color-loop-active 1 1 + disabled: true + + - label: "DUT read EnhancedCurrentHue attribute from TH." + verification: | + ./chip-tool colorcontrol read enhanced-current-hue 1 1 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DD_1_11.yaml b/src/app/tests/suites/certification/Test_TC_DD_1_11.yaml new file mode 100644 index 00000000000000..ab0845035509cd --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_1_11.yaml @@ -0,0 +1,79 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.1.11. [TC-DD-1.11] Concatenation - QR Code Onboarding Payload Verification + [DUT - Commissioner] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "If (PICS_DT_CTRL_CONCATENATED_QR_CODE_1), scan larger QR code that + will support the commissioning of all the devices" + verification: | + '' ./chip-all-clusters-app + + + [1646286638.375844][11651:11651] CHIP:DL: Device Configuration: + [1646286638.375960][11651:11651] CHIP:DL: Serial Number: TEST_SN + [1646286638.376016][11651:11651] CHIP:DL: Vendor Id: 65521 (0xFFF1) + [1646286638.376066][11651:11651] CHIP:DL: Product Id: 32769 (0x8001) + [1646286638.376153][11651:11651] CHIP:DL: Hardware Version: 0 + [1646286638.377458][11651:11651] CHIP:DL: Setup Pin Code: 20202021 + [1646286638.377541][11651:11651] CHIP:DL: Setup Discriminator: 3840 (0xF00) + [1646286638.377611][11651:11651] CHIP:DL: Manufacturing Date: (not set) + [1646286638.377664][11651:11651] CHIP:DL: Device Type: 65535 (0xFFFF) + [1646286638.377771][11651:11651] CHIP:SVR: SetupQRCode: [MT:-24J042C00KA0648G00] + [1646286638.377865][11651:11651] CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code: + [1646286638.377915][11651:11651] CHIP:SVR: https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3A-24J042C00KA0648G00 + [1646286638.377986][11651:11651] CHIP:SVR: Manual pairing code: [34970112332] + [1646286638.378089][11651:11651] CHIP:SVR: Long manual pairing code: [749701123365521327694] + + + + + ./chip-tool payload parse-setup-payload MT:-24J042C00KA0648G00 + [1646287790.029238][8190:8190] CHIP:SPL: Parsing base38Representation: MT:-24J042C00KA0648G00 + [1646287790.029368][8190:8190] CHIP:SPL: CommissioningFlow: 0 + [1646287790.029393][8190:8190] CHIP:SPL: VendorID: 65521 + [1646287790.029413][8190:8190] CHIP:SPL: Version: 0 + [1646287790.029432][8190:8190] CHIP:SPL: ProductID: 32769 + [1646287790.029451][8190:8190] CHIP:SPL: Discriminator: 3840 + [1646287790.029469][8190:8190] CHIP:SPL: SetUpPINCode: 20202021 + [1646287790.029488][8190:8190] CHIP:SPL: RendezvousInformation: 2 + disabled: true + + - label: "If (PICS_DT_CTRL_CONCATENATED_QR_CODE_1)" + verification: | + Vendor specific field testcase + disabled: true + + - label: + "If !(PICS_DT_CTRL_CONCATENATED_QR_CODE_1) && + PICS_DT_CTRL_CONCATENATED_QR_CODE_2" + verification: | + Vendor specific field testcase + disabled: true + + - label: + "If !(PICS_DT_CTRL_CONCATENATED_QR_CODE_1) && + !(PICS_DT_CTRL_CONCATENATED_QR_CODE_2)" + verification: | + Vendor specific field testcase + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DD_1_12.yaml b/src/app/tests/suites/certification/Test_TC_DD_1_12.yaml new file mode 100644 index 00000000000000..402470617d0bfa --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_1_12.yaml @@ -0,0 +1,100 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.1.12. [TC-DD-1.12] Onboarding Payload Verification - Custom Flow = 0 + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Scan the DUTs QR code using a QR code reader" + verification: | + 1. Get the QR code from the DUT + 16-MacBook-Pro:connectedhomeip liam$ ./out/lighting-app/chip-lighting-app + [1641836544619] [16162:695667] CHIP: [DL] _Init + [1641836544619] [16162:695667] CHIP: [DL] Device Configuration: + [1641836544619] [16162:695667] CHIP: [DL] Serial Number: TEST_SN + [1641836544619] [16162:695667] CHIP: [DL] Vendor Id: 9050 (0x235A) + [1641836544619] [16162:695667] CHIP: [DL] Product Id: 65279 (0xFEFF) + [1641836544619] [16162:695667] CHIP: [DL] Hardware Version: 0 + [1641836544619] [16162:695667] CHIP: [DL] Setup Pin Code: 20202021 + [1641836544619] [16162:695667] CHIP: [DL] Setup Discriminator: 3840 (0xF00) + [1641836544619] [16162:695667] CHIP: [DL] Manufacturing Date: (not set) + [1641836544619] [16162:695667] CHIP: [DL] Device Type: 257 (0x101) + [1641836544619] [16162:695667] CHIP: [SVR] SetupQRCode: [MT:YNJV7VSC00KA0648G00] + [1641836544619] [16162:695667] CHIP: [SVR] Copy/paste the below URL in a browser to see the QR Code: + [1641836544619] [16162:695667] CHIP: [SVR] https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3AYNJV7VSC00KA0648G00 + [1641836544619] [16162:695667] CHIP: [SVR] Manual pairing code: [34970112332] + + + 2. Parse the DUT's QR Code using the TH commissioner: chip-tool + 16-MacBook-Pro:connectedhomeip liam$ ./examples/chip-tool/out/debug/chip-tool payload parse-setup-payload MT:YNJV7VSC00KA0648G00 + [1641836844939] [16334:698889] CHIP: [SPL] Parsing base38Representation: MT:YNJV7VSC00KA0648G00 + [1641836844940] [16334:698889] CHIP: [SPL] CommissioningFlow: 0 + [1641836844940] [16334:698889] CHIP: [SPL] VendorID: 9050 + [1641836844940] [16334:698889] CHIP: [SPL] Version: 0 + [1641836844940] [16334:698889] CHIP: [SPL] ProductID: 65279 + [1641836844940] [16334:698889] CHIP: [SPL] Discriminator: 3840 + [1641836844940] [16334:698889] CHIP: [SPL] SetUpPINCode: 20202021 + [1641836844940] [16334:698889] CHIP: [SPL] RendezvousInformation: 2 + disabled: true + + - label: "Verify Custom payload support" + verification: | + 1. Custom Flow bit in the Onboarding Payload QR Code is set to 0 (Standard Flow) + + 16-MacBook-Pro:connectedhomeip liam$ ./examples/chip-tool/out/debug/chip-tool payload parse-setup-payload MT:YNJV7VSC00KA0648G00 + [1641836844939] [16334:698889] CHIP: [SPL] Parsing base38Representation: MT:YNJV7VSC00KA0648G00 + [1641836844940] [16334:698889] CHIP: [SPL] CommissioningFlow: 0 + [1641836844940] [16334:698889] CHIP: [SPL] VendorID: 9050 + [1641836844940] [16334:698889] CHIP: [SPL] Version: 0 + [1641836844940] [16334:698889] CHIP: [SPL] ProductID: 65279 + [1641836844940] [16334:698889] CHIP: [SPL] Discriminator: 3840 + [1641836844940] [16334:698889] CHIP: [SPL] SetUpPINCode: 20202021 + [1641836844940] [16334:698889] CHIP: [SPL] RendezvousInformation: 2 + disabled: true + + - label: + "if custom flow bit in step 2 is equal to 0 (Standard flow), reboot + the device" + verification: | + 1. Reboot the DUT + 2. Verfy that the DUT enters commissioningmode upon power up + + [1641836544690] [16162:695667] CHIP: [DL] Device Configuration: + [1641836544690] [16162:695667] CHIP: [DL] Serial Number: TEST_SN + [1641836544690] [16162:695667] CHIP: [DL] Vendor Id: 9050 (0x235A) + [1641836544690] [16162:695667] CHIP: [DL] Product Id: 65279 (0xFEFF) + [1641836544690] [16162:695667] CHIP: [DL] Hardware Version: 0 + [1641836544690] [16162:695667] CHIP: [DL] Setup Pin Code: 20202021 + [1641836544690] [16162:695667] CHIP: [DL] Setup Discriminator: 3840 (0xF00) + [1641836544690] [16162:695667] CHIP: [DL] Manufacturing Date: (not set) + [1641836544690] [16162:695667] CHIP: [DL] Device Type: 257 (0x101) + [1641836544690] [16162:695667] CHIP: [SVR] SetupQRCode: [MT:YNJV7VSC00KA0648G00] + [1641836544690] [16162:695667] CHIP: [SVR] Copy/paste the below URL in a browser to see the QR Code: + [1641836544690] [16162:695667] CHIP: [SVR] https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3AYNJV7VSC00KA0648G00 + [1641836544690] [16162:695667] CHIP: [SVR] Manual pairing code: [34970112332] + [1641836544690] [16162:695684] CHIP: [DL] _OnPlatformEvent + [1641836544690] [16162:695684] CHIP: [DIS] DNS-SD StartServer mode=0 + [1641836544690] [16162:695684] CHIP: [DIS] Failed to find a valid admin pairing. Node ID unknown + [1641836544690] [16162:695684] CHIP: [DIS] Start dns-sd server - no current nodeId + [1641836544690] [16162:695684] CHIP: [DL] Using wifi MAC for hostname + [1641836544690] [16162:695684] CHIP: [DIS] Advertise commission parameter vendorID=9050 productID=65279 discriminator=3840/15 + [1641836544690] [16162:695684] CHIP: [DL] Publishing service D920ECCFF905179B on port 5540 with type: _matterc._udp,_V9050,_T257,_S15,_L3840,_CM on interface id: 0 + [1641836544690] [16162:695684] CHIP: [DIS] Scheduling Discovery timeout in secs=900 + [1641836545360] [16162:695684] CHIP: [DL] Mdns: OnRegister name: D920ECCFF905179B, type: _matterc._udp., domain: local., flags: 2 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DD_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DD_2_1.yaml index f8228f7f218a83..97ded29eb33b0e 100644 --- a/src/app/tests/suites/certification/Test_TC_DD_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DD_2_1.yaml @@ -11,8 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 7.2.1. [TC-DD-2.1] Announcement by device verification +name: 3.2.1. [TC-DD-2.1] Announcement by device verification config: nodeId: 0x12344321 @@ -24,46 +25,68 @@ tests: "If TH knows the DUTs Discovery Capability Bitmask, it starts the commissioning process in any order of priority on all of the networking technologies that are supported by both the TH and the DUT" + verification: | + sudo ./chip-all-clusters-app --wifi disabled: true - label: "If (PICS_CHIP_DEV) then If !(PICS_CHIP_DEV) then If (PICS_DEV_LOCK) then If (PICS_DEV_BARRIER) then" + verification: | + disabled: true - label: "if (PICS_BLE) TH does not respond to DUT and DUT keeps sending ADVs" + verification: | + disabled: true - label: "if (PICS_BLE) TH does not respond to DUT and DUT keeps sending ADVs" + verification: | + disabled: true - label: "if (PICS_BLE) TH does not respond to DUT and DUT keeps sending ADVs" + verification: | + Out of scope for TE8 disabled: true - label: "if (PICS_BLE) TH does not respond to DUT and sends a power cycle command to DUT" + verification: | + Out of scope for TE8 disabled: true - label: "if (PICS_BLE) TH does not respond to DUT and DUT keeps sending ADVs. TH waits at least 15 minutes" + verification: | + Out of scope for TE8 disabled: true - label: "if (PICS_WIFI) TH scans and finds the DUT SSID" + verification: | + Out of scope for TE8 disabled: true - label: "if (PICS_WIFI) TH scans and finds the DUT SSID TH sends to DUT a 1st power cycle command (or reset manually) TH sends to DUT a 2nd power cycle command (or reset manually)" + verification: | + Out of scope for TE8 disabled: true - label: "if (PICS_WIFI) & (PICS_IE) TH scans and finds the DUT SSID" + verification: | + Out of scope for TE8 disabled: true - label: "TH is connected to the DUT through an Ethernet connection" + verification: | + Out of scope for TE8 disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DD_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DD_2_2.yaml index f66a30d0887951..e0cd27ce31a7da 100644 --- a/src/app/tests/suites/certification/Test_TC_DD_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DD_2_2.yaml @@ -11,9 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 7.2.2. [TC-DD-2.2] Discovery by commissioner verification [DUT - + 3.2.2. [TC-DD-2.2] Discovery by commissioner verification [DUT - Commissioner] config: diff --git a/src/app/tests/suites/certification/Test_TC_DD_3_3.yaml b/src/app/tests/suites/certification/Test_TC_DD_3_3.yaml new file mode 100644 index 00000000000000..100857b6d231a1 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_3_3.yaml @@ -0,0 +1,605 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.3.3. [TC-DD-3.3] User Directed Commissioning - Commissionee + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT start scanning for available commissioners using Commissioner + Discovery" + verification: | + + disabled: true + + - label: "TH is instructed to advertise Commissioner Discovery service" + verification: | + DUT to advertsise commissioner discovery service, Ex: The TV app example in SDK is reference commissioner + + + sudo ./chip-tv-app + + CHIP:DL: AUDIT: * Validate buf1 and buf2 are <<>> + CHIP:DL: AUDIT: * Validate r1 and r2 are <<>> + CHIP:DL: AUDIT: * buf1: 990049D21B9116BA6C79CDAF106B9558 + CHIP:DL: AUDIT: * buf2: 06D468BC4397CDD99A72C6E753E3D097 + CHIP:DL: AUDIT: * r1: 0x9F437DC6 r2: 0xE5EBA97A + CHIP:DL: AUDIT: ===== RANDOM NUMBER GENERATOR AUDIT END ==== + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-mCbE1q) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/reboot-count = 8 (0x8) + CHIP:DL: Got Ethernet interface: eth0 + CHIP:DL: Found the primary Ethernet interface:eth0 + CHIP:DL: Got WiFi interface: wlan0 + CHIP:DL: Failed to reset WiFi statistic counts + CHIP:DL: Device Configuration: + CHIP:DL: Serial Number: TEST_SN + CHIP:DL: Vendor Id: 9050 (0x235A) + CHIP:DL: Product Id: 65279 (0xFEFF) + CHIP:DL: Product Revision: 0 + CHIP:DL: Setup Pin Code: 20202021 + CHIP:DL: Setup Discriminator: 3840 (0xF00) + CHIP:DL: Manufacturing Date: (not set) + CHIP:DL: Device Type: 35 (0x23) + CHIP:SVR: SetupQRCode: [MT:YNJV7VSC00KA0648G00] + CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code: + CHIP:SVR: https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3AYNJV7VSC00KA0648G00 + CHIP:SVR: Manual pairing code: [34970112332] + CHIP:ZCL: Using ZAP configuration... + ] CHIP:ZCL: OpCreds: Initiating OpCreds cluster by writing fabrics list from fabric table. + CHIP:DIS: Set the fabric pairing table delegate + CHIP:ZCL: OpCreds: Call to writeFabricsIntoFabricsListAttribute + CHIP:ZCL: OpCreds: Stored 0 fabrics in fabrics list attribute. + CHIP:ZCL: Failed to store mac address for endpoint: 1. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 3. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 4. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 5. Error:../include/endpoint-configuration/Endp + CHIP:DIS: Init fabric pairing table with server storage + CHIP:IN: UDP::Init bind&listen port=5540 + CHIP:IN: UDP::Init bound to port=5540 + CHIP:IN: UDP::Init bind&listen port=5540 + CHIP:IN: UDP::Init bound to port=5540 + CHIP:IN: TransportMgr initialized + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-aw9h7V) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/GlobalMCTR = 9000 (0x2328) + CHIP:DL: wpa_supplicant: _IsWiFiStationProvisioned: interface not connected + CHIP:DIS: Fabric 1 is not yet configured + CHIP:DIS: Fabric 2 is not yet configured + CHIP:DIS: Fabric 3 is not yet configured + CHIP:DIS: Fabric 4 is not yet configured + CHIP:DIS: Fabric 5 is not yet configured + CHIP:DIS: Fabric 6 is not yet configured + CHIP:DIS: Fabric 7 is not yet configured + CHIP:DIS: Fabric 8 is not yet configured + CHIP:DIS: Fabric 9 is not yet configured + CHIP:DIS: Fabric 10 is not yet configured + CHIP:DIS: Fabric 11 is not yet configured + CHIP:DIS: Fabric 12 is not yet configured + CHIP:DIS: Fabric 13 is not yet configured + CHIP:DIS: Fabric 14 is not yet configured + CHIP:DIS: Fabric 15 is not yet configured + CHIP:DIS: Fabric 16 is not yet configured + CHIP:SC: Assigned local session key ID 1 + CHIP:SC: Waiting for PBKDF param request + CHIP:DIS: DNS-SD StartServer mode=1 + CHIP:DL: MDNS failed to join multicast group on veth5731933 for address type IPv4: ../third_party/c + CHIP:DL: MDNS failed to join multicast group on vethbf7bfa6 for address type IPv4: ../third_party/c + CHIP:DL: MDNS failed to join multicast group on vethcf434e5 for address type IPv4: ../third_party/c + CHIP:DIS: CHIP minimal mDNS started advertising. + CHIP:DIS: Failed to find a valid admin pairing. Node ID unknown + CHIP:DIS: Start dns-sd server - no current nodeId + CHIP:DL: MAC is not known, using a default. + CHIP:DIS: Advertise commission parameter vendorID=9050 productID=65279 discriminator=3840/00 + CHIP:DIS: CHIP minimal mDNS configured as 'Commissionable node device'. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Scheduling Discovery timeout in secs=900 + CHIP:DL: MAC is not known, using a default. + CHIP:DIS: Advertise commission parameter vendorID=9050 productID=65279 discriminator=3840/00 + CHIP:DIS: CHIP minimal mDNS configured as 'Commissioner device'. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: DNS-SD StartServer mode=0 + CHIP:DL: MDNS failed to join multicast group on veth5731933 for address type IPv4: ../third_party/c + CHIP:DL: MDNS failed to join multicast group on vethbf7bfa6 for address type IPv4: ../third_party/c + CHIP:DL: MDNS failed to join multicast group on vethcf434e5 for address type IPv4: ../third_party/c + CHIP:DIS: CHIP minimal mDNS started advertising. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Failed to find a valid admin pairing. Node ID unknown + CHIP:DIS: Start dns-sd server - no current nodeId + CHIP:DL: MAC is not known, using a default. + CHIP:DIS: Advertise commission parameter vendorID=9050 productID=65279 discriminator=3840/00 + CHIP:DIS: CHIP minimal mDNS configured as 'Commissionable node device'. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Scheduling Discovery timeout in secs=900 + CHIP:DL: MAC is not known, using a default. + CHIP:DIS: Advertise commission parameter vendorID=9050 productID=65279 discriminator=3840/00 + CHIP:DIS: CHIP minimal mDNS configured as 'Commissioner device'. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:IN: CASE Server enabling CASE session setups + CHIP:SVR: Server Listening... + CHIP:DL: Device Configuration: + CHIP:DL: Serial Number: TEST_SN + CHIP:DL: Vendor Id: 9050 (0x235A) + CHIP:DL: Product Id: 65279 (0xFEFF) + CHIP:DL: Product Revision: 0 + CHIP:DL: Setup Pin Code: 20202021 + CHIP:DL: Setup Discriminator: 3840 (0xF00) + CHIP:DL: Manufacturing Date: (not set) + CHIP:DL: Device Type: 35 (0x23) + CHIP:SVR: SetupQRCode: [MT:YNJV7VSC00KA0648G00] + CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code: + CHIP:SVR: https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3AYNJV7VSC00KA0648G00 + CHIP:SVR: Manual pairing code: [34970112332] + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:CTL: Generating NOC + CHIP:CTL: Generating ICAC + CHIP:SVR: Retrieved value from server storage. + CHIP:IN: UDP::Init bind&listen port=5542 + CHIP:IN: UDP::Init bound to port=5542 + CHIP:IN: UDP::Init bind&listen port=5542 + CHIP:IN: UDP::Init bound to port=5542 + CHIP:IN: TransportMgr initialized + CHIP:DIS: Init fabric pairing table with server storage + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-ZAecx4) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/GlobalMCTR = 10000 (0x2710) + CHIP:CTL: System State Initialized... + CHIP:ZCL: Using ZAP configuration... + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: OpCreds: Initiating OpCreds cluster by writing fabrics list from fabric table. + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:DIS: Set the fabric pairing table delegate + CHIP:ZCL: OpCreds: Call to writeFabricsIntoFabricsListAttribute + CHIP:ZCL: OpCreds: Stored 0 fabrics in fabrics list attribute. + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: Failed to store mac address for endpoint: 1. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 3. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 4. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 5. Error:../include/endpoint-configuration/Endp + CHIP:SVR: Retrieved value from server storage. + CHIP:DIS: Verifying the received credentials + CHIP:DIS: Added new fabric at index: 1, Initialized: 0 + CHIP:DIS: Assigned compressed fabric ID: 0x810A763DC0609539, node ID: 0xFFFFFFFEFFFFFFFF + CHIP:CTL: Joined the fabric at index 1. Compressed fabric ID is: 0x810A763DC0609539 + CHIP:SVR: Retrieved value from server storage. + CHIP:IN: UDP::Init bind&listen port=5550 + CHIP:IN: UDP::Init bound to port=5550 + CHIP:IN: UDP::Init bind&listen port=5550 + CHIP:IN: UDP::Init bound to port=5550 + CHIP:IN: TransportMgr initialized + CHIP:DL: TRACE: Bluez mainloop starting Thread + CHIP:DL: TRACE: Bus acquired for name MATTER-3840 + CHIP:DL: CREATE service object at /chipoble/17db/service + CHIP:DL: Create characteristic object at /chipoble/17db/service/c1 + CHIP:DL: Create characteristic object at /chipoble/17db/service/c2 + CHIP:DL: CHIP BTP C1 /chipoble/17db/service + CHIP:DL: CHIP BTP C2 /chipoble/17db/service + CHIP:DL: CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING is TRUE + CHIP:DL: Create characteristic object at /chipoble/17db/service/c3 + CHIP:DL: CHIP BTP C3 /chipoble/17db/service + CHIP:DL: PlatformBlueZInit init success + CHIP:DL: BluezPeripheralRegisterAppDone done + CHIP:DL: HandlePlatformSpecificBLEEvent 16392 + CHIP:DL: Create adv object at /chipoble/17db/advertising + CHIP:DL: SET service data to {'0xFFF6': <[byte 0x00, 0x00, 0x0f, 0x5a, 0x23, 0xff, 0xfe]>} + CHIP:DL: HandlePlatformSpecificBLEEvent 16393 + CHIP:DL: CHIPoBLE advertising config complete + CHIP:DL: RegisterAdvertisement complete + CHIP:DL: HandlePlatformSpecificBLEEvent 16394 + + + 2F: Invalid argument + 07] CHIP:DL: Caught signal 2 + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-1yqzCI) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/boot-reason = 6 (0x6) + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-9LKrPO) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) + CHIP:DL: Inet Layer shutdown + CHIP:DL: BLE layer shutdown + CHIP:DL: System Layer shutdown + CHIP:CTL: Shutting down the System State, this will teardown the CHIP Stack + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-Q5U5bp) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) + CHIP:DL: Inet Layer shutdown + CHIP:DL: BLE layer shutdown + CHIP:DL: System Layer shutdown + disabled: true + + - label: + "DUT start scanning for available commissioners using Commissioner + Discovery" + verification: | + On the second RPI start tv-casting-app + + ubuntu@matter-te-6:~/connectedhomeip/examples/tv-casting-app/linux/out/debug$ ./chip-tv-casting-app + + + + AUDIT: ===== RANDOM NUMBER GENERATOR AUDIT START ==== + AUDIT: * Validate buf1 and buf2 are <<>> + AUDIT: * Validate r1 and r2 are <<>> + AUDIT: * buf1: 8643126A627C1C289E7CBD1C0B59485B + AUDIT: * buf2: E9A8AB9589D71155E7B161FC3DBB66CE + AUDIT: * r1: 0x3A338FB7 r2: 0xCC480665 + AUDIT: ===== RANDOM NUMBER GENERATOR AUDIT END ==== + writing settings to file (/tmp/chip_counters.ini-oR46os) + renamed tmp file to file (/tmp/chip_counters.ini) + NVS set: chip-counters/reboot-count = 12 (0xC) + Got Ethernet interface: eth0 + Found the primary Ethernet interface:eth0 + Got WiFi interface: wlan0 + Failed to reset WiFi statistic counts + MDNS failed to join multicast group on veth5731933 for address type IPv4: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:387: Inet Error 0x00000110: Address not found + MDNS failed to join multicast group on vethbf7bfa6 for address type IPv4: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:387: Inet Error 0x00000110: Address not found + MDNS failed to join multicast group on vethcf434e5 for address type IPv4: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:387: Inet Error 0x00000110: Address not found + Attempt to mDNS broadcast failed: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:687: OS Error 0x02000065: Network is unreachable + Attempt to mDNS broadcast failed: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:687: OS Error 0x02000065: Network is unreachable + Attempt to mDNS broadcast failed: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:687: OS Error 0x02000065: Network is unreachable + Attempt to mDNS broadcast failed: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:687: OS Error 0x02000065: Network is unreachable + Discovered Commissioner #1 + Device Name: Test TV + Vendor ID: 9050 + Product ID: 65279 + Device Type: 35 + Hostname: EEAABADABAD0DDCA + IP Address #1: 2402:e280:2108:181:dea6:32ff:fef9:f0a1 + IP Address #2: fe80::dea6:32ff:fef9:f0a1 + IP Address #3: 192.168.1.12 + Port: 5550 + Commissioning Mode: 0 + 1 commissioner(s) discovered. Select one (by number# above) to request commissioning from: + disabled: true + + - label: + "DUT is instructed to start the commissioning procedure with the TH + found at step 2" + verification: | + Select option 1 on TH + disabled: true + + - label: "TH verifies the Identification Declaration message" + verification: | + On DUT. + + CHIP:SVR: UserDirectedCommissioningServer::OnMessageReceived + CHIP:SVR: UDC instance=420604DE2A8F19A2 + CHIP:SVR: UserDirectedCommissioningServer::OnMessageReceived + CHIP:SVR: UDC instance=420604DE2A8F19A2 + CHIP:SVR: UserDirectedCommissioningServer::OnMessageReceived + CHIP:SVR: UDC instance=420604DE2A8F19A2 + CHIP:SVR: UserDirectedCommissioningServer::OnMessageReceived + CHIP:SVR: UDC instance=420604DE2A8F19A2 + CHIP:SVR: OnCommissionableNodeFound instance: name=420604DE2A8F19A2 old_state=1 new_state=3 + CHIP:CTL: ------PROMPT USER!! OnUserDirectedCommissioningRequest instance=420604DE2A8F19A2 deviceName=Test TV casting app + CHIP:SVR: UDC Client[0] instance=420604DE2A8F19A2 deviceName=Test TV casting app address=UDP:192.168.1.11:5540, disc=3840 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DD_3_4.yaml b/src/app/tests/suites/certification/Test_TC_DD_3_4.yaml new file mode 100644 index 00000000000000..0a135c6b7872a0 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_3_4.yaml @@ -0,0 +1,605 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.3.4. [TC-DD-3.4] User Directed Commissioning - Commissioner [DUT - + Commissioner] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "DUT is instructed to advertise Commissioner Discovery service" + verification: | + DUT to advertsise commissioner discovery service, Ex: The TV app example in SDK is reference commissioner + + + '' ./chip-tv-app + + CHIP:DL: AUDIT: * Validate buf1 and buf2 are <<>> + CHIP:DL: AUDIT: * Validate r1 and r2 are <<>> + CHIP:DL: AUDIT: * buf1: 990049D21B9116BA6C79CDAF106B9558 + CHIP:DL: AUDIT: * buf2: 06D468BC4397CDD99A72C6E753E3D097 + CHIP:DL: AUDIT: * r1: 0x9F437DC6 r2: 0xE5EBA97A + CHIP:DL: AUDIT: ===== RANDOM NUMBER GENERATOR AUDIT END ==== + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-mCbE1q) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/reboot-count = 8 (0x8) + CHIP:DL: Got Ethernet interface: eth0 + CHIP:DL: Found the primary Ethernet interface:eth0 + CHIP:DL: Got WiFi interface: wlan0 + CHIP:DL: Failed to reset WiFi statistic counts + CHIP:DL: Device Configuration: + CHIP:DL: Serial Number: TEST_SN + CHIP:DL: Vendor Id: 9050 (0x235A) + CHIP:DL: Product Id: 65279 (0xFEFF) + CHIP:DL: Product Revision: 0 + CHIP:DL: Setup Pin Code: 20202021 + CHIP:DL: Setup Discriminator: 3840 (0xF00) + CHIP:DL: Manufacturing Date: (not set) + CHIP:DL: Device Type: 35 (0x23) + CHIP:SVR: SetupQRCode: [MT:YNJV7VSC00KA0648G00] + CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code: + CHIP:SVR: https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3AYNJV7VSC00KA0648G00 + CHIP:SVR: Manual pairing code: [34970112332] + CHIP:ZCL: Using ZAP configuration... + ] CHIP:ZCL: OpCreds: Initiating OpCreds cluster by writing fabrics list from fabric table. + CHIP:DIS: Set the fabric pairing table delegate + CHIP:ZCL: OpCreds: Call to writeFabricsIntoFabricsListAttribute + CHIP:ZCL: OpCreds: Stored 0 fabrics in fabrics list attribute. + CHIP:ZCL: Failed to store mac address for endpoint: 1. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 3. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 4. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 5. Error:../include/endpoint-configuration/Endp + CHIP:DIS: Init fabric pairing table with server storage + CHIP:IN: UDP::Init bind&listen port=5540 + CHIP:IN: UDP::Init bound to port=5540 + CHIP:IN: UDP::Init bind&listen port=5540 + CHIP:IN: UDP::Init bound to port=5540 + CHIP:IN: TransportMgr initialized + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-aw9h7V) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/GlobalMCTR = 9000 (0x2328) + CHIP:DL: wpa_supplicant: _IsWiFiStationProvisioned: interface not connected + CHIP:DIS: Fabric 1 is not yet configured + CHIP:DIS: Fabric 2 is not yet configured + CHIP:DIS: Fabric 3 is not yet configured + CHIP:DIS: Fabric 4 is not yet configured + CHIP:DIS: Fabric 5 is not yet configured + CHIP:DIS: Fabric 6 is not yet configured + CHIP:DIS: Fabric 7 is not yet configured + CHIP:DIS: Fabric 8 is not yet configured + CHIP:DIS: Fabric 9 is not yet configured + CHIP:DIS: Fabric 10 is not yet configured + CHIP:DIS: Fabric 11 is not yet configured + CHIP:DIS: Fabric 12 is not yet configured + CHIP:DIS: Fabric 13 is not yet configured + CHIP:DIS: Fabric 14 is not yet configured + CHIP:DIS: Fabric 15 is not yet configured + CHIP:DIS: Fabric 16 is not yet configured + CHIP:SC: Assigned local session key ID 1 + CHIP:SC: Waiting for PBKDF param request + CHIP:DIS: DNS-SD StartServer mode=1 + CHIP:DL: MDNS failed to join multicast group on veth5731933 for address type IPv4: ../third_party/c + CHIP:DL: MDNS failed to join multicast group on vethbf7bfa6 for address type IPv4: ../third_party/c + CHIP:DL: MDNS failed to join multicast group on vethcf434e5 for address type IPv4: ../third_party/c + CHIP:DIS: CHIP minimal mDNS started advertising. + CHIP:DIS: Failed to find a valid admin pairing. Node ID unknown + CHIP:DIS: Start dns-sd server - no current nodeId + CHIP:DL: MAC is not known, using a default. + CHIP:DIS: Advertise commission parameter vendorID=9050 productID=65279 discriminator=3840/00 + CHIP:DIS: CHIP minimal mDNS configured as 'Commissionable node device'. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Scheduling Discovery timeout in secs=900 + CHIP:DL: MAC is not known, using a default. + CHIP:DIS: Advertise commission parameter vendorID=9050 productID=65279 discriminator=3840/00 + CHIP:DIS: CHIP minimal mDNS configured as 'Commissioner device'. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: DNS-SD StartServer mode=0 + CHIP:DL: MDNS failed to join multicast group on veth5731933 for address type IPv4: ../third_party/c + CHIP:DL: MDNS failed to join multicast group on vethbf7bfa6 for address type IPv4: ../third_party/c + CHIP:DL: MDNS failed to join multicast group on vethcf434e5 for address type IPv4: ../third_party/c + CHIP:DIS: CHIP minimal mDNS started advertising. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Failed to find a valid admin pairing. Node ID unknown + CHIP:DIS: Start dns-sd server - no current nodeId + CHIP:DL: MAC is not known, using a default. + CHIP:DIS: Advertise commission parameter vendorID=9050 productID=65279 discriminator=3840/00 + CHIP:DIS: CHIP minimal mDNS configured as 'Commissionable node device'. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Scheduling Discovery timeout in secs=900 + CHIP:DL: MAC is not known, using a default. + CHIP:DIS: Advertise commission parameter vendorID=9050 productID=65279 discriminator=3840/00 + CHIP:DIS: CHIP minimal mDNS configured as 'Commissioner device'. + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 192.168.1.11 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.17.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.21.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.18.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.19.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 172.20.0.1 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from 2402:e280:2108:181:e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e65f:1ff:fe0e:bf41 + CHIP:DIS: Broadcasting mDns reply for query from fd11:db8:1::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Failed to advertise records: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp: + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fd00:6d61:7474:6572::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::42:eeff:fec7:c619 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::1 + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::907b:c7ff:fe3e:b49c + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::789d:4aff:fec4:2745 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:DIS: Broadcasting mDns reply for query from fe80::e8b9:daff:fee9:9934 + CHIP:IN: CASE Server enabling CASE session setups + CHIP:SVR: Server Listening... + CHIP:DL: Device Configuration: + CHIP:DL: Serial Number: TEST_SN + CHIP:DL: Vendor Id: 9050 (0x235A) + CHIP:DL: Product Id: 65279 (0xFEFF) + CHIP:DL: Product Revision: 0 + CHIP:DL: Setup Pin Code: 20202021 + CHIP:DL: Setup Discriminator: 3840 (0xF00) + CHIP:DL: Manufacturing Date: (not set) + CHIP:DL: Device Type: 35 (0x23) + CHIP:SVR: SetupQRCode: [MT:YNJV7VSC00KA0648G00] + CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code: + CHIP:SVR: https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3AYNJV7VSC00KA0648G00 + CHIP:SVR: Manual pairing code: [34970112332] + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:CTL: Generating NOC + CHIP:CTL: Generating ICAC + CHIP:SVR: Retrieved value from server storage. + CHIP:IN: UDP::Init bind&listen port=5542 + CHIP:IN: UDP::Init bound to port=5542 + CHIP:IN: UDP::Init bind&listen port=5542 + CHIP:IN: UDP::Init bound to port=5542 + CHIP:IN: TransportMgr initialized + CHIP:DIS: Init fabric pairing table with server storage + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:SVR: Retrieved value from server storage. + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-ZAecx4) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/GlobalMCTR = 10000 (0x2710) + CHIP:CTL: System State Initialized... + CHIP:ZCL: Using ZAP configuration... + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: OpCreds: Initiating OpCreds cluster by writing fabrics list from fabric table. + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:DIS: Set the fabric pairing table delegate + CHIP:ZCL: OpCreds: Call to writeFabricsIntoFabricsListAttribute + CHIP:ZCL: OpCreds: Stored 0 fabrics in fabrics list attribute. + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: Duplicate attribute override registration failed + CHIP:ZCL: Failed to store mac address for endpoint: 1. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 3. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 4. Error:../include/endpoint-configuration/Endp + CHIP:ZCL: Failed to store application for endpoint: 5. Error:../include/endpoint-configuration/Endp + CHIP:SVR: Retrieved value from server storage. + CHIP:DIS: Verifying the received credentials + CHIP:DIS: Added new fabric at index: 1, Initialized: 0 + CHIP:DIS: Assigned compressed fabric ID: 0x810A763DC0609539, node ID: 0xFFFFFFFEFFFFFFFF + CHIP:CTL: Joined the fabric at index 1. Compressed fabric ID is: 0x810A763DC0609539 + CHIP:SVR: Retrieved value from server storage. + CHIP:IN: UDP::Init bind&listen port=5550 + CHIP:IN: UDP::Init bound to port=5550 + CHIP:IN: UDP::Init bind&listen port=5550 + CHIP:IN: UDP::Init bound to port=5550 + CHIP:IN: TransportMgr initialized + CHIP:DL: TRACE: Bluez mainloop starting Thread + CHIP:DL: TRACE: Bus acquired for name MATTER-3840 + CHIP:DL: CREATE service object at /chipoble/17db/service + CHIP:DL: Create characteristic object at /chipoble/17db/service/c1 + CHIP:DL: Create characteristic object at /chipoble/17db/service/c2 + CHIP:DL: CHIP BTP C1 /chipoble/17db/service + CHIP:DL: CHIP BTP C2 /chipoble/17db/service + CHIP:DL: CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING is TRUE + CHIP:DL: Create characteristic object at /chipoble/17db/service/c3 + CHIP:DL: CHIP BTP C3 /chipoble/17db/service + CHIP:DL: PlatformBlueZInit init success + CHIP:DL: BluezPeripheralRegisterAppDone done + CHIP:DL: HandlePlatformSpecificBLEEvent 16392 + CHIP:DL: Create adv object at /chipoble/17db/advertising + CHIP:DL: SET service data to {'0xFFF6': <[byte 0x00, 0x00, 0x0f, 0x5a, 0x23, 0xff, 0xfe]>} + CHIP:DL: HandlePlatformSpecificBLEEvent 16393 + CHIP:DL: CHIPoBLE advertising config complete + CHIP:DL: RegisterAdvertisement complete + CHIP:DL: HandlePlatformSpecificBLEEvent 16394 + + + 2F: Invalid argument + 07] CHIP:DL: Caught signal 2 + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-1yqzCI) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/boot-reason = 6 (0x6) + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-9LKrPO) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) + CHIP:DL: Inet Layer shutdown + CHIP:DL: BLE layer shutdown + CHIP:DL: System Layer shutdown + CHIP:CTL: Shutting down the System State, this will teardown the CHIP Stack + CHIP:DL: writing settings to file (/tmp/chip_counters.ini-Q5U5bp) + CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) + CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) + CHIP:DL: Inet Layer shutdown + CHIP:DL: BLE layer shutdown + CHIP:DL: System Layer shutdown + disabled: true + + - label: + "TH start scanning for available commissioners using Commissioner + Discovery" + verification: | + On the second RPI start tv-casting-app + + ubuntu@matter-te-6:~/connectedhomeip/examples/tv-casting-app/linux/out/debug$ ./chip-tv-casting-app + + + + AUDIT: ===== RANDOM NUMBER GENERATOR AUDIT START ==== + AUDIT: * Validate buf1 and buf2 are <<>> + AUDIT: * Validate r1 and r2 are <<>> + AUDIT: * buf1: 8643126A627C1C289E7CBD1C0B59485B + AUDIT: * buf2: E9A8AB9589D71155E7B161FC3DBB66CE + AUDIT: * r1: 0x3A338FB7 r2: 0xCC480665 + AUDIT: ===== RANDOM NUMBER GENERATOR AUDIT END ==== + writing settings to file (/tmp/chip_counters.ini-oR46os) + renamed tmp file to file (/tmp/chip_counters.ini) + NVS set: chip-counters/reboot-count = 12 (0xC) + Got Ethernet interface: eth0 + Found the primary Ethernet interface:eth0 + Got WiFi interface: wlan0 + Failed to reset WiFi statistic counts + MDNS failed to join multicast group on veth5731933 for address type IPv4: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:387: Inet Error 0x00000110: Address not found + MDNS failed to join multicast group on vethbf7bfa6 for address type IPv4: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:387: Inet Error 0x00000110: Address not found + MDNS failed to join multicast group on vethcf434e5 for address type IPv4: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:387: Inet Error 0x00000110: Address not found + Attempt to mDNS broadcast failed: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:687: OS Error 0x02000065: Network is unreachable + Attempt to mDNS broadcast failed: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:687: OS Error 0x02000065: Network is unreachable + Attempt to mDNS broadcast failed: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:687: OS Error 0x02000065: Network is unreachable + Attempt to mDNS broadcast failed: ../third_party/connectedhomeip/src/inet/IPEndPointBasis.cpp:687: OS Error 0x02000065: Network is unreachable + Discovered Commissioner #1 + Device Name: Test TV + Vendor ID: 9050 + Product ID: 65279 + Device Type: 35 + Hostname: EEAABADABAD0DDCA + IP Address #1: 2402:e280:2108:181:dea6:32ff:fef9:f0a1 + IP Address #2: fe80::dea6:32ff:fef9:f0a1 + IP Address #3: 192.168.1.12 + Port: 5550 + Commissioning Mode: 0 + 1 commissioner(s) discovered. Select one (by number# above) to request commissioning from: + disabled: true + + - label: + "TH is instructed to start the commissioning procedure with the DUT + found at step 2" + verification: | + Select option 1 on TH + disabled: true + + - label: "DUT verify the Identification Declaration message" + verification: | + On DUT. + + CHIP:SVR: UserDirectedCommissioningServer::OnMessageReceived + CHIP:SVR: UDC instance=420604DE2A8F19A2 + CHIP:SVR: UserDirectedCommissioningServer::OnMessageReceived + CHIP:SVR: UDC instance=420604DE2A8F19A2 + CHIP:SVR: UserDirectedCommissioningServer::OnMessageReceived + CHIP:SVR: UDC instance=420604DE2A8F19A2 + CHIP:SVR: UserDirectedCommissioningServer::OnMessageReceived + CHIP:SVR: UDC instance=420604DE2A8F19A2 + CHIP:SVR: OnCommissionableNodeFound instance: name=420604DE2A8F19A2 old_state=1 new_state=3 + CHIP:CTL: ------PROMPT USER!! OnUserDirectedCommissioningRequest instance=420604DE2A8F19A2 deviceName=Test TV casting app + CHIP:SVR: UDC Client[0] instance=420604DE2A8F19A2 deviceName=Test TV casting app address=UDP:192.168.1.11:5540, disc=3840 + disabled: true + + - label: "By any means DUT prompt user for onboarding payload" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DD_3_7.yaml b/src/app/tests/suites/certification/Test_TC_DD_3_7.yaml new file mode 100644 index 00000000000000..b2756d991b643d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_3_7.yaml @@ -0,0 +1,38 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.3.7. [TC-DD-3.7] Commissioning Flow - Concurrent - Negative scenario [DUT + - Commissioner] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "Repeat steps 1.a-1.o from [TC-DD-3.5]. Force Fail any step between + 1.a and 1.j." + verification: | + + disabled: true + + - label: + "Repeat steps 1.a-1.o from [TC-DD-3.5]. Force Fail any step between + 1.k and 1.o" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DD_3_8.yaml b/src/app/tests/suites/certification/Test_TC_DD_3_8.yaml new file mode 100644 index 00000000000000..488ca8ad4b460d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_3_8.yaml @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.3.8. [TC-DD-3.8] Commissioning Flow - Non-concurrent - Negative scenario + [DUT - Commissioner] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "Repeat steps 1.a-1.o from [TC-DD-3.6]. Force exit any step in 1.a and + 1.o." + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_1.yaml new file mode 100644 index 00000000000000..604f91ce8cebde --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_1.yaml @@ -0,0 +1,264 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 107.1. [TC-DL-1.1] Attributes check [DUT - Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH reads LockState attribute from DUT" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: "TH reads LockType attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads ActuatorEnabled attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads DoorState attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads DoorOpenEvents attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads DoorClosedEvents attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads OpenPeriod attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads NumberOfLogRecordsSupported attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads NumberOfTotalUsersSupported attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads NumberOfPINUsersSupported attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads NumberOfRFIDUsersSupported attribute from DUT" + verification: | + + disabled: true + + - label: + "TH reads NumberOfWeekDaysSchedulesSupporterUser attribute from DUT" + verification: | + + disabled: true + + - label: + "TH reads NumberOf YearDaySchedulesSupportedPeruserattribute from DUT" + verification: | + + disabled: true + + - label: "TH reads NumberOfHoliDaySchedulesSupported attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads MaxPINCodedLength attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads MinPINCodedLength attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads MaxRFIDCodedLegth attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads MinRFIDCodedLength attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads CredentialRulesSupport attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads EnableLogging attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads Language attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads LEDSettings attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads AutoRelockTime attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads SoundVolume attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads OperatingMode attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads SupportedOperating Mode attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads DefualtConfigurationRegister attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads EnableLocalProgramming attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads EnableOneTouchLocking attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads EnableInsideStatusLED attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads EnablePrivacyMode attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads LocalProgrammingFeatures attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads WrongCodeEntryLimit attribute from DUT" + verification: | + + disabled: true + + - label: "TH writes 0 to WrongCodeEntryLimit" + verification: | + + disabled: true + + - label: "TH readsUserCodedTemporaryDisableTime attribute from DUT" + verification: | + + disabled: true + + - label: "TH writes 0 to UserCodedTemporaryDisableTime" + verification: | + + disabled: true + + - label: "TH reads SendPINOverTheAir attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads RequirePINforRemoteOperation attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads SecurityLevel from DUT" + verification: | + + disabled: true + + - label: "TH reads ExpiringUserTimeOut attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads AlarmMask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads KeypadOperationEventMask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads RemoteOperationEventMask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads ManualOperationEventMask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads RFIDOperationEventMask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads KeypadProgrammingEventMask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads RemoteProgrammingEventMask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads RFIDProgrammingEventMask attribute from DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_10.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_10.yaml new file mode 100644 index 00000000000000..d34e8ee71ac8ee --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_10.yaml @@ -0,0 +1,72 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.10. [TC-DL-1.10] Verification for the following Commands - Set User + Type, Get User Type ,Get User Type Response [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH sends Set User Type Command to DUT with the following values: User + ID as 6 User Type as 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: "TH sends Get User Type Command to DUT" + verification: | + + disabled: true + + - label: + "TH sends Set User Type Command to DUT with the following values: User + ID as 6 User Type as 0" + verification: | + + disabled: true + + - label: "TH sends Get User Type Command to DUT" + verification: | + + disabled: true + + - label: + "TH sends Set User Type Command to DUT with the following values: User + ID as 6 User Type as 8" + verification: | + + disabled: true + + - label: "TH sends Get User Type Command to DUT" + verification: | + + disabled: true + + - label: + "TH sends Set User Type Command to DUT with the following values: User + ID as 6 User Type as 10" + verification: | + + disabled: true + + - label: "TH sends Get User Type Command to DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_11.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_11.yaml new file mode 100644 index 00000000000000..979f04f57fc89a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_11.yaml @@ -0,0 +1,85 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.11. [TC-DL-1.11] Verification for the following Commands - Set Year + Schedule, Get Year Schedule, Get Year Day Schedule Response and Clear Year + Day Schedule[DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH reads RFID Users Supported attribute and saves as usersupported + for future use." + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: + "TH sends Set RFID Code Command to DUT with the following values: User + ID as 1 User Status as 0 User Type as 0 RFID Code as 785" + verification: | + + disabled: true + + - label: + "TH sends Set RFID Code Command to DUT with the following values: User + ID as usersupported+1 User Status as 0 User Type as 0 RFID Code as 824" + verification: | + + disabled: true + + - label: + "TH sends Set RFID Code Command to DUT with the following values: User + ID as 2 User Status as 0 User Type as 0 RFID Code as 824" + verification: | + + disabled: true + + - label: "TH sends Get RFID Code Command to DUT" + verification: | + + disabled: true + + - label: + "TH sends Get RFID Code Command to the DUT with User ID value as + usersupported +1" + verification: | + + disabled: true + + - label: "TH sends Clear RFID Code Command to DUT with the User ID as 2" + verification: | + + disabled: true + + - label: "TH sends Get RFID Code Command to DUT for User ID as 2" + verification: | + + disabled: true + + - label: "TH sends Clear All RFID Codes Command to DUT" + verification: | + + disabled: true + + - label: "TH sends Get RFID Code Command to DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_13.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_13.yaml new file mode 100644 index 00000000000000..ea0458698cf4fe --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_13.yaml @@ -0,0 +1,94 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.13. [TC-DL-1.13] Verification for the following Commands - Set User, Get + User, Get User Response, Clear User [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH reads NumberOfTotalUsersSupported attribute and saves for future + use." + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: + "TH sends Set User Command to DUT with the following values: + OperationType as 0 UserIndex as 2 UserName as xxx UserUniqueID as 6452 + UserStatus as 1 UserType as 0 CredentialRule as 0" + verification: | + + disabled: true + + - label: + "TH sends Set User Command to DUT with the following values: + OperationType as 0 UserIndex as 2 UserName as xxx UserUniqueID as 6452 + UserStatus as 1 UserType as 10 CredentialRule as 3" + verification: | + + disabled: true + + - label: + "TH sends Set User Command to DUT with the following values: + OperationType as 0 UserIndex as 2 UserName as xxx UserUniqueID as 8965 + UserStatus as 1 UserType as 0 CredentialRule as 0" + verification: | + + disabled: true + + - label: + "TH sends Set User Command to DUT with the following values: + OperationType as 0 UserIndex as 26 UserName as xxx UserUniqueID as + 6452 UserStatus as 1 UserType as 1 CredentialRule as 0" + verification: | + + disabled: true + + - label: + "TH sends Set User Command to DUT with the following values: + OperationType as 0 UserIndex as 2 UserName as NULL UserUniqueID as + NULL UserStatus as NULL UserType as NULL CredentialRule as NULL" + verification: | + + disabled: true + + - label: + "TH sends Set User Command to DUT with the following values: + OperationType as 2 UserIndex as 2 UserName as NULL UserUniqueID as + NULL UserStatus as NULL UserType as NULL CredentialRule as NULL" + verification: | + + disabled: true + + - label: "TH sends Get User Command to DUT" + verification: | + + disabled: true + + - label: "TH sends Clear User Command to DUT" + verification: | + + disabled: true + + - label: "TH sends Get User Command to DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_14.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_14.yaml new file mode 100644 index 00000000000000..b8533871c48486 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_14.yaml @@ -0,0 +1,140 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.14. [TC-DL-1.14] Verification for the following Commands - Set + Credential , Set Credential Response, Get Credential Status, Get Credential + Status Response, Clear Credential [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH reads NumberOfTotalUsersSupported attribute and saves for future + use." + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: + "TH sends Set Credential Command to DUT with the following fields: + OperationType as 0 Credential as 1 1 CredentialData as xxxx UserIndex + as 2 UserStatus as 0 UserType as 0" + verification: | + + disabled: true + + - label: + "TH sends Set Credential Command to DUT with the following fields: + OperationType as 0 Credential as 1 1 CredentialData as xxxx UserIndex + as 2 UserStatus as 5 UserType as 10" + verification: | + + disabled: true + + - label: + "TH sends Set Credential Command to DUT with the following fields: + OperationType as 0 Credential as 1 1 CredentialData as xxxx UserIndex + as 2 UserStatus as 0 UserType as 0" + verification: | + + disabled: true + + - label: + "TH sends Set Credential Command to DUT with the following fields: + OperationType as 0 Credential as 1 1 CredentialData as xxxx UserIndex + as 2 UserStatus as 0 UserType as 0" + verification: | + + disabled: true + + - label: + "TH sends Set Credential Command to DUT with the following fields: + OperationType as 0 Credential as 1 2 CredentialData as xxxx UserIndex + as 3 UserStatus as 0 UserType as 0" + verification: | + + disabled: true + + - label: + "TH sends Set Credential Command to DUT with the following fields: + OperationType as 2 Credential as 1 3 CredentialData as xxxx UserIndex + as 3 UserStatus as 0 UserType as 0" + verification: | + + disabled: true + + - label: "TH sends Get Credential Status Command" + verification: | + + disabled: true + + - label: + "TH sends Clear Credential Command to DUT with the following fields: + CredentialType as 1 CredentialIndex as 2" + verification: | + + disabled: true + + - label: + "TH sends Set Credential Command to DUT with the following fields: + OperationType as 0 Credential as 1 1 CredentialData as xxxx UserIndex + as 2 UserStatus as 0 UserType as 0" + verification: | + + disabled: true + + - label: + "TH sends Clear Credential Command to DUT with the following fields: + CredentialType as 1 CredentialIndex as 0xFFFE" + verification: | + + disabled: true + + - label: + "TH sends Set Credential Command to DUT with the following fields: + OperationType as 0 Credential as 1 1 CredentialData as xxxx UserIndex + as 2 UserStatus as 0 UserType as 0" + verification: | + + disabled: true + + - label: "TH sends Clear Credential Command to DUT" + verification: | + + disabled: true + + - label: "TH sends Get Credential Status Command" + verification: | + + disabled: true + + - label: + "TH sends Set Credential Command to DUT with the following fields: + OperationType as 0 Credential as 1 1 CredentialData as xxxx UserIndex + as 2 UserStatus as 0 UserType as 0" + verification: | + + disabled: true + + - label: + "TH sends Clear Credential Command to DUT with the following fields: + CredentialType as 8 CredentialIndex as 2" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_15.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_15.yaml new file mode 100644 index 00000000000000..75b0ced7601932 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_15.yaml @@ -0,0 +1,68 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.15. [TC-DL-1.15] Verification for the Operation Event Notification + Command [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH sends Get User Status Command to DUT" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: + "From the Get User Status Response extract UserID and save for future + use" + verification: | + + disabled: true + + - label: "TH sends Get PIN Code Command to DUT" + verification: | + + disabled: true + + - label: + "From the Get PIN Code Response extract PIN Code for the above User ID + and save for future use" + verification: | + + disabled: true + + - label: "TH reads KeypadOperationEventMask Attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads Remote Operation Event Mask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads Manual Operation Event Mask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads RFID Operation Event Mask attribute from DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_16.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_16.yaml new file mode 100644 index 00000000000000..9519118a3ca4d8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_16.yaml @@ -0,0 +1,87 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.16. [TC-DL-1.16] Verification for the Programming Event Notification + Command [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH sends Get User Status Command to DUT" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: + "From the Get User Status Response extract UserID and save for future + use" + verification: | + + disabled: true + + - label: "TH sends Get PIN Code Command to DUT" + verification: | + + disabled: true + + - label: + "From the Get PIN Code Response extract PIN Code for the above User ID + and save for future use" + verification: | + + disabled: true + + - label: "TH sends Get User Type command to DUT" + verification: | + + disabled: true + + - label: + "From the Get User Type Response extract User Type for the above User + ID and save for future use" + verification: | + + disabled: true + + - label: "TH sends Get User Status command to DUT" + verification: | + + disabled: true + + - label: + "From the Get User Status Response extract the User Status for the + above User ID and saves for future use" + verification: | + + disabled: true + + - label: "TH reads Keypad Programming Event Mask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads Remote Programming Event Mask attribute from DUT" + verification: | + + disabled: true + + - label: "TH reads RFID Programming Event Mask attribute from DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_17.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_17.yaml new file mode 100644 index 00000000000000..588d2bbeac0ccd --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_17.yaml @@ -0,0 +1,187 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 104.18. [TC-DL-2.17] Verification for the Door Lock Events [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Initiate a DoorLockAlarm Event by setting the AlarmCode to 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: "Initiate a DoorLockAlarm Event by setting the AlarmCode to 1" + verification: | + + disabled: true + + - label: "Initiate a DoorLockAlarm Event by setting the AlarmCode to 3" + verification: | + + disabled: true + + - label: "Initiate a DoorLockAlarm Event by setting the AlarmCode to 4" + verification: | + + disabled: true + + - label: "Initiate a DoorLockAlarm Event by setting the AlarmCode to 5" + verification: | + + disabled: true + + - label: "Initiate a DoorLockAlarm Event by setting the AlarmCode to 6" + verification: | + + disabled: true + + - label: "Initiate a DoorLockAlarm Event by setting the AlarmCode to 7" + verification: | + + disabled: true + + - label: "Initiate a DoorLockAlarm Event by setting the AlarmCode to 8" + verification: | + + disabled: true + + - label: "Initiate a DoorStateChange event by setting the DoorState to 0" + verification: | + + disabled: true + + - label: "Initiate a DoorStateChange event by setting the DoorState to 1" + verification: | + + disabled: true + + - label: "Initiate a DoorStateChange event by setting the DoorState to 2" + verification: | + + disabled: true + + - label: "Initiate a DoorStateChange event by setting the DoorState to 3" + verification: | + + disabled: true + + - label: "Initiate a DoorStateChange event by setting the DoorState to 4" + verification: | + + disabled: true + + - label: "Initiate a DoorStateChange event by setting the DoorState to 5" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 0" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 1" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 2" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 3" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 4" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 5" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 6" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 7" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 8" + verification: | + + disabled: true + + - label: "Initiate a LockOperation event by setting OperationSource to 9" + verification: | + + disabled: true + + - label: + "Initiate a LockOperationError Event by setting OperationError as 0" + verification: | + + disabled: true + + - label: + "Initiate a LockOperationError Event by setting OperationError as 1" + verification: | + + disabled: true + + - label: + "Initiate a LockOperationError Event by setting OperationError as 2" + verification: | + + disabled: true + + - label: + "Initiate a LockOperationError Event by setting OperationError as 3" + verification: | + + disabled: true + + - label: + "Initiate a LockOperationError Event by setting OperationError as 4" + verification: | + + disabled: true + + - label: "Initiate a LockUserChange event by changing the Lock User" + verification: | + + disabled: true + + - label: "Initiate a LockUserChange event by changing the Schedule" + verification: | + + disabled: true + + - label: "Initiate a LockUserChange event by changing the Credential" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_2.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_2.yaml new file mode 100644 index 00000000000000..a73cb91c8025af --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_2.yaml @@ -0,0 +1,83 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 107.2. [TC-DL-1.2] Verification for Door lock command[DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH writes the RequirePINforRemoteOperation attribute value as False + on the DUT" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: "TH sends Lock Door Command to the DUT without any valid PINCode" + verification: | + + disabled: true + + - label: + "TH writes the RequirePINforRemoteOperation attribute value as True on + the DUT" + verification: | + + disabled: true + + - label: "TH sends Lock Door Command to the DUT with valid PINCode" + verification: | + + disabled: true + + - label: + "TH sends Lock Door Command to the DUT without any argument PINCode" + verification: | + + disabled: true + + - label: "TH writes WrongCodeEntryLimit attribute value as 3 on the DUT" + verification: | + + disabled: true + + - label: + "TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds + on the DUT" + verification: | + + disabled: true + + - label: "TH sends Lock Door Command to the DUT with invalid PINCode" + verification: | + + disabled: true + + - label: + "Repeat the above step 3 times TH reads UserCodeTemporaryDisableTime + attribute from DUT" + verification: | + + disabled: true + + - label: + "After UserCodeTemporaryDisableTime attribute time expires, TH sends + Lock Command to the DUT with valid PINCode" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_4.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_4.yaml new file mode 100644 index 00000000000000..e14dfa409905f8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_4.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.4. [TC-DL-1.4] Verification for Unlock with Timeout command [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH writes AutoRelockTime attribute value as 10 seconds on the DUT" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: + "TH sends the unlock with Timeout command to the DUT with argument + PINCode value as 'xxxxxxxx' and the Timeout argument value as 5 + seconds" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_5.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_5.yaml new file mode 100644 index 00000000000000..40e3558972c302 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_5.yaml @@ -0,0 +1,74 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.5. [TC-DL-1.5] Verification for Get Log Record, Get Log Record Response + Command [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH saves the NumberOfLogRecordsSupported attribute value as logcount + for the future use" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: + "TH sends Door lock command to the DUT with PINCode argument value as + 'xxxxxxxx' for 5 times" + verification: | + + disabled: true + + - label: "Increment the logcount by 5." + verification: | + + disabled: true + + - label: "TH reads NumberOfLogRecordsSupported attribute from the DUT" + verification: | + + disabled: true + + - label: + "TH sends Get Log Record Command to the DUT with argument Log Index + value as 2" + verification: | + + disabled: true + + - label: + "TH sends Door lock command to the DUT with PINCode argument value as + 'xxxxxxxx'" + verification: | + + disabled: true + + - label: "TH reads NumberOfLogRecordsSupported attribute from the DUT" + verification: | + + disabled: true + + - label: + "TH sends Get Log Record Command to the DUT with argument Log Index + value as 0" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_6.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_6.yaml new file mode 100644 index 00000000000000..cac9a308c1b18a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_6.yaml @@ -0,0 +1,103 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.6. [TC-DL-1.6] Verification for the following Commands - Set PIN Code, + Get PIN Code, Get PIN Code Response, Clear PIN Code, Clear All PIN Codes + [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH saves the NumberOfPINUsersSupported attribute value as idvalue for + the future use" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: + "TH sends Set PIN Code Command to the DUT with the following argument + values: User ID value as 3 User Status value as 1 'OccupiedEnabled' + User Type value as 0 'UnrestrictedUser' PIN value as 'xxxxxxxx'" + verification: | + + disabled: true + + - label: + "TH sends Set PIN Code Command to the DUT with the following argument + values: User ID value as idvalue+1 User Status value as 1 + 'OccupiedEnabled' User Type value as 0 'UnrestrictedUser' PIN value as + 'xxxxxxxx'" + verification: | + + disabled: true + + - label: + "TH sends Get PIN Code Command to the DUT with argument User ID value + as 3" + verification: | + + disabled: true + + - label: + "TH sends Get PIN Code Command to the DUT with argument User ID value + as idvalue +1" + verification: | + + disabled: true + + - label: + "TH sends Get PIN Code Command to the DUT with argument User ID value + as '5a3'" + verification: | + + disabled: true + + - label: + "TH sends Clear PIN Code Command to the DUT with argument PINSlotIndex + value as 3" + verification: | + + disabled: true + + - label: + "TH sends Get PIN Code Response Command to DUT with the User ID as 3" + verification: | + + disabled: true + + - label: + "TH sends clear PIN Code Command to the DUT with argument User ID + value as idvlaue +1" + verification: | + + disabled: true + + - label: + "TH sends clear PIN Code Command to the DUT with argument PINSlotIndex + value as 0xFFFE" + verification: | + + disabled: true + + - label: + "TH sends Get PIN Code Response Command to DUT with the User ID as 8" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_7.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_7.yaml new file mode 100644 index 00000000000000..4b81f856afec9f --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_7.yaml @@ -0,0 +1,51 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.7. [TC-DL-1.7] Verification for the following Commands - Set User + Status, Get User Status , Get User Status Response [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Verify that DUT sends a SUCCESS response" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: "TH send Get User Status command to DUT with User ID as 3" + verification: | + + disabled: true + + - label: + "TH send Set User Status command to DUT for setting the User Status as + 3 for User ID as 3" + verification: | + + disabled: true + + - label: "TH sends Get User Status command to DUT" + verification: | + + disabled: true + + - label: "TH sends Get User Status command to DUT with the User ID as '3f4'" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_8.yaml b/src/app/tests/suites/certification/Test_TC_DL_1_8.yaml new file mode 100644 index 00000000000000..a8a9e4dd128225 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DL_1_8.yaml @@ -0,0 +1,75 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 107.8. [TC-DL-1.8] Verification for the following Commands - Set Week Day + Schedule, Get Week Day Schedule , Get Week Day Schedule Response, Clear Week + Day Schedule [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH reads NumberOfWeekDaySchedulesSupportedPerUser attribute and saves + for future use." + verification: | + https://github.com/project-chip/connectedhomeip/issues/15776 + disabled: true + + - label: + "TH reads NumberOfTotalUsersSupported attribute and saves for future + use." + verification: | + + disabled: true + + - label: + "TH send Set Week Day Schedule Command to DUT with the following + values: WeekDayIndex as 2 NumberOfTotalUsersSupported as 2 DaysMaskMap + as 2 StartHour as 15 StartMinute as 45 EndHour as 16 EndMinute as 55" + verification: | + + disabled: true + + - label: "TH send Get Week Day Schedule Command to DUT" + verification: | + + disabled: true + + - label: + "TH send Set Week Day Schedule Command to DUT with the following + values: WeekDayIndex as 0 NumberOfTotalUsersSupported as 2 DaysMaskMap + as 7 StartHour as 15 StartMinute as 45 EndHour as 16 EndMinute as 55" + verification: | + + disabled: true + + - label: "TH send Get Week Day Schedule Command to DUT" + verification: | + + disabled: true + + - label: "TH sends Clear Week Day Schedule Command to DUT" + verification: | + + disabled: true + + - label: "TH sends Get Week Day Schedule Command to DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DM_2_1.yaml new file mode 100644 index 00000000000000..09d68ad2422ee8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DM_2_1.yaml @@ -0,0 +1,103 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.2.1. [TC-DM-2.1] Operational Credential Commands + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Commission DUT to TH" + verification: | + + disabled: true + + - label: "TH Sends Attestation Request to DUT" + verification: | + https://github.com/project-chip/connectedhomeip/issues/14395 + disabled: true + + - label: "TH Sends Attestation Certificate Chain Request to DUT" + verification: | + ./chip-tool operationalcredentials certificate-chain-request 1 1 0 + disabled: true + + - label: "TH Sends CSR Request to DUT" + verification: | + + disabled: true + + - label: "TH Sends Add Trusted Root Certificate Request to DUT" + verification: | + + disabled: true + + - label: "TH Sends Add Op Cert Request to DUT" + verification: | + + disabled: true + + - label: "Verify DUT and TH are on the same Fabric" + verification: | + + disabled: true + + - label: "TH Sends Update Op Cert Request to DUT" + verification: | + + disabled: true + + - label: + "TH Sends Update Op Cert Request to DUT with a Fabric Label not + already in use" + verification: | + + disabled: true + + - label: + "TH Sends Update Op Cert Request to DUT with a Fabric label already in + use" + verification: | + + disabled: true + + - label: + "TH Sends Remove Fabric Request to DUT with a non-Valid Fabric index" + verification: | + ./chip-tool operationalcredentials remove-fabric 2 1 0 + + CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0008 + [1646390608.860327][6336:6341] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0008 + [1646390608.860465][6336:6341] CHIP:TOO: NOCResponse: { + [1646390608.860548][6336:6341] CHIP:TOO: statusCode: 11 + [1646390608.860611][6336:6341] CHIP:TOO: } + [1646390608.860695][6336:6341] CHIP:DMG: ICR moving to [AwaitingDe] + [1646390608.860801][6336:6341] CHIP:EM: Sending Standalone Ack for MessageCounter:1477607 on exchange 51257i + disabled: true + + - label: "TH Sends Remove Fabric Request to DUT with a valid Fabric ID" + verification: | + ./chip-tool operationalcredentials remove-fabric 1 1 0 + + CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0008 + [1646390764.134501][6347:6352] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0008 + [1646390764.134673][6347:6352] CHIP:TOO: NOCResponse: { + [1646390764.134894][6347:6352] CHIP:TOO: statusCode: 0 + [1646390764.134985][6347:6352] CHIP:TOO: fabricIndex: 1 + [1646390764.135047][6347:6352] CHIP:TOO: } + [1646390764.135157][6347:6352] CHIP:DMG: ICR moving to [AwaitingDe] + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DM_2_3.yaml b/src/app/tests/suites/certification/Test_TC_DM_2_3.yaml index ad560ee8a08126..b88de7f9b24f37 100644 --- a/src/app/tests/suites/certification/Test_TC_DM_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DM_2_3.yaml @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 10.2.3. [TC-DM-2.3] Operational Credential Commands [DUT - Commissioner] @@ -21,22 +22,36 @@ config: tests: - label: "Commission TH to DUT" + verification: | + disabled: true - label: "DUT Sends Attestation Request to TH" + verification: | + disabled: true - label: "DUT Sends Attestation Certificate Chain Request to TH" + verification: | + disabled: true - label: "DUT Sends CSR Request to TH" + verification: | + disabled: true - label: "DUT Sends Add Trusted Root Certificate Request to TH" + verification: | + disabled: true - label: "DUT Sends Add Op Cert Request to TH" + verification: | + disabled: true - label: "Verify DUT and TH are on the same Fabric" + verification: | + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_GC_1_4.yaml b/src/app/tests/suites/certification/Test_TC_GC_1_4.yaml new file mode 100644 index 00000000000000..b9933ac414c56b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_GC_1_4.yaml @@ -0,0 +1,145 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 90.4. [TC-GC-1.4] Verification For ErrorCode message [DUT - Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Start the commissioning process of TH1 on DUT" + verification: | + + disabled: true + + - label: + "During PASE Session TH1 sends CommissionComplete command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends ArmFailSafe command to the DUT with ExpiryLengthSeconds + value as 'commission_timeout' and the Breadcrumb value as 0" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool generalcommissioning arm-fail-safe 60 0 60 1 0 + + + [1646202957.619162][2956:2961] CHIP:DMG: InteractionModelRevision = 1 + [1646202957.619205][2956:2961] CHIP:DMG: }, + [1646202957.619299][2956:2961] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 + [1646202957.619369][2956:2961] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0001 + [1646202957.619461][2956:2961] CHIP:TOO: ArmFailSafeResponse: { + [1646202957.619522][2956:2961] CHIP:TOO: errorCode: 0 + [1646202957.619556][2956:2961] CHIP:TOO: debugText: + [1646202957.619591][2956:2961] CHIP:TOO: } + [1646202957.619634][2956:2961] CHIP:DMG: ICR moving to [AwaitingDe] + [1646202957.619712][2956:2961] CHIP:EM: Sending Standalone Ack for MessageCounter:5531048 on exchange 43022i + disabled: true + + - label: + "TH1 sends SetRegulatoryConfig command to the DUT with Location + attribute value as '3'" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool generalcommissioning set-regulatory-config 3 0 0 60 1 0 + + [1646204704.308373][6252:6257] CHIP:DMG: InteractionModelRevision = 1 + [1646204704.308415][6252:6257] CHIP:DMG: }, + [1646204704.308526][6252:6257] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0003 + [1646204704.308602][6252:6257] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0003 + [1646204704.308703][6252:6257] CHIP:TOO: SetRegulatoryConfigResponse: { + [1646204704.308763][6252:6257] CHIP:TOO: errorCode: 0 + [1646204704.308806][6252:6257] CHIP:TOO: debugText: + [1646204704.308847][6252:6257] CHIP:TOO: } + [1646204704.308899][6252:6257] CHIP:DMG: ICR moving to [AwaitingDe] + [1646204704.308974][6252:6257] CHIP:EM: Sending Standalone Ack for MessageCounter:2793138 on exchange 35617i + disabled: true + + - label: + "TH1 sends SetRegulatoryConfig command to the DUT with Location + attribute" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool generalcommissioning set-regulatory-config 0 0 0 60 1 0 + + [1646203091.878703][2973:2978] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0003 + [1646203091.878782][2973:2978] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0003 + [1646203091.878888][2973:2978] CHIP:TOO: SetRegulatoryConfigResponse: { + [1646203091.878950][2973:2978] CHIP:TOO: errorCode: 0 + [1646203091.878994][2973:2978] CHIP:TOO: debugText: + [1646203091.879063][2973:2978] CHIP:TOO: } + [1646203091.879114][2973:2978] CHIP:DMG: ICR moving to [AwaitingDe] + [1646203091.879197][2973:2978] CHIP:EM: Sending Standalone Ack for MessageCounter:7339336 on exchange 13158i + disabled: true + + - label: "TH1 sends AttestationRequest command to the DUT" + verification: | + For the 5.5 commissioning flow the steps are added. Not required to verify on GC test plan verification, because it's verified in another test plan. + disabled: true + + - label: "TH1 sends CSRRequest command to the DUT" + verification: | + For the 5.5 commissioning flow the steps are added. Not required to verify on GC test plan verification, because it's verified in another test plan. + disabled: true + + - label: "TH1 sends AddNOC command to the DUT" + verification: | + For the 5.5 commissioning flow the steps are added. Not required to verify on GC test plan verification, because it's verified in another test plan. + disabled: true + + - label: "TH1 Sends CommissionComplete command to the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool generalcommissioning commissioning-complete 1 0 + + [1646203451.094771][3006:3011] CHIP:DMG: InteractionModelRevision = 1 + [1646203451.094813][3006:3011] CHIP:DMG: }, + [1646203451.094921][3006:3011] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0005 + [1646203451.094997][3006:3011] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0005 + [1646203451.095097][3006:3011] CHIP:TOO: CommissioningCompleteResponse: { + [1646203451.095157][3006:3011] CHIP:TOO: errorCode: 0 + [1646203451.095200][3006:3011] CHIP:TOO: debugText: + [1646203451.095242][3006:3011] CHIP:TOO: } + [1646203451.095293][3006:3011] CHIP:DMG: ICR moving to [AwaitingDe] + [1646203451.095375][3006:3011] CHIP:EM: Sending Standalone Ack for MessageCounter:14415629 on exchange 59296i + disabled: true + + - label: + "TH1 reads Breadcrumb value from the DUT NOTE: Reading an attribute is + to confirm that commissioning successfully completed" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool generalcommissioning read breadcrumb 1 0 + + [1646205172.305272][6395:6400] CHIP:DMG: SuppressResponse = true, + [1646205172.305305][6395:6400] CHIP:DMG: InteractionModelRevision = 1 + [1646205172.305336][6395:6400] CHIP:DMG: } + [1646205172.305511][6395:6400] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Attribute 0x0000_0000DataVersion: 1894223167 + [1646205172.305586][6395:6400] CHIP:TOO: Breadcrumb: 0 + [1646205172.305747][6395:6400] CHIP:EM: Sending Standalone Ack for MessageCounter:10552439 on exchange 39551i + disabled: true + + - label: "TH1 Sends CommissionComplete command to the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool generalcommissioning commissioning-complete 1 0 + + [1646205216.257281][6409:6414] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0005 + [1646205216.257341][6409:6414] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0005 + [1646205216.257418][6409:6414] CHIP:TOO: CommissioningCompleteResponse: { + [1646205216.257463][6409:6414] CHIP:TOO: errorCode: 0 + [1646205216.257495][6409:6414] CHIP:TOO: debugText: + [1646205216.257531][6409:6414] CHIP:TOO: } + [1646205216.257578][6409:6414] CHIP:DMG: ICR moving to [AwaitingDe] + [1646205216.257725][6409:6414] CHIP:EM: Sending Standalone Ack for MessageCounter:13393976 on exchange 5554i + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml b/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml new file mode 100644 index 00000000000000..58cf68091167ce --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml @@ -0,0 +1,41 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 19.8.5. [TC-IDM-7.1] Multi Fabric Subscription Test Cases. DUT as the + server. + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "All Reference Devices send 3 Subscribe Request Messages to DUT.(Total + - 12 active subscriptions) They can subscribe to different attributes + and events. Once all subscriptions are active, change the value of all + the attributes that have been subscribed or trigger an action on the + DUT to generate an event." + verification: | + + disabled: true + + - label: + "All Reference Devices send a Read Request Message to the DUT. They + can read different attributes and events." + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_ILL_3_1.yaml b/src/app/tests/suites/certification/Test_TC_ILL_3_1.yaml new file mode 100644 index 00000000000000..2cb03b53cbbdce --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ILL_3_1.yaml @@ -0,0 +1,54 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 69.3.1.[TC-ILL-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + sudo ./chip-tool illuminancemeasurement read min-measured-value 1 1 + + sudo ./chip-tool illuminancemeasurement read max-measured-value 1 1 + + sudo ./chip-tool illuminancemeasurement read measured-value 1 1 + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + sudo ./chip-tool illuminancemeasurement read tolerance 1 1 + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + Not applicable + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + Not applicable + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_I_3_1.yaml b/src/app/tests/suites/certification/Test_TC_I_3_1.yaml new file mode 100644 index 00000000000000..ce5a6086c0c740 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_I_3_1.yaml @@ -0,0 +1,114 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 57.3.1. [TC-I-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + ./chip-tool identify read identify-time 1 1 + + [1648015371.159715][2506:2506] CHIP:IM: Received Read request + [1648015371.159805][2506:2506] CHIP:DMG: ReadRequestMessage = + [1648015371.159840][2506:2506] CHIP:DMG: { + [1648015371.159866][2506:2506] CHIP:DMG: AttributePathIBs = + [1648015371.159903][2506:2506] CHIP:DMG: [ + [1648015371.159932][2506:2506] CHIP:DMG: AttributePathIB = + [1648015371.159968][2506:2506] CHIP:DMG: { + [1648015371.160006][2506:2506] CHIP:DMG: Endpoint = 0x1, + [1648015371.160047][2506:2506] CHIP:DMG: Cluster = 0x3, + [1648015371.160087][2506:2506] CHIP:DMG: Attribute = 0x0000_0000, + [1648015371.160127][2506:2506] CHIP:DMG: } + [1648015371.160164][2506:2506] CHIP:DMG: + [1648015371.160201][2506:2506] CHIP:DMG: ], + [1648015371.160238][2506:2506] CHIP:DMG: + [1648015371.160270][2506:2506] CHIP:DMG: isFabricFiltered = true, + [1648015371.160300][2506:2506] CHIP:DMG: InteractionModelRevision = 1 + [1648015371.160324][2506:2506] CHIP:DMG: }, + + ./chip-tool identify read identify-type 1 1 + [1648015519.017225][2506:2506] CHIP:IM: Received Read request + [1648015519.017293][2506:2506] CHIP:DMG: ReadRequestMessage = + [1648015519.017332][2506:2506] CHIP:DMG: { + [1648015519.017363][2506:2506] CHIP:DMG: AttributePathIBs = + [1648015519.017403][2506:2506] CHIP:DMG: [ + [1648015519.017437][2506:2506] CHIP:DMG: AttributePathIB = + [1648015519.017577][2506:2506] CHIP:DMG: { + [1648015519.017624][2506:2506] CHIP:DMG: Endpoint = 0x1, + [1648015519.017673][2506:2506] CHIP:DMG: Cluster = 0x3, + [1648015519.017721][2506:2506] CHIP:DMG: Attribute = 0x0000_0001, + [1648015519.017768][2506:2506] CHIP:DMG: } + [1648015519.017813][2506:2506] CHIP:DMG: + [1648015519.017853][2506:2506] CHIP:DMG: ], + [1648015519.017894][2506:2506] CHIP:DMG: + [1648015519.017932][2506:2506] CHIP:DMG: isFabricFiltered = true, + [1648015519.017969][2506:2506] CHIP:DMG: InteractionModelRevision = 1 + [1648015519.018003][2506:2506] CHIP:DMG: }, + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + see above + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received write request looks like this (f.e identify-time (id 0) value 60): + ./chip-tool identify write identify-time 1 1 1 + [1646012277.591912][33190:33190] CHIP:IM: Received Write request + [1646012277.591936][33190:33190] CHIP:DMG: IM WH moving to [Initialized] + [1646012277.591987][33190:33190] CHIP:DMG: WriteRequestMessage = + [1646012277.592013][33190:33190] CHIP:DMG: { + [1646012277.592036][33190:33190] CHIP:DMG: timedRequest = false, + [1646012277.592064][33190:33190] CHIP:DMG: AttributeDataIBs = + [1646012277.592094][33190:33190] CHIP:DMG: [ + [1646012277.592118][33190:33190] CHIP:DMG: AttributeDataIB = + [1646012277.592149][33190:33190] CHIP:DMG: { + [1646012277.592175][33190:33190] CHIP:DMG: AttributePathIB = + [1646012277.592208][33190:33190] CHIP:DMG: { + [1646012277.592239][33190:33190] CHIP:DMG: Endpoint = 0x1, + [1646012277.592273][33190:33190] CHIP:DMG: Cluster = 0x3, + [1646012277.592306][33190:33190] CHIP:DMG: Attribute = 0x0000_0000, + [1646012277.592336][33190:33190] CHIP:DMG: } + [1646012277.592368][33190:33190] CHIP:DMG: + [1646012277.592400][33190:33190] CHIP:DMG: Data = 60, + [1646012277.592433][33190:33190] CHIP:DMG: }, + [1646012277.592463][33190:33190] CHIP:DMG: + [1646012277.592488][33190:33190] CHIP:DMG: ], + [1646012277.592516][33190:33190] CHIP:DMG: + [1646012277.592540][33190:33190] CHIP:DMG: moreChunkedMessages = false, + [1646012277.592566][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646012277.592589][33190:33190] CHIP:DMG: }, + [1646012277.592669][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0003 e=1 p=o + [1646012277.592721][33190:33190] CHIP:DMG: Endpoint 1, Cluster 0x0000_0003 update version to d4fdf520 + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + see above + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_I_3_2.yaml b/src/app/tests/suites/certification/Test_TC_I_3_2.yaml new file mode 100644 index 00000000000000..7706afeb33a6f0 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_I_3_2.yaml @@ -0,0 +1,171 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 57.3.2. [TC-I-3.2] Functionality with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT issues an Identify command to the Test Harness, with the + IdentifyTime argument set to 0x003C (60 seconds) or a reasonable time + that is supported by the DUT." + verification: | + On TestHarnes (all-cluster-app) a received Identify command with f.e. 60 as IdentifyTime looks like this: + + [1646010972.583498][33190:33190] CHIP:EM: Handling via exchange: 60250r, Delegate: 0xaaaace1730c8 + [1646010972.583578][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646010972.583611][33190:33190] CHIP:DMG: { + [1646010972.583636][33190:33190] CHIP:DMG: suppressResponse = false, + [1646010972.583663][33190:33190] CHIP:DMG: timedRequest = false, + [1646010972.583687][33190:33190] CHIP:DMG: InvokeRequests = + [1646010972.583718][33190:33190] CHIP:DMG: [ + [1646010972.583742][33190:33190] CHIP:DMG: CommandDataIB = + [1646010972.583773][33190:33190] CHIP:DMG: { + [1646010972.583798][33190:33190] CHIP:DMG: CommandPathIB = + [1646010972.583835][33190:33190] CHIP:DMG: { + [1646010972.583868][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646010972.583905][33190:33190] CHIP:DMG: ClusterId = 0x3, + [1646010972.583941][33190:33190] CHIP:DMG: CommandId = 0x0, + [1646010972.583976][33190:33190] CHIP:DMG: }, + [1646010972.584008][33190:33190] CHIP:DMG: + [1646010972.584037][33190:33190] CHIP:DMG: CommandData = + [1646010972.584071][33190:33190] CHIP:DMG: { + [1646010972.584106][33190:33190] CHIP:DMG: 0x0 = 60, + [1646010972.584140][33190:33190] CHIP:DMG: }, + [1646010972.584172][33190:33190] CHIP:DMG: }, + [1646010972.584204][33190:33190] CHIP:DMG: + [1646010972.584227][33190:33190] CHIP:DMG: ], + [1646010972.584257][33190:33190] CHIP:DMG: + [1646010972.584281][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646010972.584304][33190:33190] CHIP:DMG: }, + [1646010972.584359][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0003 e=1 p=o + [1646010972.584430][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0003 Command=0x0000_0000 + [1646010972.584474][33190:33190] CHIP:DMG: Endpoint 1, Cluster 0x0000_0003 update version to d4fdf424 + disabled: true + + - label: "DUT issues an IdentifyQuery command to the Test Harness." + verification: | + On TestHarnes (all-cluster-app) a received IdentifyQuery command looks like this: + + [1646011933.240584][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:11711341 on exchange 17409r + [1646011933.240642][33190:33190] CHIP:EM: Handling via exchange: 17409r, Delegate: 0xaaaace1730c8 + [1646011933.240779][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646011933.240832][33190:33190] CHIP:DMG: { + [1646011933.240865][33190:33190] CHIP:DMG: suppressResponse = false, + [1646011933.240918][33190:33190] CHIP:DMG: timedRequest = false, + [1646011933.240954][33190:33190] CHIP:DMG: InvokeRequests = + [1646011933.240996][33190:33190] CHIP:DMG: [ + [1646011933.241041][33190:33190] CHIP:DMG: CommandDataIB = + [1646011933.241085][33190:33190] CHIP:DMG: { + [1646011933.241131][33190:33190] CHIP:DMG: CommandPathIB = + [1646011933.241173][33190:33190] CHIP:DMG: { + [1646011933.241228][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646011933.241291][33190:33190] CHIP:DMG: ClusterId = 0x3, + [1646011933.241338][33190:33190] CHIP:DMG: CommandId = 0x1, + [1646011933.241392][33190:33190] CHIP:DMG: }, + [1646011933.241451][33190:33190] CHIP:DMG: + [1646011933.241489][33190:33190] CHIP:DMG: CommandData = + [1646011933.241543][33190:33190] CHIP:DMG: { + [1646011933.241584][33190:33190] CHIP:DMG: }, + [1646011933.241634][33190:33190] CHIP:DMG: }, + [1646011933.241676][33190:33190] CHIP:DMG: + [1646011933.241720][33190:33190] CHIP:DMG: ], + [1646011933.241759][33190:33190] CHIP:DMG: + [1646011933.241803][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646011933.241835][33190:33190] CHIP:DMG: }, + [1646011933.241914][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0003 e=1 p=o + [1646011933.241979][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0003 Command=0x0000_0001 + disabled: true + + - label: + "DUT issues an Identify command to the Test Harness, with the + IdentifyTime argument set to 0x0000 (Stop)." + verification: | + On TestHarnes (all-cluster-app) a received Identify command with an IdentifyTime of 0 looks like this: + + [1646011311.206353][33190:33190] CHIP:EM: Handling via exchange: 12024r, Delegate: 0xaaaace1730c8 + [1646011311.206436][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646011311.206462][33190:33190] CHIP:DMG: { + [1646011311.206483][33190:33190] CHIP:DMG: suppressResponse = false, + [1646011311.206514][33190:33190] CHIP:DMG: timedRequest = false, + [1646011311.206544][33190:33190] CHIP:DMG: InvokeRequests = + [1646011311.206575][33190:33190] CHIP:DMG: [ + [1646011311.206599][33190:33190] CHIP:DMG: CommandDataIB = + [1646011311.206628][33190:33190] CHIP:DMG: { + [1646011311.206656][33190:33190] CHIP:DMG: CommandPathIB = + [1646011311.206687][33190:33190] CHIP:DMG: { + [1646011311.206719][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646011311.206754][33190:33190] CHIP:DMG: ClusterId = 0x3, + [1646011311.206786][33190:33190] CHIP:DMG: CommandId = 0x0, + [1646011311.206815][33190:33190] CHIP:DMG: }, + [1646011311.206848][33190:33190] CHIP:DMG: + [1646011311.206875][33190:33190] CHIP:DMG: CommandData = + [1646011311.206906][33190:33190] CHIP:DMG: { + [1646011311.206937][33190:33190] CHIP:DMG: 0x0 = 0, + [1646011311.206970][33190:33190] CHIP:DMG: }, + [1646011311.207000][33190:33190] CHIP:DMG: }, + [1646011311.207032][33190:33190] CHIP:DMG: + [1646011311.207055][33190:33190] CHIP:DMG: ], + [1646011311.207085][33190:33190] CHIP:DMG: + [1646011311.207108][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646011311.207133][33190:33190] CHIP:DMG: }, + [1646011311.207188][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0003 e=1 p=o + [1646011311.207295][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0003 Command=0x0000_0000 + [1646011311.207342][33190:33190] CHIP:DMG: Endpoint 1, Cluster 0x0000_0003 update version to d4fdf4a5 + [1646011311.207377][33190:33190] CHIP:ZCL: OnIdentifyStop + disabled: true + + - label: + "DUT sends a TriggerEffect command to the Test Harness, with any + supported EffectIdentifier argument and EffectVariant set to 0 ." + verification: | + On TestHarnes (all-cluster-app) a received Identify command with f.e. 1 as EffectIdentifier looks like this: + + [1646011549.034604][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:3605482 on exchange 36067r + [1646011549.034646][33190:33190] CHIP:EM: Handling via exchange: 36067r, Delegate: 0xaaaace1730c8 + [1646011549.034790][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646011549.034821][33190:33190] CHIP:DMG: { + [1646011549.034841][33190:33190] CHIP:DMG: suppressResponse = false, + [1646011549.034865][33190:33190] CHIP:DMG: timedRequest = false, + [1646011549.034891][33190:33190] CHIP:DMG: InvokeRequests = + [1646011549.034923][33190:33190] CHIP:DMG: [ + [1646011549.034948][33190:33190] CHIP:DMG: CommandDataIB = + [1646011549.034976][33190:33190] CHIP:DMG: { + [1646011549.035001][33190:33190] CHIP:DMG: CommandPathIB = + [1646011549.035033][33190:33190] CHIP:DMG: { + [1646011549.035066][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646011549.035103][33190:33190] CHIP:DMG: ClusterId = 0x3, + [1646011549.035139][33190:33190] CHIP:DMG: CommandId = 0x40, + [1646011549.035173][33190:33190] CHIP:DMG: }, + [1646011549.035205][33190:33190] CHIP:DMG: + [1646011549.035588][33190:33190] CHIP:DMG: CommandData = + [1646011549.035632][33190:33190] CHIP:DMG: { + [1646011549.035668][33190:33190] CHIP:DMG: 0x0 = 1, + [1646011549.035706][33190:33190] CHIP:DMG: 0x1 = 0, + [1646011549.035741][33190:33190] CHIP:DMG: }, + [1646011549.035773][33190:33190] CHIP:DMG: }, + [1646011549.035806][33190:33190] CHIP:DMG: + [1646011549.035832][33190:33190] CHIP:DMG: ], + [1646011549.035866][33190:33190] CHIP:DMG: + [1646011549.035890][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646011549.035915][33190:33190] CHIP:DMG: }, + [1646011549.035975][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0003 e=1 p=o + [1646011549.036017][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0003 Command=0x0000_0040 + [1646011549.036052][33190:33190] CHIP:ZCL: RX identify:trigger effect 0x1 variant 0x0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_LC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LC_1_1.yaml new file mode 100644 index 00000000000000..052925f98e7b18 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_LC_1_1.yaml @@ -0,0 +1,57 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 95.1. [TC-LC-1.1] Global Attributes [DUT-Server] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH1 tries to write LabelList attribute of the DUT by setting Label = + 'Test_Label', Value= 'Test_Value'" + verification: | + sudo ./chip-tool any write-by-id 0x0040 0 new 1 1 + [[1647944123.073445][11126:11131] CHIP:DMG: } + [1647944123.073510][11126:11131] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 + [1647944123.073543][11126:11131] CHIP:DMG: WriteClient moving to [AwaitingDe] + [1647944123.073589][11126:11131] CHIP:EM: Sending Standalone Ack for MessageCounter:919751 on exchange 23078i + disabled: true + + - label: "TH1 reads LabelList from the DUT" + verification: | + '' ./chip-tool fixedlabel read label-list 1 0 + + [1641391188.532065][6515:6521] CHIP:TOO: FixedLabel.LabelList response: 4 entries + [1641391188.532179][6515:6521] CHIP:TOO: [1]: { + [1641391188.532230][6515:6521] CHIP:TOO: Label: room + [1641391188.532277][6515:6521] CHIP:TOO: Value: bedroom 2 + [1641391188.532321][6515:6521] CHIP:TOO: } + [1641391188.532377][6515:6521] CHIP:TOO: [2]: { + [1641391188.532424][6515:6521] CHIP:TOO: Label: orientation + [1641391188.532468][6515:6521] CHIP:TOO: Value: North + [1641391188.532512][6515:6521] CHIP:TOO: } + [1641391188.532588][6515:6521] CHIP:TOO: [3]: { + [1641391188.532635][6515:6521] CHIP:TOO: Label: floor + [1641391188.532678][6515:6521] CHIP:TOO: Value: 2 + [1641391188.532721][6515:6521] CHIP:TOO: } + [1641391188.532776][6515:6521] CHIP:TOO: [4]: { + [1641391188.532822][6515:6521] CHIP:TOO: Label: direction + [1641391188.532866][6515:6521] CHIP:TOO: Value: up + [1641391188.532909][6515:6521] CHIP:TOO: } + [1641391188.533007][6515:6521] CHIP:EM: Sending Standalone Ack for MessageCounter:331438 on exchange 13924i + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_LC_1_3.yaml b/src/app/tests/suites/certification/Test_TC_LC_1_3.yaml new file mode 100644 index 00000000000000..aff522552ee595 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_LC_1_3.yaml @@ -0,0 +1,35 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 95.3. [TC-LC-1.3] User Label cluster write verification [DUT - Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH1 writes LabelList attribute of the DUT by setting 'room:bedroom + 1','Orientation:east', 'floor:3', 'direction:down'" + verification: | + sudo ./chip-tool userlabel write label-list '[{"label":"bedroom", "value":"bedroom1"}, {"label":"orientation", "value":"east"}, {"label":"floor", "value":"3"}, {"label":"direction", "value":"down"}]' 1 0 + disabled: true + + - label: "TH1 reads LabelList attribute of the DUT" + verification: | + sudo ./chip-tool userlabel read label-list 1 0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_LC_1_4.yaml b/src/app/tests/suites/certification/Test_TC_LC_1_4.yaml new file mode 100644 index 00000000000000..3e362f04128d06 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_LC_1_4.yaml @@ -0,0 +1,33 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 95.4. [TC-LC-1.4]User Label cluster constraint_error verification [DUT - + Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH1 writes LabelList attribute of the DUT by setting + 'room:bedroombedroombedroomdroombedroombedroomdroombedroobedroo + bedroomoobedroobedroooobedroobedroooobedroobedroooobedroobedroo + oobedroobedroo 1','Orientation:east', 'floor:3'" + verification: | + sudo ./chip-tool userlabel write label-list '[{"label":"bedroombedroombedroomdroombedroombedroomdroombedroobedroo", "value":"bedroom1"}, {"label":"orientation", "value":"east"}, {"label":"floor", "value":"3"}]' 1 0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_LC_1_5.yaml b/src/app/tests/suites/certification/Test_TC_LC_1_5.yaml new file mode 100644 index 00000000000000..38fc4ee304b96b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_LC_1_5.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 95.5. [TC-LC-1.5] User Label cluster empty entry verification [DUT - + Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH1 writes LabelList attribute of the DUT by setting 'room:bedroom + 1','Orientation:east', '','','', 'direction:down'" + verification: | + sudo ./chip-tool userlabel write label-list '[{"label":"bedroom", "value":"bedroom1"}, {"label":"orientation", "value":"east"}, {"label":"floor", "value":"3"},{"label":"", "value":""},{"label":"", "value":""},{"label":"", "value":""} {"label":"direction", "value":"down"}]' 1 0 + disabled: true + + - label: "TH1 reads LabelList attribute of the DUT" + verification: | + ./chip-tool userlabel read label-list 1 0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_LO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LO_1_1.yaml new file mode 100644 index 00000000000000..8ca13596aaeddb --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_LO_1_1.yaml @@ -0,0 +1,197 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.1. [TC-LO-1.1] Localization Configuration Cluster Attributes + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH reads SupportedLocales attribute from DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool localizationconfiguration read supported-locales 1 0 + + [1645772065.848431][3762:3767] CHIP:TOO: SupportedLocales: 8 entries + [1645772065.850249][3762:3767] CHIP:TOO: [1]: en-US + [1645772065.850298][3762:3767] CHIP:TOO: [2]: de-DE + [1645772065.850333][3762:3767] CHIP:TOO: [3]: fr-FR + [1645772065.850368][3762:3767] CHIP:TOO: [4]: en-GB + [1645772065.850402][3762:3767] CHIP:TOO: [5]: es-ES + [1645772065.850435][3762:3767] CHIP:TOO: [6]: zh-CN + [1645772065.850469][3762:3767] CHIP:TOO: [7]: it-IT + [1645772065.850502][3762:3767] CHIP:TOO: [8]: ja-JP + [1645772065.851668][3762:3767] CHIP:EM: Sending Standalone Ack for MessageCounter:4927804 on exchange 64827i + disabled: true + + - label: "TH writes 'newsupportedlocales' to SupportedLocales attribute" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool localizationconfiguration write supported-locales newsupportedlocales 1 0 + + or + + '' ./chip-tool any write-by-id 0x002B 1 newsupportedlocales 3 0 + disabled: true + + - label: "TH reads SupportedLocales attribute" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool localizationconfiguration read supported-locales 1 0 + [1645772065.848431][3762:3767] CHIP:TOO: SupportedLocales: 8 entries + [1645772065.850249][3762:3767] CHIP:TOO: [1]: en-US + [1645772065.850298][3762:3767] CHIP:TOO: [2]: de-DE + [1645772065.850333][3762:3767] CHIP:TOO: [3]: fr-FR + [1645772065.850368][3762:3767] CHIP:TOO: [4]: en-GB + [1645772065.850402][3762:3767] CHIP:TOO: [5]: es-ES + [1645772065.850435][3762:3767] CHIP:TOO: [6]: zh-CN + [1645772065.850469][3762:3767] CHIP:TOO: [7]: it-IT + [1645772065.850502][3762:3767] CHIP:TOO: [8]: ja-JP + [1645772065.851668][3762:3767] CHIP:EM: Sending Standalone Ack for MessageCounter:4927804 on exchange 64827i + disabled: true + + - label: "TH reads ActiveLocale Attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool localizationconfiguration read active-locale 1 0 + + [1645772238.226467][3778:3783] CHIP:DMG: ReportDataMessage = + [1645772238.226511][3778:3783] CHIP:DMG: { + [1645772238.226545][3778:3783] CHIP:DMG: AttributeReportIBs = + [1645772238.226596][3778:3783] CHIP:DMG: [ + [1645772238.226635][3778:3783] CHIP:DMG: AttributeReportIB = + [1645772238.226691][3778:3783] CHIP:DMG: { + [1645772238.226735][3778:3783] CHIP:DMG: AttributeDataIB = + [1645772238.226787][3778:3783] CHIP:DMG: { + [1645772238.226839][3778:3783] CHIP:DMG: DataVersion = 0xcf5f714e, + [1645772238.226895][3778:3783] CHIP:DMG: AttributePathIB = + [1645772238.226949][3778:3783] CHIP:DMG: { + [1645772238.227004][3778:3783] CHIP:DMG: Endpoint = 0x0, + [1645772238.227065][3778:3783] CHIP:DMG: Cluster = 0x2b, + [1645772238.227126][3778:3783] CHIP:DMG: Attribute = 0x0000_0001, + [1645772238.227180][3778:3783] CHIP:DMG: } + [1645772238.227238][3778:3783] CHIP:DMG: + [1645772238.227300][3778:3783] CHIP:DMG: Data = "ja-JP", + [1645772238.227357][3778:3783] CHIP:DMG: }, + [1645772238.227413][3778:3783] CHIP:DMG: + [1645772238.227459][3778:3783] CHIP:DMG: }, + [1645772238.227513][3778:3783] CHIP:DMG: + [1645772238.227552][3778:3783] CHIP:DMG: ], + [1645772238.227602][3778:3783] CHIP:DMG: + [1645772238.227642][3778:3783] CHIP:DMG: SuppressResponse = true, + [1645772238.227683][3778:3783] CHIP:DMG: InteractionModelRevision = 1 + [1645772238.227721][3778:3783] CHIP:DMG: } + [1645772238.227930][3778:3783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002B Attribute 0x0000_0001DataVersion: 3479138638 + [1645772238.228001][3778:3783] CHIP:TOO: ActiveLocale: ja-JP + disabled: true + + - label: + "TH writes new string not present in SupportedLocale attribute to + ActiveLocale Attribute." + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool localizationconfiguration write active-locale fw-GB 1 0 + + [1645772751.418627][3827:3832] CHIP:DMG: WriteClient moving to [ResponseRe] + [1645772751.418700][3827:3832] CHIP:DMG: WriteResponseMessage = + [1645772751.418743][3827:3832] CHIP:DMG: { + [1645772751.418782][3827:3832] CHIP:DMG: AttributeStatusIBs = + [1645772751.418839][3827:3832] CHIP:DMG: [ + [1645772751.418882][3827:3832] CHIP:DMG: AttributeStatusIB = + [1645772751.418931][3827:3832] CHIP:DMG: { + [1645772751.418977][3827:3832] CHIP:DMG: AttributePathIB = + [1645772751.419039][3827:3832] CHIP:DMG: { + [1645772751.419096][3827:3832] CHIP:DMG: Endpoint = 0x0, + [1645772751.419157][3827:3832] CHIP:DMG: Cluster = 0x2b, + [1645772751.419217][3827:3832] CHIP:DMG: Attribute = 0x0000_0001, + [1645772751.419271][3827:3832] CHIP:DMG: } + [1645772751.419332][3827:3832] CHIP:DMG: + [1645772751.419392][3827:3832] CHIP:DMG: StatusIB = + [1645772751.419447][3827:3832] CHIP:DMG: { + [1645772751.419497][3827:3832] CHIP:DMG: status = 0x87, + [1645772751.419553][3827:3832] CHIP:DMG: }, + [1645772751.419608][3827:3832] CHIP:DMG: + [1645772751.419656][3827:3832] CHIP:DMG: }, + [1645772751.419714][3827:3832] CHIP:DMG: + [1645772751.419756][3827:3832] CHIP:DMG: ], + [1645772751.419809][3827:3832] CHIP:DMG: + [1645772751.419852][3827:3832] CHIP:DMG: InteractionModelRevision = 1 + [1645772751.419893][3827:3832] CHIP:DMG: } + [1645772751.419997][3827:3832] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 + disabled: true + + - label: + "TH writes new string present in SupportedLocale attribute to + ActiveLocale Attribute." + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool localizationconfiguration write active-locale fr-FR 1 0 + + [1645772570.568391][3806:3811] CHIP:DMG: WriteClient moving to [ResponseRe] + [1645772570.568456][3806:3811] CHIP:DMG: WriteResponseMessage = + [1645772570.568492][3806:3811] CHIP:DMG: { + [1645772570.568525][3806:3811] CHIP:DMG: AttributeStatusIBs = + [1645772570.568569][3806:3811] CHIP:DMG: [ + [1645772570.568605][3806:3811] CHIP:DMG: AttributeStatusIB = + [1645772570.568651][3806:3811] CHIP:DMG: { + [1645772570.568694][3806:3811] CHIP:DMG: AttributePathIB = + [1645772570.568747][3806:3811] CHIP:DMG: { + [1645772570.568794][3806:3811] CHIP:DMG: Endpoint = 0x0, + [1645772570.568851][3806:3811] CHIP:DMG: Cluster = 0x2b, + [1645772570.568906][3806:3811] CHIP:DMG: Attribute = 0x0000_0001, + [1645772570.568958][3806:3811] CHIP:DMG: } + [1645772570.569014][3806:3811] CHIP:DMG: + [1645772570.569064][3806:3811] CHIP:DMG: StatusIB = + [1645772570.569104][3806:3811] CHIP:DMG: { + [1645772570.569147][3806:3811] CHIP:DMG: status = 0x0, + [1645772570.569267][3806:3811] CHIP:DMG: }, + [1645772570.569311][3806:3811] CHIP:DMG: + [1645772570.569347][3806:3811] CHIP:DMG: }, + [1645772570.569387][3806:3811] CHIP:DMG: + [1645772570.569416][3806:3811] CHIP:DMG: ], + [1645772570.569454][3806:3811] CHIP:DMG: + [1645772570.569484][3806:3811] CHIP:DMG: InteractionModelRevision = 1 + [1645772570.569513][3806:3811] CHIP:DMG: } + [1645772570.569589][3806:3811] CHIP:DMG: WriteClient moving to [AwaitingDe] + disabled: true + + - label: "TH Reads ActiveLocale." + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool localizationconfiguration read active-locale 1 0 + [1645772597.251785][3816:3821] CHIP:DMG: ReportDataMessage = + [1645772597.251837][3816:3821] CHIP:DMG: { + [1645772597.251866][3816:3821] CHIP:DMG: AttributeReportIBs = + [1645772597.251907][3816:3821] CHIP:DMG: [ + [1645772597.251953][3816:3821] CHIP:DMG: AttributeReportIB = + [1645772597.252010][3816:3821] CHIP:DMG: { + [1645772597.252049][3816:3821] CHIP:DMG: AttributeDataIB = + [1645772597.252105][3816:3821] CHIP:DMG: { + [1645772597.252149][3816:3821] CHIP:DMG: DataVersion = 0xcf5f714f, + [1645772597.252237][3816:3821] CHIP:DMG: AttributePathIB = + [1645772597.252294][3816:3821] CHIP:DMG: { + [1645772597.252344][3816:3821] CHIP:DMG: Endpoint = 0x0, + [1645772597.252405][3816:3821] CHIP:DMG: Cluster = 0x2b, + [1645772597.252461][3816:3821] CHIP:DMG: Attribute = 0x0000_0001, + [1645772597.252505][3816:3821] CHIP:DMG: } + [1645772597.252563][3816:3821] CHIP:DMG: + [1645772597.252623][3816:3821] CHIP:DMG: Data = "fr-FR", + [1645772597.252671][3816:3821] CHIP:DMG: }, + [1645772597.252728][3816:3821] CHIP:DMG: + [1645772597.252774][3816:3821] CHIP:DMG: }, + [1645772597.252819][3816:3821] CHIP:DMG: + [1645772597.252862][3816:3821] CHIP:DMG: ], + [1645772597.252904][3816:3821] CHIP:DMG: + [1645772597.252948][3816:3821] CHIP:DMG: SuppressResponse = true, + [1645772597.252981][3816:3821] CHIP:DMG: InteractionModelRevision = 1 + [1645772597.253024][3816:3821] CHIP:DMG: } + [1645772597.253230][3816:3821] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002B Attribute 0x0000_0001DataVersion: 3479138639 + [1645772597.253293][3816:3821] CHIP:TOO: ActiveLocale: fr-FR + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_LVL_2_3.yaml b/src/app/tests/suites/certification/Test_TC_LVL_2_3.yaml new file mode 100644 index 00000000000000..710e2ed32c5c82 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_LVL_2_3.yaml @@ -0,0 +1,294 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 24.2.3. [TC-LVL-2.3] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + ./chip-tool levelcontrol read current-level 112233 1 + [1636147421.294296][5294:5299] CHIP:ZCL: ReadAttributesResponse: + [1636147421.294322][5294:5299] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147421.294348][5294:5299] CHIP:ZCL: attributeId: 0x0000_0000 + [1636147421.294371][5294:5299] CHIP:ZCL: status: Success (0x0000) + [1636147421.294394][5294:5299] CHIP:ZCL: attribute TLV Type: 0x04 + + ./chip-tool levelcontrol read on-level 112233 1 + [1636147635.980414][5350:5355] CHIP:ZCL: ReadAttributesResponse: + [1636147635.980436][5350:5355] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147635.980460][5350:5355] CHIP:ZCL: attributeId: 0x0000_0010 + [1636147635.980481][5350:5355] CHIP:ZCL: status: Success (0x0000) + [1636147635.980501][5350:5355] CHIP:ZCL: attribute TLV Type: 0x04 + + ./chip-tool levelcontrol read options 112233 1 + [1636147755.811403][5387:5392] CHIP:ZCL: ReadAttributesResponse: + [1636147755.811425][5387:5392] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147755.811446][5387:5392] CHIP:ZCL: attributeId: 0x0000_000F + [1636147755.811464][5387:5392] CHIP:ZCL: status: Success (0x0000) + [1636147755.811485][5387:5392] CHIP:ZCL: attribute TLV Type: 0x04 + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + "./chip-tool levelcontrol read remaining-time 112233 1 + [1636147460.095983][5305:5310] CHIP:ZCL: ReadAttributesResponse: + [1636147460.096008][5305:5310] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147460.096035][5305:5310] CHIP:ZCL: attributeId: 0x0000_0001 + [1636147460.096060][5305:5310] CHIP:ZCL: status: Success (0x0000) + [1636147460.096084][5305:5310] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read min-level 112233 1 + [1636147490.255968][5312:5318] CHIP:ZCL: ReadAttributesResponse: + [1636147490.255991][5312:5318] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147490.256015][5312:5318] CHIP:ZCL: attributeId: 0x0000_0002 + [1636147490.256037][5312:5318] CHIP:ZCL: status: Success (0x0000) + [1636147490.256058][5312:5318] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read max-level 112233 1 + [1636147512.529027][5321:5326] CHIP:ZCL: ReadAttributesResponse: + [1636147512.529047][5321:5326] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147512.529068][5321:5326] CHIP:ZCL: attributeId: 0x0000_0003 + [1636147512.529087][5321:5326] CHIP:ZCL: status: Success (0x0000) + [1636147512.529106][5321:5326] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read current-frequency 112233 1 + [1636147546.233970][5328:5333] CHIP:ZCL: ReadAttributesResponse: + [1636147546.233992][5328:5333] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147546.234016][5328:5333] CHIP:ZCL: attributeId: 0x0000_0004 + [1636147546.234035][5328:5333] CHIP:ZCL: status: Success (0x0000) + [1636147546.234055][5328:5333] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read min-frequency 112233 1 + [1636147579.663628][5335:5340] CHIP:ZCL: ReadAttributesResponse: + [1636147579.663653][5335:5340] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147579.663679][5335:5340] CHIP:ZCL: attributeId: 0x0000_0005 + [1636147579.663703][5335:5340] CHIP:ZCL: status: Success (0x0000) + [1636147579.663726][5335:5340] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read max-frequency 112233 1 + [1636147611.528718][5342:5347] CHIP:ZCL: ReadAttributesResponse: + [1636147611.528741][5342:5347] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147611.528761][5342:5347] CHIP:ZCL: attributeId: 0x0000_0006 + [1636147611.528781][5342:5347] CHIP:ZCL: status: Success (0x0000) + [1636147611.528801][5342:5347] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read on-off-transition-time 112233 1 + [1636147635.980414][5350:5355] CHIP:ZCL: ReadAttributesResponse: + [1636147635.980436][5350:5355] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147635.980460][5350:5355] CHIP:ZCL: attributeId: 0x0000_0010 + [1636147635.980481][5350:5355] CHIP:ZCL: status: Success (0x0000) + [1636147635.980501][5350:5355] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read on-transition-time 112233 1 + [1636147685.431399][5364:5369] CHIP:ZCL: ReadAttributesResponse: + [1636147685.431422][5364:5369] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147685.431451][5364:5369] CHIP:ZCL: attributeId: 0x0000_0012 + [1636147685.431474][5364:5369] CHIP:ZCL: status: Success (0x0000) + [1636147685.431496][5364:5369] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read off-transition-time 112233 1 + [1636147702.981073][5371:5376] CHIP:ZCL: ReadAttributesResponse: + [1636147702.981098][5371:5376] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147702.981125][5371:5376] CHIP:ZCL: attributeId: 0x0000_0013 + [1636147702.981149][5371:5376] CHIP:ZCL: status: Success (0x0000) + [1636147702.981172][5371:5376] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read default-move-rate 112233 1 + [1636147727.632177][5379:5384] CHIP:ZCL: ReadAttributesResponse: + [1636147727.632201][5379:5384] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147727.632224][5379:5384] CHIP:ZCL: attributeId: 0x0000_0014 + [1636147727.632244][5379:5384] CHIP:ZCL: status: Success (0x0000) + [1636147727.632264][5379:5384] CHIP:ZCL: attribute TLV Type: 0x04" + "./chip-tool levelcontrol read start-up-current-level 112233 1 + [1636147777.843632][5395:5400] CHIP:ZCL: ReadAttributesResponse: + [1636147777.843657][5395:5400] CHIP:ZCL: ClusterId: 0x0000_0008 + [1636147777.843684][5395:5400] CHIP:ZCL: attributeId: 0x0000_4000 + [1636147777.843708][5395:5400] CHIP:ZCL: status: Success (0x0000) + [1636147777.843730][5395:5400] CHIP:ZCL: attribute TLV Type: 0x04" + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + "./chip-tool levelcontrol write on-level 5 (replace with your value) 123123 1 + [1636522781.877694][6671:6676] CHIP:DMG: WriteResponseMessage = + [1636522781.877752][6671:6676] CHIP:DMG: { + [1636522781.877795][6671:6676] CHIP:DMG: AttributeStatuses = + [1636522781.877848][6671:6676] CHIP:DMG: [ + [1636522781.877889][6671:6676] CHIP:DMG: AttributeStatusIB = + [1636522781.877938][6671:6676] CHIP:DMG: { + [1636522781.877963][6671:6676] CHIP:DMG: AttributePathIB = + [1636522781.878009][6671:6676] CHIP:DMG: { + [1636522781.878060][6671:6676] CHIP:DMG: Attribute = 0x0000_0011, + [1636522781.878102][6671:6676] CHIP:DMG: Node = 0x0, + [1636522781.878142][6671:6676] CHIP:DMG: Cluster = 0x8, + [1636522781.878178][6671:6676] CHIP:DMG: Endpoint = 0x1, + [1636522781.878213][6671:6676] CHIP:DMG: } + [1636522781.878255][6671:6676] CHIP:DMG: + [1636522781.878288][6671:6676] CHIP:DMG: StatusIB = + [1636522781.878323][6671:6676] CHIP:DMG: { + [1636522781.878359][6671:6676] CHIP:DMG: status = 0x0, + [1636522781.878395][6671:6676] CHIP:DMG: }, + [1636522781.878432][6671:6676] CHIP:DMG: + [1636522781.878460][6671:6676] CHIP:DMG: }, + [1636522781.878495][6671:6676] CHIP:DMG: + [1636522781.878521][6671:6676] CHIP:DMG: ], + [1636522781.878551][6671:6676] CHIP:DMG: + [1636522781.878573][6671:6676] CHIP:DMG: } + [1636522781.878631][6671:6676] CHIP:ZCL: WriteResponse: + [1636522781.878654][6671:6676] CHIP:ZCL: status: Success (0x0000)" + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + "./chip-tool levelcontrol write on-off-transition-time 5 (replace with your own value) 123123 1 + [1636522561.168841][6649:6654] CHIP:DMG: WriteResponseMessage = + [1636522561.168867][6649:6654] CHIP:DMG: { + [1636522561.168889][6649:6654] CHIP:DMG: AttributeStatuses = + [1636522561.168920][6649:6654] CHIP:DMG: [ + [1636522561.168945][6649:6654] CHIP:DMG: AttributeStatusIB = + [1636522561.168977][6649:6654] CHIP:DMG: { + [1636522561.169006][6649:6654] CHIP:DMG: AttributePathIB = + [1636522561.169040][6649:6654] CHIP:DMG: { + [1636522561.169074][6649:6654] CHIP:DMG: Attribute = 0x0000_0010, + [1636522561.169110][6649:6654] CHIP:DMG: Node = 0x0, + [1636522561.169145][6649:6654] CHIP:DMG: Cluster = 0x8, + [1636522561.169179][6649:6654] CHIP:DMG: Endpoint = 0x1, + [1636522561.169211][6649:6654] CHIP:DMG: } + [1636522561.169248][6649:6654] CHIP:DMG: + [1636522561.169280][6649:6654] CHIP:DMG: StatusIB = + [1636522561.169312][6649:6654] CHIP:DMG: { + [1636522561.169344][6649:6654] CHIP:DMG: status = 0x0, + [1636522561.169376][6649:6654] CHIP:DMG: }, + [1636522561.169411][6649:6654] CHIP:DMG: + [1636522561.169439][6649:6654] CHIP:DMG: }, + [1636522561.169474][6649:6654] CHIP:DMG: + [1636522561.169501][6649:6654] CHIP:DMG: ], + [1636522561.169532][6649:6654] CHIP:DMG: + [1636522561.169553][6649:6654] CHIP:DMG: } + [1636522561.169611][6649:6654] CHIP:ZCL: WriteResponse: + [1636522561.169634][6649:6654] CHIP:ZCL: status: Success (0x0000)" + "./chip-tool levelcontrol write on-transition-time 5 (replace with your value) 123123 1 + [1636522899.652554][6689:6694] CHIP:DMG: WriteResponseMessage = + [1636522899.652575][6689:6694] CHIP:DMG: { + [1636522899.652599][6689:6694] CHIP:DMG: AttributeStatuses = + [1636522899.652626][6689:6694] CHIP:DMG: [ + [1636522899.652650][6689:6694] CHIP:DMG: AttributeStatusIB = + [1636522899.652684][6689:6694] CHIP:DMG: { + [1636522899.652713][6689:6694] CHIP:DMG: AttributePathIB = + [1636522899.652749][6689:6694] CHIP:DMG: { + [1636522899.652785][6689:6694] CHIP:DMG: Attribute = 0x0000_0012, + [1636522899.652821][6689:6694] CHIP:DMG: Node = 0x0, + [1636522899.652858][6689:6694] CHIP:DMG: Cluster = 0x8, + [1636522899.652892][6689:6694] CHIP:DMG: Endpoint = 0x1, + [1636522899.652925][6689:6694] CHIP:DMG: } + [1636522899.652964][6689:6694] CHIP:DMG: + [1636522899.652997][6689:6694] CHIP:DMG: StatusIB = + [1636522899.653030][6689:6694] CHIP:DMG: { + [1636522899.653063][6689:6694] CHIP:DMG: status = 0x0, + [1636522899.653097][6689:6694] CHIP:DMG: }, + [1636522899.653130][6689:6694] CHIP:DMG: + [1636522899.653160][6689:6694] CHIP:DMG: }, + [1636522899.653192][6689:6694] CHIP:DMG: + [1636522899.653214][6689:6694] CHIP:DMG: ], + [1636522899.653243][6689:6694] CHIP:DMG: + [1636522899.653264][6689:6694] CHIP:DMG: } + [1636522899.653318][6689:6694] CHIP:ZCL: WriteResponse: + [1636522899.653339][6689:6694] CHIP:ZCL: status: Success (0x0000)" + "./chip-tool levelcontrol write off-transition-time 5 1 1 + [1636523135.094185][6710:6715] CHIP:DMG: WriteResponseMessage = + [1636523135.094247][6710:6715] CHIP:DMG: { + [1636523135.094306][6710:6715] CHIP:DMG: AttributeStatuses = + [1636523135.094366][6710:6715] CHIP:DMG: [ + [1636523135.094394][6710:6715] CHIP:DMG: AttributeStatusIB = + [1636523135.094430][6710:6715] CHIP:DMG: { + [1636523135.094458][6710:6715] CHIP:DMG: AttributePathIB = + [1636523135.094496][6710:6715] CHIP:DMG: { + [1636523135.094533][6710:6715] CHIP:DMG: Attribute = 0x0000_0013, + [1636523135.094571][6710:6715] CHIP:DMG: Node = 0x0, + [1636523135.094609][6710:6715] CHIP:DMG: Cluster = 0x8, + [1636523135.094644][6710:6715] CHIP:DMG: Endpoint = 0x1, + [1636523135.094677][6710:6715] CHIP:DMG: } + [1636523135.094717][6710:6715] CHIP:DMG: + [1636523135.094750][6710:6715] CHIP:DMG: StatusIB = + [1636523135.094777][6710:6715] CHIP:DMG: { + [1636523135.094805][6710:6715] CHIP:DMG: status = 0x0, + [1636523135.094840][6710:6715] CHIP:DMG: }, + [1636523135.094874][6710:6715] CHIP:DMG: + [1636523135.094896][6710:6715] CHIP:DMG: }, + [1636523135.094929][6710:6715] CHIP:DMG: + [1636523135.094954][6710:6715] CHIP:DMG: ], + [1636523135.094983][6710:6715] CHIP:DMG: + [1636523135.095004][6710:6715] CHIP:DMG: } + [1636523135.095061][6710:6715] CHIP:ZCL: WriteResponse: + [1636523135.095082][6710:6715] CHIP:ZCL: status: Success (0x0000)" + "./chip-tool levelcontrol write default-move-rate 5 1 1 + [1636523200.238505][6728:6733] CHIP:DMG: WriteResponseMessage = + [1636523200.238533][6728:6733] CHIP:DMG: { + [1636523200.238559][6728:6733] CHIP:DMG: AttributeStatuses = + [1636523200.238592][6728:6733] CHIP:DMG: [ + [1636523200.238621][6728:6733] CHIP:DMG: AttributeStatusIB = + [1636523200.238659][6728:6733] CHIP:DMG: { + [1636523200.238693][6728:6733] CHIP:DMG: AttributePathIB = + [1636523200.238734][6728:6733] CHIP:DMG: { + [1636523200.238773][6728:6733] CHIP:DMG: Attribute = 0x0000_0014, + [1636523200.238817][6728:6733] CHIP:DMG: Node = 0x0, + [1636523200.238860][6728:6733] CHIP:DMG: Cluster = 0x8, + [1636523200.238898][6728:6733] CHIP:DMG: Endpoint = 0x1, + [1636523200.238938][6728:6733] CHIP:DMG: } + [1636523200.238980][6728:6733] CHIP:DMG: + [1636523200.239019][6728:6733] CHIP:DMG: StatusIB = + [1636523200.239058][6728:6733] CHIP:DMG: { + [1636523200.239098][6728:6733] CHIP:DMG: status = 0x0, + [1636523200.239138][6728:6733] CHIP:DMG: }, + [1636523200.239178][6728:6733] CHIP:DMG: + [1636523200.239211][6728:6733] CHIP:DMG: }, + [1636523200.239249][6728:6733] CHIP:DMG: + [1636523200.239276][6728:6733] CHIP:DMG: ], + [1636523200.239310][6728:6733] CHIP:DMG: + [1636523200.239334][6728:6733] CHIP:DMG: } + [1636523200.239396][6728:6733] CHIP:ZCL: WriteResponse: + [1636523200.239421][6728:6733] CHIP:ZCL: status: Success (0x0000)" + "./chip-tool levelcontrol write start-up-current-level 5 (replace with your value) 123123 1 + [1636523273.060220][6749:6754] CHIP:DMG: WriteResponseMessage = + [1636523273.060249][6749:6754] CHIP:DMG: { + [1636523273.060276][6749:6754] CHIP:DMG: AttributeStatuses = + [1636523273.060313][6749:6754] CHIP:DMG: [ + [1636523273.060338][6749:6754] CHIP:DMG: AttributeStatusIB = + [1636523273.060406][6749:6754] CHIP:DMG: { + [1636523273.060432][6749:6754] CHIP:DMG: AttributePathIB = + [1636523273.060472][6749:6754] CHIP:DMG: { + [1636523273.060516][6749:6754] CHIP:DMG: Attribute = 0x0000_4000, + [1636523273.060553][6749:6754] CHIP:DMG: Node = 0x0, + [1636523273.060592][6749:6754] CHIP:DMG: Cluster = 0x8, + [1636523273.060626][6749:6754] CHIP:DMG: Endpoint = 0x1, + [1636523273.060663][6749:6754] CHIP:DMG: } + [1636523273.060704][6749:6754] CHIP:DMG: + [1636523273.060736][6749:6754] CHIP:DMG: StatusIB = + [1636523273.060770][6749:6754] CHIP:DMG: { + [1636523273.060803][6749:6754] CHIP:DMG: status = 0x0, + [1636523273.060835][6749:6754] CHIP:DMG: }, + [1636523273.060870][6749:6754] CHIP:DMG: + [1636523273.060899][6749:6754] CHIP:DMG: }, + [1636523273.060936][6749:6754] CHIP:DMG: + [1636523273.060961][6749:6754] CHIP:DMG: ], + [1636523273.060992][6749:6754] CHIP:DMG: + [1636523273.061015][6749:6754] CHIP:DMG: } + [1636523273.061073][6749:6754] CHIP:ZCL: WriteResponse: + [1636523273.061097][6749:6754] CHIP:ZCL: status: Success (0x0000)" + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_MC_10_7.yaml b/src/app/tests/suites/certification/Test_TC_MC_10_7.yaml new file mode 100644 index 00000000000000..0a402a002ca25c --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_10_7.yaml @@ -0,0 +1,125 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 18.12.7. [TC-MC-10.7] Content Search Verification (DUT as Server) + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Actor' and Value as An Actors name, for + example, Gaby sHoffman" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Channel' and Value as Channel Name name, for + example, PBS'" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Character' and Value as Characters name,for + example, Snow White" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Director' and Value as Directors name, for + example, Spike Lee" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Event' and Value as An Events name , for + example 'Football games'" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Franchise' and Value as Franchises name,for + example 'Star Wars'" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Genre' and Value as Genres name, for example + 'Horror'" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'League' and Value as Leagues name, for example + 'NCAA'" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Popularity' and Value as Popularitys name" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Provider' and Value as Providers name, for + example 'Netflix'" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Sport' and Value as Sports name, for example, + football" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'SportsTeam' and Value as SportTeams name , for + example 'Arsenel'" + verification: | + + disabled: true + + - label: + "DUT sends a LaunchContent command to the TH with search parameter + consisting of Type As 'Type' and Value as Types name, for example + 'TVSeries'," + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_MC_2_2.yaml b/src/app/tests/suites/certification/Test_TC_MC_2_2.yaml new file mode 100644 index 00000000000000..fb3cbd0fa709e7 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_2_2.yaml @@ -0,0 +1,57 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 21.2.2. [TC-MC-2.2] Low Power Mode Verification (DUT as Client) + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "DUT sends Sleep command to TH" + verification: | + ./chip-tool lowpower sleep 1 1 + [1645781483.851821][5175:5180] CHIP:DMG: InvokeResponseMessage = + [1645781483.851850][5175:5180] CHIP:DMG: { + [1645781483.851879][5175:5180] CHIP:DMG: suppressResponse = false, + [1645781483.851907][5175:5180] CHIP:DMG: InvokeResponseIBs = + [1645781483.851976][5175:5180] CHIP:DMG: [ + [1645781483.852006][5175:5180] CHIP:DMG: InvokeResponseIB = + [1645781483.852048][5175:5180] CHIP:DMG: { + [1645781483.852079][5175:5180] CHIP:DMG: CommandStatusIB = + [1645781483.852118][5175:5180] CHIP:DMG: { + [1645781483.852152][5175:5180] CHIP:DMG: CommandPathIB = + [1645781483.852189][5175:5180] CHIP:DMG: { + [1645781483.852234][5175:5180] CHIP:DMG: EndpointId = 0x1, + [1645781483.852279][5175:5180] CHIP:DMG: ClusterId = 0x508, + [1645781483.852317][5175:5180] CHIP:DMG: CommandId = 0x0, + [1645781483.852354][5175:5180] CHIP:DMG: }, + [1645781483.852392][5175:5180] CHIP:DMG: + [1645781483.852427][5175:5180] CHIP:DMG: StatusIB = + [1645781483.852465][5175:5180] CHIP:DMG: { + [1645781483.852502][5175:5180] CHIP:DMG: status = 0x0, + [1645781483.852537][5175:5180] CHIP:DMG: }, + [1645781483.852578][5175:5180] CHIP:DMG: + [1645781483.852612][5175:5180] CHIP:DMG: }, + [1645781483.852687][5175:5180] CHIP:DMG: + [1645781483.852717][5175:5180] CHIP:DMG: }, + [1645781483.852752][5175:5180] CHIP:DMG: + [1645781483.852778][5175:5180] CHIP:DMG: ], + [1645781483.852812][5175:5180] CHIP:DMG: + [1645781483.852871][5175:5180] CHIP:DMG: InteractionModelRevision = 1 + [1645781483.852894][5175:5180] CHIP:DMG: }, + [1645781483.852965][5175:5180] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0508 Command=0x0000_0000 Status=0x0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml b/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml new file mode 100644 index 00000000000000..f58d69d0a2f879 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 78.1.3. [TC-MOD-1.3] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + ./chip-tool modeselect read supported-modes 1 1 + + [1636130688126] [80643:15347427] CHIP: [ZCL] ReadAttributesResponse: + [1636130688126] [80643:15347427] CHIP: [ZCL] ClusterId: 0x0000_0050 + [1636130688126] [80643:15347427] CHIP: [ZCL] attributeId: 0x0000_0001 + [1636130688126] [80643:15347427] CHIP: [ZCL] status: Success (0x0000) + [1636130688126] [80643:15347427] CHIP: [ZCL] attribute TLV Type: 0x16 + [1636130688126] [80643:15347427] CHIP: [TOO] OnModeSelectSupportedModesListAttributeResponse: 3 entries + [1636130688126] [80643:15347427] CHIP: [TOO] ModeOptionStruct[1]: + [1636130688126] [80643:15347427] CHIP: [ZCL] Label: Black + [1636130688127] [80643:15347427] CHIP: [TOO] Mode: 0 + [1636130688127] [80643:15347427] CHIP: [TOO] SemanticTag: 0 + [1636130688127] [80643:15347427] CHIP: [TOO] ModeOptionStruct[2]: + [1636130688127] [80643:15347427] CHIP: [ZCL] Label: Cappuccino + [1636130688127] [80643:15347427] CHIP: [TOO] Mode: 4 + [1636130688127] [80643:15347427] CHIP: [TOO] SemanticTag: 0 + [1636130688127] [80643:15347427] CHIP: [TOO] ModeOptionStruct[3]: + [1636130688127] [80643:15347427] CHIP: [ZCL] Label: Espresso + [1636130688127] [80643:15347427] CHIP: [TOO] Mode: 7 + [1636130688127] [80643:15347427] CHIP: [TOO] SemanticTag: 0" + + ./chip-tool modeselect read current-mode 1 1 + + [1636130740980] [80827:15348218] CHIP: [ZCL] ReadAttributesResponse: + [1636130740980] [80827:15348218] CHIP: [ZCL] ClusterId: 0x0000_0050 + [1636130740980] [80827:15348218] CHIP: [ZCL] attributeId: 0x0000_0000 + [1636130740980] [80827:15348218] CHIP: [ZCL] status: Success (0x0000) + [1636130740980] [80827:15348218] CHIP: [ZCL] attribute TLV Type: 0x04 + [1636130740980] [80827:15348218] CHIP: [TOO] Int8u attribute Response: 0" + + ./chip-tool modeselect read start-up-mode 1 1 + + [1636130817982] [81036:15349339] CHIP: [ZCL] ReadAttributesResponse: + [1636130817982] [81036:15349339] CHIP: [ZCL] ClusterId: 0x0000_0050 + [1636130817982] [81036:15349339] CHIP: [ZCL] attributeId: 0x0000_0003 + [1636130817982] [81036:15349339] CHIP: [ZCL] status: Success (0x0000) + [1636130817982] [81036:15349339] CHIP: [ZCL] attribute TLV Type: 0x04 + [1636130817982] [81036:15349339] CHIP: [TOO] Int8u attribute Response: 0" + + ./chip-tool modeselect read description 1 1 + + [1636130846823] [81045:15349635] CHIP: [ZCL] ReadAttributesResponse: + [1636130846823] [81045:15349635] CHIP: [ZCL] ClusterId: 0x0000_0050 + [1636130846823] [81045:15349635] CHIP: [ZCL] attributeId: 0x0000_0004 + [1636130846823] [81045:15349635] CHIP: [ZCL] status: Success (0x0000) + [1636130846823] [81045:15349635] CHIP: [ZCL] attribute TLV Type: 0x0c + [1636130846823] [81045:15349635] CHIP: [TOO] CharString attribute Response: Coffee" + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + ./chip-tool modeselect read on-mode 1 1 + [1636130785100] [80839:15348768] CHIP: [ZCL] ReadAttributesResponse: + [1636130785100] [80839:15348768] CHIP: [ZCL] ClusterId: 0x0000_0050 + [1636130785100] [80839:15348768] CHIP: [ZCL] attributeId: 0x0000_0002 + [1636130785100] [80839:15348768] CHIP: [ZCL] status: Success (0x0000) + [1636130785100] [80839:15348768] CHIP: [ZCL] attribute TLV Type: 0x04 + [1636130785100] [80839:15348768] CHIP: [TOO] Int8u attribute Response: 0" + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + no writable attributes + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + no writable attributes + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_1.yaml new file mode 100644 index 00000000000000..5d043e77d0f566 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_1.yaml @@ -0,0 +1,205 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.1. [TC-NC-1.1] Verification on wifi connection and attributes check [DUT - + Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Factory reset the DUT" + verification: | + + disabled: true + + - label: "TH1 is commissioned with DUT" + verification: | + + disabled: true + + - label: + "TH1 reads Descriptor Cluster from the DUT with EP0 TH1 reads + ServerList from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool descriptor read server-list 1 0 + + [1646214614.113925][6900:6905] CHIP:DMG: SuppressResponse = true, + [1646214614.113950][6900:6905] CHIP:DMG: InteractionModelRevision = 1 + [1646214614.113972][6900:6905] CHIP:DMG: } + [1646214614.115636][6900:6905] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001DataVersion: 3460417267 + [1646214614.115731][6900:6905] CHIP:TOO: server list: 25 entries + [1646214614.115784][6900:6905] CHIP:TOO: [1]: 3 + [1646214614.115810][6900:6905] CHIP:TOO: [2]: 4 + [1646214614.115834][6900:6905] CHIP:TOO: [3]: 29 + [1646214614.115858][6900:6905] CHIP:TOO: [4]: 30 + [1646214614.115882][6900:6905] CHIP:TOO: [5]: 31 + [1646214614.115906][6900:6905] CHIP:TOO: [6]: 40 + [1646214614.115930][6900:6905] CHIP:TOO: [7]: 42 + [1646214614.115954][6900:6905] CHIP:TOO: [8]: 43 + [1646214614.115978][6900:6905] CHIP:TOO: [9]: 44 + [1646214614.116002][6900:6905] CHIP:TOO: [10]: 45 + [1646214614.116025][6900:6905] CHIP:TOO: [11]: 46 + [1646214614.116049][6900:6905] CHIP:TOO: [12]: 48 + [1646214614.116073][6900:6905] CHIP:TOO: [13]: 49 + [1646214614.116096][6900:6905] CHIP:TOO: [14]: 50 + [1646214614.116120][6900:6905] CHIP:TOO: [15]: 51 + [1646214614.116144][6900:6905] CHIP:TOO: [16]: 52 + [1646214614.116168][6900:6905] CHIP:TOO: [17]: 53 + [1646214614.116192][6900:6905] CHIP:TOO: [18]: 54 + [1646214614.116215][6900:6905] CHIP:TOO: [19]: 55 + [1646214614.116239][6900:6905] CHIP:TOO: [20]: 60 + [1646214614.116263][6900:6905] CHIP:TOO: [21]: 62 + [1646214614.116287][6900:6905] CHIP:TOO: [22]: 63 + [1646214614.116310][6900:6905] CHIP:TOO: [23]: 64 + [1646214614.116334][6900:6905] CHIP:TOO: [24]: 65 + [1646214614.116358][6900:6905] CHIP:TOO: [25]: 1029 + [1646214614.116434][6900:6905] CHIP:EM: Sending Standalone Ack for MessageCounter:1857540 on exchange 31492i + disabled: true + + - label: "TH1 reads FeatureMap attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read feature-map 1 0 + + [1646216292.917209][7008:7013] CHIP:DMG: SuppressResponse = true, + [1646216292.917233][7008:7013] CHIP:DMG: InteractionModelRevision = 1 + [1646216292.917255][7008:7013] CHIP:DMG: } + [1646216292.917396][7008:7013] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFCDataVersion: 1979781767 + [1646216292.917463][7008:7013] CHIP:TOO: FeatureMap: 2 + [1646216292.917535][7008:7013] CHIP:EM: Sending Standalone Ack for MessageCounter:182244 on exchange 2996i + disabled: true + + - label: "TH1 reads the MaxNetworks attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read max-networks 1 0 + + [1646216356.472036][7021:7026] CHIP:DMG: SuppressResponse = true, + [1646216356.472088][7021:7026] CHIP:DMG: InteractionModelRevision = 1 + [1646216356.472136][7021:7026] CHIP:DMG: } + [1646216356.472388][7021:7026] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0000DataVersion: 1979781767 + [1646216356.472511][7021:7026] CHIP:TOO: MaxNetworks: 1 + [1646216356.472624][7021:7026] CHIP:EM: Sending Standalone Ack for MessageCounter:4914191 on exchange 38527i + disabled: true + + - label: "TH1 reads the Networks attribute list from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read networks 1 0 + + [1646216660.523645][7061:7066] CHIP:DMG: SuppressResponse = true, + [1646216660.523697][7061:7066] CHIP:DMG: InteractionModelRevision = 1 + [1646216660.523748][7061:7066] CHIP:DMG: } + [1646216660.524025][7061:7066] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0001DataVersion: 1979781767 + [1646216660.524156][7061:7066] CHIP:TOO: Networks: 0 entries + [1646216660.524291][7061:7066] CHIP:EM: Sending Standalone Ack for MessageCounter:14276450 on exchange 28012i + disabled: true + + - label: "TH1 reads ScanMaxTimeSeconds attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read connect-max-time-seconds 1 0 + + [1646216949.280140][7091:7096] CHIP:DMG: SuppressResponse = true, + [1646216949.280193][7091:7096] CHIP:DMG: InteractionModelRevision = 1 + [1646216949.280240][7091:7096] CHIP:DMG: } + [1646216949.280501][7091:7096] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0003DataVersion: 1979781767 + [1646216949.280624][7091:7096] CHIP:TOO: ConnectMaxTimeSeconds: 20 + [1646216949.280737][7091:7096] CHIP:EM: Sending Standalone Ack for MessageCounter:8269595 on exchange 2666i + disabled: true + + - label: "TH1 reads ConnectMaxTimeSeconds Attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read scan-max-time-seconds 1 0 + + [1646216873.504483][7078:7083] CHIP:DMG: SuppressResponse = true, + [1646216873.504519][7078:7083] CHIP:DMG: InteractionModelRevision = 1 + [1646216873.504552][7078:7083] CHIP:DMG: } + [1646216873.504741][7078:7083] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0002DataVersion: 1979781767 + [1646216873.504833][7078:7083] CHIP:TOO: ScanMaxTimeSeconds: 10 + [1646216873.504917][7078:7083] CHIP:EM: Sending Standalone Ack for MessageCounter:6708918 on exchange 13997i + disabled: true + + - label: "TH1 reads InterfaceEnabled attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read interface-enabled 1 0 + + [1646217021.862336][7106:7111] CHIP:DMG: SuppressResponse = true, + [1646217021.862397][7106:7111] CHIP:DMG: InteractionModelRevision = 1 + [1646217021.862452][7106:7111] CHIP:DMG: } + [1646217021.862746][7106:7111] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0004DataVersion: 1979781767 + [1646217021.862850][7106:7111] CHIP:TOO: InterfaceEnabled: TRUE + [1646217021.863094][7106:7111] CHIP:EM: Sending Standalone Ack for MessageCounter:3161135 on exchange 55787i + disabled: true + + - label: "TH1 reads LastNetworkingStatus attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read last-networking-status 1 0 + + + [1646217109.850089][7117:7122] CHIP:DMG: SuppressResponse = true, + [1646217109.850135][7117:7122] CHIP:DMG: InteractionModelRevision = 1 + [1646217109.850177][7117:7122] CHIP:DMG: } + [1646217109.850450][7117:7122] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0005DataVersion: 1979781767 + [1646217109.850562][7117:7122] CHIP:TOO: LastNetworkingStatus: 0 + [1646217109.850669][7117:7122] CHIP:EM: Sending Standalone Ack for MessageCounter:4481761 on exchange 38865i + disabled: true + + - label: + "TH1 reads the LastNetworkID attribute from the DUT TH1 reads the + Networks attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read last-network-id 1 0 + + [1646217207.932462][7127:7132] CHIP:DMG: SuppressResponse = true, + [1646217207.932516][7127:7132] CHIP:DMG: InteractionModelRevision = 1 + [1646217207.932565][7127:7132] CHIP:DMG: } + [1646217207.932823][7127:7132] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0006DataVersion: 1979781767 + [1646217207.932919][7127:7132] CHIP:TOO: LastNetworkID: + [1646217207.933048][7127:7132] CHIP:EM: Sending Standalone Ack for MessageCounter:3865700 on exchange 5677i + disabled: true + + - label: "TH1 reads the LastConnectErrorValue attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read last-connect-error-value 1 0 + + + [1646217256.305530][7140:7145] CHIP:DMG: SuppressResponse = true, + [1646217256.305592][7140:7145] CHIP:DMG: InteractionModelRevision = 1 + [1646217256.305649][7140:7145] CHIP:DMG: } + [1646217256.306032][7140:7145] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0007DataVersion: 1979781767 + [1646217256.306161][7140:7145] CHIP:TOO: LastConnectErrorValue: 0 + [1646217256.306279][7140:7145] CHIP:EM: Sending Standalone Ack for MessageCounter:9268313 on exchange 31123 + disabled: true + + - label: "TH1 reads ClientGeneratedCommandList attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ '' ./chip-tool networkcommissioning read client-generated-command-list 1 0 + + + [1646218469.473647][7198:7203] CHIP:DMG: SuppressResponse = true, + [1646218469.473694][7198:7203] CHIP:DMG: InteractionModelRevision = 1 + [1646218469.473736][7198:7203] CHIP:DMG: } + [1646218469.474480][7198:7203] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF9DataVersion: 1979781767 + [1646218469.474561][7198:7203] CHIP:TOO: ClientGeneratedCommandList: 7 entries + [1646218469.474615][7198:7203] CHIP:TOO: [1]: 0 + [1646218469.474642][7198:7203] CHIP:TOO: [2]: 2 + [1646218469.474666][7198:7203] CHIP:TOO: [3]: 3 + [1646218469.474690][7198:7203] CHIP:TOO: [4]: 4 + [1646218469.474713][7198:7203] CHIP:TOO: [5]: 5 + [1646218469.474736][7198:7203] CHIP:TOO: [6]: 6 + [1646218469.474760][7198:7203] CHIP:TOO: [7]: 8 + [1646218469.474830][7198:7203] CHIP:EM: Sending Standalone Ack for MessageCounter:4858130 on exchange 48356i + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_10.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_10.yaml new file mode 100644 index 00000000000000..150cf1490a85f1 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_10.yaml @@ -0,0 +1,55 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.10. [TC-NC-1.10] Verification for RemoveNetwork Command for Thread + interface[DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends RemoveNetwork Command to the DUT with NetworkID argument + value as 'Userth_op' and Breadcrumb argument value as 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15782 + + ./chip-tool networkcommissioning remove-network 1111161622222211 0 162 0 + [1645774313.858714][4045:4050] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0005 + [1645774313.858893][4045:4050] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Command 0x0000_0005 + [1645774313.859065][4045:4050] CHIP:TOO: NetworkConfigResponse: { + [1645774313.859124][4045:4050] CHIP:TOO: networkingStatus: 5 + [1645774313.859164][4045:4050] CHIP:TOO: debugText: + [1645774313.859203][4045:4050] CHIP:TOO: } + [1645774313.859262][4045:4050] CHIP:DMG: ICR moving to [AwaitingDe] + disabled: true + + - label: "TH1 reads MaxNetworks attribute from the DUT" + verification: | + + disabled: true + + - label: "TH1 reads LastNetworkingStatus attribute from the DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_11.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_11.yaml new file mode 100644 index 00000000000000..85d6ab3ec307e5 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_11.yaml @@ -0,0 +1,56 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.11. [TC-NC-1.11] Verificatrion for ConnectNetwork Command for Wifi + interface [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: "TH1 saves the timestamp as CT1" + verification: | + + disabled: true + + - label: + "TH1 sends ConnectNetwork command to the DUT with NetworkID argument + value as 'Userwifi_ssid1' and Breadcrumb argument value as 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15782 + disabled: true + + - label: "TH1 saves the timestamp as CT2" + verification: | + + disabled: true + + - label: "TH1 reads Networks attribute from the DUT" + verification: | + + disabled: true + + - label: "TH1 sends CommissioningComplete Command from the DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_12.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_12.yaml new file mode 100644 index 00000000000000..d16afafef40409 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_12.yaml @@ -0,0 +1,66 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.12. [TC-NC-1.12] Verificatrion for ConnectNetwork Command for Thread + interface [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: "TH1 saves the timestamp as CT1" + verification: | + + disabled: true + + - label: + "TH1 sends ConnectNetwork command to the DUT with NetworkID argument + value as 'Userth_op' and Breadcrumb argument value as 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15782 + + ./chip-tool networkcommissioning connect-network 1111161622222211 0 162 0 + + [1645774700.721104][4113:4118] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0007 + [1645774700.721204][4113:4118] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Command 0x0000_0007 + [1645774700.721335][4113:4118] CHIP:TOO: ConnectNetworkResponse: { + [1645774700.721398][4113:4118] CHIP:TOO: networkingStatus: 5 + [1645774700.721453][4113:4118] CHIP:TOO: debugText: + [1645774700.721505][4113:4118] CHIP:TOO: errorValue: 0 + [1645774700.721559][4113:4118] CHIP:TOO: } + disabled: true + + - label: "TH1 saves the timestamp as CT2" + verification: | + + disabled: true + + - label: "TH1 reads Networks attribute from the DUT" + verification: | + + disabled: true + + - label: "TH1 sends CommissioningComplete Command from the DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_13.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_13.yaml new file mode 100644 index 00000000000000..b99604d85db496 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_13.yaml @@ -0,0 +1,56 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.13. [TC-NC-1.13] Verificatrion for ConnectNetwork Command for Ethernet + interface [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: "TH1 saves the timestamp as CT1" + verification: | + + disabled: true + + - label: + "TH1 sends ConnectNetwork command to the DUT with NetworkID argument + value as 'Ethnet_id' and Breadcrumb argument value as 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15782 + disabled: true + + - label: "TH1 saves the timestamp as CT2" + verification: | + + disabled: true + + - label: "TH1 reads Networks attribute from the DUT" + verification: | + + disabled: true + + - label: "TH1 sends CommissioningComplete Command from the DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_14.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_14.yaml new file mode 100644 index 00000000000000..7f84236a5e5546 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_14.yaml @@ -0,0 +1,42 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.14. [TC-NC-1.14] Verification for ReorderNetwork command for Wifi + interface [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends ReorderNetwork Command to the DUT with the following + arguments: NetworkID argument value as 'Userwifi_ssid1' NetworkIndex + argument value as 'Wifinet_idx3' Breadcrumb argument value as 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15782 + disabled: true + + - label: "TH1 reads Networks attribute list from the DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_15.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_15.yaml new file mode 100644 index 00000000000000..2c78b3a65e3723 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_15.yaml @@ -0,0 +1,42 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.15. [TC-NC-1.15] Verification for ReorderNetwork command for Thread + interface [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends ReorderNetwork Command to the DUT with the following + arguments: NetworkID argument value as 'Userth_op1' NetworkIndex + argument value as 'Thnet_idx2' Breadcrumb argument value as 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15782 + disabled: true + + - label: "TH1 reads Networks attribute list from the DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_16.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_16.yaml new file mode 100644 index 00000000000000..d73fae1bf863e7 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_16.yaml @@ -0,0 +1,62 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.16. [TC-NC-1.16] NetworkNotFound value as LastNetworkingstatus argument + validation for wifi interface [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends RemoveNetwork Command to the DUT with NetworkID argument + value as 'Userwifi_ssid1' and Breadcrumb argument value as 0" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning remove-network GRLPrivate_EXT 0 1 0 + + [1646296227.059289][3118:3123] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0005 + [1646296227.059353][3118:3123] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Command 0x0000_0005 + [1646296227.059438][3118:3123] CHIP:TOO: NetworkConfigResponse: { + [1646296227.059487][3118:3123] CHIP:TOO: networkingStatus: 5 + [1646296227.059522][3118:3123] CHIP:TOO: debugText: + [1646296227.059556][3118:3123] CHIP:TOO: } + [1646296227.059598][3118:3123] CHIP:DMG: ICR moving to [AwaitingDe] + [1646296227.059667][3118:3123] CHIP:EM: Sending Standalone Ack for MessageCounter:15895540 on exchange 28900i + disabled: true + + - label: + "TH1 sends ConnectNetwork Command to the DUT with NetworkID value as + 'Userwifi_ssid1' and Breadcrumb value as 0" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning connect-network GRLPrivate_EXT 0 1 0 + + [1646297689.443117][3209:3214] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0007 + [1646297689.443168][3209:3214] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Command 0x0000_0007 + [1646297689.443244][3209:3214] CHIP:TOO: ConnectNetworkResponse: { + [1646297689.443286][3209:3214] CHIP:TOO: networkingStatus: 5 + [1646297689.443315][3209:3214] CHIP:TOO: debugText: + [1646297689.443342][3209:3214] CHIP:TOO: errorValue: 0 + [1646297689.443371][3209:3214] CHIP:TOO: } + [1646297689.443407][3209:3214] CHIP:DMG: ICR moving to [AwaitingDe] + [1646297689.443461][3209:3214] CHIP:EM: Sending Standalone Ack for MessageCounter:16011443 on exchange 34839i + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_17.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_17.yaml new file mode 100644 index 00000000000000..81b4580bb3baa8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_17.yaml @@ -0,0 +1,61 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.17. [TC-NC-1.17] NetworkNotFound value as LastNetworkingstatus argument + validation for Thread interface [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends RemoveNetwork Command to the DUT with NetworkID argument + value as 'Userth_op1' and Breadcrumb argument value as 0" + verification: | + ./chip-tool networkcommissioning remove-network 1 0 162 0 + + [1645774811.423681][4127:4132] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0005 + [1645774811.423787][4127:4132] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Command 0x0000_0005 + [1645774811.423978][4127:4132] CHIP:TOO: NetworkConfigResponse: { + [1645774811.424046][4127:4132] CHIP:TOO: networkingStatus: 5 + [1645774811.424105][4127:4132] CHIP:TOO: debugText: + [1645774811.424165][4127:4132] CHIP:TOO: } + [1645774811.424256][4127:4132] CHIP:DMG: ICR moving to [AwaitingDe] + [1645774811.424362][4127:4132] CHIP:EM: Sending Standalone Ack for MessageCounter:5388547 on exchange 23393i + disabled: true + + - label: + "TH1 sends ConnectNetwork Command to the DUT with NetworkID value as + 'Userth_op1' and Breadcrumb value as 0" + verification: | + ./chip-tool networkcommissioning connect-network 1 0 162 0 + + [1645774599.313109][4096:4101] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0007 + [1645774599.313202][4096:4101] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Command 0x0000_0007 + [1645774599.313317][4096:4101] CHIP:TOO: ConnectNetworkResponse: { + [1645774599.313372][4096:4101] CHIP:TOO: networkingStatus: 5 + [1645774599.313420][4096:4101] CHIP:TOO: debugText: + [1645774599.313469][4096:4101] CHIP:TOO: errorValue: 0 + [1645774599.313519][4096:4101] CHIP:TOO: } + [1645774599.313597][4096:4101] CHIP:DMG: ICR moving to [AwaitingDe] + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_18.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_18.yaml new file mode 100644 index 00000000000000..4b8a303fdeafef --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_18.yaml @@ -0,0 +1,45 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.18. [TC-NC-1.18] NetworkNotFound value as LastNetworkingstatus argument + validation for Ethernet interface [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends ConnectNetwork Command to the DUT with NetworkID value as + 'Usereth_id' and Breadcrumb value as 0" + verification: | + '' ./chip-tool networkcommissioning connect-network GRLPrivate_EXT 0 1 0 + + [1646298622.867316][3284:3289] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0007 + [1646298622.867375][3284:3289] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Command 0x0000_0007 + [1646298622.867457][3284:3289] CHIP:TOO: ConnectNetworkResponse: { + [1646298622.867502][3284:3289] CHIP:TOO: networkingStatus: 5 + [1646298622.867535][3284:3289] CHIP:TOO: debugText: + [1646298622.867565][3284:3289] CHIP:TOO: errorValue: 0 + [1646298622.867597][3284:3289] CHIP:TOO: } + [1646298622.867635][3284:3289] CHIP:DMG: ICR moving to [AwaitingDe] + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_2.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_2.yaml new file mode 100644 index 00000000000000..4c83676e71b102 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_2.yaml @@ -0,0 +1,203 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.2. [TC-NC-1.2] Verification on thread connection and attributes check [DUT + - Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Factory reset the DUT" + verification: | + + disabled: true + + - label: "TH1 is commissioned with DUT" + verification: | + + disabled: true + + - label: + "TH1 reads Descriptor Cluster from the DUT with EP0 TH1 reads + ServerList from the DUT" + verification: | + buntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool descriptor read server-list 162 0 + + [1645772414.100694][3827:3832] CHIP:DMG: SuppressResponse = true, + [1645772414.100718][3827:3832] CHIP:DMG: InteractionModelRevision = 1 + [1645772414.100740][3827:3832] CHIP:DMG: } + [1645772414.102134][3827:3832] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001DataVersion: 3883095917 + [1645772414.102248][3827:3832] CHIP:TOO: server list: 21 entries + [1645772414.102291][3827:3832] CHIP:TOO: [1]: 4 + [1645772414.102317][3827:3832] CHIP:TOO: [2]: 29 + [1645772414.102341][3827:3832] CHIP:TOO: [3]: 31 + [1645772414.102366][3827:3832] CHIP:TOO: [4]: 40 + [1645772414.102389][3827:3832] CHIP:TOO: [5]: 42 + [1645772414.102413][3827:3832] CHIP:TOO: [6]: 43 + [1645772414.102436][3827:3832] CHIP:TOO: [7]: 44 + [1645772414.102459][3827:3832] CHIP:TOO: [8]: 48 + [1645772414.102482][3827:3832] CHIP:TOO: [9]: 49 + [1645772414.102506][3827:3832] CHIP:TOO: [10]: 50 + [1645772414.102529][3827:3832] CHIP:TOO: [11]: 51 + [1645772414.102552][3827:3832] CHIP:TOO: [12]: 52 + [1645772414.102575][3827:3832] CHIP:TOO: [13]: 53 + [1645772414.102598][3827:3832] CHIP:TOO: [14]: 54 + [1645772414.102622][3827:3832] CHIP:TOO: [15]: 55 + [1645772414.102645][3827:3832] CHIP:TOO: [16]: 59 + [1645772414.102669][3827:3832] CHIP:TOO: [17]: 60 + [1645772414.102692][3827:3832] CHIP:TOO: [18]: 62 + [1645772414.102715][3827:3832] CHIP:TOO: [19]: 63 + [1645772414.102738][3827:3832] CHIP:TOO: [20]: 64 + [1645772414.102761][3827:3832] CHIP:TOO: [21]: 65 + [1645772414.102925][3827:3832] CHIP:EM: Sending Standalone Ack for MessageCounter:15329672 on exchange 6140i + disabled: true + + - label: "TH1 reads FeatureMap attribute from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read feature-map 162 0 + + + [1645772204.502545][3809:3814] CHIP:DMG: SuppressResponse = true, + [1645772204.502608][3809:3814] CHIP:DMG: InteractionModelRevision = 1 + [1645772204.502683][3809:3814] CHIP:DMG: } + [1645772204.503195][3809:3814] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFCDataVersion: 92121563 + [1645772204.503398][3809:3814] CHIP:TOO: FeatureMap: 2 + [1645772204.503556][3809:3814] CHIP:EM: Sending Standalone Ack for MessageCounter:5988746 on exchange 46140i + disabled: true + + - label: "TH1 reads the MaxNetworks attribute from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read max-networks 162 0 + + + [1645772548.257320][3837:3842] CHIP:DMG: SuppressResponse = true, + [1645772548.257381][3837:3842] CHIP:DMG: InteractionModelRevision = 1 + [1645772548.257437][3837:3842] CHIP:DMG: } + [1645772548.257735][3837:3842] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0000DataVersion: 92121563 + [1645772548.257878][3837:3842] CHIP:TOO: MaxNetworks: 1 + [1645772548.258032][3837:3842] CHIP:EM: Sending Standalone Ack for MessageCounter:7388528 on exchange 41499i + disabled: true + + - label: "TH1 reads the Networks attribute list from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read networks 162 0 + + [1645772651.445097][3856:3861] CHIP:DMG: SuppressResponse = true, + [1645772651.445149][3856:3861] CHIP:DMG: InteractionModelRevision = 1 + [1645772651.445209][3856:3861] CHIP:DMG: } + [1645772651.445754][3856:3861] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0001DataVersion: 92121563 + [1645772651.445875][3856:3861] CHIP:TOO: Networks: 1 entries + [1645772651.446057][3856:3861] CHIP:TOO: [1]: { + [1645772651.446120][3856:3861] CHIP:TOO: NetworkID: 1111161622222211 + [1645772651.446173][3856:3861] CHIP:TOO: Connected: TRUE + [1645772651.446228][3856:3861] CHIP:TOO: } + [1645772651.446431][3856:3861] CHIP:EM: Sending Standalone Ack for MessageCounter:12695576 on exchange 11133i + disabled: true + + - label: "TH1 reads ScanMaxTimeSeconds attribute from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read scan-max-time-seconds 162 0 + + [1645772820.740795][3867:3872] CHIP:DMG: SuppressResponse = true, + [1645772820.740855][3867:3872] CHIP:DMG: InteractionModelRevision = 1 + [1645772820.740903][3867:3872] CHIP:DMG: } + [1645772820.741209][3867:3872] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0002DataVersion: 92121563 + [1645772820.741357][3867:3872] CHIP:TOO: ScanMaxTimeSeconds: 10 + [1645772820.741512][3867:3872] CHIP:EM: Sending Standalone Ack for MessageCounter:10309775 on exchange 55305i + disabled: true + + - label: "TH1 reads ConnectMaxTimeSeconds Attribute from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read connect-max-time-seconds 162 0 + + [1645772901.118880][3879:3884] CHIP:DMG: SuppressResponse = true, + [1645772901.119008][3879:3884] CHIP:DMG: InteractionModelRevision = 1 + [1645772901.119141][3879:3884] CHIP:DMG: } + [1645772901.119684][3879:3884] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0003DataVersion: 92121563 + [1645772901.119885][3879:3884] CHIP:TOO: ConnectMaxTimeSeconds: 20 + [1645772901.120100][3879:3884] CHIP:EM: Sending Standalone Ack for MessageCounter:11917538 on exchange 4188 + disabled: true + + - label: "TH1 reads InterfaceEnabled attribute from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read interface-enabled 162 0 + + [1645772984.653996][3895:3900] CHIP:DMG: SuppressResponse = true, + [1645772984.654043][3895:3900] CHIP:DMG: InteractionModelRevision = 1 + [1645772984.654084][3895:3900] CHIP:DMG: } + [1645772984.654310][3895:3900] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0004DataVersion: 92121563 + [1645772984.654388][3895:3900] CHIP:TOO: InterfaceEnabled: TRUE + [1645772984.654530][3895:3900] CHIP:EM: Sending Standalone Ack for MessageCounter:14026610 on exchange 33717i + disabled: true + + - label: "TH1 reads LastNetworkingStatus attribute from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read last-networking-status 162 0 + + [1645773078.930516][3905:3910] CHIP:DMG: SuppressResponse = true, + [1645773078.930579][3905:3910] CHIP:DMG: InteractionModelRevision = 1 + [1645773078.930635][3905:3910] CHIP:DMG: } + [1645773078.930943][3905:3910] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0005DataVersion: 92121563 + [1645773078.931067][3905:3910] CHIP:TOO: LastNetworkingStatus: 0 + [1645773078.931217][3905:3910] CHIP:EM: Sending Standalone Ack for MessageCounter:16576011 on exchange 44187i + disabled: true + + - label: + "TH1 reads the LastNetworkID attribute from the DUT TH1 reads the + Networks attribute from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read last-network-id 162 0 + + [1645773167.178501][3913:3918] CHIP:DMG: SuppressResponse = true, + [1645773167.178561][3913:3918] CHIP:DMG: InteractionModelRevision = 1 + [1645773167.178618][3913:3918] CHIP:DMG: } + [1645773167.178919][3913:3918] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0006DataVersion: 92121563 + [1645773167.182241][3913:3918] CHIP:TOO: LastNetworkID: 1111161622222211 + [1645773167.182422][3913:3918] CHIP:EM: Sending Standalone Ack for MessageCounter:2029571 on exchange 18566i + disabled: true + + - label: "TH1 reads the LastConnectErrorValue attribute from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read last-connect-error-value 162 0 + + [1645773318.752774][3938:3943] CHIP:DMG: SuppressResponse = true, + [1645773318.752861][3938:3943] CHIP:DMG: InteractionModelRevision = 1 + [1645773318.753043][3938:3943] CHIP:DMG: } + [1645773318.753543][3938:3943] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0007DataVersion: 92121563 + [1645773318.753724][3938:3943] CHIP:TOO: LastConnectErrorValue: 0 + [1645773318.753985][3938:3943] CHIP:EM: Sending Standalone Ack for MessageCounter:15303417 on exchange 41937i + disabled: true + + - label: "TH1 reads ClientGeneratedCommandList attribute from the DUT" + verification: | + ubuntu@ubuntu:~/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool networkcommissioning read client-generated-command-list 162 0 + + [1645773402.037043][3947:3952] CHIP:DMG: SuppressResponse = true, + [1645773402.037070][3947:3952] CHIP:DMG: InteractionModelRevision = 1 + [1645773402.037127][3947:3952] CHIP:DMG: } + [1645773402.037764][3947:3952] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF9DataVersion: 92121563 + [1645773402.037831][3947:3952] CHIP:TOO: ClientGeneratedCommandList: 6 entries + [1645773402.037872][3947:3952] CHIP:TOO: [1]: 0 + [1645773402.037898][3947:3952] CHIP:TOO: [2]: 2 + [1645773402.037935][3947:3952] CHIP:TOO: [3]: 3 + [1645773402.037959][3947:3952] CHIP:TOO: [4]: 4 + [1645773402.037992][3947:3952] CHIP:TOO: [5]: 6 + [1645773402.038016][3947:3952] CHIP:TOO: [6]: 8 + [1645773402.038151][3947:3952] CHIP:EM: Sending Standalone Ack for MessageCounter:10505378 on exchange 51792i + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_3.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_3.yaml new file mode 100644 index 00000000000000..e795ab40dcdb89 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_3.yaml @@ -0,0 +1,184 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.3. [TC-NC-1.3] Verification on Ethernet connection and attributes check + [DUT - Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Factory reset the DUT" + verification: | + + disabled: true + + - label: "TH1 is commissioned with DUT" + verification: | + + disabled: true + + - label: + "TH1 reads Descriptor Cluster from the DUT with EP0 TH1 reads + ServerList from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool descriptor read server-list 1 0 + + + [1646226258.250313][2446:2451] CHIP:DMG: SuppressResponse = true, + [1646226258.250337][2446:2451] CHIP:DMG: InteractionModelRevision = 1 + [1646226258.250359][2446:2451] CHIP:DMG: } + [1646226258.252027][2446:2451] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001DataVersion: 3582931896 + [1646226258.252128][2446:2451] CHIP:TOO: server list: 25 entries + [1646226258.252183][2446:2451] CHIP:TOO: [1]: 3 + [1646226258.252208][2446:2451] CHIP:TOO: [2]: 4 + [1646226258.252232][2446:2451] CHIP:TOO: [3]: 29 + [1646226258.252256][2446:2451] CHIP:TOO: [4]: 30 + [1646226258.252280][2446:2451] CHIP:TOO: [5]: 31 + [1646226258.252303][2446:2451] CHIP:TOO: [6]: 40 + [1646226258.252326][2446:2451] CHIP:TOO: [7]: 42 + [1646226258.252349][2446:2451] CHIP:TOO: [8]: 43 + [1646226258.252373][2446:2451] CHIP:TOO: [9]: 44 + [1646226258.252396][2446:2451] CHIP:TOO: [10]: 45 + [1646226258.252420][2446:2451] CHIP:TOO: [11]: 46 + [1646226258.252443][2446:2451] CHIP:TOO: [12]: 48 + [1646226258.252466][2446:2451] CHIP:TOO: [13]: 49 + [1646226258.252489][2446:2451] CHIP:TOO: [14]: 50 + [1646226258.252512][2446:2451] CHIP:TOO: [15]: 51 + [1646226258.252536][2446:2451] CHIP:TOO: [16]: 52 + [1646226258.252559][2446:2451] CHIP:TOO: [17]: 53 + [1646226258.252582][2446:2451] CHIP:TOO: [18]: 54 + [1646226258.252605][2446:2451] CHIP:TOO: [19]: 55 + [1646226258.252629][2446:2451] CHIP:TOO: [20]: 60 + [1646226258.252652][2446:2451] CHIP:TOO: [21]: 62 + [1646226258.252675][2446:2451] CHIP:TOO: [22]: 63 + [1646226258.252698][2446:2451] CHIP:TOO: [23]: 64 + [1646226258.252721][2446:2451] CHIP:TOO: [24]: 65 + [1646226258.252745][2446:2451] CHIP:TOO: [25]: 1029 + [1646226258.255517][2446:2451] CHIP:EM: Sending Standalone Ack for MessageCounter:10627940 on exchange 21443i + disabled: true + + - label: "TH1 reads FeatureMap attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read feature-map 1 0 + + [1646226326.733918][2460:2465] CHIP:DMG: + [1646226326.733950][2460:2465] CHIP:DMG: SuppressResponse = true, + [1646226326.733984][2460:2465] CHIP:DMG: InteractionModelRevision = 1 + [1646226326.734014][2460:2465] CHIP:DMG: } + [1646226326.734188][2460:2465] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFCDataVersion: 3622667250 + [1646226326.736250][2460:2465] CHIP:TOO: FeatureMap: 2 + [1646226326.736362][2460:2465] CHIP:EM: Sending Standalone Ack for MessageCounter:9135736 on exchange 51231i + disabled: true + + - label: "TH1 reads the MaxNetworks attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read max-networks 1 0 + + [1646226441.815782][2475:2480] CHIP:DMG: SuppressResponse = true, + [1646226441.815849][2475:2480] CHIP:DMG: InteractionModelRevision = 1 + [1646226441.815889][2475:2480] CHIP:DMG: } + [1646226441.816092][2475:2480] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0000DataVersion: 3622667250 + [1646226441.816191][2475:2480] CHIP:TOO: MaxNetworks: 1 + [1646226441.816288][2475:2480] CHIP:EM: Sending Standalone Ack for MessageCounter:14864333 on exchange 39473i + disabled: true + + - label: "TH1 reads the Networks attribute list from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read networks 1 0 + + [1646226488.740009][2488:2493] CHIP:DMG: + [1646226488.740041][2488:2493] CHIP:DMG: SuppressResponse = true, + [1646226488.740074][2488:2493] CHIP:DMG: InteractionModelRevision = 1 + [1646226488.740113][2488:2493] CHIP:DMG: } + [1646226488.740320][2488:2493] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0001DataVersion: 3622667250 + [1646226488.740409][2488:2493] CHIP:TOO: Networks: 0 entries + [1646226488.740501][2488:2493] CHIP:EM: Sending Standalone Ack for MessageCounter:9725190 on exchange 29852i + disabled: true + + - label: "TH1 reads InterfaceEnabled attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read interface-enabled 1 0 + + [1646226615.428003][2502:2507] CHIP:DMG: + [1646226615.428035][2502:2507] CHIP:DMG: SuppressResponse = true, + [1646226615.428064][2502:2507] CHIP:DMG: InteractionModelRevision = 1 + [1646226615.428094][2502:2507] CHIP:DMG: } + [1646226615.428270][2502:2507] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0004DataVersion: 3622667250 + [1646226615.428331][2502:2507] CHIP:TOO: InterfaceEnabled: TRUE + [1646226615.428415][2502:2507] CHIP:EM: Sending Standalone Ack for MessageCounter:3894401 on exchange 55691i + disabled: true + + - label: "TH1 reads LastNetworkingStatus attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read last-networking-status 1 0 + + [1646227167.614060][2533:2538] CHIP:DMG: SuppressResponse = true, + [1646227167.614095][2533:2538] CHIP:DMG: InteractionModelRevision = 1 + [1646227167.614126][2533:2538] CHIP:DMG: } + [1646227167.614299][2533:2538] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0005DataVersion: 3622667250 + [1646227167.614385][2533:2538] CHIP:TOO: LastNetworkingStatus: 0 + [1646227167.614468][2533:2538] CHIP:EM: Sending Standalone Ack for MessageCounter:8947540 on exchange 12532i + disabled: true + + - label: + "TH1 reads the LastNetworkID attribute from the DUT TH1 reads the + Networks attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read last-network-id 1 0 + + [1646227218.543427][2545:2550] CHIP:DMG: + [1646227218.543462][2545:2550] CHIP:DMG: SuppressResponse = true, + [1646227218.543506][2545:2550] CHIP:DMG: InteractionModelRevision = 1 + [1646227218.543538][2545:2550] CHIP:DMG: } + [1646227218.543748][2545:2550] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0006DataVersion: 3622667250 + [1646227218.543836][2545:2550] CHIP:TOO: LastNetworkID: + [1646227218.543924][2545:2550] CHIP:EM: Sending Standalone Ack for MessageCounter:9758721 on exchange 15256i + disabled: true + + - label: "TH1 reads the LastConnectErrorValue attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read last-connect-error-value 1 0 + + [1646227266.753206][2560:2565] CHIP:DMG: + [1646227266.753239][2560:2565] CHIP:DMG: SuppressResponse = true, + [1646227266.753272][2560:2565] CHIP:DMG: InteractionModelRevision = 1 + [1646227266.753303][2560:2565] CHIP:DMG: } + [1646227266.753472][2560:2565] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0007DataVersion: 3622667250 + [1646227266.753556][2560:2565] CHIP:TOO: LastConnectErrorValue: 0 + [1646227266.753632][2560:2565] CHIP:EM: Sending Standalone Ack for MessageCounter:7911198 on exchange 43970i + disabled: true + + - label: "TH1 reads ClientGeneratedCommandList attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read client-generated-command-list 1 0 + + [1646227303.224981][2570:2575] CHIP:DMG: SuppressResponse = true, + [1646227303.225017][2570:2575] CHIP:DMG: InteractionModelRevision = 1 + [1646227303.225050][2570:2575] CHIP:DMG: } + [1646227303.225902][2570:2575] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF9DataVersion: 3622667250 + [1646227303.226014][2570:2575] CHIP:TOO: ClientGeneratedCommandList: 7 entries + [1646227303.226093][2570:2575] CHIP:TOO: [1]: 0 + [1646227303.226131][2570:2575] CHIP:TOO: [2]: 2 + [1646227303.226167][2570:2575] CHIP:TOO: [3]: 3 + [1646227303.226195][2570:2575] CHIP:TOO: [4]: 4 + [1646227303.226223][2570:2575] CHIP:TOO: [5]: 5 + [1646227303.226251][2570:2575] CHIP:TOO: [6]: 6 + [1646227303.226333][2570:2575] CHIP:TOO: [7]: 8 + [1646227303.226419][2570:2575] CHIP:EM: Sending Standalone Ack for MessageCounter:15891447 on exchange 61063i + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_4.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_4.yaml new file mode 100644 index 00000000000000..57daab0088e7fd --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_4.yaml @@ -0,0 +1,59 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.4. [TC-NC-1.4] Verification for ScanNetworks command for Wifi interface + [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH1 sends ScanNetworks command to the DUT with the SSID argument + value as null and Breadcrumb argument value as 0" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning scan-networks null 0 1 0 + + [1646293689.990014][2928:2933] CHIP:CTL: Device connected callback with null pairing delegate. Ignoring + [1646293689.990067][2928:2933] CHIP:EM: Sending Standalone Ack for MessageCounter:1871595063 on exchange 3459i + [1646293689.990110][2928:2933] CHIP:IN: Prepared unauthenticated message 0xffffa1bcb938 to 0x0000000000000000 (0) of type 0x10 and protocolId (0, 0) on exchange 3459i with MessageCounter:525156546. + [1646293689.990157][2928:2933] CHIP:IN: Sending unauthenticated msg 0xffffa1bcb938 with MessageCounter:525156546 to 0x0000000000000000 at monotonic time: 5262853 msec + [1646293689.990248][2928:2933] CHIP:EM: Flushed pending ack for MessageCounter:1871595063 on exchange 3459i + [1646293690.190932][2928:2933] CHIP:EM: Received message of type 0x10 with protocolId (0, 0) and MessageCounter:13758687 on exchange 3460i + [1646293690.191036][2928:2933] CHIP:EM: Found matching exchange: 3460i, Delegate: 0xffff8c003aa0 + [1646293690.191120][2928:2933] CHIP:EM: Rxd Ack; Removing MessageCounter:11356051 from Retrans Table on exchange 3460i + [1646293690.191180][2928:2933] CHIP:EM: Removed CHIP MessageCounter:11356051 from RetransTable on exchange 3460i + [1646293699.967781][2928:2928] CHIP:-: ../../examples/chip-tool/commands/common/CHIPCommand.cpp:249: CHIP Error 0x00000032: Timeout at ../../examples/chip-tool/commands/common/CHIPCommand.cpp:62 + [1646293699.967832][2928:2928] CHIP:TOO: Run command failure: ../../examples/chip-tool/commands/common/CHIPCommand.cpp:249: CHIP Error 0x00000032: Timeout + [1646293699.976755][2928:2928] CHIP:SPT: VerifyOrDie failure at ../../src/lib/support/Pool.h:304: Allocated() == 0 + Aborted + disabled: true + + - label: + "TH1 sends ScanNetworks Command to the DUT with SSID argument value as + 'Userwifi_ssid' and Breadcrumb argument value 0" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning scan-networks GRLPrivate_EXT 0 1 0 + + [1646289182.010873][2486:2491] CHIP:DMG: InteractionModelRevision = 1 + [1646289182.010903][2486:2491] CHIP:DMG: }, + [1646289182.010981][2486:2491] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0000 Status=0x9c + [1646289182.011022][2486:2491] CHIP:TOO: Error: IM Error 0x0000059C: General error: 0x9c + [1646289182.011094][2486:2491] CHIP:DMG: ICR moving to [AwaitingDe] + [1646289182.011133][2486:2491] CHIP:EM: Sending Standalone Ack for MessageCounter:3499711 on exchange 3366i + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_5.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_5.yaml new file mode 100644 index 00000000000000..ba0b97fda75c37 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_5.yaml @@ -0,0 +1,49 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.5. [TC-NC-1.5] UNSPPUORTED_ACCESS message Validation for Wifi interface + [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH1 sends the AddOrUpdateWiFiNetwork command to the DUT with the + following argument: SSID argument value as 'Userwifi_ssid' Credentials + argument value as 'xxxxx' Breadcrumb argument value as 0" + verification: | + Can't verify the test case as it need to be executed before the commissioning. + Which is not possiable with the CHIP tool step + disabled: true + + - label: + "TH1 sends RemoveNetwork command to the DUT with NetworkID argument + value as 'Userwifi_ssid' and Breadcrumb argument value as 0" + verification: | + Can't verify the test case as it need to be executed before the commissioning. + Which is not possiable with the CHIP tool step + disabled: true + + - label: + "TH1 sends ConnectNetwork command to the DUT with NetworkID argument + value as 'Userwifi_ssid' and Breadcrumb argument value as 0" + verification: | + Can't verify the test case as it need to be executed before the commissioning. + Which is not possiable with the CHIP tool step + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_6.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_6.yaml new file mode 100644 index 00000000000000..052c8c839b15f1 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_6.yaml @@ -0,0 +1,49 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.6. [TC-NC-1.6] UNSPPUORTED_ACCESS message Validation for Thread interface + [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "TH1 sends the AddOrUpdateThreadNetwork command to the DUT with the + following argument: OperationalDataset argument value as 'Userth_op' + Breadcrumb argument value as 0" + verification: | + Can't verify the test case as it need to be executed before the commissioning. + Which is not possiable with the CHIP tool step + disabled: true + + - label: + "TH1 sends RemoveNetwork command to the DUT with NetworkID argument + value as 'Userth_op' and Breadcrumb argument value as 0" + verification: | + Can't verify the test case as it need to be executed before the commissioning. + Which is not possiable with the CHIP tool step + disabled: true + + - label: + "TH1 sends ConnectNetwork command to the DUT with NetworkID argument + value as 'Userth_op' and Breadcrumb argument value as 0" + verification: | + Can't verify the test case as it need to be executed before the commissioning. + Which is not possiable with the CHIP tool step + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_7.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_7.yaml new file mode 100644 index 00000000000000..4f16e88a944383 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_7.yaml @@ -0,0 +1,89 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.7. [TC-NC-1.7] Verification for AddOrUpdateWiFiNetwork command + [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends AddOrUpdateWiFiNetwork command to the DUT with SSID + argument value as 'Userwifi_ssid', Credentials argument value as + 'xxxxx' and Breadcrumb argument value as 0" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning add-or-update-wi-fi-network GRLPrivate_EXT matter123 0 1 0 + + + [1646289754.056172][2573:2578] CHIP:DMG: + [1646289754.056240][2573:2578] CHIP:DMG: InteractionModelRevision = 1 + [1646289754.056278][2573:2578] CHIP:DMG: }, + [1646289754.056375][2573:2578] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0005 + [1646289754.056445][2573:2578] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Command 0x0000_0005 + [1646289754.056535][2573:2578] CHIP:TOO: NetworkConfigResponse: { + [1646289754.056590][2573:2578] CHIP:TOO: networkingStatus: 0 + [1646289754.056628][2573:2578] CHIP:TOO: debugText: + [1646289754.056666][2573:2578] CHIP:TOO: } + [1646289754.056712][2573:2578] CHIP:DMG: ICR moving to [AwaitingDe] + [1646289754.056787][2573:2578] CHIP:EM: Sending Standalone Ack for MessageCounter:11569822 on exchange 38244i + disabled: true + + - label: "TH1 reads MaxNetworks attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read max-networks 1 0 + + [1646290259.940728][2681:2686] CHIP:DMG: + [1646290259.940760][2681:2686] CHIP:DMG: SuppressResponse = true, + [1646290259.940793][2681:2686] CHIP:DMG: InteractionModelRevision = 1 + [1646290259.940824][2681:2686] CHIP:DMG: } + [1646290259.941000][2681:2686] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0000DataVersion: 2391702431 + [1646290259.943230][2681:2686] CHIP:TOO: MaxNetworks: 1 + [1646290259.943345][2681:2686] CHIP:EM: Sending Standalone Ack for MessageCounter:5523057 on exchange 61782i + disabled: true + + - label: "TH1 reads LastNetworkingStatus attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read last-networking-status 1 0 + + [1646290420.281009][2697:2702] CHIP:DMG: + [1646290420.281042][2697:2702] CHIP:DMG: SuppressResponse = true, + [1646290420.281075][2697:2702] CHIP:DMG: InteractionModelRevision = 1 + [1646290420.281106][2697:2702] CHIP:DMG: } + [1646290420.281281][2697:2702] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0005DataVersion: 2391702431 + [1646290420.281367][2697:2702] CHIP:TOO: LastNetworkingStatus: 0 + [1646290420.281448][2697:2702] CHIP:EM: Sending Standalone Ack for MessageCounter:4395284 on exchange 47160i + disabled: true + + - label: "TH1 reads Networks attribute from the DUT" + verification: | + ubuntu@ubuntu:~/apps$ sudo ./chip-tool networkcommissioning read networks 1 0 + + [1646290474.427405][2708:2713] CHIP:DMG: + [1646290474.427438][2708:2713] CHIP:DMG: SuppressResponse = true, + [1646290474.427471][2708:2713] CHIP:DMG: InteractionModelRevision = 1 + [1646290474.427502][2708:2713] CHIP:DMG: } + [1646290474.427705][2708:2713] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0001DataVersion: 2391702431 + [1646290474.427798][2708:2713] CHIP:TOO: Networks: 0 entries + [1646290474.427897][2708:2713] CHIP:EM: Sending Standalone Ack for MessageCounter:9385469 on exchange 48753i + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_8.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_8.yaml new file mode 100644 index 00000000000000..88b41acd6792b2 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_8.yaml @@ -0,0 +1,62 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.8. [TC-NC-1.8] Verification for AddOrUpdateThreadNetwork command + [DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends AddOrUpdateThreadNetwork command to the DUT with + OperationalDataset argument value as 'Userth_op' and Breadcrumb + argument value as 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15782 + + ./chip-tool networkcommissioning add-or-update-thread-network 1111161622222211 0 162 0 + + [1645774062.824543][4020:4025] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0031 Command=0x0000_0005 + [1645774062.824650][4020:4025] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Command 0x0000_0005 + [1645774062.824775][4020:4025] CHIP:TOO: NetworkConfigResponse: { + [1645774062.824838][4020:4025] CHIP:TOO: networkingStatus: 2 + [1645774062.824891][4020:4025] CHIP:TOO: debugText: + [1645774062.824945][4020:4025] CHIP:TOO: } + [1645774062.825030][4020:4025] CHIP:DMG: ICR moving to [AwaitingDe] + disabled: true + + - label: "TH1 reads MaxNetworks attribute from the DUT" + verification: | + + disabled: true + + - label: "TH1 reads LastNetworkingStatus attribute from the DUT" + verification: | + + disabled: true + + - label: "TH1 reads Networks attribute from the DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_NC_1_9.yaml b/src/app/tests/suites/certification/Test_TC_NC_1_9.yaml new file mode 100644 index 00000000000000..d80fa50572c8e9 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NC_1_9.yaml @@ -0,0 +1,46 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.9. [TC-NC-1.9] Verification for RemoveNetwork Command for Wifi + interface[DUT-Commissionee] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH1 sends ArmFailSafe command to the DUT" + verification: | + + disabled: true + + - label: + "TH1 sends RemoveNetwork Command to the DUT with NetworkID argument + value as 'Userwifi_ssid1' and Breadcrumb argument value as 0" + verification: | + https://github.com/project-chip/connectedhomeip/issues/15782 + disabled: true + + - label: "TH1 reads MaxNetworks attribute from the DUT" + verification: | + + disabled: true + + - label: "TH1 reads LastNetworkingStatus attribute from the DUT" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_OCC_3_2.yaml b/src/app/tests/suites/certification/Test_TC_OCC_3_2.yaml new file mode 100644 index 00000000000000..8bcf66322954ed --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OCC_3_2.yaml @@ -0,0 +1,78 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.2.6. [TC-OCC-3.2] Primary functionality with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Commission TH to DUT" + verification: | + + disabled: true + + - label: "DUT reads Occupancy attribute from TH" + verification: | + ./chip-tool occupancysensing read occupancy 1 1 + + [1646207231.401268][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646207231.401302][2190:2190] CHIP:DMG: { + [1646207231.401330][2190:2190] CHIP:DMG: AttributePathIBs = + [1646207231.401370][2190:2190] CHIP:DMG: [ + [1646207231.401402][2190:2190] CHIP:DMG: AttributePathIB = + [1646207231.401459][2190:2190] CHIP:DMG: { + [1646207231.401514][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646207231.401554][2190:2190] CHIP:DMG: Cluster = 0x406, + [1646207231.401597][2190:2190] CHIP:DMG: Attribute = 0x0000_0000, + [1646207231.401635][2190:2190] CHIP:DMG: } + [1646207231.401672][2190:2190] CHIP:DMG: + [1646207231.401705][2190:2190] CHIP:DMG: ], + [1646207231.401739][2190:2190] CHIP:DMG: + [1646207231.401771][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646207231.401803][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646207231.401832][2190:2190] CHIP:DMG: }, + [1646207231.401908][2190:2190] CHIP:DMG: IM RH moving to [GeneratingReports] + disabled: true + + - label: "Operate on TH to change the occupancy status" + verification: | + Logs will be device specific + disabled: true + + - label: "after a few seconds, DUT reads Occupancy attribute from TH" + verification: | + ./chip-tool occupancysensing read occupancy 1 1 + + [1646207231.401268][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646207231.401302][2190:2190] CHIP:DMG: { + [1646207231.401330][2190:2190] CHIP:DMG: AttributePathIBs = + [1646207231.401370][2190:2190] CHIP:DMG: [ + [1646207231.401402][2190:2190] CHIP:DMG: AttributePathIB = + [1646207231.401459][2190:2190] CHIP:DMG: { + [1646207231.401514][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646207231.401554][2190:2190] CHIP:DMG: Cluster = 0x406, + [1646207231.401597][2190:2190] CHIP:DMG: Attribute = 0x0000_0000, + [1646207231.401635][2190:2190] CHIP:DMG: } + [1646207231.401672][2190:2190] CHIP:DMG: + [1646207231.401705][2190:2190] CHIP:DMG: ], + [1646207231.401739][2190:2190] CHIP:DMG: + [1646207231.401771][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646207231.401803][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646207231.401832][2190:2190] CHIP:DMG: }, + [1646207231.401908][2190:2190] CHIP:DMG: IM RH moving to [GeneratingReports] + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_OO_3_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_3_1.yaml new file mode 100644 index 00000000000000..d5684a566b51a8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OO_3_1.yaml @@ -0,0 +1,99 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.3.1. [TC-OO-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received read of OnOff (id 0) looks like this: + + [1646100811.596736][33190:33190] CHIP:IM: Received Read request + [1646100811.596807][33190:33190] CHIP:DMG: ReadRequestMessage = + [1646100811.596833][33190:33190] CHIP:DMG: { + [1646100811.596855][33190:33190] CHIP:DMG: AttributePathIBs = + [1646100811.596888][33190:33190] CHIP:DMG: [ + [1646100811.596912][33190:33190] CHIP:DMG: AttributePathIB = + [1646100811.596955][33190:33190] CHIP:DMG: { + [1646100811.596985][33190:33190] CHIP:DMG: Endpoint = 0x1, + [1646100811.597019][33190:33190] CHIP:DMG: Cluster = 0x6, + [1646100811.597062][33190:33190] CHIP:DMG: Attribute = 0x0000_0000, + [1646100811.597094][33190:33190] CHIP:DMG: } + [1646100811.597169][33190:33190] CHIP:DMG: + [1646100811.597209][33190:33190] CHIP:DMG: ], + [1646100811.597237][33190:33190] CHIP:DMG: + [1646100811.597272][33190:33190] CHIP:DMG: isFabricFiltered = false, + [1646100811.597297][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646100811.597320][33190:33190] CHIP:DMG: }, + [1646100811.597401][33190:33190] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646100811.598115][33190:33190] CHIP:DMG: Cluster 6, Attribute 0 is dirty + [1646100811.598165][33190:33190] CHIP:DMG: Reading attribute: Cluster=0x0000_0006 Endpoint=1 AttributeId=0x0000_0000 (expanded=0) + [1646100811.598196][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=v + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + see above + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received write request looks like this (f.e OnTime (id 16385) value 60): + + [1646100983.669189][33190:33190] CHIP:IM: Received Write request + [1646100983.669246][33190:33190] CHIP:DMG: IM WH moving to [Initialized] + [1646100983.669312][33190:33190] CHIP:DMG: WriteRequestMessage = + [1646100983.669345][33190:33190] CHIP:DMG: { + [1646100983.669372][33190:33190] CHIP:DMG: timedRequest = false, + [1646100983.669400][33190:33190] CHIP:DMG: AttributeDataIBs = + [1646100983.669455][33190:33190] CHIP:DMG: [ + [1646100983.669483][33190:33190] CHIP:DMG: AttributeDataIB = + [1646100983.669527][33190:33190] CHIP:DMG: { + [1646100983.669560][33190:33190] CHIP:DMG: AttributePathIB = + [1646100983.669606][33190:33190] CHIP:DMG: { + [1646100983.669644][33190:33190] CHIP:DMG: Endpoint = 0x1, + [1646100983.669694][33190:33190] CHIP:DMG: Cluster = 0x6, + [1646100983.669741][33190:33190] CHIP:DMG: Attribute = 0x0000_4001, + [1646100983.669777][33190:33190] CHIP:DMG: } + [1646100983.669824][33190:33190] CHIP:DMG: + [1646100983.669875][33190:33190] CHIP:DMG: Data = 60, + [1646100983.669916][33190:33190] CHIP:DMG: }, + [1646100983.669960][33190:33190] CHIP:DMG: + [1646100983.669987][33190:33190] CHIP:DMG: ], + [1646100983.670031][33190:33190] CHIP:DMG: + [1646100983.670060][33190:33190] CHIP:DMG: moreChunkedMessages = false, + [1646100983.670098][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646100983.670125][33190:33190] CHIP:DMG: }, + [1646100983.670234][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=o + [1646100983.670301][33190:33190] CHIP:DMG: Endpoint 1, Cluster 0x0000_0006 update version to 6ba329dc + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + see above + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_OO_3_2.yaml b/src/app/tests/suites/certification/Test_TC_OO_3_2.yaml new file mode 100644 index 00000000000000..f8407e1cf13a2b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OO_3_2.yaml @@ -0,0 +1,234 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.3.2. [TC-OO-3.2] Functionality with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "DUT issues an Off command to the Test Harness." + verification: | + On TestHarnes (all-cluster-app) a received Off command looks like this: + + [1646102181.016213][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:1364748 on exchange 16786r + [1646102181.016254][33190:33190] CHIP:EM: Handling via exchange: 16786r, Delegate: 0xaaaace1730c8 + [1646102181.016620][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646102181.016666][33190:33190] CHIP:DMG: { + [1646102181.016690][33190:33190] CHIP:DMG: suppressResponse = false, + [1646102181.016716][33190:33190] CHIP:DMG: timedRequest = false, + [1646102181.016741][33190:33190] CHIP:DMG: InvokeRequests = + [1646102181.016770][33190:33190] CHIP:DMG: [ + [1646102181.016794][33190:33190] CHIP:DMG: CommandDataIB = + [1646102181.016829][33190:33190] CHIP:DMG: { + [1646102181.016857][33190:33190] CHIP:DMG: CommandPathIB = + [1646102181.016891][33190:33190] CHIP:DMG: { + [1646102181.016924][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646102181.016956][33190:33190] CHIP:DMG: ClusterId = 0x6, + [1646102181.016989][33190:33190] CHIP:DMG: CommandId = 0x0, + [1646102181.017020][33190:33190] CHIP:DMG: }, + [1646102181.017053][33190:33190] CHIP:DMG: + [1646102181.017080][33190:33190] CHIP:DMG: CommandData = + [1646102181.017113][33190:33190] CHIP:DMG: { + [1646102181.017143][33190:33190] CHIP:DMG: }, + [1646102181.017171][33190:33190] CHIP:DMG: }, + [1646102181.017202][33190:33190] CHIP:DMG: + [1646102181.017227][33190:33190] CHIP:DMG: ], + [1646102181.017256][33190:33190] CHIP:DMG: + [1646102181.017280][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646102181.017303][33190:33190] CHIP:DMG: }, + [1646102181.017357][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=o + [1646102181.017399][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0000 + disabled: true + + - label: "DUT issues an On command to the Test Harness." + verification: | + On TestHarnes (all-cluster-app) a received On command looks like this: + + [1646102270.625767][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:15922463 on exchange 1577r + [1646102270.625810][33190:33190] CHIP:EM: Handling via exchange: 1577r, Delegate: 0xaaaace1730c8 + [1646102270.626205][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646102270.626252][33190:33190] CHIP:DMG: { + [1646102270.626278][33190:33190] CHIP:DMG: suppressResponse = false, + [1646102270.626318][33190:33190] CHIP:DMG: timedRequest = false, + [1646102270.626346][33190:33190] CHIP:DMG: InvokeRequests = + [1646102270.626381][33190:33190] CHIP:DMG: [ + [1646102270.626409][33190:33190] CHIP:DMG: CommandDataIB = + [1646102270.626442][33190:33190] CHIP:DMG: { + [1646102270.626470][33190:33190] CHIP:DMG: CommandPathIB = + [1646102270.626508][33190:33190] CHIP:DMG: { + [1646102270.626546][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646102270.626585][33190:33190] CHIP:DMG: ClusterId = 0x6, + [1646102270.626620][33190:33190] CHIP:DMG: CommandId = 0x1, + [1646102270.626654][33190:33190] CHIP:DMG: }, + [1646102270.626695][33190:33190] CHIP:DMG: + [1646102270.626726][33190:33190] CHIP:DMG: CommandData = + [1646102270.626761][33190:33190] CHIP:DMG: { + [1646102270.626795][33190:33190] CHIP:DMG: }, + [1646102270.626827][33190:33190] CHIP:DMG: }, + [1646102270.626860][33190:33190] CHIP:DMG: + [1646102270.626887][33190:33190] CHIP:DMG: ], + [1646102270.626920][33190:33190] CHIP:DMG: + [1646102270.626946][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646102270.626972][33190:33190] CHIP:DMG: }, + [1646102270.627032][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=o + [1646102270.627078][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0001 + disabled: true + + - label: "DUT issues an Toggle command to the Test Harness." + verification: | + On TestHarnes (all-cluster-app) a received Toggle command looks like this: + + [1646102299.034377][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:15497853 on exchange 28117r + [1646102299.034429][33190:33190] CHIP:EM: Handling via exchange: 28117r, Delegate: 0xaaaace1730c8 + [1646102299.034872][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646102299.034923][33190:33190] CHIP:DMG: { + [1646102299.034955][33190:33190] CHIP:DMG: suppressResponse = false, + [1646102299.034990][33190:33190] CHIP:DMG: timedRequest = false, + [1646102299.035023][33190:33190] CHIP:DMG: InvokeRequests = + [1646102299.035062][33190:33190] CHIP:DMG: [ + [1646102299.035094][33190:33190] CHIP:DMG: CommandDataIB = + [1646102299.035131][33190:33190] CHIP:DMG: { + [1646102299.035167][33190:33190] CHIP:DMG: CommandPathIB = + [1646102299.035209][33190:33190] CHIP:DMG: { + [1646102299.035305][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646102299.035346][33190:33190] CHIP:DMG: ClusterId = 0x6, + [1646102299.035381][33190:33190] CHIP:DMG: CommandId = 0x2, + [1646102299.035422][33190:33190] CHIP:DMG: }, + [1646102299.035465][33190:33190] CHIP:DMG: + [1646102299.035502][33190:33190] CHIP:DMG: CommandData = + [1646102299.035543][33190:33190] CHIP:DMG: { + [1646102299.035585][33190:33190] CHIP:DMG: }, + [1646102299.035623][33190:33190] CHIP:DMG: }, + [1646102299.035665][33190:33190] CHIP:DMG: + [1646102299.035696][33190:33190] CHIP:DMG: ], + [1646102299.035736][33190:33190] CHIP:DMG: + [1646102299.035768][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646102299.035799][33190:33190] CHIP:DMG: }, + [1646102299.035869][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=o + [1646102299.035922][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0002 + disabled: true + + - label: "DUT issues an OffWithEffect command to the Test Harness." + verification: | + On TestHarnes (all-cluster-app) a received OffWithEffect command with f.e. 1 for EffectIdentifier and 0 for EffectVariant looks like this: + + [1646101669.038374][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:2036360 on exchange 5461r + [1646101669.038415][33190:33190] CHIP:EM: Handling via exchange: 5461r, Delegate: 0xaaaace1730c8 + [1646101669.038772][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646101669.038820][33190:33190] CHIP:DMG: { + [1646101669.038847][33190:33190] CHIP:DMG: suppressResponse = false, + [1646101669.038874][33190:33190] CHIP:DMG: timedRequest = false, + [1646101669.038899][33190:33190] CHIP:DMG: InvokeRequests = + [1646101669.038930][33190:33190] CHIP:DMG: [ + [1646101669.038954][33190:33190] CHIP:DMG: CommandDataIB = + [1646101669.038983][33190:33190] CHIP:DMG: { + [1646101669.039010][33190:33190] CHIP:DMG: CommandPathIB = + [1646101669.039041][33190:33190] CHIP:DMG: { + [1646101669.039076][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646101669.039108][33190:33190] CHIP:DMG: ClusterId = 0x6, + [1646101669.039138][33190:33190] CHIP:DMG: CommandId = 0x40, + [1646101669.039167][33190:33190] CHIP:DMG: }, + [1646101669.039200][33190:33190] CHIP:DMG: + [1646101669.039256][33190:33190] CHIP:DMG: CommandData = + [1646101669.039289][33190:33190] CHIP:DMG: { + [1646101669.039321][33190:33190] CHIP:DMG: 0x0 = 1, + [1646101669.039353][33190:33190] CHIP:DMG: 0x1 = 0, + [1646101669.039384][33190:33190] CHIP:DMG: }, + [1646101669.039414][33190:33190] CHIP:DMG: }, + [1646101669.039446][33190:33190] CHIP:DMG: + [1646101669.039470][33190:33190] CHIP:DMG: ], + [1646101669.039500][33190:33190] CHIP:DMG: + [1646101669.039523][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646101669.039546][33190:33190] CHIP:DMG: }, + [1646101669.039603][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=o + [1646101669.039644][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0040 + [1646101669.039684][33190:33190] CHIP:ZCL: On/Off set value: 1 0 + [1646101669.039707][33190:33190] CHIP:ZCL: On/off already set to new value + disabled: true + + - label: + "DUT issues an OnWithRecallGlobalScene command to the Test Harness." + verification: | + On TestHarnes (all-cluster-app) a received OnWithRecallGlobalScene command looks like this: + + [1646102326.055526][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:15476331 on exchange 1832r + [1646102326.055565][33190:33190] CHIP:EM: Handling via exchange: 1832r, Delegate: 0xaaaace1730c8 + [1646102326.055921][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646102326.055966][33190:33190] CHIP:DMG: { + [1646102326.055989][33190:33190] CHIP:DMG: suppressResponse = false, + [1646102326.056022][33190:33190] CHIP:DMG: timedRequest = false, + [1646102326.056046][33190:33190] CHIP:DMG: InvokeRequests = + [1646102326.056077][33190:33190] CHIP:DMG: [ + [1646102326.056171][33190:33190] CHIP:DMG: CommandDataIB = + [1646102326.056205][33190:33190] CHIP:DMG: { + [1646102326.056232][33190:33190] CHIP:DMG: CommandPathIB = + [1646102326.056261][33190:33190] CHIP:DMG: { + [1646102326.056292][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646102326.056328][33190:33190] CHIP:DMG: ClusterId = 0x6, + [1646102326.056362][33190:33190] CHIP:DMG: CommandId = 0x41, + [1646102326.056389][33190:33190] CHIP:DMG: }, + [1646102326.056420][33190:33190] CHIP:DMG: + [1646102326.056451][33190:33190] CHIP:DMG: CommandData = + [1646102326.056481][33190:33190] CHIP:DMG: { + [1646102326.056515][33190:33190] CHIP:DMG: }, + [1646102326.056542][33190:33190] CHIP:DMG: }, + [1646102326.056573][33190:33190] CHIP:DMG: + [1646102326.056596][33190:33190] CHIP:DMG: ], + [1646102326.056661][33190:33190] CHIP:DMG: + [1646102326.056685][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646102326.056708][33190:33190] CHIP:DMG: }, + [1646102326.056763][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=o + [1646102326.056804][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0041 + disabled: true + + - label: "DUT issues an OnWithTimedOff command to the Test Harness." + verification: | + On TestHarnes (all-cluster-app) a received OnWithTimedOff command with f.e. 0 for OnOffControl, 120 for OnTime and 5 for OffWaitTime looks like this: + + [1646101954.445121][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:1056488 on exchange 1252r + [1646101954.445162][33190:33190] CHIP:EM: Handling via exchange: 1252r, Delegate: 0xaaaace1730c8 + [1646101954.445536][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646101954.445582][33190:33190] CHIP:DMG: { + [1646101954.445604][33190:33190] CHIP:DMG: suppressResponse = false, + [1646101954.445630][33190:33190] CHIP:DMG: timedRequest = false, + [1646101954.445654][33190:33190] CHIP:DMG: InvokeRequests = + [1646101954.445686][33190:33190] CHIP:DMG: [ + [1646101954.445709][33190:33190] CHIP:DMG: CommandDataIB = + [1646101954.445743][33190:33190] CHIP:DMG: { + [1646101954.445768][33190:33190] CHIP:DMG: CommandPathIB = + [1646101954.445798][33190:33190] CHIP:DMG: { + [1646101954.445831][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646101954.445863][33190:33190] CHIP:DMG: ClusterId = 0x6, + [1646101954.445894][33190:33190] CHIP:DMG: CommandId = 0x42, + [1646101954.445924][33190:33190] CHIP:DMG: }, + [1646101954.445956][33190:33190] CHIP:DMG: + [1646101954.445983][33190:33190] CHIP:DMG: CommandData = + [1646101954.446016][33190:33190] CHIP:DMG: { + [1646101954.446048][33190:33190] CHIP:DMG: 0x0 = 0, + [1646101954.446080][33190:33190] CHIP:DMG: 0x1 = 120, + [1646101954.446115][33190:33190] CHIP:DMG: 0x2 = 5, + [1646101954.446146][33190:33190] CHIP:DMG: }, + [1646101954.446174][33190:33190] CHIP:DMG: }, + [1646101954.446206][33190:33190] CHIP:DMG: + [1646101954.446229][33190:33190] CHIP:DMG: ], + [1646101954.446259][33190:33190] CHIP:DMG: + [1646101954.446282][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646101954.446304][33190:33190] CHIP:DMG: }, + [1646101954.446361][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=o + [1646101954.446403][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0042 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_PRS_3_1.yaml b/src/app/tests/suites/certification/Test_TC_PRS_3_1.yaml new file mode 100644 index 00000000000000..029757f0f81ec9 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PRS_3_1.yaml @@ -0,0 +1,81 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.3.1. [TC-PRS-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Commission DUT to TH" + verification: | + + disabled: true + + - label: "DUT reads attribute value from TH." + verification: | + ./chip-tool pressuremeasurement read measured-value 1 1 + + Endpoint: 1 Cluster: 0x0000_0403 Attribute 0x0000_0000DataVersion: 3000764473 + [1646127393.744240][2874:2879] CHIP:TOO: MeasuredValue: 0 + disabled: true + + - label: "DUT reads attribute value from TH." + verification: | + ./chip-tool pressuremeasurement read min-measured-value 1 1 + + Endpoint: 1 Cluster: 0x0000_0403 Attribute 0x0000_0001DataVersion: 3000764473 + [1646127524.530004][2882:2888] CHIP:TOO: MinMeasuredValue: 0 + disabled: true + + - label: "DUT reads attribute value from TH." + verification: | + ./chip-tool pressuremeasurement read max-measured-value 1 1 + + Endpoint: 1 Cluster: 0x0000_0403 Attribute 0x0000_0002DataVersion: 3000764473 + [1646127595.013597][2891:2896] CHIP:TOO: MaxMeasuredValue: 0 + disabled: true + + - label: "DUT reads attribute value from TH." + verification: | + ./chip-tool pressuremeasurement read tolerance 1 1 + disabled: true + + - label: "DUT reads attribute value from TH." + verification: | + ./chip-tool pressuremeasurement read scaled-value 1 1 + disabled: true + + - label: "DUT reads attribute value from TH." + verification: | + ./chip-tool pressuremeasurement read min-scaled-value 1 1 + disabled: true + + - label: "DUT reads attribute value from TH." + verification: | + ./chip-tool pressuremeasurement read max-scaled-value 1 1 + disabled: true + + - label: "DUT reads attribute value from TH." + verification: | + ./chip-tool pressuremeasurement read scaled-tolerance 1 1 + disabled: true + + - label: "DUT reads attribute value from TH." + verification: | + ./chip-tool pressuremeasurement read scale 1 1 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_PSCFG_2_2.yaml b/src/app/tests/suites/certification/Test_TC_PSCFG_2_2.yaml new file mode 100644 index 00000000000000..359093913a798a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PSCFG_2_2.yaml @@ -0,0 +1,46 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 63.2.2. [TC-PSCFG-2.2] Primary functionality with server as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Commission DUT to TH" + verification: | + + disabled: true + + - label: "TH reads the Sources attribute from the DUT" + verification: | + ./chip-tool powersourceconfiguration read sources 1 0 + + [...] + [1646157640.271321][44339:44344] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002E Attribute 0x0000_0000DataVersion: 502821112 + [1646157640.271401][44339:44344] CHIP:TOO: Sources: 1 entries + [1646157640.271466][44339:44344] CHIP:TOO: [1]: 1 + disabled: true + + - label: "./chip-tool powersource read order 1 1" + verification: | + ./chip-tool powersource read order 1 1 + + [...] + [1646157759.345628][44355:44360] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_002F Attribute 0x0000_0001DataVersion: 1844928386 + [1646157759.345704][44355:44360] CHIP:TOO: Order: 0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_PSCFG_3_1.yaml b/src/app/tests/suites/certification/Test_TC_PSCFG_3_1.yaml index e806657108b09c..207fd7f9797f1a 100644 --- a/src/app/tests/suites/certification/Test_TC_PSCFG_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PSCFG_3_1.yaml @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 63.3.1. [TC-PSCFG-3.1] Attributes with client as DUT @@ -23,52 +24,51 @@ tests: - label: "DUT reads all supported mandatory attributes from TH once at a time in a manufacturer specific order" - verification: - "On TestHarnes (all-cluster-app) a received read of the Sources - attribute (id 0) looks like this: [1646159106.338144][33190:33190] - CHIP:EM: Received message of type 0x2 with protocolId (0, 1) and - MessageCounter:15430892 on exchange 55596r - [1646159106.338186][33190:33190] CHIP:EM: Handling via exchange: - 55596r, Delegate: 0xaaaace1730c8 [1646159106.338646][33190:33190] - CHIP:IM: Received Read request [1646159106.338735][33190:33190] - CHIP:DMG: ReadRequestMessage = [1646159106.338767][33190:33190] - CHIP:DMG: { [1646159106.338788][33190:33190] CHIP:DMG: - AttributePathIBs = [1646159106.338815][33190:33190] CHIP:DMG: [ - [1646159106.338838][33190:33190] CHIP:DMG: AttributePathIB = - [1646159106.338870][33190:33190] CHIP:DMG: { - [1646159106.338899][33190:33190] CHIP:DMG: Endpoint = 0x0, - [1646159106.338935][33190:33190] CHIP:DMG: Cluster = 0x2e, - [1646159106.338969][33190:33190] CHIP:DMG: Attribute = 0x0000_0000, - [1646159106.339001][33190:33190] CHIP:DMG: } + verification: | + On TestHarnes (all-cluster-app) a received read of the Sources attribute (id 0) looks like this: + + [1646159106.338144][33190:33190] CHIP:EM: Received message of type 0x2 with protocolId (0, 1) and MessageCounter:15430892 on exchange 55596r + [1646159106.338186][33190:33190] CHIP:EM: Handling via exchange: 55596r, Delegate: 0xaaaace1730c8 + [1646159106.338646][33190:33190] CHIP:IM: Received Read request + [1646159106.338735][33190:33190] CHIP:DMG: ReadRequestMessage = + [1646159106.338767][33190:33190] CHIP:DMG: { + [1646159106.338788][33190:33190] CHIP:DMG: AttributePathIBs = + [1646159106.338815][33190:33190] CHIP:DMG: [ + [1646159106.338838][33190:33190] CHIP:DMG: AttributePathIB = + [1646159106.338870][33190:33190] CHIP:DMG: { + [1646159106.338899][33190:33190] CHIP:DMG: Endpoint = 0x0, + [1646159106.338935][33190:33190] CHIP:DMG: Cluster = 0x2e, + [1646159106.338969][33190:33190] CHIP:DMG: Attribute = 0x0000_0000, + [1646159106.339001][33190:33190] CHIP:DMG: } [1646159106.339031][33190:33190] CHIP:DMG: - [1646159106.339058][33190:33190] CHIP:DMG: ], + [1646159106.339058][33190:33190] CHIP:DMG: ], [1646159106.339085][33190:33190] CHIP:DMG: - [1646159106.339111][33190:33190] CHIP:DMG: isFabricFiltered = false, - [1646159106.339138][33190:33190] CHIP:DMG: InteractionModelRevision = - 1 [1646159106.339160][33190:33190] CHIP:DMG: }, - [1646159106.339244][33190:33190] CHIP:DMG: IM RH moving to - [GeneratingReports] [1646159106.340134][33190:33190] CHIP:DMG: - Cluster 2e, Attribute 0 is dirty - [1646159106.340201][33190:33190] CHIP:DMG: Reading attribute: - Cluster=0x0000_002E Endpoint=0 AttributeId=0x0000_0000 (expanded=0) - [1646159106.340234][33190:33190] CHIP:DMG: AccessControl: checking f=1 - a=c s=0x000000000001B669 t= c=0x0000_002E e=0 p=v" + [1646159106.339111][33190:33190] CHIP:DMG: isFabricFiltered = false, + [1646159106.339138][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646159106.339160][33190:33190] CHIP:DMG: }, + [1646159106.339244][33190:33190] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646159106.340134][33190:33190] CHIP:DMG: Cluster 2e, Attribute 0 is dirty + [1646159106.340201][33190:33190] CHIP:DMG: Reading attribute: Cluster=0x0000_002E Endpoint=0 AttributeId=0x0000_0000 (expanded=0) + [1646159106.340234][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_002E e=0 p=v disabled: true - label: "DUT reads all supported optional attributes from TH once at a time in a manufacturer specific order" - verification: "see above" + verification: | + see above disabled: true - label: "DUT writes a suitable value to all supported mandatory attributes on the TH once at a time in a manufacturer specific order" - verification: "No writable attributes" + verification: | + No writable attributes disabled: true - label: "DUT writes a suitable value to all supported optional attributes on the TH once at a time in a manufacturer specific order" - verification: "No writable attributes" + verification: | + No writable attributes disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_PS_3_1.yaml b/src/app/tests/suites/certification/Test_TC_PS_3_1.yaml new file mode 100644 index 00000000000000..2f11fb6a717820 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PS_3_1.yaml @@ -0,0 +1,75 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 60.3.1. [TC-PS-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received read of Staus attribute (id 0) looks like this: + + [1646155382.977445][33190:33190] CHIP:EM: Received message of type 0x2 with protocolId (0, 1) and MessageCounter:685127 on exchange 16568r + [1646155382.977534][33190:33190] CHIP:EM: Handling via exchange: 16568r, Delegate: 0xaaaace1730c8 + [1646155382.978021][33190:33190] CHIP:IM: Received Read request + [1646155382.978109][33190:33190] CHIP:DMG: ReadRequestMessage = + [1646155382.978143][33190:33190] CHIP:DMG: { + [1646155382.978167][33190:33190] CHIP:DMG: AttributePathIBs = + [1646155382.978204][33190:33190] CHIP:DMG: [ + [1646155382.978309][33190:33190] CHIP:DMG: AttributePathIB = + [1646155382.978369][33190:33190] CHIP:DMG: { + [1646155382.978408][33190:33190] CHIP:DMG: Endpoint = 0x1, + [1646155382.978459][33190:33190] CHIP:DMG: Cluster = 0x2f, + [1646155382.978513][33190:33190] CHIP:DMG: Attribute = 0x0000_0000, + [1646155382.978545][33190:33190] CHIP:DMG: } + [1646155382.978767][33190:33190] CHIP:DMG: + [1646155382.978804][33190:33190] CHIP:DMG: ], + [1646155382.978836][33190:33190] CHIP:DMG: + [1646155382.978872][33190:33190] CHIP:DMG: isFabricFiltered = false, + [1646155382.978901][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646155382.978927][33190:33190] CHIP:DMG: }, + [1646155382.978998][33190:33190] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646155382.979658][33190:33190] CHIP:DMG: Cluster 2f, Attribute 0 is dirty + [1646155382.979729][33190:33190] CHIP:DMG: Reading attribute: Cluster=0x0000_002F Endpoint=1 AttributeId=0x0000_0000 (expanded=0) + [1646155382.979764][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_002F e=1 p=v + [1646010346.974150][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0003 e=1 p=v + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + see above + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + No writable attributes + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + No writable attributes + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RH_3_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_3_1.yaml new file mode 100644 index 00000000000000..a512ee075ed3df --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RH_3_1.yaml @@ -0,0 +1,74 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 9.3.1. [TC-RH-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received read of MeasuredValue (id 0) looks like this: + + [1646098758.912225][33190:33190] CHIP:EM: Received message of type 0x2 with protocolId (0, 1) and MessageCounter:15745149 on exchange 3055r + [1646098758.912345][33190:33190] CHIP:EM: Handling via exchange: 3055r, Delegate: 0xaaaace1730c8 + [1646098758.912702][33190:33190] CHIP:IM: Received Read request + [1646098758.912785][33190:33190] CHIP:DMG: ReadRequestMessage = + [1646098758.912821][33190:33190] CHIP:DMG: { + [1646098758.912847][33190:33190] CHIP:DMG: AttributePathIBs = + [1646098758.912879][33190:33190] CHIP:DMG: [ + [1646098758.912909][33190:33190] CHIP:DMG: AttributePathIB = + [1646098758.912949][33190:33190] CHIP:DMG: { + [1646098758.912985][33190:33190] CHIP:DMG: Endpoint = 0x1, + [1646098758.913021][33190:33190] CHIP:DMG: Cluster = 0x405, + [1646098758.913060][33190:33190] CHIP:DMG: Attribute = 0x0000_0000, + [1646098758.913099][33190:33190] CHIP:DMG: } + [1646098758.913134][33190:33190] CHIP:DMG: + [1646098758.913167][33190:33190] CHIP:DMG: ], + [1646098758.913201][33190:33190] CHIP:DMG: + [1646098758.913233][33190:33190] CHIP:DMG: isFabricFiltered = false, + [1646098758.913264][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646098758.913292][33190:33190] CHIP:DMG: }, + [1646098758.913367][33190:33190] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646098758.913768][33190:33190] CHIP:DMG: Cluster 405, Attribute 0 is dirty + [1646098758.913817][33190:33190] CHIP:DMG: Reading attribute: Cluster=0x0000_0405 Endpoint=1 AttributeId=0x0000_0000 (expanded=0) + [1646098758.913854][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0405 e=1 p=v + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + see above + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + no writable attributes + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + no writable attributes + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml new file mode 100644 index 00000000000000..80cb4c9b27139c --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml @@ -0,0 +1,117 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 13.4.1. [TC-SC-4.1] Commissionable Node Discovery - Commissionee Case + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT is put in Commissioning Mode using Open Basic Commissioning + Window command and starts advertising Commissionable Node Discovery + service using DNS-SD" + verification: | + ./chip-tool administratorcommissioning open-basic-commissioning-window 10 1 0 --timedInteractionTimeoutMs 1000 + + + + The delay timer is given 10 as an example , use whatever works for your product + disabled: true + + - label: "Check DNS-SD subtypes used by DUT" + verification: | + ~$ avahi-browse -rt _matterc._udp + + = eth0 IPv6 F95E077ABDCC2B36 _matterc._udp local + hostname = [422F10CDC290A406.local] + address = [fd11:28::8a29:a7d0:3d31:eab9] + port = [5540] + txt = ["PI=" "PH=36" "RI=00007C5F6E176CD40F68685D100A1CF8A98B" "CM=1" "D=3840" "T=0" "CRA=300" "CRI=5000" "VP=9050+20044"] + + Service Domain 422F10CDC290A406.local + verify CM flag is 1 + + to look for subtypes, on the raspi run $ avahi-browse -p _services._dns-sd._udp | grep _matterc + + +;eth0;IPv6;_CM;_sub._matterc._udp;local + +;eth0;IPv6;_L3840;_sub._matterc._udp;local + +;eth0;IPv6;_S0;_sub._matterc._udp;local + +;eth0;IPv6;_V9050;_sub._matterc._udp;local + disabled: true + + - label: + "DUT is rebooted, then put in Commissioning Mode using Open Basic + Commissioning Window command, starting advertising Commissionable Node + Discovery service using DNS-SD" + verification: | + Reboot the device + if the device proivisioning state persists, run the chip-tool cmd in Step2 + disabled: true + + - label: "Check DNS-SD subtypes used by DUT" + verification: | + Verify same step as Step3, + disabled: true + + - label: "Commission DUT with TH" + verification: | + + disabled: true + + - label: + "DUT is instructed to enter in commissioning mode using Open + Commissioning Window command" + verification: | + run chip tool command to open + ./chip-tool pairing open-commissioning-window 1 1 20 2000 3840 + disabled: true + + - label: "Check DNS-SD subtypes used by DUT" + verification: | + Same verification steps as Step 3, Except Verify CM flag to be 2 + + + $avahi-browse -rt _matterc._udp + + eth0 IPv6 923F5363843F26A0 _matterc._udp local + + eth0 IPv6 8CDE894B98DF7DEF _matterc._udp local + = eth0 IPv6 8CDE894B98DF7DEF _matterc._udp local + hostname = [E45F0149AE290000.local] + address = [fe80::e65f:1ff:fe49:ae29] + port = [5540] + txt = ["PI=" "PH=33" "CM=1" "D=3840" "T=1" "CRA=300" "CRI=5000" "VP=65521+32769"] + = eth0 IPv6 923F5363843F26A0 _matterc._udp local + hostname = [E45F0149AE290000.local] + address = [fe80::e65f:1ff:fe49:ae29] + port = [5540] + txt = ["PI=" "PH=36" "CM=2" "D=3840" "T=1" "CRA=300" "CRI=5000" "VP=65521+32769"] + disabled: true + + - label: "Wait for OCW timeout to expire" + verification: | + Wait until timeout to expire + disabled: true + + - label: "If (PICS_EXTENDED_DISCOVERY) enable Extended Discovery" + verification: | + If the device supports Discovery for extended period of time, Device should continue to advertise that duration + disabled: true + + - label: "If (PICS_EXTENDED_DISCOVERY) check DNS-SD subtypes used by DUT" + verification: | + same as step 8 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml new file mode 100644 index 00000000000000..a7ce4dfec95dc6 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml @@ -0,0 +1,38 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 13.4.10. [TC-SC-4.10] Operational Discovery - Sleepy Node + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "DUT is instructed to advertise its service" + verification: | + + disabled: true + + - label: "TH scans for DNS-SD advertising" + verification: | + avahi-browse -rt _matter._tcp + + veth5329b41 IPv6 68F6D747B9CD3DCD-0000000000000001 _matter._tcp local + = veth5329b41 IPv6 68F6D747B9CD3DCD-0000000000000001 _matter._tcp local + hostname = [EEAABADABAD0DDCA.local] + address = [fe80::acec:27ff:fe14:515d] + port = [5540] + txt = ["T=1" "CRA=300" "CRI=5000"] + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml new file mode 100644 index 00000000000000..3049b334336fae --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml @@ -0,0 +1,59 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 13.4.3. [TC-SC-4.3] Operational Discovery - Node + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH is instructed to start advertising a service using DNS-SD" + verification: | + + disabled: true + + - label: "Scan for DNS-SD advertising" + verification: | + avahi-browse -rt _matter._tcp + + eth0 IPv6 C6C15E13BDC03C7B-0000000000000001 _matter._tcp local + = eth0 IPv6 C6C15E13BDC03C7B-0000000000000001 _matter._tcp local + hostname = [E45F010EBE440000.local] + address = [fe80::e65f:1ff:fe0e:be44] + port = [5540] + txt = ["T=1" "CRA=300" "CRI=5000"] + disabled: true + + - label: + "TH is instructed to start advertising a service using DNS-SD and + using only the TXT records defined in section of the matter spec" + verification: | + avahi-browse _matter._tcp -r + + eth0 IPv6 6E1DCC08ABCCD0E5 _matterc._udp local + = eth0 IPv6 6E1DCC08ABCCD0E5 _matterc._udp local + hostname = [E45F010EBE440000.local] + address = [fe80::e65f:1ff:fe0e:be44] + port = [5540] + txt = ["PI=" "PH=33" "CM=1" "D=0" "T=1" "CRA=300" "CRI=5000" "VP=65521+32769"] + disabled: true + + - label: + "TH is instructed to start advertising a service using DNS-SD with + non-standard TXT record keys" + verification: | + avahi-publish-service --subtype=_S3._sub._matterc._udp --subtype=_L840._sub._matterc._udp DD200C20D25AE5F7 --subtype=_CM._sub._matterc._udp + _matterc._udp 11111 D=840 CM=2 INVALID_TEST=40 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml new file mode 100644 index 00000000000000..719e2068721408 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml @@ -0,0 +1,74 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.4.4. [TC-SC-4.4] Operational Discovery - Controller [DUT - Controller] + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "TH is instructed to start advertising a service using DNS-SD" + verification: | + + disabled: true + + - label: "Scan for DNS-SD advertising" + verification: | + avahi-browse -rt _matter._tcp + + eth0 IPv6 C6C15E13BDC03C7B-0000000000000001 _matter._tcp local + = eth0 IPv6 C6C15E13BDC03C7B-0000000000000001 _matter._tcp local + hostname = [E45F010EBE440000.local] + address = [fe80::e65f:1ff:fe0e:be44] + port = [5540] + txt = ["T=1" "CRA=300" "CRI=5000"] + disabled: true + + - label: "DUT is instructed to advertise its service" + verification: | + + disabled: true + + - label: "Scan for DNS-SD advertising" + verification: | + avahi-browse -rt _matter._tcp + + eth0 IPv6 C6C15E13BDC03C7B-0000000000000001 _matter._tcp local + = eth0 IPv6 C6C15E13BDC03C7B-0000000000000001 _matter._tcp local + hostname = [E45F010EBE440000.local] + address = [fe80::e65f:1ff:fe0e:be44] + port = [5540] + txt = ["T=1" "CRA=300" "CRI=5000"] + disabled: true + + - label: "DUT is instructed to query the TH for its servicesm" + verification: | + + disabled: true + + - label: "DUT is instructed to query the TH for its services again" + verification: | + + disabled: true + + - label: "Change its IP address by any means" + verification: | + + disabled: true + + - label: "DUT is instructed to query the TH for its services" + verification: | + + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml index 22b8546d6f2b06..5918be9261ad5b 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 13.4.6. [TC-SC-4.6] Commissioner Discovery - Commissioner [DUT - @@ -25,7 +26,48 @@ tests: - label: "DUT is instructed to start advertising its presence as a commissioner in the network" + verification: | + disabled: true - label: "Check DNS-SD subtypes used by DUT" + verification: | + ~$ avahi-browse -rt _matterc._udp + + =+ eth0 IPv6 6F14191BBD6759A2 _matterc._udp local + + eth0 IPv6 24BE6DC784D2B8F0 _matterc._udp local + + eth0 IPv6 E3E885474ABBD03C _matterc._udp local + + eth0 IPv6 C3184821E44C8228 _matterc._udp local + = eth0 IPv6 6F14191BBD6759A2 _matterc._udp local + hostname = [E45F010EBE440000.local] + address = [fe80::e65f:1ff:fe0e:be44] + port = [5540] + txt = ["PI=" "PH=33" "CM=1" "D=0" "T=1" "CRA=300" "CRI=5000" "VP=65521+32769"] + = eth0 IPv6 24BE6DC784D2B8F0 _matterc._udp local + hostname = [E45F010EBE440000.local] + address = [fe80::e65f:1ff:fe0e:be44] + port = [5540] + txt = ["PI=" "PH=33" "CM=1" "D=0" "T=1" "CRA=300" "CRI=5000" "VP=65521+32769"] + = eth0 IPv6 E3E885474ABBD03C _matterc._udp local + hostname = [E45F010EBE440000.local] + address = [fe80::e65f:1ff:fe0e:be44] + port = [5540] + txt = ["PI=" "PH=33" "CM=1" "D=0" "T=1" "CRA=300" "CRI=5000" "VP=65521+32769"] + = eth0 IPv6 C3184821E44C8228 _matterc._udp local + hostname = [E45F010EBE440000.local] + address = [fe80::e65f:1ff:fe0e:be44] + port = [5540] + txt = ["PI=" "PH=33" "CM=1" "D=0" "T=1" "CRA=300" "CRI=5000" "VP=65521+32769"] + + + Service Domain 422F10CDC290A406.local + verify CM flag is 1 + + to look for subtypes, on the raspi run $ avahi-browse -p _services._dns-sd._udp + | grep _matterc + + +;eth0;IPv6;_CM;_sub._matterc._udp;local + +;eth0;IPv6;_L3840;_sub._matterc._udp;local + +;eth0;IPv6;_S0;_sub._matterc._udp;local + +;eth0;IPv6;_V9050;_sub._matterc._udp;local disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_7.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_7.yaml index 6fb056c1a8fa24..b2ee1c2c7c4f36 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_7.yaml @@ -11,8 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 13.4.7. [TC-SC-4.7] Commissioner Discovery - Commissionee +name: 3.4.7. [TC-SC-4.7] Commissioner Discovery - Commissionee config: nodeId: 0x12344321 @@ -23,15 +24,49 @@ tests: - label: "TH is instructed to start advertising its presence as a commissioner in the network" + verification: | + Launch Example TV app disabled: true - label: "Scan for DNS-SD commissioner advertisements from TH" + verification: | + if DUT supports discovering UDC, DUT should be able to scan the TV-app + ~$ avahi-browse -rt _matterc._udp + + =+ wlp3s0 IPv4 DD200C20D25AE5F7 _matterd._udp local + + enp2s0 IPv6 DD200C20D25AE5F7 _matterd._udp local + + enp2s0 IPv4 DD200C20D25AE5F7 _matterd._udp local + = wlp3s0 IPv4 DD200C20D25AE5F7 _matterd._udp local + hostname = [matter-7.local] + address = [192.168.1.105] + port = [33333] + txt = ["DN=Living Room TV" "DT=35" "VP=123+456"] + = enp2s0 IPv6 DD200C20D25AE5F7 _matterd._udp local + hostname = [matter-7.local] + address = [2002:c0a8:40c:10:e65f:1ff:fe0f:2877] + port = [33333] + txt = ["DN=Living Room TV" "DT=35" "VP=123+456"] + = enp2s0 IPv4 DD200C20D25AE5F7 _matterd._udp local + hostname = [matter-7.local] + address = [192.168.1.105] + port = [33333] + txt = ["DN=Living Room TV" "DT=35" "VP=123+456"] + + enp2s0 IPv6 20B078AC19BDBCF9 _matterd._udp local + = enp2s0 IPv6 20B078AC19BDBCF9 _matterd._udp local + hostname = [E45F010F28770000.local] + address = [fe80::e65f:1ff:fe0f:2877] + port = [5550] + txt = ["T=1" "CRA=300" "CRI=5000" "DN=Test TV" "DT=35" "VP=65521+32769"] disabled: true - label: "By any means, TH adds an unknown key/value pair in the advertised data(e.g. AB=12345)" + verification: | + Not in Scope of TE8 disabled: true - label: "Scan for DNS-SD commissioner advertisements from TH" + verification: | + Not in Scope of TE8 disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_8.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_8.yaml index b348bbeece3832..30617ce1b0c30e 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_8.yaml @@ -11,10 +11,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - "13.4.8. [TC-SC-4.8] Compressed Fabric ID remains the same for Nodes - commissioned to the same fabric [DUT Commissionee, TH2 Commissionee]" + 3.4.8. [TC-SC-4.8] Compressed Fabric ID remains the same for Nodes + commissioned to the same fabric [DUT Commissionee, TH2 Commissionee] config: nodeId: 0x12344321 @@ -23,28 +24,46 @@ config: tests: - label: "TH1 creates a Fabric" + verification: | + disabled: true - label: "Commission DUT to TH1s Fabric" + verification: | + ./chip-tool pairing ble-wifi 1 zigbeehome mater123 20202021 3840 (./chip-tool pairing ble-wifi {NODE ID} {SSID} {PASSWORD} {SETUPPINCODE} {DISCRIMINATOR}) disabled: true - label: "Commission TH2 to TH1s Fabric" + verification: | + disabled: true - label: "Scan for DNS-SD advertising from DUT" + verification: | + ./chip-tool operationalcredentials read fabrics 1 1 disabled: true - label: "Scan for DNS-SD advertising from TH2" + verification: | + ./chip-tool operationalcredentials read fabrics 2 1 disabled: true - label: "Remove DUT from TH1s fabric using Remove Fabric method" + verification: | + ./chip-tool operationalcredentials remove-fabrics 1 0 disabled: true - label: "Commission DUT to TH1s Fabric again" + verification: | + ./chip-tool pairing ble-wifi 1 zigbeehome mater123 20202021 3840 (./chip-tool pairing ble-wifi {NODE ID} {SSID} {PASSWORD} {SETUPPINCODE} {DISCRIMINATOR}) disabled: true - label: "Scan for DNS-SD advertising from DUT" + verification: | + verify fabric ID value is exactly same as what we got in step 4 disabled: true - label: "Repeat step 7 to 9 for DUT using Factory Reset Method" + verification: | + DUT vendor has to provide a way to put the device in factory reset disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SWTCH_1_1.yaml b/src/app/tests/suites/certification/Test_TC_SWTCH_1_1.yaml new file mode 100644 index 00000000000000..6ee4bc45edbff6 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SWTCH_1_1.yaml @@ -0,0 +1,60 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 74.1.1. [TC-SWTCH-1.1] Global attributes with server as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Commission DUT to TH (can be skipped if done in a preceding test)" + verification: | + + disabled: true + + - label: "Read FeatureMap (global attribute 65532)" + verification: | + ./chip-tool switch read feature-map 1 1 + + [1646208136.241983][2390:2395] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_FFFCDataVersion: 1206711661 + [1646208136.242043][2390:2395] CHIP:TOO: FeatureMap: 0 + disabled: true + + - label: "Check values of flags in this FeatureMap" + verification: | + no Matter messages, but TH internal checking + disabled: true + + - label: "Check values of flags in this FeatureMap" + verification: | + no Matter messages, but TH internal checking + disabled: true + + - label: "Check values of flags in this FeatureMap" + verification: | + no Matter messages, but TH internal checking + disabled: true + + - label: "Check values of flags in this FeatureMap" + verification: | + no Matter messages, but TH internal checking + disabled: true + + - label: "Check values of flags in this FeatureMap" + verification: | + no Matter messages, but TH internal checking + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SWTCH_3_1.yaml b/src/app/tests/suites/certification/Test_TC_SWTCH_3_1.yaml new file mode 100644 index 00000000000000..5e614086f71d78 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SWTCH_3_1.yaml @@ -0,0 +1,103 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 74.3.1. [TC-SWTCH-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + ./chip-tool switch read number-of-positions 1 1 + [1646209806.545525][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646209806.545648][2190:2190] CHIP:DMG: { + [1646209806.545672][2190:2190] CHIP:DMG: AttributePathIBs = + [1646209806.545702][2190:2190] CHIP:DMG: [ + [1646209806.545746][2190:2190] CHIP:DMG: AttributePathIB = + [1646209806.545783][2190:2190] CHIP:DMG: { + [1646209806.545815][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646209806.545852][2190:2190] CHIP:DMG: Cluster = 0x3b, + [1646209806.545886][2190:2190] CHIP:DMG: Attribute = 0x0000_0000, + [1646209806.545946][2190:2190] CHIP:DMG: } + [1646209806.545980][2190:2190] CHIP:DMG: + [1646209806.546025][2190:2190] CHIP:DMG: ], + [1646209806.546070][2190:2190] CHIP:DMG: + [1646209806.546117][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646209806.546156][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646209806.546180][2190:2190] CHIP:DMG: }, + + ./chip-tool switch read current-position 1 1 + [1646209852.886417][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646209852.886459][2190:2190] CHIP:DMG: { + [1646209852.886489][2190:2190] CHIP:DMG: AttributePathIBs = + [1646209852.886521][2190:2190] CHIP:DMG: [ + [1646209852.886551][2190:2190] CHIP:DMG: AttributePathIB = + [1646209852.886589][2190:2190] CHIP:DMG: { + [1646209852.886624][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646209852.886660][2190:2190] CHIP:DMG: Cluster = 0x3b, + [1646209852.886703][2190:2190] CHIP:DMG: Attribute = 0x0000_0001, + [1646209852.886741][2190:2190] CHIP:DMG: } + [1646209852.886776][2190:2190] CHIP:DMG: + [1646209852.886807][2190:2190] CHIP:DMG: ], + [1646209852.886841][2190:2190] CHIP:DMG: + [1646209852.886870][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646209852.886900][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646209852.886927][2190:2190] CHIP:DMG: }, + [1646209852.887004][2190:2190] CHIP:DMG: IM RH moving to [GeneratingReports] + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + ./chip-tool switch read multi-press-max 1 1 + + [1646209889.768919][2190:2190] CHIP:DMG: ReadRequestMessage = + [1646209889.768984][2190:2190] CHIP:DMG: { + [1646209889.769012][2190:2190] CHIP:DMG: AttributePathIBs = + [1646209889.769049][2190:2190] CHIP:DMG: [ + [1646209889.769076][2190:2190] CHIP:DMG: AttributePathIB = + [1646209889.769107][2190:2190] CHIP:DMG: { + [1646209889.769154][2190:2190] CHIP:DMG: Endpoint = 0x1, + [1646209889.769205][2190:2190] CHIP:DMG: Cluster = 0x3b, + [1646209889.769254][2190:2190] CHIP:DMG: Attribute = 0x0000_0002, + [1646209889.769292][2190:2190] CHIP:DMG: } + [1646209889.769325][2190:2190] CHIP:DMG: + [1646209889.769367][2190:2190] CHIP:DMG: ], + [1646209889.769401][2190:2190] CHIP:DMG: + [1646209889.769432][2190:2190] CHIP:DMG: isFabricFiltered = false, + [1646209889.769461][2190:2190] CHIP:DMG: InteractionModelRevision = 1 + [1646209889.769499][2190:2190] CHIP:DMG: }, + [1646209889.769572][2190:2190] CHIP:DMG: IM RH moving to [GeneratingReports] + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + no writable attributes + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + no writable attributes + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_TM_3_1.yaml new file mode 100644 index 00000000000000..3dfdd6426a7270 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TM_3_1.yaml @@ -0,0 +1,80 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 6.3.1. [TC-TM-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + chip-tool temperaturemeasurement read measured-value 12345 1 + + verify that you see something like this: + + [1643288740.653361][12907:12912] CHIP:DMG: } + [1643288740.653441][12907:12912] CHIP:DMG: + [1643288740.653497][12907:12912] CHIP:DMG: Data = 2420, + [1643288740.653546][12907:12912] CHIP:DMG: }, + chip-tool temperaturemeasurement read min-measured-value 12345 1 + + verify that you see something like this: + + [1643288902.528399][12918:12923] CHIP:DMG: } + [1643288902.528491][12918:12923] CHIP:DMG: + [1643288902.528577][12918:12923] CHIP:DMG: Data = -4000, + [1643288902.528663][12918:12923] CHIP:DMG: }, + chip-tool temperaturemeasurement read max-measured-value 12345 1 + + verify that you see something like this: + + [1643289012.569725][12931:12936] CHIP:DMG: } + [1643289012.569805][12931:12936] CHIP:DMG: + [1643289012.569883][12931:12936] CHIP:DMG: Data = 8500, + [1643289012.569957][12931:12936] CHIP:DMG: }, + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + chip-tool temperaturemeasurement read max-measured-value 12345 1 + + verify that you see something like this: + + [1643289012.569725][12931:12936] CHIP:DMG: } + [1643289012.569805][12931:12936] CHIP:DMG: + [1643289012.569883][12931:12936] CHIP:DMG: Data = 120, + [1643289012.569957][12931:12936] CHIP:DMG: }, + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + no writable attributes + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + no writable attributes + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_3_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_3_1.yaml new file mode 100644 index 00000000000000..13cf5eda0bb786 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_3_1.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 42.3.1. [TC-TSTAT-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received read of local-temperature (id 0) looks like this: + + [1646062486.687816][33190:33190] CHIP:IM: Received Read request + [1646062486.687873][33190:33190] CHIP:DMG: ReadRequestMessage = + [1646062486.687902][33190:33190] CHIP:DMG: { + [1646062486.687924][33190:33190] CHIP:DMG: AttributePathIBs = + [1646062486.687951][33190:33190] CHIP:DMG: [ + [1646062486.687975][33190:33190] CHIP:DMG: AttributePathIB = + [1646062486.688010][33190:33190] CHIP:DMG: { + [1646062486.688040][33190:33190] CHIP:DMG: Endpoint = 0x1, + [1646062486.688073][33190:33190] CHIP:DMG: Cluster = 0x201, + [1646062486.688107][33190:33190] CHIP:DMG: Attribute = 0x0000_0000, + [1646062486.688136][33190:33190] CHIP:DMG: } + [1646062486.688165][33190:33190] CHIP:DMG: + [1646062486.688192][33190:33190] CHIP:DMG: ], + [1646062486.688219][33190:33190] CHIP:DMG: + [1646062486.688245][33190:33190] CHIP:DMG: isFabricFiltered = false, + [1646062486.688269][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646062486.688291][33190:33190] CHIP:DMG: }, + [1646062486.688354][33190:33190] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646062486.688608][33190:33190] CHIP:DMG: Cluster 201, Attribute 0 is dirty + [1646062486.688644][33190:33190] CHIP:DMG: Reading attribute: Cluster=0x0000_0201 Endpoint=1 AttributeId=0x0000_0000 (expanded=0) + [1646062486.688675][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0201 e=1 p=v + [1646062486.688742][33190:33190] CHIP:DMG: Sending report (payload has 37 bytes)... + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + see above + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received write request looks like this (f.e local-temperature-calibration (id 16) value 10): + + [1646062753.451418][33190:33190] CHIP:IM: Received Write request + [1646062753.451455][33190:33190] CHIP:DMG: IM WH moving to [Initialized] + [1646062753.451518][33190:33190] CHIP:DMG: WriteRequestMessage = + [1646062753.451549][33190:33190] CHIP:DMG: { + [1646062753.451578][33190:33190] CHIP:DMG: timedRequest = false, + [1646062753.451614][33190:33190] CHIP:DMG: AttributeDataIBs = + [1646062753.451652][33190:33190] CHIP:DMG: [ + [1646062753.451681][33190:33190] CHIP:DMG: AttributeDataIB = + [1646062753.451718][33190:33190] CHIP:DMG: { + [1646062753.451785][33190:33190] CHIP:DMG: AttributePathIB = + [1646062753.451831][33190:33190] CHIP:DMG: { + [1646062753.451875][33190:33190] CHIP:DMG: Endpoint = 0x1, + [1646062753.451920][33190:33190] CHIP:DMG: Cluster = 0x201, + [1646062753.451964][33190:33190] CHIP:DMG: Attribute = 0x0000_0010, + [1646062753.452351][33190:33190] CHIP:DMG: } + [1646062753.452402][33190:33190] CHIP:DMG: + [1646062753.452445][33190:33190] CHIP:DMG: Data = 10, + [1646062753.452482][33190:33190] CHIP:DMG: }, + [1646062753.452520][33190:33190] CHIP:DMG: + [1646062753.452549][33190:33190] CHIP:DMG: ], + [1646062753.452586][33190:33190] CHIP:DMG: + [1646062753.452616][33190:33190] CHIP:DMG: moreChunkedMessages = false, + [1646062753.452648][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646062753.452678][33190:33190] CHIP:DMG: }, + [1646062753.452791][33190:33190] CHIP:DMG: IM WH moving to [AddStatus] + [1646062753.452844][33190:33190] CHIP:EM: Piggybacking Ack for MessageCounter:8013357 on exchange: 61433r + [1646062753.452923][33190:33190] CHIP:IN: Prepared secure message 0xaaaace176940 to 0x000000000001B669 (1) of type 0x7 and protocolId (0, 1) on exchange 61433r with MessageCounter:10838634. + [1646062753.452971][33190:33190] CHIP:IN: Sending encrypted msg 0xaaaace176940 with MessageCounter:10838634 to 0x000000000001B669 (1) at monotonic time: 256943237 msec + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + see above + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_3_2.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_3_2.yaml new file mode 100644 index 00000000000000..6e8032fb73e4ae --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_3_2.yaml @@ -0,0 +1,136 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 42.3.2. [TC-TSAT-3.2] Functionality with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT increases the temperature by sending a SetpointRaiseLower command + to the Test Harness, with a valid Mode argument (0, 1 or 2) and a + reasonable positive value that is supported by the DUT." + verification: | + On TestHarnes (all-cluster-app) a received setpoint-raise-lower command with f.e. mode 0 and an amount of 10 looks like this: + + + [1646064221.719107][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:4540287 on exchange 31012r + [1646064221.719148][33190:33190] CHIP:EM: Handling via exchange: 31012r, Delegate: 0xaaaace1730c8 + [1646064221.719450][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646064221.719491][33190:33190] CHIP:DMG: { + [1646064221.719513][33190:33190] CHIP:DMG: suppressResponse = false, + [1646064221.719539][33190:33190] CHIP:DMG: timedRequest = false, + [1646064221.719564][33190:33190] CHIP:DMG: InvokeRequests = + [1646064221.719595][33190:33190] CHIP:DMG: [ + [1646064221.719619][33190:33190] CHIP:DMG: CommandDataIB = + [1646064221.719650][33190:33190] CHIP:DMG: { + [1646064221.719677][33190:33190] CHIP:DMG: CommandPathIB = + [1646064221.719710][33190:33190] CHIP:DMG: { + [1646064221.719741][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646064221.719773][33190:33190] CHIP:DMG: ClusterId = 0x201, + [1646064221.719802][33190:33190] CHIP:DMG: CommandId = 0x0, + [1646064221.719832][33190:33190] CHIP:DMG: }, + [1646064221.719864][33190:33190] CHIP:DMG: + [1646064221.719891][33190:33190] CHIP:DMG: CommandData = + [1646064221.719922][33190:33190] CHIP:DMG: { + [1646064221.719955][33190:33190] CHIP:DMG: 0x0 = 0, + [1646064221.719992][33190:33190] CHIP:DMG: 0x1 = 10, + [1646064221.720023][33190:33190] CHIP:DMG: }, + [1646064221.720051][33190:33190] CHIP:DMG: }, + [1646064221.720082][33190:33190] CHIP:DMG: + [1646064221.720107][33190:33190] CHIP:DMG: ], + [1646064221.720137][33190:33190] CHIP:DMG: + [1646064221.720161][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646064221.720184][33190:33190] CHIP:DMG: }, + [1646064221.720243][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0201 e=1 p=o + [1646064221.720285][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0000 + disabled: true + + - label: + "DUT loweres the temperature by sending a SetpointRaiseLower command + to the Test Harness, with a valid Mode argument (0, 1 or 2) and a + reasonable negative value that is supported by the DUT." + verification: | + On TestHarnes (all-cluster-app) a received setpoint-raise-lower command with f.e. mode 0 and an amount of 10 looks like this: + + + [1646064525.675075][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:16717414 on exchange 9698r + [1646064525.675116][33190:33190] CHIP:EM: Handling via exchange: 9698r, Delegate: 0xaaaace1730c8 + [1646064525.675402][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646064525.675444][33190:33190] CHIP:DMG: { + [1646064525.675471][33190:33190] CHIP:DMG: suppressResponse = false, + [1646064525.675497][33190:33190] CHIP:DMG: timedRequest = false, + [1646064525.675521][33190:33190] CHIP:DMG: InvokeRequests = + [1646064525.675552][33190:33190] CHIP:DMG: [ + [1646064525.675576][33190:33190] CHIP:DMG: CommandDataIB = + [1646064525.675605][33190:33190] CHIP:DMG: { + [1646064525.675630][33190:33190] CHIP:DMG: CommandPathIB = + [1646064525.675660][33190:33190] CHIP:DMG: { + [1646064525.675692][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646064525.675724][33190:33190] CHIP:DMG: ClusterId = 0x201, + [1646064525.675822][33190:33190] CHIP:DMG: CommandId = 0x0, + [1646064525.675852][33190:33190] CHIP:DMG: }, + [1646064525.675884][33190:33190] CHIP:DMG: + [1646064525.675911][33190:33190] CHIP:DMG: CommandData = + [1646064525.675941][33190:33190] CHIP:DMG: { + [1646064525.675971][33190:33190] CHIP:DMG: 0x0 = 0, + [1646064525.676005][33190:33190] CHIP:DMG: 0x1 = -10, + [1646064525.676033][33190:33190] CHIP:DMG: }, + [1646064525.676060][33190:33190] CHIP:DMG: }, + [1646064525.676091][33190:33190] CHIP:DMG: + [1646064525.676114][33190:33190] CHIP:DMG: ], + [1646064525.676143][33190:33190] CHIP:DMG: + [1646064525.676167][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646064525.676189][33190:33190] CHIP:DMG: }, + [1646064525.676247][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0201 e=1 p=o + [1646064525.676288][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0000 + disabled: true + + - label: "DUT sends a GetRelayStatusLog command to the Test Harness." + verification: | + On TestHarnes (all-cluster-app) a received GetRelayStatusLog command looks like this: + + [1646064788.912273][33190:33190] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:15642355 on exchange 58465r + [1646064788.912319][33190:33190] CHIP:EM: Handling via exchange: 58465r, Delegate: 0xaaaace1730c8 + [1646064788.912604][33190:33190] CHIP:DMG: InvokeRequestMessage = + [1646064788.912647][33190:33190] CHIP:DMG: { + [1646064788.912673][33190:33190] CHIP:DMG: suppressResponse = false, + [1646064788.912704][33190:33190] CHIP:DMG: timedRequest = false, + [1646064788.912732][33190:33190] CHIP:DMG: InvokeRequests = + [1646064788.912767][33190:33190] CHIP:DMG: [ + [1646064788.912794][33190:33190] CHIP:DMG: CommandDataIB = + [1646064788.912833][33190:33190] CHIP:DMG: { + [1646064788.912861][33190:33190] CHIP:DMG: CommandPathIB = + [1646064788.912896][33190:33190] CHIP:DMG: { + [1646064788.912936][33190:33190] CHIP:DMG: EndpointId = 0x1, + [1646064788.912977][33190:33190] CHIP:DMG: ClusterId = 0x201, + [1646064788.913010][33190:33190] CHIP:DMG: CommandId = 0x4, + [1646064788.913048][33190:33190] CHIP:DMG: }, + [1646064788.913085][33190:33190] CHIP:DMG: + [1646064788.913116][33190:33190] CHIP:DMG: CommandData = + [1646064788.913151][33190:33190] CHIP:DMG: { + [1646064788.913186][33190:33190] CHIP:DMG: }, + [1646064788.913218][33190:33190] CHIP:DMG: }, + [1646064788.913253][33190:33190] CHIP:DMG: + [1646064788.913280][33190:33190] CHIP:DMG: ], + [1646064788.913313][33190:33190] CHIP:DMG: + [1646064788.913340][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646064788.913366][33190:33190] CHIP:DMG: }, + [1646064788.913428][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0201 e=1 p=o + [1646064788.913476][33190:33190] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0004 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TSUIC_3_1.yaml b/src/app/tests/suites/certification/Test_TC_TSUIC_3_1.yaml new file mode 100644 index 00000000000000..136dc9e5e6d5f4 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TSUIC_3_1.yaml @@ -0,0 +1,103 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 12.3.1. [TC-TSUIC-3.1] Attributes with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: + "DUT reads all supported mandatory attributes from TH once at a time + in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received read of the TemperatureDisplayMode attribute (id 0) looks like this: + + [1646160935.509019][33190:33190] CHIP:EM: Received message of type 0x2 with protocolId (0, 1) and MessageCounter:16016787 on exchange 34750r + [1646160935.509071][33190:33190] CHIP:EM: Handling via exchange: 34750r, Delegate: 0xaaaace1730c8 + [1646160935.509632][33190:33190] CHIP:IM: Received Read request + [1646160935.509731][33190:33190] CHIP:DMG: ReadRequestMessage = + [1646160935.509771][33190:33190] CHIP:DMG: { + [1646160935.509800][33190:33190] CHIP:DMG: AttributePathIBs = + [1646160935.509834][33190:33190] CHIP:DMG: [ + [1646160935.509868][33190:33190] CHIP:DMG: AttributePathIB = + [1646160935.509912][33190:33190] CHIP:DMG: { + [1646160935.509951][33190:33190] CHIP:DMG: Endpoint = 0x1, + [1646160935.509995][33190:33190] CHIP:DMG: Cluster = 0x204, + [1646160935.510038][33190:33190] CHIP:DMG: Attribute = 0x0000_0000, + [1646160935.510077][33190:33190] CHIP:DMG: } + [1646160935.510115][33190:33190] CHIP:DMG: + [1646160935.510148][33190:33190] CHIP:DMG: ], + [1646160935.510185][33190:33190] CHIP:DMG: + [1646160935.510221][33190:33190] CHIP:DMG: isFabricFiltered = false, + [1646160935.510255][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646160935.510285][33190:33190] CHIP:DMG: }, + [1646160935.510371][33190:33190] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646160935.510982][33190:33190] CHIP:DMG: Cluster 204, Attribute 0 is dirty + [1646160935.511047][33190:33190] CHIP:DMG: Reading attribute: Cluster=0x0000_0204 Endpoint=1 AttributeId=0x0000_0000 (expanded=0) + [1646160935.511083][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0204 e=1 p=v + disabled: true + + - label: + "DUT reads all supported optional attributes from TH once at a time in + a manufacturer specific order" + verification: | + see above + disabled: true + + - label: + "DUT writes a suitable value to all supported mandatory attributes on + the TH once at a time in a manufacturer specific order" + verification: | + On TestHarnes (all-cluster-app) a received write request looks like this (f.e TemperatureDisplayMode (id 0) value 1): + + [1646160997.869977][33190:33190] CHIP:EM: Received message of type 0x6 with protocolId (0, 1) and MessageCounter:372309 on exchange 57309r + [1646160997.870023][33190:33190] CHIP:EM: Handling via exchange: 57309r, Delegate: 0xaaaace1730c8 + [1646160997.870554][33190:33190] CHIP:IM: Received Write request + [1646160997.870609][33190:33190] CHIP:DMG: IM WH moving to [Initialized] + [1646160997.870676][33190:33190] CHIP:DMG: WriteRequestMessage = + [1646160997.870711][33190:33190] CHIP:DMG: { + [1646160997.870738][33190:33190] CHIP:DMG: timedRequest = false, + [1646160997.870771][33190:33190] CHIP:DMG: AttributeDataIBs = + [1646160997.870810][33190:33190] CHIP:DMG: [ + [1646160997.870840][33190:33190] CHIP:DMG: AttributeDataIB = + [1646160997.870877][33190:33190] CHIP:DMG: { + [1646160997.870912][33190:33190] CHIP:DMG: AttributePathIB = + [1646160997.870952][33190:33190] CHIP:DMG: { + [1646160997.870995][33190:33190] CHIP:DMG: Endpoint = 0x1, + [1646160997.871040][33190:33190] CHIP:DMG: Cluster = 0x204, + [1646160997.871083][33190:33190] CHIP:DMG: Attribute = 0x0000_0000, + [1646160997.871121][33190:33190] CHIP:DMG: } + [1646160997.871161][33190:33190] CHIP:DMG: + [1646160997.871204][33190:33190] CHIP:DMG: Data = 1, + [1646160997.871278][33190:33190] CHIP:DMG: }, + [1646160997.871320][33190:33190] CHIP:DMG: + [1646160997.871350][33190:33190] CHIP:DMG: ], + [1646160997.871385][33190:33190] CHIP:DMG: + [1646160997.871416][33190:33190] CHIP:DMG: moreChunkedMessages = false, + [1646160997.871447][33190:33190] CHIP:DMG: InteractionModelRevision = 1 + [1646160997.871475][33190:33190] CHIP:DMG: }, + [1646160997.871571][33190:33190] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0204 e=1 p=o + [1646160997.871635][33190:33190] CHIP:DMG: Endpoint 1, Cluster 0x0000_0204 update version to ed28a81d + disabled: true + + - label: + "DUT writes a suitable value to all supported optional attributes on + the TH once at a time in a manufacturer specific order" + verification: | + see above + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_4_5.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_4_5.yaml index a07c2785d10894..fdc4aca48880ff 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_4_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_4_5.yaml @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: Window Covering [TC-WNCV-4.5] Positions Storage Verification with server as diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_5_1.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_5_1.yaml new file mode 100644 index 00000000000000..0ffa0ebaab399e --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_WNCV_5_1.yaml @@ -0,0 +1,172 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 3.4.6. [TC-WNCV-5.1] Mandatory Attributes Verification with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Check Attribute defining the cluster Features" + verification: | + + disabled: true + + - label: "DUT reads the FeatureMap attribute from TH" + verification: | + On TestHarnes (all-cluster-app) a received read of feature-map looks like this: + + [1646298926.644020][362295:362295] CHIP:IM: Received Read request + [1646298926.644091][362295:362295] CHIP:DMG: ReadRequestMessage = + [1646298926.644120][362295:362295] CHIP:DMG: { + [1646298926.644194][362295:362295] CHIP:DMG: AttributePathIBs = + [1646298926.644223][362295:362295] CHIP:DMG: [ + [1646298926.644273][362295:362295] CHIP:DMG: AttributePathIB = + [1646298926.644301][362295:362295] CHIP:DMG: { + [1646298926.644450][362295:362295] CHIP:DMG: Endpoint = 0x1, + [1646298926.644493][362295:362295] CHIP:DMG: Cluster = 0x102, + [1646298926.644540][362295:362295] CHIP:DMG: Attribute = 0x0000_FFFC, + [1646298926.644620][362295:362295] CHIP:DMG: } + [1646298926.644819][362295:362295] CHIP:DMG: + [1646298926.644861][362295:362295] CHIP:DMG: ], + [1646298926.644936][362295:362295] CHIP:DMG: + [1646298926.644986][362295:362295] CHIP:DMG: isFabricFiltered = true, + [1646298926.645061][362295:362295] CHIP:DMG: InteractionModelRevision = 1 + [1646298926.645086][362295:362295] CHIP:DMG: }, + [1646298926.645122][362295:362295] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646298926.645190][362295:362295] CHIP:DMG: Cluster 102, Attribute fffc is dirty + [1646298926.645252][362295:362295] CHIP:DMG: Reading attribute: Cluster=0x0000_0102 Endpoint=1 AttributeId=0x0000_FFFC (expanded=0) + [1646298926.645282][362295:362295] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0102 e=1 p=v + disabled: true + + - label: "Check Attribute defining the product" + verification: | + + disabled: true + + - label: "DUT reads the Type attribute from TH" + verification: | + On TestHarnes (all-cluster-app) a received read of type looks like this: + + [1646299341.831213][362295:362295] CHIP:IM: Received Read request + [1646299341.831257][362295:362295] CHIP:DMG: ReadRequestMessage = + [1646299341.831301][362295:362295] CHIP:DMG: { + [1646299341.831327][362295:362295] CHIP:DMG: AttributePathIBs = + [1646299341.831369][362295:362295] CHIP:DMG: [ + [1646299341.831395][362295:362295] CHIP:DMG: AttributePathIB = + [1646299341.831428][362295:362295] CHIP:DMG: { + [1646299341.831456][362295:362295] CHIP:DMG: Endpoint = 0x1, + [1646299341.831483][362295:362295] CHIP:DMG: Cluster = 0x102, + [1646299341.831527][362295:362295] CHIP:DMG: Attribute = 0x0000_0000, + [1646299341.831553][362295:362295] CHIP:DMG: } + [1646299341.831587][362295:362295] CHIP:DMG: + [1646299341.831613][362295:362295] CHIP:DMG: ], + [1646299341.831641][362295:362295] CHIP:DMG: + [1646299341.831674][362295:362295] CHIP:DMG: isFabricFiltered = true, + [1646299341.831718][362295:362295] CHIP:DMG: InteractionModelRevision = 1 + [1646299341.831744][362295:362295] CHIP:DMG: }, + [1646299341.831808][362295:362295] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646299341.831877][362295:362295] CHIP:DMG: Cluster 102, Attribute 0 is dirty + [1646299341.831923][362295:362295] CHIP:DMG: Reading attribute: Cluster=0x0000_0102 Endpoint=1 AttributeId=0x0000_0000 (expanded=0) + [1646299341.831954][362295:362295] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0102 e=1 p=v + disabled: true + + - label: "DUT reads the EndProductType attribute from TH" + verification: | + On TestHarnes (all-cluster-app) a received read of end-product-type looks like this: + + 1646299403.213429][362295:362295] CHIP:IM: Received Read request + [1646299403.213463][362295:362295] CHIP:DMG: ReadRequestMessage = + [1646299403.213491][362295:362295] CHIP:DMG: { + [1646299403.213546][362295:362295] CHIP:DMG: AttributePathIBs = + [1646299403.213576][362295:362295] CHIP:DMG: [ + [1646299403.213617][362295:362295] CHIP:DMG: AttributePathIB = + [1646299403.213644][362295:362295] CHIP:DMG: { + [1646299403.213689][362295:362295] CHIP:DMG: Endpoint = 0x1, + [1646299403.213716][362295:362295] CHIP:DMG: Cluster = 0x102, + [1646299403.213744][362295:362295] CHIP:DMG: Attribute = 0x0000_000D, + [1646299403.213797][362295:362295] CHIP:DMG: } + [1646299403.213828][362295:362295] CHIP:DMG: + [1646299403.213861][362295:362295] CHIP:DMG: ], + [1646299403.213889][362295:362295] CHIP:DMG: + [1646299403.213922][362295:362295] CHIP:DMG: isFabricFiltered = true, + [1646299403.213978][362295:362295] CHIP:DMG: InteractionModelRevision = 1 + [1646299403.214006][362295:362295] CHIP:DMG: }, + [1646299403.214082][362295:362295] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646299403.214193][362295:362295] CHIP:DMG: Cluster 102, Attribute d is dirty + [1646299403.214240][362295:362295] CHIP:DMG: Reading attribute: Cluster=0x0000_0102 Endpoint=1 AttributeId=0x0000_000D (expanded=0) + [1646299403.214286][362295:362295] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0102 e=1 p=v + disabled: true + + - label: "Check Attribute defining the working status" + verification: | + + disabled: true + + - label: "DUT reads the Mode attribute from TH" + verification: | + On TestHarnes (all-cluster-app) a received read of mode looks like this: + + [1646298391.021408][362295:362295] CHIP:IM: Received Read request + [1646298391.021612][362295:362295] CHIP:DMG: ReadRequestMessage = + [1646298391.021678][362295:362295] CHIP:DMG: { + [1646298391.021770][362295:362295] CHIP:DMG: AttributePathIBs = + [1646298391.021799][362295:362295] CHIP:DMG: [ + [1646298391.021870][362295:362295] CHIP:DMG: AttributePathIB = + [1646298391.021899][362295:362295] CHIP:DMG: { + [1646298391.022134][362295:362295] CHIP:DMG: Endpoint = 0x1, + [1646298391.022444][362295:362295] CHIP:DMG: Cluster = 0x102, + [1646298391.022769][362295:362295] CHIP:DMG: Attribute = 0x0000_0017, + [1646298391.023006][362295:362295] CHIP:DMG: } + [1646298391.023359][362295:362295] CHIP:DMG: + [1646298391.023414][362295:362295] CHIP:DMG: ], + [1646298391.023491][362295:362295] CHIP:DMG: + [1646298391.023577][362295:362295] CHIP:DMG: isFabricFiltered = true, + [1646298391.023605][362295:362295] CHIP:DMG: InteractionModelRevision = 1 + [1646298391.023658][362295:362295] CHIP:DMG: }, + [1646298391.023698][362295:362295] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646298391.023913][362295:362295] CHIP:DMG: Cluster 102, Attribute 17 is dirty + [1646298391.024036][362295:362295] CHIP:DMG: Reading attribute: Cluster=0x0000_0102 Endpoint=1 AttributeId=0x0000_0017 (expanded=0) + [1646298391.024247][362295:362295] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0102 e=1 p=v + disabled: true + + - label: "DUT reads the ConfigStatus attribute from TH" + verification: | + On TestHarnes (all-cluster-app) a received read of config-status looks like this: + + [1646298854.266428][362295:362295] CHIP:IM: Received Read request + [1646298854.266463][362295:362295] CHIP:DMG: ReadRequestMessage = + [1646298854.266490][362295:362295] CHIP:DMG: { + [1646298854.266537][362295:362295] CHIP:DMG: AttributePathIBs = + [1646298854.266582][362295:362295] CHIP:DMG: [ + [1646298854.266631][362295:362295] CHIP:DMG: AttributePathIB = + [1646298854.266676][362295:362295] CHIP:DMG: { + [1646298854.266726][362295:362295] CHIP:DMG: Endpoint = 0x1, + [1646298854.266769][362295:362295] CHIP:DMG: Cluster = 0x102, + [1646298854.266840][362295:362295] CHIP:DMG: Attribute = 0x0000_0007, + [1646298854.266880][362295:362295] CHIP:DMG: } + [1646298854.266922][362295:362295] CHIP:DMG: + [1646298854.266963][362295:362295] CHIP:DMG: ], + [1646298854.266990][362295:362295] CHIP:DMG: + [1646298854.267021][362295:362295] CHIP:DMG: isFabricFiltered = true, + [1646298854.267047][362295:362295] CHIP:DMG: InteractionModelRevision = 1 + [1646298854.267091][362295:362295] CHIP:DMG: }, + [1646298854.267129][362295:362295] CHIP:DMG: IM RH moving to [GeneratingReports] + [1646298854.267197][362295:362295] CHIP:DMG: Cluster 102, Attribute 7 is dirty + [1646298854.267240][362295:362295] CHIP:DMG: Reading attribute: Cluster=0x0000_0102 Endpoint=1 AttributeId=0x0000_0007 (expanded=0) + [1646298854.267295][362295:362295] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0102 e=1 p=v + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_7_1.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_7_1.yaml new file mode 100644 index 00000000000000..dcb35e5cfbffeb --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_WNCV_7_1.yaml @@ -0,0 +1,107 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: + 3.4.8. [TC-WNCV-7.1] GoToPercentage Commands Verification with client as DUT + +config: + nodeId: 0x12344321 + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Check GoToLiftPercentage command 50%" + verification: | + + disabled: true + + - label: + "If (PA_LF & LF) DUT sends GoToLiftPercentage command with 50% to DUT" + verification: | + On TestHarnes (all-cluster-app) a received GoToLift for WindowCovering looks like this + + [1646297766.073468][361158:361158] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:12638616 on exchange 3757r + [1646297766.073500][361158:361158] CHIP:EM: Handling via exchange: 3757r, Delegate: 0x55d525b25500 + [1646297766.073560][361158:361158] CHIP:DMG: InvokeRequestMessage = + [1646297766.073589][361158:361158] CHIP:DMG: { + [1646297766.073618][361158:361158] CHIP:DMG: suppressResponse = false, + [1646297766.073662][361158:361158] CHIP:DMG: timedRequest = false, + [1646297766.073691][361158:361158] CHIP:DMG: InvokeRequests = + [1646297766.073722][361158:361158] CHIP:DMG: [ + [1646297766.073769][361158:361158] CHIP:DMG: CommandDataIB = + [1646297766.073830][361158:361158] CHIP:DMG: { + [1646297766.073881][361158:361158] CHIP:DMG: CommandPathIB = + [1646297766.073911][361158:361158] CHIP:DMG: { + [1646297766.073970][361158:361158] CHIP:DMG: EndpointId = 0x1, + [1646297766.074008][361158:361158] CHIP:DMG: ClusterId = 0x102, + [1646297766.074069][361158:361158] CHIP:DMG: CommandId = 0x5, + [1646297766.074120][361158:361158] CHIP:DMG: }, + [1646297766.074180][361158:361158] CHIP:DMG: + [1646297766.074211][361158:361158] CHIP:DMG: CommandData = + [1646297766.074258][361158:361158] CHIP:DMG: { + [1646297766.074288][361158:361158] CHIP:DMG: 0x0 = 50, + [1646297766.074316][361158:361158] CHIP:DMG: 0x1 = 5000, + [1646297766.074386][361158:361158] CHIP:DMG: }, + [1646297766.074415][361158:361158] CHIP:DMG: }, + [1646297766.074476][361158:361158] CHIP:DMG: + [1646297766.074505][361158:361158] CHIP:DMG: ], + [1646297766.074565][361158:361158] CHIP:DMG: + [1646297766.074619][361158:361158] CHIP:DMG: InteractionModelRevision = 1 + [1646297766.074647][361158:361158] CHIP:DMG: }, + [1646297766.074705][361158:361158] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0102 e=1 p=o + [1646297766.074745][361158:361158] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0102 Command=0x0000_0005 + disabled: true + + - label: "Check GoToTiltPercentage command 50%" + verification: | + + disabled: true + + - label: + "If (PA_TL & TL) DUT sends GoToTiltPercentage command with 50% to DUT" + verification: | + On TestHarnes (all-cluster-app) a received GoToTilt for WindowCovering looks like this + + [1646298060.215062][361158:361158] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:13675126 on exchange 583r + [1646298060.215092][361158:361158] CHIP:EM: Handling via exchange: 583r, Delegate: 0x55d525b25500 + [1646298060.215225][361158:361158] CHIP:DMG: InvokeRequestMessage = + [1646298060.215260][361158:361158] CHIP:DMG: { + [1646298060.215285][361158:361158] CHIP:DMG: suppressResponse = false, + [1646298060.215355][361158:361158] CHIP:DMG: timedRequest = false, + [1646298060.215745][361158:361158] CHIP:DMG: InvokeRequests = + [1646298060.215925][361158:361158] CHIP:DMG: [ + [1646298060.216063][361158:361158] CHIP:DMG: CommandDataIB = + [1646298060.216460][361158:361158] CHIP:DMG: { + [1646298060.216641][361158:361158] CHIP:DMG: CommandPathIB = + [1646298060.216850][361158:361158] CHIP:DMG: { + [1646298060.217059][361158:361158] CHIP:DMG: EndpointId = 0x1, + [1646298060.217327][361158:361158] CHIP:DMG: ClusterId = 0x102, + [1646298060.217551][361158:361158] CHIP:DMG: CommandId = 0x8, + [1646298060.217768][361158:361158] CHIP:DMG: }, + [1646298060.217960][361158:361158] CHIP:DMG: + [1646298060.218130][361158:361158] CHIP:DMG: CommandData = + [1646298060.218320][361158:361158] CHIP:DMG: { + [1646298060.218510][361158:361158] CHIP:DMG: 0x0 = 50, + [1646298060.218727][361158:361158] CHIP:DMG: 0x1 = 5000, + [1646298060.218944][361158:361158] CHIP:DMG: }, + [1646298060.219135][361158:361158] CHIP:DMG: }, + [1646298060.219301][361158:361158] CHIP:DMG: + [1646298060.219436][361158:361158] CHIP:DMG: ], + [1646298060.219684][361158:361158] CHIP:DMG: + [1646298060.219795][361158:361158] CHIP:DMG: InteractionModelRevision = 1 + [1646298060.219930][361158:361158] CHIP:DMG: }, + [1646298060.220021][361158:361158] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0102 e=1 p=o + [1646298060.220264][361158:361158] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0102 Command=0x0000_0008 + disabled: true diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index f667dc7c50d713..1a036738354409 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -244,12 +244,18 @@ class ManualTestList : public Command printf("Test_TC_DD_1_8\n"); printf("Test_TC_DD_1_9\n"); printf("Test_TC_DD_1_10\n"); + printf("Test_TC_DD_1_11\n"); + printf("Test_TC_DD_1_12\n"); printf("Test_TC_DD_2_1\n"); printf("Test_TC_DD_2_2\n"); printf("Test_TC_DD_3_1\n"); printf("Test_TC_DD_3_2\n"); + printf("Test_TC_DD_3_3\n"); + printf("Test_TC_DD_3_4\n"); printf("Test_TC_DD_3_5\n"); printf("Test_TC_DD_3_6\n"); + printf("Test_TC_DD_3_7\n"); + printf("Test_TC_DD_3_8\n"); printf("Test_TC_DD_3_9\n"); printf("Test_TC_DD_3_10\n"); printf("Test_TC_DD_3_11\n"); @@ -262,6 +268,7 @@ class ManualTestList : public Command printf("Test_TC_BDX_1_1\n"); printf("Test_TC_BDX_1_2\n"); printf("Test_TC_BDX_1_3\n"); + printf("Test_TC_BDX_1_4\n"); printf("Test_TC_BDX_1_5\n"); printf("Test_TC_BDX_1_6\n"); printf("Test_TC_BDX_2_1\n"); @@ -274,8 +281,10 @@ class ManualTestList : public Command printf("Test_TC_BR_3\n"); printf("Test_TC_BRAC_2_1\n"); printf("Test_TC_BRAC_2_2\n"); + printf("Test_TC_BRAC_3_1\n"); printf("Test_TC_DM_1_2\n"); printf("Test_TC_DM_1_4\n"); + printf("Test_TC_DM_2_1\n"); printf("Test_TC_DM_2_3\n"); printf("Test_TC_DM_2_4\n"); printf("Test_TC_DM_3_2\n"); @@ -287,11 +296,15 @@ class ManualTestList : public Command printf("Test_TC_ETHDIAG_1_2\n"); printf("Test_TC_GC_1_2\n"); printf("Test_TC_GC_1_3\n"); + printf("Test_TC_GC_1_4\n"); printf("Test_TC_GENDIAG_1_1\n"); printf("Test_TC_GENDIAG_1_2\n"); printf("Test_TC_GENDIAG_2_1\n"); printf("Test_TC_I_2_2\n"); + printf("Test_TC_I_3_1\n"); + printf("Test_TC_I_3_2\n"); printf("Test_TC_ILL_2_2\n"); + printf("Test_TC_ILL_3_1\n"); printf("Test_TC_IDM_1_1\n"); printf("Test_TC_IDM_1_2\n"); printf("Test_TC_IDM_2_1\n"); @@ -306,6 +319,8 @@ class ManualTestList : public Command printf("Test_TC_IDM_6_2\n"); printf("Test_TC_IDM_6_3\n"); printf("Test_TC_IDM_6_4\n"); + printf("Test_TC_IDM_7_1\n"); + printf("Test_TC_MC_2_2\n"); printf("Test_TC_MC_3_12\n"); printf("Test_TC_MC_3_13\n"); printf("Test_TC_MC_4_1\n"); @@ -316,6 +331,7 @@ class ManualTestList : public Command printf("Test_TC_MC_10_4\n"); printf("Test_TC_MC_10_5\n"); printf("Test_TC_MC_10_6\n"); + printf("Test_TC_MC_10_7\n"); printf("Test_TC_MF_1_1\n"); printf("Test_TC_MF_1_2\n"); printf("Test_TC_MF_1_7\n"); @@ -340,6 +356,7 @@ class ManualTestList : public Command printf("Test_TC_MF_1_27\n"); printf("Test_TC_MF_1_28\n"); printf("Test_TC_MOD_1_2\n"); + printf("Test_TC_MOD_1_3\n"); printf("Test_TC_MOD_2_1\n"); printf("Test_TC_MOD_2_2\n"); printf("Test_TC_MOD_3_1\n"); @@ -360,23 +377,88 @@ class ManualTestList : public Command printf("Test_TC_SU_4_1\n"); printf("Test_TC_SU_4_2\n"); printf("Test_TC_PSCFG_2_1\n"); + printf("Test_TC_PSCFG_2_2\n"); printf("Test_TC_PSCFG_3_1\n"); + printf("Test_TC_SC_4_1\n"); + printf("Test_TC_SC_4_3\n"); + printf("Test_TC_SC_4_4\n"); printf("Test_TC_SC_4_5\n"); printf("Test_TC_SC_4_6\n"); printf("Test_TC_SC_4_7\n"); printf("Test_TC_SC_4_8\n"); printf("Test_TC_SC_4_9\n"); + printf("Test_TC_SC_4_10\n"); printf("Test_TC_SWDIAG_1_2\n"); printf("Test_TC_WIFIDIAG_1_2\n"); printf("Test_TC_WIFIDIAG_2_1\n"); printf("Test_TC_WNCV_6_1\n"); + printf("Test_TC_WNCV_7_1\n"); printf("Test_TC_FLW_3_1\n"); printf("Test_TC_OCC_2_3\n"); printf("Test_TC_OCC_2_4\n"); printf("Test_TC_OCC_3_1\n"); + printf("Test_TC_OCC_3_2\n"); printf("Test_TC_PRS_2_2\n"); printf("Test_TC_PRS_2_3\n"); + printf("Test_TC_PRS_3_1\n"); printf("Test_TC_PS_2_2\n"); + printf("Test_TC_PS_3_1\n"); + printf("Test_TC_BOOL_2_2\n"); + printf("Test_TC_BOOL_3_1\n"); + printf("Test_TC_CC_2_2\n"); + printf("Test_TC_CC_3_4\n"); + printf("Test_TC_CC_4_5\n"); + printf("Test_TC_CC_5_4\n"); + printf("Test_TC_CC_6_4\n"); + printf("Test_TC_CC_7_5\n"); + printf("Test_TC_CC_9_4\n"); + printf("Test_TC_DL_1_1\n"); + printf("Test_TC_DL_1_2\n"); + printf("Test_TC_DL_1_4\n"); + printf("Test_TC_DL_1_5\n"); + printf("Test_TC_DL_1_6\n"); + printf("Test_TC_DL_1_7\n"); + printf("Test_TC_DL_1_8\n"); + printf("Test_TC_DL_1_10\n"); + printf("Test_TC_DL_1_11\n"); + printf("Test_TC_DL_1_13\n"); + printf("Test_TC_DL_1_14\n"); + printf("Test_TC_DL_1_15\n"); + printf("Test_TC_DL_1_16\n"); + printf("Test_TC_DL_1_17\n"); + printf("Test_TC_LC_1_1\n"); + printf("Test_TC_LC_1_3\n"); + printf("Test_TC_LC_1_4\n"); + printf("Test_TC_LC_1_5\n"); + printf("Test_TC_LO_1_1\n"); + printf("Test_TC_LVL_2_3\n"); + printf("Test_TC_NC_1_1\n"); + printf("Test_TC_NC_1_2\n"); + printf("Test_TC_NC_1_3\n"); + printf("Test_TC_NC_1_4\n"); + printf("Test_TC_NC_1_5\n"); + printf("Test_TC_NC_1_6\n"); + printf("Test_TC_NC_1_7\n"); + printf("Test_TC_NC_1_8\n"); + printf("Test_TC_NC_1_9\n"); + printf("Test_TC_NC_1_10\n"); + printf("Test_TC_NC_1_11\n"); + printf("Test_TC_NC_1_12\n"); + printf("Test_TC_NC_1_13\n"); + printf("Test_TC_NC_1_14\n"); + printf("Test_TC_NC_1_15\n"); + printf("Test_TC_NC_1_16\n"); + printf("Test_TC_NC_1_17\n"); + printf("Test_TC_NC_1_18\n"); + printf("Test_TC_OO_3_1\n"); + printf("Test_TC_OO_3_2\n"); + printf("Test_TC_RH_3_1\n"); + printf("Test_TC_SWTCH_1_1\n"); + printf("Test_TC_SWTCH_3_1\n"); + printf("Test_TC_TM_3_1\n"); + printf("Test_TC_TSTAT_3_1\n"); + printf("Test_TC_TSTAT_3_2\n"); + printf("Test_TC_TSUIC_3_1\n"); return CHIP_NO_ERROR; } @@ -52460,10 +52542,10 @@ class Test_TC_DD_1_10Suite : public TestCommand } }; -class Test_TC_DD_2_1Suite : public TestCommand +class Test_TC_DD_1_11Suite : public TestCommand { public: - Test_TC_DD_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_2_1", 0, credsIssuerConfig) + Test_TC_DD_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_11", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52471,7 +52553,7 @@ class Test_TC_DD_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_2_1Suite() {} + ~Test_TC_DD_1_11Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52516,10 +52598,10 @@ class Test_TC_DD_2_1Suite : public TestCommand } }; -class Test_TC_DD_2_2Suite : public TestCommand +class Test_TC_DD_1_12Suite : public TestCommand { public: - Test_TC_DD_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_2_2", 0, credsIssuerConfig) + Test_TC_DD_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_1_12", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52527,7 +52609,7 @@ class Test_TC_DD_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_2_2Suite() {} + ~Test_TC_DD_1_12Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52572,10 +52654,10 @@ class Test_TC_DD_2_2Suite : public TestCommand } }; -class Test_TC_DD_3_1Suite : public TestCommand +class Test_TC_DD_2_1Suite : public TestCommand { public: - Test_TC_DD_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_1", 0, credsIssuerConfig) + Test_TC_DD_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52583,7 +52665,7 @@ class Test_TC_DD_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_1Suite() {} + ~Test_TC_DD_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52628,10 +52710,10 @@ class Test_TC_DD_3_1Suite : public TestCommand } }; -class Test_TC_DD_3_2Suite : public TestCommand +class Test_TC_DD_2_2Suite : public TestCommand { public: - Test_TC_DD_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_2", 0, credsIssuerConfig) + Test_TC_DD_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52639,7 +52721,7 @@ class Test_TC_DD_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_2Suite() {} + ~Test_TC_DD_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52684,10 +52766,10 @@ class Test_TC_DD_3_2Suite : public TestCommand } }; -class Test_TC_DD_3_5Suite : public TestCommand +class Test_TC_DD_3_1Suite : public TestCommand { public: - Test_TC_DD_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_5", 0, credsIssuerConfig) + Test_TC_DD_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52695,7 +52777,7 @@ class Test_TC_DD_3_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_5Suite() {} + ~Test_TC_DD_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52740,10 +52822,10 @@ class Test_TC_DD_3_5Suite : public TestCommand } }; -class Test_TC_DD_3_6Suite : public TestCommand +class Test_TC_DD_3_2Suite : public TestCommand { public: - Test_TC_DD_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_6", 0, credsIssuerConfig) + Test_TC_DD_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52751,7 +52833,7 @@ class Test_TC_DD_3_6Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_6Suite() {} + ~Test_TC_DD_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52796,10 +52878,10 @@ class Test_TC_DD_3_6Suite : public TestCommand } }; -class Test_TC_DD_3_9Suite : public TestCommand +class Test_TC_DD_3_3Suite : public TestCommand { public: - Test_TC_DD_3_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_9", 0, credsIssuerConfig) + Test_TC_DD_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52807,7 +52889,7 @@ class Test_TC_DD_3_9Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_9Suite() {} + ~Test_TC_DD_3_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52852,10 +52934,10 @@ class Test_TC_DD_3_9Suite : public TestCommand } }; -class Test_TC_DD_3_10Suite : public TestCommand +class Test_TC_DD_3_4Suite : public TestCommand { public: - Test_TC_DD_3_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_10", 0, credsIssuerConfig) + Test_TC_DD_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52863,7 +52945,7 @@ class Test_TC_DD_3_10Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_10Suite() {} + ~Test_TC_DD_3_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52908,10 +52990,10 @@ class Test_TC_DD_3_10Suite : public TestCommand } }; -class Test_TC_DD_3_11Suite : public TestCommand +class Test_TC_DD_3_5Suite : public TestCommand { public: - Test_TC_DD_3_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_11", 0, credsIssuerConfig) + Test_TC_DD_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52919,7 +53001,7 @@ class Test_TC_DD_3_11Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_11Suite() {} + ~Test_TC_DD_3_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -52964,10 +53046,10 @@ class Test_TC_DD_3_11Suite : public TestCommand } }; -class Test_TC_DD_3_12Suite : public TestCommand +class Test_TC_DD_3_6Suite : public TestCommand { public: - Test_TC_DD_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_12", 0, credsIssuerConfig) + Test_TC_DD_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -52975,7 +53057,7 @@ class Test_TC_DD_3_12Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_12Suite() {} + ~Test_TC_DD_3_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53020,10 +53102,10 @@ class Test_TC_DD_3_12Suite : public TestCommand } }; -class Test_TC_DD_3_13Suite : public TestCommand +class Test_TC_DD_3_7Suite : public TestCommand { public: - Test_TC_DD_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_13", 0, credsIssuerConfig) + Test_TC_DD_3_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53031,7 +53113,7 @@ class Test_TC_DD_3_13Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_13Suite() {} + ~Test_TC_DD_3_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53076,10 +53158,10 @@ class Test_TC_DD_3_13Suite : public TestCommand } }; -class Test_TC_DD_3_14Suite : public TestCommand +class Test_TC_DD_3_8Suite : public TestCommand { public: - Test_TC_DD_3_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_14", 0, credsIssuerConfig) + Test_TC_DD_3_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_8", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53087,7 +53169,7 @@ class Test_TC_DD_3_14Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_3_14Suite() {} + ~Test_TC_DD_3_8Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53132,10 +53214,10 @@ class Test_TC_DD_3_14Suite : public TestCommand } }; -class Test_TC_DD_4_1Suite : public TestCommand +class Test_TC_DD_3_9Suite : public TestCommand { public: - Test_TC_DD_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_4_1", 0, credsIssuerConfig) + Test_TC_DD_3_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_9", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53143,7 +53225,7 @@ class Test_TC_DD_4_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DD_4_1Suite() {} + ~Test_TC_DD_3_9Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53188,11 +53270,10 @@ class Test_TC_DD_4_1Suite : public TestCommand } }; -class TestGroupDemoCommandSuite : public TestCommand +class Test_TC_DD_3_10Suite : public TestCommand { public: - TestGroupDemoCommandSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("TestGroupDemoCommand", 21, credsIssuerConfig) + Test_TC_DD_3_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_10", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53200,7 +53281,7 @@ class TestGroupDemoCommandSuite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~TestGroupDemoCommandSuite() {} + ~Test_TC_DD_3_10Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53225,80 +53306,6 @@ class TestGroupDemoCommandSuite : public TestCommand switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -53314,121 +53321,71 @@ class TestGroupDemoCommandSuite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - case 1: { - LogStep(1, "Turn On the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::On::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); - } - case 2: { - LogStep(2, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - case 3: { - LogStep(3, "Turn Off the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::Off::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); - } - case 4: { - LogStep(4, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - case 5: { - LogStep(5, "Turn On the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::On::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); - } - case 6: { - LogStep(6, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - case 7: { - LogStep(7, "Turn Off the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::Off::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); - } - case 8: { - LogStep(8, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - case 9: { - LogStep(9, "Turn On the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::On::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); - } - case 10: { - LogStep(10, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - case 11: { - LogStep(11, "Turn Off the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::Off::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); - } - case 12: { - LogStep(12, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - case 13: { - LogStep(13, "Turn On the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::On::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); - } - case 14: { - LogStep(14, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - case 15: { - LogStep(15, "Turn Off the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::Off::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); - } - case 16: { - LogStep(16, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - case 17: { - LogStep(17, "Turn On the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::On::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); - } - case 18: { - LogStep(18, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - case 19: { - LogStep(19, "Turn Off the light to see attribute change"); - chip::app::Clusters::OnOff::Commands::Off::Type value; - return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_11Suite : public TestCommand +{ +public: + Test_TC_DD_3_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_11", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_11Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - case 20: { - LogStep(20, "Wait 100ms"); - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { } return CHIP_NO_ERROR; } }; -class TestGroupDemoConfigSuite : public TestCommand +class Test_TC_DD_3_12Suite : public TestCommand { public: - TestGroupDemoConfigSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("TestGroupDemoConfig", 5, credsIssuerConfig) + Test_TC_DD_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_12", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53436,7 +53393,468 @@ class TestGroupDemoConfigSuite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~TestGroupDemoConfigSuite() {} + ~Test_TC_DD_3_12Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_13Suite : public TestCommand +{ +public: + Test_TC_DD_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_13", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_13Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_3_14Suite : public TestCommand +{ +public: + Test_TC_DD_3_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_3_14", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_3_14Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DD_4_1Suite : public TestCommand +{ +public: + Test_TC_DD_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DD_4_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DD_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class TestGroupDemoCommandSuite : public TestCommand +{ +public: + TestGroupDemoCommandSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestGroupDemoCommand", 21, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestGroupDemoCommandSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 1: { + LogStep(1, "Turn On the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 2: { + LogStep(2, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + case 3: { + LogStep(3, "Turn Off the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 4: { + LogStep(4, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + case 5: { + LogStep(5, "Turn On the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 6: { + LogStep(6, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + case 7: { + LogStep(7, "Turn Off the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 8: { + LogStep(8, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + case 9: { + LogStep(9, "Turn On the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 10: { + LogStep(10, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + case 11: { + LogStep(11, "Turn Off the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 12: { + LogStep(12, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + case 13: { + LogStep(13, "Turn On the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 14: { + LogStep(14, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + case 15: { + LogStep(15, "Turn Off the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 16: { + LogStep(16, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + case 17: { + LogStep(17, "Turn On the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::On::Id, value); + } + case 18: { + LogStep(18, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + case 19: { + LogStep(19, "Turn Off the light to see attribute change"); + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendGroupCommand(kIdentityAlpha, 257, OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 20: { + LogStep(20, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestGroupDemoConfigSuite : public TestCommand +{ +public: + TestGroupDemoConfigSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestGroupDemoConfig", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestGroupDemoConfigSuite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53712,10 +54130,4273 @@ class Test_TC_BDX_1_2Suite : public TestCommand } }; -class Test_TC_BDX_1_3Suite : public TestCommand +class Test_TC_BDX_1_3Suite : public TestCommand +{ +public: + Test_TC_BDX_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_1_4Suite : public TestCommand +{ +public: + Test_TC_BDX_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_1_5Suite : public TestCommand +{ +public: + Test_TC_BDX_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_1_6Suite : public TestCommand +{ +public: + Test_TC_BDX_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_1_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_1Suite : public TestCommand +{ +public: + Test_TC_BDX_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_2Suite : public TestCommand +{ +public: + Test_TC_BDX_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_3Suite : public TestCommand +{ +public: + Test_TC_BDX_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_4Suite : public TestCommand +{ +public: + Test_TC_BDX_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BDX_2_5Suite : public TestCommand +{ +public: + Test_TC_BDX_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BDX_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BR_1Suite : public TestCommand +{ +public: + Test_TC_BR_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BR_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BR_2Suite : public TestCommand +{ +public: + Test_TC_BR_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BR_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BR_3Suite : public TestCommand +{ +public: + Test_TC_BR_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BR_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRAC_2_1Suite : public TestCommand +{ +public: + Test_TC_BRAC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BRAC_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRAC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRAC_2_2Suite : public TestCommand +{ +public: + Test_TC_BRAC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BRAC_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRAC_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRAC_3_1Suite : public TestCommand +{ +public: + Test_TC_BRAC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BRAC_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRAC_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DM_1_2Suite : public TestCommand +{ +public: + Test_TC_DM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DM_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DM_1_4Suite : public TestCommand +{ +public: + Test_TC_DM_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_1_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DM_1_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DM_2_1Suite : public TestCommand +{ +public: + Test_TC_DM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DM_2_3Suite : public TestCommand +{ +public: + Test_TC_DM_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_2_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DM_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DM_2_4Suite : public TestCommand +{ +public: + Test_TC_DM_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_2_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DM_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DM_3_2Suite : public TestCommand +{ +public: + Test_TC_DM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DM_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DM_3_4Suite : public TestCommand +{ +public: + Test_TC_DM_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_3_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DM_3_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DIAG_LOG_1_1Suite : public TestCommand +{ +public: + Test_TC_DIAG_LOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_LOG_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DIAG_LOG_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DIAG_LOG_1_2Suite : public TestCommand +{ +public: + Test_TC_DIAG_LOG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_LOG_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DIAG_LOG_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DIAG_LOG_1_3Suite : public TestCommand +{ +public: + Test_TC_DIAG_LOG_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_LOG_1_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DIAG_LOG_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DESC_1_1Suite : public TestCommand +{ +public: + Test_TC_DESC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DESC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ETHDIAG_1_2Suite : public TestCommand +{ +public: + Test_TC_ETHDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ETHDIAG_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ETHDIAG_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_GC_1_2Suite : public TestCommand +{ +public: + Test_TC_GC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_GC_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_GC_1_3Suite : public TestCommand +{ +public: + Test_TC_GC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_GC_1_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_GC_1_4Suite : public TestCommand +{ +public: + Test_TC_GC_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_GC_1_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_GENDIAG_1_1Suite : public TestCommand +{ +public: + Test_TC_GENDIAG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GENDIAG_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_GENDIAG_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_GENDIAG_1_2Suite : public TestCommand +{ +public: + Test_TC_GENDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GENDIAG_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_GENDIAG_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_GENDIAG_2_1Suite : public TestCommand +{ +public: + Test_TC_GENDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GENDIAG_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_GENDIAG_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_2_2Suite : public TestCommand +{ +public: + Test_TC_I_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_3_1Suite : public TestCommand +{ +public: + Test_TC_I_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_3_2Suite : public TestCommand +{ +public: + Test_TC_I_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ILL_2_2Suite : public TestCommand +{ +public: + Test_TC_ILL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ILL_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ILL_3_1Suite : public TestCommand +{ +public: + Test_TC_ILL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ILL_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_1_1Suite : public TestCommand +{ +public: + Test_TC_IDM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_1_2Suite : public TestCommand +{ +public: + Test_TC_IDM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_2_1Suite : public TestCommand +{ +public: + Test_TC_IDM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_2_2Suite : public TestCommand +{ +public: + Test_TC_IDM_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_3_1Suite : public TestCommand +{ +public: + Test_TC_IDM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_3_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_3_2Suite : public TestCommand +{ +public: + Test_TC_IDM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_3_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_4_1Suite : public TestCommand +{ +public: + Test_TC_IDM_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_4_2Suite : public TestCommand +{ +public: + Test_TC_IDM_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_4_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_5_1Suite : public TestCommand +{ +public: + Test_TC_IDM_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_5_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_5_2Suite : public TestCommand +{ +public: + Test_TC_IDM_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_5_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_6_1Suite : public TestCommand +{ +public: + Test_TC_IDM_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_6_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_6_2Suite : public TestCommand +{ +public: + Test_TC_IDM_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_6_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_6_3Suite : public TestCommand +{ +public: + Test_TC_IDM_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_6_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_6_4Suite : public TestCommand +{ +public: + Test_TC_IDM_6_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_6_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IDM_7_1Suite : public TestCommand +{ +public: + Test_TC_IDM_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_7_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IDM_7_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_2_2Suite : public TestCommand +{ +public: + Test_TC_MC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_2_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_3_12Suite : public TestCommand +{ +public: + Test_TC_MC_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_12", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_3_12Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_3_13Suite : public TestCommand +{ +public: + Test_TC_MC_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_13", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_3_13Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_4_1Suite : public TestCommand +{ +public: + Test_TC_MC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_4_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_8_2Suite : public TestCommand +{ +public: + Test_TC_MC_8_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_8_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_8_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_9_2Suite : public TestCommand +{ +public: + Test_TC_MC_9_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_9_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_9_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_10_2Suite : public TestCommand +{ +public: + Test_TC_MC_10_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_10_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_10_3Suite : public TestCommand +{ +public: + Test_TC_MC_10_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_3", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_10_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_10_4Suite : public TestCommand +{ +public: + Test_TC_MC_10_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_4", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_10_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_10_5Suite : public TestCommand +{ +public: + Test_TC_MC_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_5", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_10_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_10_6Suite : public TestCommand +{ +public: + Test_TC_MC_10_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_10_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MC_10_7Suite : public TestCommand +{ +public: + Test_TC_MC_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_7", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MC_10_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_1Suite : public TestCommand +{ +public: + Test_TC_MF_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_2Suite : public TestCommand +{ +public: + Test_TC_MF_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_2", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_7Suite : public TestCommand +{ +public: + Test_TC_MF_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_7", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_8Suite : public TestCommand +{ +public: + Test_TC_MF_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_8", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_9Suite : public TestCommand +{ +public: + Test_TC_MF_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_9", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_10Suite : public TestCommand +{ +public: + Test_TC_MF_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_10", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_11Suite : public TestCommand +{ +public: + Test_TC_MF_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_11", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_11Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_12Suite : public TestCommand +{ +public: + Test_TC_MF_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_12", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_12Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_13Suite : public TestCommand +{ +public: + Test_TC_MF_1_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_13", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_13Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_14Suite : public TestCommand +{ +public: + Test_TC_MF_1_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_14", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_14Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_16Suite : public TestCommand +{ +public: + Test_TC_MF_1_16Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_16", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_16Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_17Suite : public TestCommand { public: - Test_TC_BDX_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_3", 0, credsIssuerConfig) + Test_TC_MF_1_17Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_17", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53723,7 +58404,7 @@ class Test_TC_BDX_1_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_1_3Suite() {} + ~Test_TC_MF_1_17Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53768,10 +58449,10 @@ class Test_TC_BDX_1_3Suite : public TestCommand } }; -class Test_TC_BDX_1_5Suite : public TestCommand +class Test_TC_MF_1_18Suite : public TestCommand { public: - Test_TC_BDX_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_5", 0, credsIssuerConfig) + Test_TC_MF_1_18Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_18", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53779,7 +58460,7 @@ class Test_TC_BDX_1_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_1_5Suite() {} + ~Test_TC_MF_1_18Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53824,18 +58505,18 @@ class Test_TC_BDX_1_5Suite : public TestCommand } }; -class Test_TC_BDX_1_6Suite : public TestCommand +class Test_TC_MF_1_19Suite : public TestCommand { public: - Test_TC_BDX_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_1_6", 0, credsIssuerConfig) + Test_TC_MF_1_19Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_19", 0, credsIssuerConfig) { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_1_6Suite() {} + ~Test_TC_MF_1_19Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53843,9 +58524,9 @@ class Test_TC_BDX_1_6Suite : public TestCommand } private: - chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mNodeId; chip::Optional mTimeout; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -53880,10 +58561,10 @@ class Test_TC_BDX_1_6Suite : public TestCommand } }; -class Test_TC_BDX_2_1Suite : public TestCommand +class Test_TC_MF_1_20Suite : public TestCommand { public: - Test_TC_BDX_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_1", 0, credsIssuerConfig) + Test_TC_MF_1_20Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_20", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53891,7 +58572,7 @@ class Test_TC_BDX_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_1Suite() {} + ~Test_TC_MF_1_20Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53936,10 +58617,10 @@ class Test_TC_BDX_2_1Suite : public TestCommand } }; -class Test_TC_BDX_2_2Suite : public TestCommand +class Test_TC_MF_1_21Suite : public TestCommand { public: - Test_TC_BDX_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_2", 0, credsIssuerConfig) + Test_TC_MF_1_21Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_21", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -53947,7 +58628,7 @@ class Test_TC_BDX_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_2Suite() {} + ~Test_TC_MF_1_21Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -53992,10 +58673,10 @@ class Test_TC_BDX_2_2Suite : public TestCommand } }; -class Test_TC_BDX_2_3Suite : public TestCommand +class Test_TC_MF_1_22Suite : public TestCommand { public: - Test_TC_BDX_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_3", 0, credsIssuerConfig) + Test_TC_MF_1_22Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_22", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54003,7 +58684,7 @@ class Test_TC_BDX_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_3Suite() {} + ~Test_TC_MF_1_22Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54048,10 +58729,10 @@ class Test_TC_BDX_2_3Suite : public TestCommand } }; -class Test_TC_BDX_2_4Suite : public TestCommand +class Test_TC_MF_1_23Suite : public TestCommand { public: - Test_TC_BDX_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_4", 0, credsIssuerConfig) + Test_TC_MF_1_23Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_23", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54059,7 +58740,7 @@ class Test_TC_BDX_2_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_4Suite() {} + ~Test_TC_MF_1_23Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54104,10 +58785,10 @@ class Test_TC_BDX_2_4Suite : public TestCommand } }; -class Test_TC_BDX_2_5Suite : public TestCommand +class Test_TC_MF_1_24Suite : public TestCommand { public: - Test_TC_BDX_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BDX_2_5", 0, credsIssuerConfig) + Test_TC_MF_1_24Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_24", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54115,7 +58796,7 @@ class Test_TC_BDX_2_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BDX_2_5Suite() {} + ~Test_TC_MF_1_24Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54160,10 +58841,10 @@ class Test_TC_BDX_2_5Suite : public TestCommand } }; -class Test_TC_BR_1Suite : public TestCommand +class Test_TC_MF_1_25Suite : public TestCommand { public: - Test_TC_BR_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_1", 0, credsIssuerConfig) + Test_TC_MF_1_25Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_25", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54171,7 +58852,7 @@ class Test_TC_BR_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BR_1Suite() {} + ~Test_TC_MF_1_25Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54216,10 +58897,10 @@ class Test_TC_BR_1Suite : public TestCommand } }; -class Test_TC_BR_2Suite : public TestCommand +class Test_TC_MF_1_26Suite : public TestCommand { public: - Test_TC_BR_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_2", 0, credsIssuerConfig) + Test_TC_MF_1_26Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_26", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54227,7 +58908,7 @@ class Test_TC_BR_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BR_2Suite() {} + ~Test_TC_MF_1_26Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54272,10 +58953,10 @@ class Test_TC_BR_2Suite : public TestCommand } }; -class Test_TC_BR_3Suite : public TestCommand +class Test_TC_MF_1_27Suite : public TestCommand { public: - Test_TC_BR_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_3", 0, credsIssuerConfig) + Test_TC_MF_1_27Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_27", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54283,7 +58964,7 @@ class Test_TC_BR_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BR_3Suite() {} + ~Test_TC_MF_1_27Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54328,10 +59009,10 @@ class Test_TC_BR_3Suite : public TestCommand } }; -class Test_TC_BRAC_2_1Suite : public TestCommand +class Test_TC_MF_1_28Suite : public TestCommand { public: - Test_TC_BRAC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BRAC_2_1", 0, credsIssuerConfig) + Test_TC_MF_1_28Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_28", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54339,7 +59020,7 @@ class Test_TC_BRAC_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BRAC_2_1Suite() {} + ~Test_TC_MF_1_28Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54384,10 +59065,10 @@ class Test_TC_BRAC_2_1Suite : public TestCommand } }; -class Test_TC_BRAC_2_2Suite : public TestCommand +class Test_TC_MOD_1_2Suite : public TestCommand { public: - Test_TC_BRAC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BRAC_2_2", 0, credsIssuerConfig) + Test_TC_MOD_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54395,7 +59076,7 @@ class Test_TC_BRAC_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BRAC_2_2Suite() {} + ~Test_TC_MOD_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54440,10 +59121,10 @@ class Test_TC_BRAC_2_2Suite : public TestCommand } }; -class Test_TC_DM_1_2Suite : public TestCommand +class Test_TC_MOD_1_3Suite : public TestCommand { public: - Test_TC_DM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_1_2", 0, credsIssuerConfig) + Test_TC_MOD_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_1_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54451,7 +59132,7 @@ class Test_TC_DM_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_1_2Suite() {} + ~Test_TC_MOD_1_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54496,10 +59177,10 @@ class Test_TC_DM_1_2Suite : public TestCommand } }; -class Test_TC_DM_1_4Suite : public TestCommand +class Test_TC_MOD_2_1Suite : public TestCommand { public: - Test_TC_DM_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_1_4", 0, credsIssuerConfig) + Test_TC_MOD_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54507,7 +59188,7 @@ class Test_TC_DM_1_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_1_4Suite() {} + ~Test_TC_MOD_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54552,10 +59233,10 @@ class Test_TC_DM_1_4Suite : public TestCommand } }; -class Test_TC_DM_2_3Suite : public TestCommand +class Test_TC_MOD_2_2Suite : public TestCommand { public: - Test_TC_DM_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_2_3", 0, credsIssuerConfig) + Test_TC_MOD_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54563,7 +59244,7 @@ class Test_TC_DM_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_2_3Suite() {} + ~Test_TC_MOD_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54608,10 +59289,10 @@ class Test_TC_DM_2_3Suite : public TestCommand } }; -class Test_TC_DM_2_4Suite : public TestCommand +class Test_TC_MOD_3_1Suite : public TestCommand { public: - Test_TC_DM_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_2_4", 0, credsIssuerConfig) + Test_TC_MOD_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54619,7 +59300,7 @@ class Test_TC_DM_2_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_2_4Suite() {} + ~Test_TC_MOD_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54664,10 +59345,10 @@ class Test_TC_DM_2_4Suite : public TestCommand } }; -class Test_TC_DM_3_2Suite : public TestCommand +class Test_TC_MOD_3_2Suite : public TestCommand { public: - Test_TC_DM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_3_2", 0, credsIssuerConfig) + Test_TC_MOD_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54675,7 +59356,7 @@ class Test_TC_DM_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_3_2Suite() {} + ~Test_TC_MOD_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54720,10 +59401,10 @@ class Test_TC_DM_3_2Suite : public TestCommand } }; -class Test_TC_DM_3_4Suite : public TestCommand +class Test_TC_MOD_3_3Suite : public TestCommand { public: - Test_TC_DM_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DM_3_4", 0, credsIssuerConfig) + Test_TC_MOD_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_3_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54731,7 +59412,7 @@ class Test_TC_DM_3_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DM_3_4Suite() {} + ~Test_TC_MOD_3_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54776,11 +59457,10 @@ class Test_TC_DM_3_4Suite : public TestCommand } }; -class Test_TC_DIAG_LOG_1_1Suite : public TestCommand +class Test_TC_SU_1_1Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_1", 0, credsIssuerConfig) + Test_TC_SU_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54788,7 +59468,7 @@ class Test_TC_DIAG_LOG_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DIAG_LOG_1_1Suite() {} + ~Test_TC_SU_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54833,11 +59513,10 @@ class Test_TC_DIAG_LOG_1_1Suite : public TestCommand } }; -class Test_TC_DIAG_LOG_1_2Suite : public TestCommand +class Test_TC_SU_2_1Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_2", 0, credsIssuerConfig) + Test_TC_SU_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54845,7 +59524,7 @@ class Test_TC_DIAG_LOG_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DIAG_LOG_1_2Suite() {} + ~Test_TC_SU_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54890,11 +59569,10 @@ class Test_TC_DIAG_LOG_1_2Suite : public TestCommand } }; -class Test_TC_DIAG_LOG_1_3Suite : public TestCommand +class Test_TC_SU_2_2Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_3", 0, credsIssuerConfig) + Test_TC_SU_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54902,7 +59580,7 @@ class Test_TC_DIAG_LOG_1_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DIAG_LOG_1_3Suite() {} + ~Test_TC_SU_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54947,10 +59625,10 @@ class Test_TC_DIAG_LOG_1_3Suite : public TestCommand } }; -class Test_TC_DESC_1_1Suite : public TestCommand +class Test_TC_SU_2_3Suite : public TestCommand { public: - Test_TC_DESC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_1_1", 0, credsIssuerConfig) + Test_TC_SU_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54958,7 +59636,7 @@ class Test_TC_DESC_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DESC_1_1Suite() {} + ~Test_TC_SU_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55003,11 +59681,10 @@ class Test_TC_DESC_1_1Suite : public TestCommand } }; -class Test_TC_ETHDIAG_1_2Suite : public TestCommand +class Test_TC_SU_2_4Suite : public TestCommand { public: - Test_TC_ETHDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ETHDIAG_1_2", 0, credsIssuerConfig) + Test_TC_SU_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55015,7 +59692,7 @@ class Test_TC_ETHDIAG_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ETHDIAG_1_2Suite() {} + ~Test_TC_SU_2_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55060,10 +59737,10 @@ class Test_TC_ETHDIAG_1_2Suite : public TestCommand } }; -class Test_TC_GC_1_2Suite : public TestCommand +class Test_TC_SU_2_5Suite : public TestCommand { public: - Test_TC_GC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_2", 0, credsIssuerConfig) + Test_TC_SU_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55071,7 +59748,7 @@ class Test_TC_GC_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GC_1_2Suite() {} + ~Test_TC_SU_2_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55116,10 +59793,10 @@ class Test_TC_GC_1_2Suite : public TestCommand } }; -class Test_TC_GC_1_3Suite : public TestCommand +class Test_TC_SU_2_6Suite : public TestCommand { public: - Test_TC_GC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_3", 0, credsIssuerConfig) + Test_TC_SU_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55127,7 +59804,7 @@ class Test_TC_GC_1_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GC_1_3Suite() {} + ~Test_TC_SU_2_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55172,11 +59849,10 @@ class Test_TC_GC_1_3Suite : public TestCommand } }; -class Test_TC_GENDIAG_1_1Suite : public TestCommand +class Test_TC_SU_2_7Suite : public TestCommand { public: - Test_TC_GENDIAG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GENDIAG_1_1", 0, credsIssuerConfig) + Test_TC_SU_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55184,7 +59860,7 @@ class Test_TC_GENDIAG_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GENDIAG_1_1Suite() {} + ~Test_TC_SU_2_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55229,11 +59905,10 @@ class Test_TC_GENDIAG_1_1Suite : public TestCommand } }; -class Test_TC_GENDIAG_1_2Suite : public TestCommand +class Test_TC_SU_3_1Suite : public TestCommand { public: - Test_TC_GENDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GENDIAG_1_2", 0, credsIssuerConfig) + Test_TC_SU_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55241,7 +59916,7 @@ class Test_TC_GENDIAG_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GENDIAG_1_2Suite() {} + ~Test_TC_SU_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55286,11 +59961,10 @@ class Test_TC_GENDIAG_1_2Suite : public TestCommand } }; -class Test_TC_GENDIAG_2_1Suite : public TestCommand +class Test_TC_SU_3_2Suite : public TestCommand { public: - Test_TC_GENDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GENDIAG_2_1", 0, credsIssuerConfig) + Test_TC_SU_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55298,7 +59972,7 @@ class Test_TC_GENDIAG_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GENDIAG_2_1Suite() {} + ~Test_TC_SU_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55343,10 +60017,10 @@ class Test_TC_GENDIAG_2_1Suite : public TestCommand } }; -class Test_TC_I_2_2Suite : public TestCommand +class Test_TC_SU_3_3Suite : public TestCommand { public: - Test_TC_I_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_2_2", 0, credsIssuerConfig) + Test_TC_SU_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55354,7 +60028,7 @@ class Test_TC_I_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_I_2_2Suite() {} + ~Test_TC_SU_3_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55399,10 +60073,10 @@ class Test_TC_I_2_2Suite : public TestCommand } }; -class Test_TC_ILL_2_2Suite : public TestCommand +class Test_TC_SU_3_4Suite : public TestCommand { public: - Test_TC_ILL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_2_2", 0, credsIssuerConfig) + Test_TC_SU_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55410,7 +60084,7 @@ class Test_TC_ILL_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ILL_2_2Suite() {} + ~Test_TC_SU_3_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55455,10 +60129,10 @@ class Test_TC_ILL_2_2Suite : public TestCommand } }; -class Test_TC_IDM_1_1Suite : public TestCommand +class Test_TC_SU_4_1Suite : public TestCommand { public: - Test_TC_IDM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_1_1", 0, credsIssuerConfig) + Test_TC_SU_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_4_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55466,7 +60140,7 @@ class Test_TC_IDM_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_1_1Suite() {} + ~Test_TC_SU_4_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55511,10 +60185,10 @@ class Test_TC_IDM_1_1Suite : public TestCommand } }; -class Test_TC_IDM_1_2Suite : public TestCommand +class Test_TC_SU_4_2Suite : public TestCommand { public: - Test_TC_IDM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_1_2", 0, credsIssuerConfig) + Test_TC_SU_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_4_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55522,7 +60196,7 @@ class Test_TC_IDM_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_1_2Suite() {} + ~Test_TC_SU_4_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55567,10 +60241,10 @@ class Test_TC_IDM_1_2Suite : public TestCommand } }; -class Test_TC_IDM_2_1Suite : public TestCommand +class Test_TC_PSCFG_2_1Suite : public TestCommand { public: - Test_TC_IDM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_1", 0, credsIssuerConfig) + Test_TC_PSCFG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PSCFG_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55578,7 +60252,7 @@ class Test_TC_IDM_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_2_1Suite() {} + ~Test_TC_PSCFG_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55623,10 +60297,10 @@ class Test_TC_IDM_2_1Suite : public TestCommand } }; -class Test_TC_IDM_2_2Suite : public TestCommand +class Test_TC_PSCFG_2_2Suite : public TestCommand { public: - Test_TC_IDM_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_2_2", 0, credsIssuerConfig) + Test_TC_PSCFG_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PSCFG_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55634,7 +60308,7 @@ class Test_TC_IDM_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_2_2Suite() {} + ~Test_TC_PSCFG_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55679,10 +60353,10 @@ class Test_TC_IDM_2_2Suite : public TestCommand } }; -class Test_TC_IDM_3_1Suite : public TestCommand +class Test_TC_PSCFG_3_1Suite : public TestCommand { public: - Test_TC_IDM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_1", 0, credsIssuerConfig) + Test_TC_PSCFG_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PSCFG_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55690,7 +60364,7 @@ class Test_TC_IDM_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_3_1Suite() {} + ~Test_TC_PSCFG_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55735,10 +60409,10 @@ class Test_TC_IDM_3_1Suite : public TestCommand } }; -class Test_TC_IDM_3_2Suite : public TestCommand +class Test_TC_SC_4_1Suite : public TestCommand { public: - Test_TC_IDM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_3_2", 0, credsIssuerConfig) + Test_TC_SC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55746,7 +60420,7 @@ class Test_TC_IDM_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_3_2Suite() {} + ~Test_TC_SC_4_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55791,10 +60465,10 @@ class Test_TC_IDM_3_2Suite : public TestCommand } }; -class Test_TC_IDM_4_1Suite : public TestCommand +class Test_TC_SC_4_3Suite : public TestCommand { public: - Test_TC_IDM_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_1", 0, credsIssuerConfig) + Test_TC_SC_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55802,7 +60476,7 @@ class Test_TC_IDM_4_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_4_1Suite() {} + ~Test_TC_SC_4_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55847,10 +60521,10 @@ class Test_TC_IDM_4_1Suite : public TestCommand } }; -class Test_TC_IDM_4_2Suite : public TestCommand +class Test_TC_SC_4_4Suite : public TestCommand { public: - Test_TC_IDM_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_4_2", 0, credsIssuerConfig) + Test_TC_SC_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55858,7 +60532,7 @@ class Test_TC_IDM_4_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_4_2Suite() {} + ~Test_TC_SC_4_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55903,10 +60577,10 @@ class Test_TC_IDM_4_2Suite : public TestCommand } }; -class Test_TC_IDM_5_1Suite : public TestCommand +class Test_TC_SC_4_5Suite : public TestCommand { public: - Test_TC_IDM_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_1", 0, credsIssuerConfig) + Test_TC_SC_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55914,7 +60588,7 @@ class Test_TC_IDM_5_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_5_1Suite() {} + ~Test_TC_SC_4_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55959,10 +60633,10 @@ class Test_TC_IDM_5_1Suite : public TestCommand } }; -class Test_TC_IDM_5_2Suite : public TestCommand +class Test_TC_SC_4_6Suite : public TestCommand { public: - Test_TC_IDM_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_5_2", 0, credsIssuerConfig) + Test_TC_SC_4_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55970,7 +60644,7 @@ class Test_TC_IDM_5_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_5_2Suite() {} + ~Test_TC_SC_4_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56015,10 +60689,10 @@ class Test_TC_IDM_5_2Suite : public TestCommand } }; -class Test_TC_IDM_6_1Suite : public TestCommand +class Test_TC_SC_4_7Suite : public TestCommand { public: - Test_TC_IDM_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_1", 0, credsIssuerConfig) + Test_TC_SC_4_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56026,7 +60700,7 @@ class Test_TC_IDM_6_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_6_1Suite() {} + ~Test_TC_SC_4_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56071,10 +60745,10 @@ class Test_TC_IDM_6_1Suite : public TestCommand } }; -class Test_TC_IDM_6_2Suite : public TestCommand +class Test_TC_SC_4_8Suite : public TestCommand { public: - Test_TC_IDM_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_2", 0, credsIssuerConfig) + Test_TC_SC_4_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_8", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56082,7 +60756,7 @@ class Test_TC_IDM_6_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_6_2Suite() {} + ~Test_TC_SC_4_8Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56127,10 +60801,10 @@ class Test_TC_IDM_6_2Suite : public TestCommand } }; -class Test_TC_IDM_6_3Suite : public TestCommand +class Test_TC_SC_4_9Suite : public TestCommand { public: - Test_TC_IDM_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_3", 0, credsIssuerConfig) + Test_TC_SC_4_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_9", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56138,7 +60812,7 @@ class Test_TC_IDM_6_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_6_3Suite() {} + ~Test_TC_SC_4_9Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56183,10 +60857,10 @@ class Test_TC_IDM_6_3Suite : public TestCommand } }; -class Test_TC_IDM_6_4Suite : public TestCommand +class Test_TC_SC_4_10Suite : public TestCommand { public: - Test_TC_IDM_6_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_IDM_6_4", 0, credsIssuerConfig) + Test_TC_SC_4_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_10", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56194,7 +60868,7 @@ class Test_TC_IDM_6_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_IDM_6_4Suite() {} + ~Test_TC_SC_4_10Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56239,10 +60913,10 @@ class Test_TC_IDM_6_4Suite : public TestCommand } }; -class Test_TC_MC_3_12Suite : public TestCommand +class Test_TC_SWDIAG_1_2Suite : public TestCommand { public: - Test_TC_MC_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_12", 0, credsIssuerConfig) + Test_TC_SWDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWDIAG_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56250,7 +60924,7 @@ class Test_TC_MC_3_12Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_3_12Suite() {} + ~Test_TC_SWDIAG_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56295,10 +60969,11 @@ class Test_TC_MC_3_12Suite : public TestCommand } }; -class Test_TC_MC_3_13Suite : public TestCommand +class Test_TC_WIFIDIAG_1_2Suite : public TestCommand { public: - Test_TC_MC_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_3_13", 0, credsIssuerConfig) + Test_TC_WIFIDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WIFIDIAG_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56306,7 +60981,7 @@ class Test_TC_MC_3_13Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_3_13Suite() {} + ~Test_TC_WIFIDIAG_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56351,10 +61026,11 @@ class Test_TC_MC_3_13Suite : public TestCommand } }; -class Test_TC_MC_4_1Suite : public TestCommand +class Test_TC_WIFIDIAG_2_1Suite : public TestCommand { public: - Test_TC_MC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_4_1", 0, credsIssuerConfig) + Test_TC_WIFIDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WIFIDIAG_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56362,7 +61038,7 @@ class Test_TC_MC_4_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_4_1Suite() {} + ~Test_TC_WIFIDIAG_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56407,10 +61083,10 @@ class Test_TC_MC_4_1Suite : public TestCommand } }; -class Test_TC_MC_8_2Suite : public TestCommand +class Test_TC_WNCV_6_1Suite : public TestCommand { public: - Test_TC_MC_8_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_8_2", 0, credsIssuerConfig) + Test_TC_WNCV_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_6_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56418,7 +61094,7 @@ class Test_TC_MC_8_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_8_2Suite() {} + ~Test_TC_WNCV_6_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56463,10 +61139,10 @@ class Test_TC_MC_8_2Suite : public TestCommand } }; -class Test_TC_MC_9_2Suite : public TestCommand +class Test_TC_WNCV_7_1Suite : public TestCommand { public: - Test_TC_MC_9_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_9_2", 0, credsIssuerConfig) + Test_TC_WNCV_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_7_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56474,7 +61150,7 @@ class Test_TC_MC_9_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_9_2Suite() {} + ~Test_TC_WNCV_7_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56519,10 +61195,10 @@ class Test_TC_MC_9_2Suite : public TestCommand } }; -class Test_TC_MC_10_2Suite : public TestCommand +class Test_TC_FLW_3_1Suite : public TestCommand { public: - Test_TC_MC_10_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_2", 0, credsIssuerConfig) + Test_TC_FLW_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56530,7 +61206,7 @@ class Test_TC_MC_10_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_2Suite() {} + ~Test_TC_FLW_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56575,10 +61251,10 @@ class Test_TC_MC_10_2Suite : public TestCommand } }; -class Test_TC_MC_10_3Suite : public TestCommand +class Test_TC_OCC_2_3Suite : public TestCommand { public: - Test_TC_MC_10_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_3", 0, credsIssuerConfig) + Test_TC_OCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56586,7 +61262,7 @@ class Test_TC_MC_10_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_3Suite() {} + ~Test_TC_OCC_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56631,10 +61307,10 @@ class Test_TC_MC_10_3Suite : public TestCommand } }; -class Test_TC_MC_10_4Suite : public TestCommand +class Test_TC_OCC_2_4Suite : public TestCommand { public: - Test_TC_MC_10_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_4", 0, credsIssuerConfig) + Test_TC_OCC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56642,7 +61318,7 @@ class Test_TC_MC_10_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_4Suite() {} + ~Test_TC_OCC_2_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56687,10 +61363,10 @@ class Test_TC_MC_10_4Suite : public TestCommand } }; -class Test_TC_MC_10_5Suite : public TestCommand +class Test_TC_OCC_3_1Suite : public TestCommand { public: - Test_TC_MC_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_5", 0, credsIssuerConfig) + Test_TC_OCC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56698,7 +61374,7 @@ class Test_TC_MC_10_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_5Suite() {} + ~Test_TC_OCC_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56743,10 +61419,10 @@ class Test_TC_MC_10_5Suite : public TestCommand } }; -class Test_TC_MC_10_6Suite : public TestCommand +class Test_TC_OCC_3_2Suite : public TestCommand { public: - Test_TC_MC_10_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_10_6", 0, credsIssuerConfig) + Test_TC_OCC_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56754,7 +61430,7 @@ class Test_TC_MC_10_6Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_10_6Suite() {} + ~Test_TC_OCC_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56799,10 +61475,10 @@ class Test_TC_MC_10_6Suite : public TestCommand } }; -class Test_TC_MF_1_1Suite : public TestCommand +class Test_TC_PRS_2_2Suite : public TestCommand { public: - Test_TC_MF_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_1", 0, credsIssuerConfig) + Test_TC_PRS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56810,7 +61486,7 @@ class Test_TC_MF_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_1Suite() {} + ~Test_TC_PRS_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56855,10 +61531,10 @@ class Test_TC_MF_1_1Suite : public TestCommand } }; -class Test_TC_MF_1_2Suite : public TestCommand +class Test_TC_PRS_2_3Suite : public TestCommand { public: - Test_TC_MF_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_2", 0, credsIssuerConfig) + Test_TC_PRS_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56866,7 +61542,7 @@ class Test_TC_MF_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_2Suite() {} + ~Test_TC_PRS_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56911,10 +61587,10 @@ class Test_TC_MF_1_2Suite : public TestCommand } }; -class Test_TC_MF_1_7Suite : public TestCommand +class Test_TC_PRS_3_1Suite : public TestCommand { public: - Test_TC_MF_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_7", 0, credsIssuerConfig) + Test_TC_PRS_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56922,7 +61598,7 @@ class Test_TC_MF_1_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_7Suite() {} + ~Test_TC_PRS_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -56967,10 +61643,10 @@ class Test_TC_MF_1_7Suite : public TestCommand } }; -class Test_TC_MF_1_8Suite : public TestCommand +class Test_TC_PS_2_2Suite : public TestCommand { public: - Test_TC_MF_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_8", 0, credsIssuerConfig) + Test_TC_PS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -56978,7 +61654,7 @@ class Test_TC_MF_1_8Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_8Suite() {} + ~Test_TC_PS_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57023,10 +61699,10 @@ class Test_TC_MF_1_8Suite : public TestCommand } }; -class Test_TC_MF_1_9Suite : public TestCommand +class Test_TC_PS_3_1Suite : public TestCommand { public: - Test_TC_MF_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_9", 0, credsIssuerConfig) + Test_TC_PS_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57034,7 +61710,7 @@ class Test_TC_MF_1_9Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_9Suite() {} + ~Test_TC_PS_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57079,10 +61755,10 @@ class Test_TC_MF_1_9Suite : public TestCommand } }; -class Test_TC_MF_1_10Suite : public TestCommand +class Test_TC_BOOL_2_2Suite : public TestCommand { public: - Test_TC_MF_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_10", 0, credsIssuerConfig) + Test_TC_BOOL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57090,7 +61766,7 @@ class Test_TC_MF_1_10Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_10Suite() {} + ~Test_TC_BOOL_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57135,10 +61811,10 @@ class Test_TC_MF_1_10Suite : public TestCommand } }; -class Test_TC_MF_1_11Suite : public TestCommand +class Test_TC_BOOL_3_1Suite : public TestCommand { public: - Test_TC_MF_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_11", 0, credsIssuerConfig) + Test_TC_BOOL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57146,7 +61822,7 @@ class Test_TC_MF_1_11Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_11Suite() {} + ~Test_TC_BOOL_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57191,10 +61867,10 @@ class Test_TC_MF_1_11Suite : public TestCommand } }; -class Test_TC_MF_1_12Suite : public TestCommand +class Test_TC_CC_2_2Suite : public TestCommand { public: - Test_TC_MF_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_12", 0, credsIssuerConfig) + Test_TC_CC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57202,7 +61878,7 @@ class Test_TC_MF_1_12Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_12Suite() {} + ~Test_TC_CC_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57247,10 +61923,10 @@ class Test_TC_MF_1_12Suite : public TestCommand } }; -class Test_TC_MF_1_13Suite : public TestCommand +class Test_TC_CC_3_4Suite : public TestCommand { public: - Test_TC_MF_1_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_13", 0, credsIssuerConfig) + Test_TC_CC_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57258,7 +61934,7 @@ class Test_TC_MF_1_13Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_13Suite() {} + ~Test_TC_CC_3_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57303,10 +61979,10 @@ class Test_TC_MF_1_13Suite : public TestCommand } }; -class Test_TC_MF_1_14Suite : public TestCommand +class Test_TC_CC_4_5Suite : public TestCommand { public: - Test_TC_MF_1_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_14", 0, credsIssuerConfig) + Test_TC_CC_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57314,7 +61990,7 @@ class Test_TC_MF_1_14Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_14Suite() {} + ~Test_TC_CC_4_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57359,10 +62035,10 @@ class Test_TC_MF_1_14Suite : public TestCommand } }; -class Test_TC_MF_1_16Suite : public TestCommand +class Test_TC_CC_5_4Suite : public TestCommand { public: - Test_TC_MF_1_16Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_16", 0, credsIssuerConfig) + Test_TC_CC_5_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57370,7 +62046,7 @@ class Test_TC_MF_1_16Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_16Suite() {} + ~Test_TC_CC_5_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57415,10 +62091,10 @@ class Test_TC_MF_1_16Suite : public TestCommand } }; -class Test_TC_MF_1_17Suite : public TestCommand +class Test_TC_CC_6_4Suite : public TestCommand { public: - Test_TC_MF_1_17Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_17", 0, credsIssuerConfig) + Test_TC_CC_6_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57426,7 +62102,7 @@ class Test_TC_MF_1_17Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_17Suite() {} + ~Test_TC_CC_6_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57471,10 +62147,10 @@ class Test_TC_MF_1_17Suite : public TestCommand } }; -class Test_TC_MF_1_18Suite : public TestCommand +class Test_TC_CC_7_5Suite : public TestCommand { public: - Test_TC_MF_1_18Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_18", 0, credsIssuerConfig) + Test_TC_CC_7_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57482,7 +62158,7 @@ class Test_TC_MF_1_18Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_18Suite() {} + ~Test_TC_CC_7_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57527,18 +62203,18 @@ class Test_TC_MF_1_18Suite : public TestCommand } }; -class Test_TC_MF_1_19Suite : public TestCommand +class Test_TC_CC_9_4Suite : public TestCommand { public: - Test_TC_MF_1_19Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_19", 0, credsIssuerConfig) + Test_TC_CC_9_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_9_4", 0, credsIssuerConfig) { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_19Suite() {} + ~Test_TC_CC_9_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57546,9 +62222,9 @@ class Test_TC_MF_1_19Suite : public TestCommand } private: + chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mNodeId; chip::Optional mTimeout; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -57583,10 +62259,10 @@ class Test_TC_MF_1_19Suite : public TestCommand } }; -class Test_TC_MF_1_20Suite : public TestCommand +class Test_TC_DL_1_1Suite : public TestCommand { public: - Test_TC_MF_1_20Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_20", 0, credsIssuerConfig) + Test_TC_DL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57594,7 +62270,7 @@ class Test_TC_MF_1_20Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_20Suite() {} + ~Test_TC_DL_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57639,10 +62315,10 @@ class Test_TC_MF_1_20Suite : public TestCommand } }; -class Test_TC_MF_1_21Suite : public TestCommand +class Test_TC_DL_1_2Suite : public TestCommand { public: - Test_TC_MF_1_21Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_21", 0, credsIssuerConfig) + Test_TC_DL_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57650,7 +62326,7 @@ class Test_TC_MF_1_21Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_21Suite() {} + ~Test_TC_DL_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57695,10 +62371,10 @@ class Test_TC_MF_1_21Suite : public TestCommand } }; -class Test_TC_MF_1_22Suite : public TestCommand +class Test_TC_DL_1_4Suite : public TestCommand { public: - Test_TC_MF_1_22Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_22", 0, credsIssuerConfig) + Test_TC_DL_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57706,7 +62382,7 @@ class Test_TC_MF_1_22Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_22Suite() {} + ~Test_TC_DL_1_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57751,10 +62427,10 @@ class Test_TC_MF_1_22Suite : public TestCommand } }; -class Test_TC_MF_1_23Suite : public TestCommand +class Test_TC_DL_1_5Suite : public TestCommand { public: - Test_TC_MF_1_23Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_23", 0, credsIssuerConfig) + Test_TC_DL_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57762,7 +62438,7 @@ class Test_TC_MF_1_23Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_23Suite() {} + ~Test_TC_DL_1_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57807,10 +62483,10 @@ class Test_TC_MF_1_23Suite : public TestCommand } }; -class Test_TC_MF_1_24Suite : public TestCommand +class Test_TC_DL_1_6Suite : public TestCommand { public: - Test_TC_MF_1_24Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_24", 0, credsIssuerConfig) + Test_TC_DL_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57818,7 +62494,7 @@ class Test_TC_MF_1_24Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_24Suite() {} + ~Test_TC_DL_1_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57863,10 +62539,10 @@ class Test_TC_MF_1_24Suite : public TestCommand } }; -class Test_TC_MF_1_25Suite : public TestCommand +class Test_TC_DL_1_7Suite : public TestCommand { public: - Test_TC_MF_1_25Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_25", 0, credsIssuerConfig) + Test_TC_DL_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57874,7 +62550,7 @@ class Test_TC_MF_1_25Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_25Suite() {} + ~Test_TC_DL_1_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57919,10 +62595,10 @@ class Test_TC_MF_1_25Suite : public TestCommand } }; -class Test_TC_MF_1_26Suite : public TestCommand +class Test_TC_DL_1_8Suite : public TestCommand { public: - Test_TC_MF_1_26Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_26", 0, credsIssuerConfig) + Test_TC_DL_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_8", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57930,7 +62606,7 @@ class Test_TC_MF_1_26Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_26Suite() {} + ~Test_TC_DL_1_8Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -57975,10 +62651,10 @@ class Test_TC_MF_1_26Suite : public TestCommand } }; -class Test_TC_MF_1_27Suite : public TestCommand +class Test_TC_DL_1_10Suite : public TestCommand { public: - Test_TC_MF_1_27Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_27", 0, credsIssuerConfig) + Test_TC_DL_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_10", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -57986,7 +62662,7 @@ class Test_TC_MF_1_27Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_27Suite() {} + ~Test_TC_DL_1_10Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58031,10 +62707,10 @@ class Test_TC_MF_1_27Suite : public TestCommand } }; -class Test_TC_MF_1_28Suite : public TestCommand +class Test_TC_DL_1_11Suite : public TestCommand { public: - Test_TC_MF_1_28Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_28", 0, credsIssuerConfig) + Test_TC_DL_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_11", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58042,7 +62718,7 @@ class Test_TC_MF_1_28Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MF_1_28Suite() {} + ~Test_TC_DL_1_11Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58087,10 +62763,10 @@ class Test_TC_MF_1_28Suite : public TestCommand } }; -class Test_TC_MOD_1_2Suite : public TestCommand +class Test_TC_DL_1_13Suite : public TestCommand { public: - Test_TC_MOD_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_1_2", 0, credsIssuerConfig) + Test_TC_DL_1_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_13", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58098,7 +62774,7 @@ class Test_TC_MOD_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MOD_1_2Suite() {} + ~Test_TC_DL_1_13Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58143,10 +62819,10 @@ class Test_TC_MOD_1_2Suite : public TestCommand } }; -class Test_TC_MOD_2_1Suite : public TestCommand +class Test_TC_DL_1_14Suite : public TestCommand { public: - Test_TC_MOD_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_2_1", 0, credsIssuerConfig) + Test_TC_DL_1_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_14", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58154,7 +62830,7 @@ class Test_TC_MOD_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MOD_2_1Suite() {} + ~Test_TC_DL_1_14Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58199,10 +62875,10 @@ class Test_TC_MOD_2_1Suite : public TestCommand } }; -class Test_TC_MOD_2_2Suite : public TestCommand +class Test_TC_DL_1_15Suite : public TestCommand { public: - Test_TC_MOD_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_2_2", 0, credsIssuerConfig) + Test_TC_DL_1_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_15", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58210,7 +62886,7 @@ class Test_TC_MOD_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MOD_2_2Suite() {} + ~Test_TC_DL_1_15Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58255,10 +62931,10 @@ class Test_TC_MOD_2_2Suite : public TestCommand } }; -class Test_TC_MOD_3_1Suite : public TestCommand +class Test_TC_DL_1_16Suite : public TestCommand { public: - Test_TC_MOD_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_3_1", 0, credsIssuerConfig) + Test_TC_DL_1_16Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_16", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58266,7 +62942,7 @@ class Test_TC_MOD_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MOD_3_1Suite() {} + ~Test_TC_DL_1_16Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58311,10 +62987,10 @@ class Test_TC_MOD_3_1Suite : public TestCommand } }; -class Test_TC_MOD_3_2Suite : public TestCommand +class Test_TC_DL_1_17Suite : public TestCommand { public: - Test_TC_MOD_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_3_2", 0, credsIssuerConfig) + Test_TC_DL_1_17Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_17", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58322,7 +62998,7 @@ class Test_TC_MOD_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MOD_3_2Suite() {} + ~Test_TC_DL_1_17Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58367,10 +63043,10 @@ class Test_TC_MOD_3_2Suite : public TestCommand } }; -class Test_TC_MOD_3_3Suite : public TestCommand +class Test_TC_LC_1_1Suite : public TestCommand { public: - Test_TC_MOD_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_3_3", 0, credsIssuerConfig) + Test_TC_LC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58378,7 +63054,7 @@ class Test_TC_MOD_3_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MOD_3_3Suite() {} + ~Test_TC_LC_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58423,10 +63099,10 @@ class Test_TC_MOD_3_3Suite : public TestCommand } }; -class Test_TC_SU_1_1Suite : public TestCommand +class Test_TC_LC_1_3Suite : public TestCommand { public: - Test_TC_SU_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_1_1", 0, credsIssuerConfig) + Test_TC_LC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_1_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58434,7 +63110,7 @@ class Test_TC_SU_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_1_1Suite() {} + ~Test_TC_LC_1_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58479,10 +63155,10 @@ class Test_TC_SU_1_1Suite : public TestCommand } }; -class Test_TC_SU_2_1Suite : public TestCommand +class Test_TC_LC_1_4Suite : public TestCommand { public: - Test_TC_SU_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_1", 0, credsIssuerConfig) + Test_TC_LC_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_1_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58490,7 +63166,7 @@ class Test_TC_SU_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_2_1Suite() {} + ~Test_TC_LC_1_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58535,10 +63211,10 @@ class Test_TC_SU_2_1Suite : public TestCommand } }; -class Test_TC_SU_2_2Suite : public TestCommand +class Test_TC_LC_1_5Suite : public TestCommand { public: - Test_TC_SU_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_2", 0, credsIssuerConfig) + Test_TC_LC_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_1_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58546,7 +63222,7 @@ class Test_TC_SU_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_2_2Suite() {} + ~Test_TC_LC_1_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58591,10 +63267,10 @@ class Test_TC_SU_2_2Suite : public TestCommand } }; -class Test_TC_SU_2_3Suite : public TestCommand +class Test_TC_LO_1_1Suite : public TestCommand { public: - Test_TC_SU_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_3", 0, credsIssuerConfig) + Test_TC_LO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LO_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58602,7 +63278,7 @@ class Test_TC_SU_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_2_3Suite() {} + ~Test_TC_LO_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58647,10 +63323,10 @@ class Test_TC_SU_2_3Suite : public TestCommand } }; -class Test_TC_SU_2_4Suite : public TestCommand +class Test_TC_LVL_2_3Suite : public TestCommand { public: - Test_TC_SU_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_4", 0, credsIssuerConfig) + Test_TC_LVL_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58658,7 +63334,7 @@ class Test_TC_SU_2_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_2_4Suite() {} + ~Test_TC_LVL_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58703,10 +63379,10 @@ class Test_TC_SU_2_4Suite : public TestCommand } }; -class Test_TC_SU_2_5Suite : public TestCommand +class Test_TC_NC_1_1Suite : public TestCommand { public: - Test_TC_SU_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_5", 0, credsIssuerConfig) + Test_TC_NC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58714,7 +63390,7 @@ class Test_TC_SU_2_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_2_5Suite() {} + ~Test_TC_NC_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58759,10 +63435,10 @@ class Test_TC_SU_2_5Suite : public TestCommand } }; -class Test_TC_SU_2_6Suite : public TestCommand +class Test_TC_NC_1_2Suite : public TestCommand { public: - Test_TC_SU_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_6", 0, credsIssuerConfig) + Test_TC_NC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58770,7 +63446,7 @@ class Test_TC_SU_2_6Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_2_6Suite() {} + ~Test_TC_NC_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58815,10 +63491,10 @@ class Test_TC_SU_2_6Suite : public TestCommand } }; -class Test_TC_SU_2_7Suite : public TestCommand +class Test_TC_NC_1_3Suite : public TestCommand { public: - Test_TC_SU_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_2_7", 0, credsIssuerConfig) + Test_TC_NC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58826,7 +63502,7 @@ class Test_TC_SU_2_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_2_7Suite() {} + ~Test_TC_NC_1_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58871,10 +63547,10 @@ class Test_TC_SU_2_7Suite : public TestCommand } }; -class Test_TC_SU_3_1Suite : public TestCommand +class Test_TC_NC_1_4Suite : public TestCommand { public: - Test_TC_SU_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_1", 0, credsIssuerConfig) + Test_TC_NC_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58882,7 +63558,7 @@ class Test_TC_SU_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_3_1Suite() {} + ~Test_TC_NC_1_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58927,10 +63603,10 @@ class Test_TC_SU_3_1Suite : public TestCommand } }; -class Test_TC_SU_3_2Suite : public TestCommand +class Test_TC_NC_1_5Suite : public TestCommand { public: - Test_TC_SU_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_2", 0, credsIssuerConfig) + Test_TC_NC_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58938,7 +63614,7 @@ class Test_TC_SU_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_3_2Suite() {} + ~Test_TC_NC_1_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -58983,10 +63659,10 @@ class Test_TC_SU_3_2Suite : public TestCommand } }; -class Test_TC_SU_3_3Suite : public TestCommand +class Test_TC_NC_1_6Suite : public TestCommand { public: - Test_TC_SU_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_3", 0, credsIssuerConfig) + Test_TC_NC_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -58994,7 +63670,7 @@ class Test_TC_SU_3_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_3_3Suite() {} + ~Test_TC_NC_1_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59039,10 +63715,10 @@ class Test_TC_SU_3_3Suite : public TestCommand } }; -class Test_TC_SU_3_4Suite : public TestCommand +class Test_TC_NC_1_7Suite : public TestCommand { public: - Test_TC_SU_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_3_4", 0, credsIssuerConfig) + Test_TC_NC_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59050,7 +63726,7 @@ class Test_TC_SU_3_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_3_4Suite() {} + ~Test_TC_NC_1_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59095,10 +63771,10 @@ class Test_TC_SU_3_4Suite : public TestCommand } }; -class Test_TC_SU_4_1Suite : public TestCommand +class Test_TC_NC_1_8Suite : public TestCommand { public: - Test_TC_SU_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_4_1", 0, credsIssuerConfig) + Test_TC_NC_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_8", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59106,7 +63782,7 @@ class Test_TC_SU_4_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_4_1Suite() {} + ~Test_TC_NC_1_8Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59151,10 +63827,10 @@ class Test_TC_SU_4_1Suite : public TestCommand } }; -class Test_TC_SU_4_2Suite : public TestCommand +class Test_TC_NC_1_9Suite : public TestCommand { public: - Test_TC_SU_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SU_4_2", 0, credsIssuerConfig) + Test_TC_NC_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_9", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59162,7 +63838,7 @@ class Test_TC_SU_4_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SU_4_2Suite() {} + ~Test_TC_NC_1_9Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59207,10 +63883,10 @@ class Test_TC_SU_4_2Suite : public TestCommand } }; -class Test_TC_PSCFG_2_1Suite : public TestCommand +class Test_TC_NC_1_10Suite : public TestCommand { public: - Test_TC_PSCFG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PSCFG_2_1", 0, credsIssuerConfig) + Test_TC_NC_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_10", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59218,7 +63894,7 @@ class Test_TC_PSCFG_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PSCFG_2_1Suite() {} + ~Test_TC_NC_1_10Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59263,10 +63939,10 @@ class Test_TC_PSCFG_2_1Suite : public TestCommand } }; -class Test_TC_PSCFG_3_1Suite : public TestCommand +class Test_TC_NC_1_11Suite : public TestCommand { public: - Test_TC_PSCFG_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PSCFG_3_1", 0, credsIssuerConfig) + Test_TC_NC_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_11", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59274,7 +63950,7 @@ class Test_TC_PSCFG_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PSCFG_3_1Suite() {} + ~Test_TC_NC_1_11Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59319,10 +63995,10 @@ class Test_TC_PSCFG_3_1Suite : public TestCommand } }; -class Test_TC_SC_4_5Suite : public TestCommand +class Test_TC_NC_1_12Suite : public TestCommand { public: - Test_TC_SC_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_5", 0, credsIssuerConfig) + Test_TC_NC_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_12", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59330,7 +64006,7 @@ class Test_TC_SC_4_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_5Suite() {} + ~Test_TC_NC_1_12Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59375,10 +64051,10 @@ class Test_TC_SC_4_5Suite : public TestCommand } }; -class Test_TC_SC_4_6Suite : public TestCommand +class Test_TC_NC_1_13Suite : public TestCommand { public: - Test_TC_SC_4_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_6", 0, credsIssuerConfig) + Test_TC_NC_1_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_13", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59386,7 +64062,7 @@ class Test_TC_SC_4_6Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_6Suite() {} + ~Test_TC_NC_1_13Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59431,10 +64107,10 @@ class Test_TC_SC_4_6Suite : public TestCommand } }; -class Test_TC_SC_4_7Suite : public TestCommand +class Test_TC_NC_1_14Suite : public TestCommand { public: - Test_TC_SC_4_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_7", 0, credsIssuerConfig) + Test_TC_NC_1_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_14", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59442,7 +64118,7 @@ class Test_TC_SC_4_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_7Suite() {} + ~Test_TC_NC_1_14Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59487,10 +64163,10 @@ class Test_TC_SC_4_7Suite : public TestCommand } }; -class Test_TC_SC_4_8Suite : public TestCommand +class Test_TC_NC_1_15Suite : public TestCommand { public: - Test_TC_SC_4_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_8", 0, credsIssuerConfig) + Test_TC_NC_1_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_15", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59498,7 +64174,7 @@ class Test_TC_SC_4_8Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_8Suite() {} + ~Test_TC_NC_1_15Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59543,10 +64219,10 @@ class Test_TC_SC_4_8Suite : public TestCommand } }; -class Test_TC_SC_4_9Suite : public TestCommand +class Test_TC_NC_1_16Suite : public TestCommand { public: - Test_TC_SC_4_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_9", 0, credsIssuerConfig) + Test_TC_NC_1_16Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_16", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59554,7 +64230,7 @@ class Test_TC_SC_4_9Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_9Suite() {} + ~Test_TC_NC_1_16Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59599,10 +64275,10 @@ class Test_TC_SC_4_9Suite : public TestCommand } }; -class Test_TC_SWDIAG_1_2Suite : public TestCommand +class Test_TC_NC_1_17Suite : public TestCommand { public: - Test_TC_SWDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWDIAG_1_2", 0, credsIssuerConfig) + Test_TC_NC_1_17Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_17", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59610,7 +64286,7 @@ class Test_TC_SWDIAG_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SWDIAG_1_2Suite() {} + ~Test_TC_NC_1_17Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59655,11 +64331,10 @@ class Test_TC_SWDIAG_1_2Suite : public TestCommand } }; -class Test_TC_WIFIDIAG_1_2Suite : public TestCommand +class Test_TC_NC_1_18Suite : public TestCommand { public: - Test_TC_WIFIDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_WIFIDIAG_1_2", 0, credsIssuerConfig) + Test_TC_NC_1_18Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_NC_1_18", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59667,7 +64342,7 @@ class Test_TC_WIFIDIAG_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_WIFIDIAG_1_2Suite() {} + ~Test_TC_NC_1_18Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59712,11 +64387,10 @@ class Test_TC_WIFIDIAG_1_2Suite : public TestCommand } }; -class Test_TC_WIFIDIAG_2_1Suite : public TestCommand +class Test_TC_OO_3_1Suite : public TestCommand { public: - Test_TC_WIFIDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_WIFIDIAG_2_1", 0, credsIssuerConfig) + Test_TC_OO_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59724,7 +64398,7 @@ class Test_TC_WIFIDIAG_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_WIFIDIAG_2_1Suite() {} + ~Test_TC_OO_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59769,10 +64443,10 @@ class Test_TC_WIFIDIAG_2_1Suite : public TestCommand } }; -class Test_TC_WNCV_6_1Suite : public TestCommand +class Test_TC_OO_3_2Suite : public TestCommand { public: - Test_TC_WNCV_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_6_1", 0, credsIssuerConfig) + Test_TC_OO_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59780,7 +64454,7 @@ class Test_TC_WNCV_6_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_WNCV_6_1Suite() {} + ~Test_TC_OO_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59825,10 +64499,10 @@ class Test_TC_WNCV_6_1Suite : public TestCommand } }; -class Test_TC_FLW_3_1Suite : public TestCommand +class Test_TC_RH_3_1Suite : public TestCommand { public: - Test_TC_FLW_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_3_1", 0, credsIssuerConfig) + Test_TC_RH_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59836,7 +64510,7 @@ class Test_TC_FLW_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_FLW_3_1Suite() {} + ~Test_TC_RH_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59881,10 +64555,10 @@ class Test_TC_FLW_3_1Suite : public TestCommand } }; -class Test_TC_OCC_2_3Suite : public TestCommand +class Test_TC_SWTCH_1_1Suite : public TestCommand { public: - Test_TC_OCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_3", 0, credsIssuerConfig) + Test_TC_SWTCH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59892,7 +64566,7 @@ class Test_TC_OCC_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_OCC_2_3Suite() {} + ~Test_TC_SWTCH_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59937,10 +64611,10 @@ class Test_TC_OCC_2_3Suite : public TestCommand } }; -class Test_TC_OCC_2_4Suite : public TestCommand +class Test_TC_SWTCH_3_1Suite : public TestCommand { public: - Test_TC_OCC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_4", 0, credsIssuerConfig) + Test_TC_SWTCH_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59948,7 +64622,7 @@ class Test_TC_OCC_2_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_OCC_2_4Suite() {} + ~Test_TC_SWTCH_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -59993,10 +64667,10 @@ class Test_TC_OCC_2_4Suite : public TestCommand } }; -class Test_TC_OCC_3_1Suite : public TestCommand +class Test_TC_TM_3_1Suite : public TestCommand { public: - Test_TC_OCC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_3_1", 0, credsIssuerConfig) + Test_TC_TM_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TM_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -60004,7 +64678,7 @@ class Test_TC_OCC_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_OCC_3_1Suite() {} + ~Test_TC_TM_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -60049,10 +64723,10 @@ class Test_TC_OCC_3_1Suite : public TestCommand } }; -class Test_TC_PRS_2_2Suite : public TestCommand +class Test_TC_TSTAT_3_1Suite : public TestCommand { public: - Test_TC_PRS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_2", 0, credsIssuerConfig) + Test_TC_TSTAT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -60060,7 +64734,7 @@ class Test_TC_PRS_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PRS_2_2Suite() {} + ~Test_TC_TSTAT_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -60105,10 +64779,10 @@ class Test_TC_PRS_2_2Suite : public TestCommand } }; -class Test_TC_PRS_2_3Suite : public TestCommand +class Test_TC_TSTAT_3_2Suite : public TestCommand { public: - Test_TC_PRS_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_3", 0, credsIssuerConfig) + Test_TC_TSTAT_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -60116,7 +64790,7 @@ class Test_TC_PRS_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PRS_2_3Suite() {} + ~Test_TC_TSTAT_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -60161,10 +64835,10 @@ class Test_TC_PRS_2_3Suite : public TestCommand } }; -class Test_TC_PS_2_2Suite : public TestCommand +class Test_TC_TSUIC_3_1Suite : public TestCommand { public: - Test_TC_PS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_2_2", 0, credsIssuerConfig) + Test_TC_TSUIC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSUIC_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -60172,7 +64846,7 @@ class Test_TC_PS_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PS_2_2Suite() {} + ~Test_TC_TSUIC_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -60425,12 +65099,18 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -60443,6 +65123,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -60455,8 +65136,10 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -60468,11 +65151,15 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -60487,6 +65174,8 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -60497,6 +65186,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -60521,6 +65211,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -60541,23 +65232,88 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), #endif // CONFIG_ENABLE_YAML_TESTS }; From aa0f07ad90ff5be6180f4e4531299425e8518a89 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 28 Apr 2022 20:46:29 +0200 Subject: [PATCH 30/59] [Tests] Increase the tests timeout from 30 minutes to 40 minutes (#17838) --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 83f1fe23216beb..ab937a941256a5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -88,7 +88,7 @@ jobs: --copy-artifacts-to objdir-clone \ " - name: Run Tests - timeout-minutes: 30 + timeout-minutes: 40 run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ From 0ff0b15447988dbb6202ef0786dcf31eafd58bf8 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 28 Apr 2022 21:01:42 +0200 Subject: [PATCH 31/59] [chip-tool] Do not try to reset an element that does not exists in the case of a group command (#17844) --- examples/chip-tool/commands/clusters/ClusterCommand.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/chip-tool/commands/clusters/ClusterCommand.h b/examples/chip-tool/commands/clusters/ClusterCommand.h index ca1738bc8b6715..bea828262d3554 100644 --- a/examples/chip-tool/commands/clusters/ClusterCommand.h +++ b/examples/chip-tool/commands/clusters/ClusterCommand.h @@ -104,8 +104,11 @@ class ClusterCommand : public ModelCommand, public chip::app::CommandSender::Cal virtual void OnDone(chip::app::CommandSender * client) override { - mCommandSender.front().reset(); - mCommandSender.erase(mCommandSender.begin()); + if (mCommandSender.size()) + { + mCommandSender.front().reset(); + mCommandSender.erase(mCommandSender.begin()); + } // If the command is repeated N times, wait for all the responses to comes in // before exiting. From 2826b34f444500f631c8278dbe5b71e0917aeba5 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 28 Apr 2022 16:39:53 -0400 Subject: [PATCH 32/59] Remove the concept of client attributes from EmberAfAttributeSearchRecord. (#17825) All attributes in Matter are server attributes. --- src/app/util/af-types.h | 7 ------- src/app/util/af.h | 10 +--------- src/app/util/attribute-metadata.h | 4 +--- src/app/util/attribute-storage.cpp | 10 +++------- src/app/util/attribute-table.cpp | 20 ++++++++++++------- .../util/ember-compatibility-functions.cpp | 6 ++---- src/app/util/util.cpp | 14 +++++++++---- 7 files changed, 30 insertions(+), 41 deletions(-) diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index 31ba518ccfdf2a..7bae467385e664 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -158,13 +158,6 @@ typedef struct */ chip::ClusterId clusterId; - /** - * Cluster mask for the cluster, used to determine if it is - * the server or client version of the cluster. See CLUSTER_MASK_ - * macros defined in att-storage.h - */ - EmberAfClusterMask clusterMask; - /** * The identifier for the attribute. */ diff --git a/src/app/util/af.h b/src/app/util/af.h index 55e4a3aef1a681..62260001a9c47c 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -90,12 +90,11 @@ static constexpr uint16_t kEmberInvalidEndpointIndex = 0xFFFF; * @param endpoint Zigbee endpoint number. * @param clusterId Cluster ID of the sought cluster. * @param attributeId Attribute ID of the sought attribute. - * @param mask CLUSTER_MASK_SERVER or CLUSTER_MASK_CLIENT * * @return Returns pointer to the attribute metadata location. */ const EmberAfAttributeMetadata * emberAfLocateAttributeMetadata(chip::EndpointId endpoint, chip::ClusterId clusterId, - chip::AttributeId attributeId, uint8_t mask); + chip::AttributeId attributeId); /** * @brief Returns true if endpoint contains the ZCL cluster with specified id. @@ -249,13 +248,6 @@ uint8_t emberAfGetDataSize(uint8_t dataType); */ #define emberAfClusterIsManufacturerSpecific(cluster) ((cluster)->clusterId >= 0xFC00) -/** - * @brief macro that returns true if client attribute, and false if server. - * - * @param metadata EmberAfAttributeMetadata* to consider. - */ -#define emberAfAttributeIsClient(metadata) (((metadata)->mask & ATTRIBUTE_MASK_CLIENT) != 0) - /** * @brief macro that returns true if attribute is saved in external storage. * diff --git a/src/app/util/attribute-metadata.h b/src/app/util/attribute-metadata.h index 01987935589115..c9765679e94446 100644 --- a/src/app/util/attribute-metadata.h +++ b/src/app/util/attribute-metadata.h @@ -136,10 +136,8 @@ union EmberAfDefaultOrMinMaxAttributeValue #define ATTRIBUTE_MASK_EXTERNAL_STORAGE (0x10) // Attribute is singleton #define ATTRIBUTE_MASK_SINGLETON (0x20) -// Attribute is a client attribute -#define ATTRIBUTE_MASK_CLIENT (0x40) // Attribute is nullable -#define ATTRIBUTE_MASK_NULLABLE (0x80) +#define ATTRIBUTE_MASK_NULLABLE (0x40) /** * @brief Each attribute has it's metadata stored in such struct. diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index cc5630847c4cfc..ec2c0f12bc823f 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -415,14 +415,12 @@ void emAfCallInits(void) } // Returns the pointer to metadata, or null if it is not found -const EmberAfAttributeMetadata * emberAfLocateAttributeMetadata(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, - uint8_t mask) +const EmberAfAttributeMetadata * emberAfLocateAttributeMetadata(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId) { const EmberAfAttributeMetadata * metadata = nullptr; EmberAfAttributeSearchRecord record; record.endpoint = endpoint; record.clusterId = clusterId; - record.clusterMask = mask; record.attributeId = attributeId; emAfReadOrWriteAttribute(&record, &metadata, nullptr, // buffer @@ -512,12 +510,11 @@ static EmberAfStatus typeSensitiveMemCopy(ClusterId clusterId, uint8_t * dest, u * * Clusters match if: * 1. Cluster ids match AND - * 2. Cluster directions match as defined by cluster->mask - * and attRecord->clusterMask + * 2. Cluster is a server cluster (because there are no client attributes). */ bool emAfMatchCluster(const EmberAfCluster * cluster, EmberAfAttributeSearchRecord * attRecord) { - return (cluster->clusterId == attRecord->clusterId && cluster->mask & attRecord->clusterMask); + return (cluster->clusterId == attRecord->clusterId && (cluster->mask & CLUSTER_MASK_SERVER)); } /** @@ -1244,7 +1241,6 @@ void emAfLoadAttributeDefaults(EndpointId endpoint, bool ignoreStorage, Optional EmberAfAttributeSearchRecord record; record.endpoint = de->endpoint; record.clusterId = cluster->clusterId; - record.clusterMask = (emberAfAttributeIsClient(am) ? CLUSTER_MASK_CLIENT : CLUSTER_MASK_SERVER); record.attributeId = am->attributeId; if (ptr == nullptr) diff --git a/src/app/util/attribute-table.cpp b/src/app/util/attribute-table.cpp index 13e2efc42bfe83..4bbf7889cce0dd 100644 --- a/src/app/util/attribute-table.cpp +++ b/src/app/util/attribute-table.cpp @@ -159,7 +159,7 @@ void emberAfPrintAttributeTable(void) { EmberAfDefinedEndpoint * ep = &(emAfEndpoints[endpointIndex]); emberAfAttributesPrintln("ENDPOINT %x", ep->endpoint); - emberAfAttributesPrintln("clus / side / attr / mfg /type(len)/ rw / storage / data (raw)"); + emberAfAttributesPrintln("clus / attr / mfg /type(len)/ rw / storage / data (raw)"); emberAfAttributesFlush(); for (clusterIndex = 0; clusterIndex < ep->endpointType->clusterCount; clusterIndex++) { @@ -174,8 +174,7 @@ void emberAfPrintAttributeTable(void) // manually reset the watchdog. // halResetWatchdog(); - emberAfAttributesPrint(ChipLogFormatMEI " / %p / " ChipLogFormatMEI " / ", ChipLogValueMEI(cluster->clusterId), - (emberAfAttributeIsClient(metaData) ? "clnt" : "srvr"), + emberAfAttributesPrint(ChipLogFormatMEI " / " ChipLogFormatMEI " / ", ChipLogValueMEI(cluster->clusterId), ChipLogValueMEI(metaData->attributeId)); emberAfAttributesPrint("----"); emberAfAttributesPrint( @@ -183,8 +182,7 @@ void emberAfPrintAttributeTable(void) (metaData->IsReadOnly() ? "RO" : "RW"), (metaData->IsNonVolatile() ? " nonvolatile " : (metaData->IsExternal() ? " extern " : " RAM "))); emberAfAttributesFlush(); - status = emAfReadAttribute(ep->endpoint, cluster->clusterId, metaData->attributeId, - (emberAfAttributeIsClient(metaData) ? CLUSTER_MASK_CLIENT : CLUSTER_MASK_SERVER), data, + status = emAfReadAttribute(ep->endpoint, cluster->clusterId, metaData->attributeId, CLUSTER_MASK_SERVER, data, ATTRIBUTE_LARGEST, nullptr); if (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) { @@ -299,11 +297,15 @@ static bool IsNullValue(const uint8_t * data, uint16_t dataLen, bool isAttribute EmberAfStatus emAfWriteAttribute(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, uint8_t mask, uint8_t * data, EmberAfAttributeType dataType, bool overrideReadOnlyAndDataType, bool justTest) { + if (mask != CLUSTER_MASK_SERVER) + { + return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE; + } + const EmberAfAttributeMetadata * metadata = nullptr; EmberAfAttributeSearchRecord record; record.endpoint = endpoint; record.clusterId = cluster; - record.clusterMask = mask; record.attributeId = attributeID; emAfReadOrWriteAttribute(&record, &metadata, nullptr, // buffer @@ -444,12 +446,16 @@ EmberAfStatus emAfWriteAttribute(EndpointId endpoint, ClusterId cluster, Attribu EmberAfStatus emAfReadAttribute(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, uint8_t mask, uint8_t * dataPtr, uint16_t readLength, EmberAfAttributeType * dataType) { + if (mask != CLUSTER_MASK_SERVER) + { + return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE; + } + const EmberAfAttributeMetadata * metadata = nullptr; EmberAfAttributeSearchRecord record; EmberAfStatus status; record.endpoint = endpoint; record.clusterId = cluster; - record.clusterMask = mask; record.attributeId = attributeID; status = emAfReadOrWriteAttribute(&record, &metadata, dataPtr, readLength, false); // write? diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 8f1bb851ca6380..2c0b960970fea0 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -540,8 +540,7 @@ CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, b attributeCluster = emberAfFindCluster(aPath.mEndpointId, aPath.mClusterId, CLUSTER_MASK_SERVER); break; default: - attributeMetadata = - emberAfLocateAttributeMetadata(aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId, CLUSTER_MASK_SERVER); + attributeMetadata = emberAfLocateAttributeMetadata(aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId); } if (attributeCluster == nullptr && attributeMetadata == nullptr) @@ -611,7 +610,6 @@ CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, b EmberAfAttributeSearchRecord record; record.endpoint = aPath.mEndpointId; record.clusterId = aPath.mClusterId; - record.clusterMask = CLUSTER_MASK_SERVER; record.attributeId = aPath.mAttributeId; EmberAfStatus emberStatus = emAfReadOrWriteAttribute(&record, &attributeMetadata, attributeData, sizeof(attributeData), /* write = */ false); @@ -965,7 +963,7 @@ CHIP_ERROR prepareWriteData(const EmberAfAttributeMetadata * attributeMetadata, const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePath & aConcreteClusterPath) { return emberAfLocateAttributeMetadata(aConcreteClusterPath.mEndpointId, aConcreteClusterPath.mClusterId, - aConcreteClusterPath.mAttributeId, CLUSTER_MASK_SERVER); + aConcreteClusterPath.mAttributeId); } CHIP_ERROR WriteSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, const ConcreteDataAttributePath & aPath, diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 0c5dcc0fb6c348..3644d45ad51b04 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -771,15 +771,21 @@ uint8_t emberAfMake8bitEncodedChanPg(uint8_t page, uint8_t channel) bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, bool asServer) { - uint8_t mask = asServer ? CLUSTER_MASK_SERVER : CLUSTER_MASK_CLIENT; - return (emberAfLocateAttributeMetadata(endpoint, clusterId, attributeId, mask) != nullptr); + if (!asServer) + { + return false; + } + return (emberAfLocateAttributeMetadata(endpoint, clusterId, attributeId) != nullptr); } bool emberAfIsNonVolatileAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, bool asServer) { - uint8_t mask = asServer ? CLUSTER_MASK_SERVER : CLUSTER_MASK_CLIENT; - const EmberAfAttributeMetadata * metadata = emberAfLocateAttributeMetadata(endpoint, clusterId, attributeId, mask); + if (!asServer) + { + return false; + } + const EmberAfAttributeMetadata * metadata = emberAfLocateAttributeMetadata(endpoint, clusterId, attributeId); if (metadata == nullptr) { From d2e6b99d68a862b1d59102d5c2e6da940e051a25 Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:50:01 -0700 Subject: [PATCH 33/59] Moved TargetEndpointInfo and TargetVideoPlayerInfo out of tv-casting-app/linux/main.cpp (#17826) Refactored tv-casting-app/linux/main.cpp: Created CastingServer, renamed Casting->CastingUtils --- examples/tv-casting-app/linux/BUILD.gn | 6 +- .../linux/CastingShellCommands.cpp | 13 +- .../tv-casting-app/linux/CastingUtils.cpp | 112 ++++ .../linux/{Casting.h => CastingUtils.h} | 26 +- examples/tv-casting-app/linux/main.cpp | 551 +----------------- .../tv-casting-app/tv-casting-common/BUILD.gn | 20 + .../tv-casting-common/include/CastingServer.h | 75 +++ .../include/TargetEndpointInfo.h | 42 ++ .../include/TargetVideoPlayerInfo.h | 70 +++ .../tv-casting-common/src/CastingServer.cpp | 203 +++++++ .../src/TargetEndpointInfo.cpp | 70 +++ .../src/TargetVideoPlayerInfo.cpp | 144 +++++ 12 files changed, 788 insertions(+), 544 deletions(-) create mode 100644 examples/tv-casting-app/linux/CastingUtils.cpp rename examples/tv-casting-app/linux/{Casting.h => CastingUtils.h} (59%) create mode 100644 examples/tv-casting-app/tv-casting-common/include/CastingServer.h create mode 100644 examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h create mode 100644 examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h create mode 100644 examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp create mode 100644 examples/tv-casting-app/tv-casting-common/src/TargetEndpointInfo.cpp create mode 100644 examples/tv-casting-app/tv-casting-common/src/TargetVideoPlayerInfo.cpp diff --git a/examples/tv-casting-app/linux/BUILD.gn b/examples/tv-casting-app/linux/BUILD.gn index a48f121ab0109a..9f6bdb831c5a65 100644 --- a/examples/tv-casting-app/linux/BUILD.gn +++ b/examples/tv-casting-app/linux/BUILD.gn @@ -23,9 +23,10 @@ assert(chip_build_tools) executable("chip-tv-casting-app") { sources = [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include/CHIPProjectAppConfig.h", - "Casting.h", "CastingShellCommands.cpp", "CastingShellCommands.h", + "CastingUtils.cpp", + "CastingUtils.h", "main.cpp", ] @@ -37,6 +38,9 @@ executable("chip-tv-casting-app") { "${chip_root}/third_party/inipp", ] + include_dirs = + [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ] + cflags = [ "-Wconversion" ] if (chip_build_libshell) { diff --git a/examples/tv-casting-app/linux/CastingShellCommands.cpp b/examples/tv-casting-app/linux/CastingShellCommands.cpp index 502f5e580361ff..b051c4be7a0339 100644 --- a/examples/tv-casting-app/linux/CastingShellCommands.cpp +++ b/examples/tv-casting-app/linux/CastingShellCommands.cpp @@ -20,7 +20,8 @@ */ #include "CastingShellCommands.h" -#include "Casting.h" +#include "CastingServer.h" +#include "CastingUtils.h" #include #include #include @@ -67,7 +68,7 @@ static CHIP_ERROR CastingHandler(int argc, char ** argv) char * eptr; chip::NodeId nodeId = (chip::NodeId) strtoull(argv[1], &eptr, 10); chip::FabricIndex fabricIndex = (chip::FabricIndex) strtol(argv[2], &eptr, 10); - return TargetVideoPlayerInfoInit(nodeId, fabricIndex); + return CastingServer::GetInstance()->TargetVideoPlayerInfoInit(nodeId, fabricIndex); } if (strcmp(argv[0], "discover") == 0) { @@ -95,7 +96,7 @@ static CHIP_ERROR CastingHandler(int argc, char ** argv) } char * url = argv[1]; char * display = argv[2]; - return ContentLauncherLaunchURL(url, display); + return CastingServer::GetInstance()->ContentLauncherLaunchURL(url, display); } if (strcmp(argv[0], "access") == 0) { @@ -106,7 +107,7 @@ static CHIP_ERROR CastingHandler(int argc, char ** argv) } char * eptr; chip::NodeId node = (chip::NodeId) strtoull(argv[1], &eptr, 0); - ReadServerClustersForNode(node); + CastingServer::GetInstance()->ReadServerClustersForNode(node); return CHIP_NO_ERROR; } #if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT @@ -116,7 +117,9 @@ static CHIP_ERROR CastingHandler(int argc, char ** argv) chip::Inet::IPAddress commissioner; chip::Inet::IPAddress::FromString(argv[1], commissioner); uint16_t port = (uint16_t) strtol(argv[2], &eptr, 10); - return SendUDC(chip::Transport::PeerAddress::UDP(commissioner, port)); + PrepareForCommissioning(); + return CastingServer::GetInstance()->SendUserDirectedCommissioningRequest( + chip::Transport::PeerAddress::UDP(commissioner, port)); } #endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT return CHIP_ERROR_INVALID_ARGUMENT; diff --git a/examples/tv-casting-app/linux/CastingUtils.cpp b/examples/tv-casting-app/linux/CastingUtils.cpp new file mode 100644 index 00000000000000..61fafc850ba0eb --- /dev/null +++ b/examples/tv-casting-app/linux/CastingUtils.cpp @@ -0,0 +1,112 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CastingUtils.h" + +CHIP_ERROR DiscoverCommissioners() +{ + // Send discover commissioners request + ReturnErrorOnFailure(CastingServer::GetInstance()->DiscoverCommissioners()); + + // Give commissioners some time to respond and then ScheduleWork to initiate commissioning + return DeviceLayer::SystemLayer().StartTimer( + chip::System::Clock::Milliseconds32(kCommissionerDiscoveryTimeoutInMs), + [](System::Layer *, void *) { chip::DeviceLayer::PlatformMgr().ScheduleWork(InitCommissioningFlow); }, nullptr); +} + +CHIP_ERROR RequestCommissioning(int index) +{ + const Dnssd::DiscoveredNodeData * selectedCommissioner = CastingServer::GetInstance()->GetDiscoveredCommissioner(index); + if (selectedCommissioner == nullptr) + { + ChipLogError(AppServer, "No such commissioner with index %d exists", index); + return CHIP_ERROR_INVALID_ARGUMENT; + } + PrepareForCommissioning(selectedCommissioner); + return CHIP_NO_ERROR; +} + +/** + * Enters commissioning mode, opens commissioning window, logs onboarding payload. + * If non-null selectedCommissioner is provided, sends user directed commissioning + * request to the selectedCommissioner and advertises self as commissionable node over DNS-SD + */ +void PrepareForCommissioning(const Dnssd::DiscoveredNodeData * selectedCommissioner) +{ + CastingServer::GetInstance()->InitServer(); + + CastingServer::GetInstance()->OpenBasicCommissioningWindow(); + + // Display onboarding payload + chip::DeviceLayer::ConfigurationMgr().LogDeviceConfig(); + +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + if (selectedCommissioner != nullptr) + { + // Send User Directed commissioning request + // Wait 1 second to allow our commissionee DNS records to publish (needed on Mac) + int32_t expiration = 1; + ReturnOnFailure(DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(expiration), HandleUDCSendExpiration, + (void *) selectedCommissioner)); + } + else + { + ChipLogProgress(AppServer, "To run discovery again, enter: cast discover"); + } +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT +} + +void InitCommissioningFlow(intptr_t commandArg) +{ + int commissionerCount = 0; + + // Display discovered commissioner TVs to ask user to select one + for (int i = 0; i < CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES; i++) + { + const Dnssd::DiscoveredNodeData * commissioner = CastingServer::GetInstance()->GetDiscoveredCommissioner(i); + if (commissioner != nullptr) + { + ChipLogProgress(AppServer, "Discovered Commissioner #%d", commissionerCount++); + commissioner->LogDetail(); + } + } + + if (commissionerCount > 0) + { + ChipLogProgress(AppServer, "%d commissioner(s) discovered. Select one (by number# above) to request commissioning from: ", + commissionerCount); + + ChipLogProgress(AppServer, "Example: cast request 0"); + } + else + { + ChipLogError(AppServer, "No commissioner discovered, commissioning must be initiated manually!"); + PrepareForCommissioning(); + } +} + +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT +void HandleUDCSendExpiration(System::Layer * aSystemLayer, void * context) +{ + Dnssd::DiscoveredNodeData * selectedCommissioner = (Dnssd::DiscoveredNodeData *) context; + + // Send User Directed commissioning request + ReturnOnFailure(CastingServer::GetInstance()->SendUserDirectedCommissioningRequest(chip::Transport::PeerAddress::UDP( + selectedCommissioner->ipAddress[0], selectedCommissioner->port, selectedCommissioner->interfaceId))); +} +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT diff --git a/examples/tv-casting-app/linux/Casting.h b/examples/tv-casting-app/linux/CastingUtils.h similarity index 59% rename from examples/tv-casting-app/linux/Casting.h rename to examples/tv-casting-app/linux/CastingUtils.h index 3808727f437e8e..2491a1c0762631 100644 --- a/examples/tv-casting-app/linux/Casting.h +++ b/examples/tv-casting-app/linux/CastingUtils.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2022 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,18 +16,26 @@ * limitations under the License. */ +/** + * @brief CastingUtils carries several utility functions that can be used + * with Linux implementations of the TV Casting app. + */ #pragma once -#include -#include -#include -#include +#include "CastingServer.h" +#include "TargetEndpointInfo.h" +#include "TargetVideoPlayerInfo.h" + +constexpr uint32_t kCommissionerDiscoveryTimeoutInMs = 5 * 1000; -CHIP_ERROR TargetVideoPlayerInfoInit(chip::NodeId nodeId, chip::FabricIndex fabricIndex); CHIP_ERROR DiscoverCommissioners(); + CHIP_ERROR RequestCommissioning(int index); -void ReadServerClustersForNode(chip::NodeId nodeId); -CHIP_ERROR ContentLauncherLaunchURL(const char * contentUrl, const char * contentDisplayStr); + +void PrepareForCommissioning(const Dnssd::DiscoveredNodeData * selectedCommissioner = nullptr); + +void InitCommissioningFlow(intptr_t commandArg); + #if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT -CHIP_ERROR SendUDC(chip::Transport::PeerAddress commissioner); +void HandleUDCSendExpiration(System::Layer * aSystemLayer, void * context); #endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT diff --git a/examples/tv-casting-app/linux/main.cpp b/examples/tv-casting-app/linux/main.cpp index 14225b04e6ca48..683bb2c77026d8 100644 --- a/examples/tv-casting-app/linux/main.cpp +++ b/examples/tv-casting-app/linux/main.cpp @@ -16,42 +16,23 @@ * limitations under the License. */ +#include "CastingServer.h" +#include "CastingUtils.h" +#if defined(ENABLE_CHIP_SHELL) +#include "CastingShellCommands.h" +#include +#include +#endif + #include "LinuxCommissionableDataProvider.h" #include "Options.h" -#include "app/clusters/bindings/BindingManager.h" -#include -#include -#include -#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include - -#if defined(ENABLE_CHIP_SHELL) -#include "CastingShellCommands.h" -#include -#include -#endif - -#include -#include using namespace chip; -using namespace chip::Controller; -using namespace chip::Credentials; using chip::ArgParser::HelpOptions; using chip::ArgParser::OptionDef; using chip::ArgParser::OptionSet; @@ -60,30 +41,24 @@ using namespace chip::app::Clusters::ContentLauncher::Commands; #if defined(ENABLE_CHIP_SHELL) using chip::Shell::Engine; #endif - struct TVExampleDeviceType { const char * name; uint16_t id; }; -constexpr TVExampleDeviceType kKnownDeviceTypes[] = { { "video-player", 35 }, { "dimmable-light", 257 } }; -constexpr int kKnownDeviceTypesCount = sizeof kKnownDeviceTypes / sizeof *kKnownDeviceTypes; -constexpr uint16_t kOptionDeviceType = 't'; -constexpr System::Clock::Seconds16 kCommissioningWindowTimeout = System::Clock::Seconds16(3 * 60); -constexpr uint32_t kCommissionerDiscoveryTimeoutInMs = 5 * 1000; +Dnssd::DiscoveryFilter gDiscoveryFilter = Dnssd::DiscoveryFilter(); +constexpr TVExampleDeviceType kKnownDeviceTypes[] = { { "video-player", 35 }, { "dimmable-light", 257 } }; +constexpr int kKnownDeviceTypesCount = sizeof kKnownDeviceTypes / sizeof *kKnownDeviceTypes; +constexpr uint16_t kOptionDeviceType = 't'; // TODO: Accept these values over CLI -const char * kContentUrl = "https://www.test.com/videoid"; -const char * kContentDisplayStr = "Test video"; -constexpr EndpointId kTvEndpoint = 1; +const char * kContentUrl = "https://www.test.com/videoid"; +const char * kContentDisplayStr = "Test video"; CommissionableNodeController gCommissionableNodeController; chip::System::SocketWatchToken gToken; -Dnssd::DiscoveryFilter gDiscoveryFilter = Dnssd::DiscoveryFilter(); -bool gInited = false; - -CASEClientPool gCASEClientPool; +bool gInited = false; bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, const char * aName, const char * aValue) { @@ -131,504 +106,22 @@ HelpOptions helpOptions("tv-casting-app", "Usage: tv-casting-app [options]", "1. OptionSet * allOptions[] = { &cmdLineOptions, &helpOptions, nullptr }; -void ReadServerClusters(EndpointId endpointId); -CHIP_ERROR InitBindingHandlers() -{ - auto & server = chip::Server::GetInstance(); - chip::BindingManager::GetInstance().Init( - { &server.GetFabricTable(), server.GetCASESessionManager(), &server.GetPersistentStorage() }); - return CHIP_NO_ERROR; -} - -#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT -void HandleUDCSendExpiration(System::Layer * aSystemLayer, void * context) -{ - Dnssd::DiscoveredNodeData * selectedCommissioner = (Dnssd::DiscoveredNodeData *) context; - - // Send User Directed commissioning request - ReturnOnFailure(Server::GetInstance().SendUserDirectedCommissioningRequest(chip::Transport::PeerAddress::UDP( - selectedCommissioner->ipAddress[0], selectedCommissioner->port, selectedCommissioner->interfaceId))); -} -#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT - -void InitServer() -{ - if (gInited) - { - return; - } - // DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init("/tmp/chip_tv_casting_kvs"); - DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init(CHIP_CONFIG_KVS_PATH); - - // Enter commissioning mode, open commissioning window - static chip::CommonCaseDeviceServerInitParams initParams; - (void) initParams.InitializeStaticResourcesBeforeServerInit(); - chip::Server::GetInstance().Init(initParams); - - // Initialize binding handlers - ReturnOnFailure(InitBindingHandlers()); - - gInited = true; -} - -/** - * Enters commissioning mode, opens commissioning window, logs onboarding payload. - * If non-null selectedCommissioner is provided, sends user directed commissioning - * request to the selectedCommissioner and advertises self as commissionable node over DNS-SD - */ -void PrepareForCommissioning(const Dnssd::DiscoveredNodeData * selectedCommissioner = nullptr) -{ - InitServer(); - - Server::GetInstance().GetFabricTable().DeleteAllFabrics(); - ReturnOnFailure( - Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(kCommissioningWindowTimeout)); - - // Display onboarding payload - chip::DeviceLayer::ConfigurationMgr().LogDeviceConfig(); - -#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT - if (selectedCommissioner != nullptr) - { - // Send User Directed commissioning request - // Wait 1 second to allow our commissionee DNS records to publish (needed on Mac) - int32_t expiration = 1; - ReturnOnFailure(DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(expiration), HandleUDCSendExpiration, - (void *) selectedCommissioner)); - } - else - { - ChipLogProgress(AppServer, "To run discovery again, enter: cast discover"); - } -#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT -} - -#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT -CHIP_ERROR SendUDC(chip::Transport::PeerAddress commissioner) -{ - PrepareForCommissioning(); - return Server::GetInstance().SendUserDirectedCommissioningRequest(commissioner); -} -#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT - -void InitCommissioningFlow(intptr_t commandArg) -{ - int commissionerCount = 0; - - // Display discovered commissioner TVs to ask user to select one - for (int i = 0; i < CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES; i++) - { - const Dnssd::DiscoveredNodeData * commissioner = gCommissionableNodeController.GetDiscoveredCommissioner(i); - if (commissioner != nullptr) - { - ChipLogProgress(AppServer, "Discovered Commissioner #%d", commissionerCount++); - commissioner->LogDetail(); - } - } - - if (commissionerCount > 0) - { - ChipLogProgress(AppServer, "%d commissioner(s) discovered. Select one (by number# above) to request commissioning from: ", - commissionerCount); - - ChipLogProgress(AppServer, "Example: cast request 0"); - } - else - { - ChipLogError(AppServer, "No commissioner discovered, commissioning must be initiated manually!"); - PrepareForCommissioning(); - } -} - -CHIP_ERROR DiscoverCommissioners() -{ - // Send discover commissioners request - ReturnErrorOnFailure(gCommissionableNodeController.DiscoverCommissioners(gDiscoveryFilter)); - - // Give commissioners some time to respond and then ScheduleWork to initiate commissioning - return DeviceLayer::SystemLayer().StartTimer( - chip::System::Clock::Milliseconds32(kCommissionerDiscoveryTimeoutInMs), - [](System::Layer *, void *) { chip::DeviceLayer::PlatformMgr().ScheduleWork(InitCommissioningFlow); }, nullptr); -} - -CHIP_ERROR RequestCommissioning(int index) -{ - const Dnssd::DiscoveredNodeData * selectedCommissioner = gCommissionableNodeController.GetDiscoveredCommissioner(index); - if (selectedCommissioner == nullptr) - { - ChipLogError(AppServer, "No such commissioner with index %d exists", index); - return CHIP_ERROR_INVALID_ARGUMENT; - } - PrepareForCommissioning(selectedCommissioner); - return CHIP_NO_ERROR; -} - -void OnContentLauncherSuccessResponse(void * context, const LaunchResponse::DecodableType & response) -{ - ChipLogProgress(AppServer, "ContentLauncher: Default Success Response"); -} - -void OnContentLauncherFailureResponse(void * context, CHIP_ERROR error) -{ - ChipLogError(AppServer, "ContentLauncher: Default Failure Response: %" CHIP_ERROR_FORMAT, error.Format()); -} - -class TargetEndpointInfo -{ -public: - void Initialize(EndpointId endpointId) - { - mEndpointId = endpointId; - for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint; i++) - { - mClusters[i] = kInvalidClusterId; - } - mInitialized = true; - } - - void Reset() { mInitialized = false; } - - bool HasCluster(ClusterId clusterId) - { - for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint; i++) - { - if (mClusters[i] == clusterId) - { - return true; - } - } - return false; - } - - bool AddCluster(ClusterId clusterId) - { - for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint; i++) - { - if (mClusters[i] == clusterId) - { - return true; - } - if (mClusters[i] == kInvalidClusterId) - { - mClusters[i] = clusterId; - return true; - } - } - return false; - } - - bool IsInitialized() { return mInitialized; } - - EndpointId GetEndpointId() const { return mEndpointId; } - - void PrintInfo() - { - ChipLogProgress(NotSpecified, " endpoint=%d", mEndpointId); - for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint; i++) - { - if (mClusters[i] != kInvalidClusterId) - { - - ChipLogProgress(NotSpecified, " cluster=" ChipLogFormatMEI, ChipLogValueMEI(mClusters[i])); - } - } - } - -private: - static constexpr size_t kMaxNumberOfClustersPerEndpoint = 10; - ClusterId mClusters[kMaxNumberOfClustersPerEndpoint] = {}; - EndpointId mEndpointId; - bool mInitialized = false; -}; - -class TargetVideoPlayerInfo -{ -public: - TargetVideoPlayerInfo() : - mOnConnectedCallback(HandleDeviceConnected, this), mOnConnectionFailureCallback(HandleDeviceConnectionFailure, this) - {} - - bool IsInitialized() { return mInitialized; } - - CHIP_ERROR Initialize(NodeId nodeId, FabricIndex fabricIndex) - { - ChipLogProgress(NotSpecified, "TargetVideoPlayerInfo nodeId=0x" ChipLogFormatX64 " fabricIndex=%d", ChipLogValueX64(nodeId), - fabricIndex); - mNodeId = nodeId; - mFabricIndex = fabricIndex; - for (auto & endpointInfo : mEndpoints) - { - endpointInfo.Reset(); - } - - Server * server = &(chip::Server::GetInstance()); - chip::FabricInfo * fabric = server->GetFabricTable().FindFabricWithIndex(fabricIndex); - if (fabric == nullptr) - { - ChipLogError(AppServer, "Did not find fabric for index %d", fabricIndex); - return CHIP_ERROR_INVALID_FABRIC_ID; - } - - chip::DeviceProxyInitParams initParams = { - .sessionManager = &(server->GetSecureSessionManager()), - .sessionResumptionStorage = server->GetSessionResumptionStorage(), - .exchangeMgr = &(server->GetExchangeManager()), - .fabricTable = &(server->GetFabricTable()), - .clientPool = &gCASEClientPool, - }; - - PeerId peerID = fabric->GetPeerIdForNode(nodeId); - - // - // TODO: The code here is assuming that we can create an OperationalDeviceProxy instance and attach it immediately - // to a CASE session that just got established to us by the tv-app. While this will work most of the time, - // this is a dangerous assumption to make since it is entirely possible for that secure session to have been - // evicted in the time since that session was established to the point here when we desire to interact back - // with that peer. If that is the case, our `OnConnected` callback will not get invoked syncronously and - // mOperationalDeviceProxy will still have a value of null, triggering the check below to fail. - // - mOperationalDeviceProxy = nullptr; - CHIP_ERROR err = - server->GetCASESessionManager()->FindOrEstablishSession(peerID, &mOnConnectedCallback, &mOnConnectionFailureCallback); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "Could not establish a session to the peer"); - return err; - } - - if (mOperationalDeviceProxy == nullptr) - { - ChipLogError(AppServer, "Failed to find an existing instance of OperationalDeviceProxy to the peer"); - return CHIP_ERROR_INVALID_ARGUMENT; - } - ChipLogProgress(AppServer, "Created an instance of OperationalDeviceProxy"); - - mInitialized = true; - return CHIP_NO_ERROR; - } - - NodeId GetNodeId() const { return mNodeId; } - FabricIndex GetFabricIndex() const { return mFabricIndex; } - OperationalDeviceProxy * GetOperationalDeviceProxy() const { return mOperationalDeviceProxy; } - - TargetEndpointInfo * GetOrAddEndpoint(EndpointId endpointId) - { - if (!mInitialized) - { - return nullptr; - } - TargetEndpointInfo * endpoint = GetEndpoint(endpointId); - if (endpoint != nullptr) - { - return endpoint; - } - for (auto & endpointInfo : mEndpoints) - { - if (!endpointInfo.IsInitialized()) - { - endpointInfo.Initialize(endpointId); - return &endpointInfo; - } - } - return nullptr; - } - - TargetEndpointInfo * GetEndpoint(EndpointId endpointId) - { - if (!mInitialized) - { - return nullptr; - } - for (auto & endpointInfo : mEndpoints) - { - if (endpointInfo.IsInitialized() && endpointInfo.GetEndpointId() == endpointId) - { - return &endpointInfo; - } - } - return nullptr; - } - - bool HasEndpoint(EndpointId endpointId) - { - if (!mInitialized) - { - return false; - } - for (auto & endpointInfo : mEndpoints) - { - if (endpointInfo.IsInitialized() && endpointInfo.GetEndpointId() == endpointId) - { - return true; - } - } - return false; - } - - void PrintInfo() - { - ChipLogProgress(NotSpecified, " TargetVideoPlayerInfo nodeId=0x" ChipLogFormatX64 " fabric index=%d", - ChipLogValueX64(mNodeId), mFabricIndex); - for (auto & endpointInfo : mEndpoints) - { - if (endpointInfo.IsInitialized()) - { - endpointInfo.PrintInfo(); - } - } - } - -private: - static void HandleDeviceConnected(void * context, OperationalDeviceProxy * device) - { - TargetVideoPlayerInfo * _this = static_cast(context); - _this->mOperationalDeviceProxy = device; - _this->mInitialized = true; - ChipLogProgress(AppServer, "HandleDeviceConnected created an instance of OperationalDeviceProxy"); - } - - static void HandleDeviceConnectionFailure(void * context, PeerId peerId, CHIP_ERROR error) - { - TargetVideoPlayerInfo * _this = static_cast(context); - _this->mOperationalDeviceProxy = nullptr; - } - - static constexpr size_t kMaxNumberOfEndpoints = 5; - TargetEndpointInfo mEndpoints[kMaxNumberOfEndpoints]; - NodeId mNodeId; - FabricIndex mFabricIndex; - OperationalDeviceProxy * mOperationalDeviceProxy; - - Callback::Callback mOnConnectedCallback; - Callback::Callback mOnConnectionFailureCallback; - - bool mInitialized = false; -}; -TargetVideoPlayerInfo gTargetVideoPlayerInfo; - -void OnDescriptorReadSuccessResponse(void * context, const app::DataModel::DecodableList & responseList) -{ - TargetEndpointInfo * endpointInfo = static_cast(context); - - ChipLogProgress(AppServer, "Descriptor: Default Success Response endpoint=%d", endpointInfo->GetEndpointId()); - - auto iter = responseList.begin(); - while (iter.Next()) - { - auto & clusterId = iter.GetValue(); - endpointInfo->AddCluster(clusterId); - } - // Always print the target info after handling descriptor read response - // Even when we get nothing back for any reasons - gTargetVideoPlayerInfo.PrintInfo(); -} - -void OnDescriptorReadFailureResponse(void * context, CHIP_ERROR error) -{ - ChipLogError(AppServer, "Descriptor: Default Failure Response: %" CHIP_ERROR_FORMAT, error.Format()); -} - -void ReadServerClusters(EndpointId endpointId) -{ - OperationalDeviceProxy * operationalDeviceProxy = gTargetVideoPlayerInfo.GetOperationalDeviceProxy(); - if (operationalDeviceProxy == nullptr) - { - ChipLogError(AppServer, "Failed in getting an instance of OperationalDeviceProxy"); - return; - } - - chip::Controller::DescriptorCluster cluster; - CHIP_ERROR err = cluster.Associate(operationalDeviceProxy, endpointId); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "Associate() failed: %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - TargetEndpointInfo * endpointInfo = gTargetVideoPlayerInfo.GetOrAddEndpoint(endpointId); - - if (cluster.ReadAttribute( - endpointInfo, OnDescriptorReadSuccessResponse, OnDescriptorReadFailureResponse) != CHIP_NO_ERROR) - { - ChipLogError(Controller, "Could not read Descriptor cluster ServerList"); - } - - ChipLogProgress(Controller, "Sent descriptor read for remote endpoint=%d", endpointId); -} - -void ReadServerClustersForNode(NodeId nodeId) -{ - ChipLogProgress(NotSpecified, "ReadServerClustersForNode nodeId=0x" ChipLogFormatX64, ChipLogValueX64(nodeId)); - for (const auto & binding : BindingTable::GetInstance()) - { - ChipLogProgress(NotSpecified, - "Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64 - " groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI, - binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local, - binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0))); - if (binding.type == EMBER_UNICAST_BINDING && nodeId == binding.nodeId) - { - if (!gTargetVideoPlayerInfo.HasEndpoint(binding.remote)) - { - ReadServerClusters(binding.remote); - } - else - { - TargetEndpointInfo * endpointInfo = gTargetVideoPlayerInfo.GetEndpoint(binding.remote); - if (endpointInfo != nullptr && endpointInfo->IsInitialized()) - { - endpointInfo->PrintInfo(); - } - } - } - } -} - -CHIP_ERROR ContentLauncherLaunchURL(const char * contentUrl, const char * contentDisplayStr) -{ - OperationalDeviceProxy * operationalDeviceProxy = gTargetVideoPlayerInfo.GetOperationalDeviceProxy(); - if (operationalDeviceProxy == nullptr) - { - ChipLogError(AppServer, "Failed in getting an instance of OperationalDeviceProxy"); - return CHIP_ERROR_PEER_NODE_NOT_FOUND; - } - - ContentLauncherCluster cluster; - CHIP_ERROR err = cluster.Associate(operationalDeviceProxy, kTvEndpoint); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "Associate() failed: %" CHIP_ERROR_FORMAT, err.Format()); - return err; - } - LaunchURL::Type request; - request.contentURL = chip::CharSpan::fromCharString(contentUrl); - request.displayString = Optional(chip::CharSpan::fromCharString(contentDisplayStr)); - request.brandingInformation = MakeOptional(chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type()); - cluster.InvokeCommand(request, nullptr, OnContentLauncherSuccessResponse, OnContentLauncherFailureResponse); - return CHIP_NO_ERROR; -} - -CHIP_ERROR TargetVideoPlayerInfoInit(NodeId nodeId, FabricIndex fabricIndex) -{ - InitServer(); - return gTargetVideoPlayerInfo.Initialize(nodeId, fabricIndex); -} - void DeviceEventCallback(const DeviceLayer::ChipDeviceEvent * event, intptr_t arg) { if (event->Type == DeviceLayer::DeviceEventType::kBindingsChangedViaCluster) { - if (gTargetVideoPlayerInfo.IsInitialized()) + if (CastingServer::GetInstance()->GetTargetVideoPlayerInfo()->IsInitialized()) { - ReadServerClustersForNode(gTargetVideoPlayerInfo.GetNodeId()); + CastingServer::GetInstance()->ReadServerClustersForNode( + CastingServer::GetInstance()->GetTargetVideoPlayerInfo()->GetNodeId()); } } else if (event->Type == DeviceLayer::DeviceEventType::kCommissioningComplete) { - ReturnOnFailure(gTargetVideoPlayerInfo.Initialize(event->CommissioningComplete.PeerNodeId, - event->CommissioningComplete.PeerFabricIndex)); + ReturnOnFailure(CastingServer::GetInstance()->GetTargetVideoPlayerInfo()->Initialize( + event->CommissioningComplete.PeerNodeId, event->CommissioningComplete.PeerFabricIndex)); - ContentLauncherLaunchURL(kContentUrl, kContentDisplayStr); + CastingServer::GetInstance()->ContentLauncherLaunchURL(kContentUrl, kContentDisplayStr); } } @@ -710,7 +203,7 @@ int main(int argc, char * argv[]) } // Send discover commissioners request - SuccessOrExit(err = gCommissionableNodeController.DiscoverCommissioners(gDiscoveryFilter)); + SuccessOrExit(err = CastingServer::GetInstance()->DiscoverCommissioners()); // Give commissioners some time to respond and then ScheduleWork to initiate commissioning DeviceLayer::SystemLayer().StartTimer( diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index 7b88b5a710e901..28faac10bf99fc 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -21,5 +21,25 @@ chip_data_model("tv-casting-common") { zap_pregenerated_dir = "${chip_root}/zzz_generated/tv-casting-app/zap-generated" + + sources = [ + "include/CastingServer.h", + "include/TargetEndpointInfo.h", + "include/TargetVideoPlayerInfo.h", + "src/CastingServer.cpp", + "src/TargetEndpointInfo.cpp", + "src/TargetVideoPlayerInfo.cpp", + ] + + deps = [ + "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/src/credentials:default_attestation_verifier", + "${chip_root}/src/lib", + "${chip_root}/third_party/inipp", + ] + + include_dirs = + [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ] + is_server = true } diff --git a/examples/tv-casting-app/tv-casting-common/include/CastingServer.h b/examples/tv-casting-app/tv-casting-common/include/CastingServer.h new file mode 100644 index 00000000000000..e046818be34868 --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/include/CastingServer.h @@ -0,0 +1,75 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +#include "TargetEndpointInfo.h" +#include "TargetVideoPlayerInfo.h" + +using namespace chip; +using namespace chip::Controller; +using namespace chip::Credentials; +using namespace chip::app::Clusters::ContentLauncher::Commands; + +constexpr System::Clock::Seconds16 kCommissioningWindowTimeout = System::Clock::Seconds16(3 * 60); +constexpr EndpointId kTvEndpoint = 1; + +/** + * @brief Represents a TV Casting server that can get the casting app commissioned + * and then have it send TV Casting/Media related commands. This is to be instantiated + * as a singleton and is to be used across Linux, Android and iOS. + */ +class CastingServer +{ +public: + CastingServer(CastingServer & other) = delete; + void operator=(const CastingServer &) = delete; + static CastingServer * GetInstance(); + + void InitServer(); + + CHIP_ERROR DiscoverCommissioners(); + const Dnssd::DiscoveredNodeData * GetDiscoveredCommissioner(int index); + CHIP_ERROR OpenBasicCommissioningWindow(); +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + CHIP_ERROR SendUserDirectedCommissioningRequest(chip::Transport::PeerAddress commissioner); +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + + CHIP_ERROR InitBindingHandlers(); + TargetVideoPlayerInfo * GetTargetVideoPlayerInfo() { return &mTargetVideoPlayerInfo; } + CHIP_ERROR TargetVideoPlayerInfoInit(chip::NodeId nodeId, chip::FabricIndex fabricIndex); + void ReadServerClusters(EndpointId endpointId); + void ReadServerClustersForNode(chip::NodeId nodeId); + static void OnDescriptorReadSuccessResponse(void * context, const app::DataModel::DecodableList & responseList); + static void OnDescriptorReadFailureResponse(void * context, CHIP_ERROR error); + CHIP_ERROR ContentLauncherLaunchURL(const char * contentUrl, const char * contentDisplayStr); + static void OnContentLauncherSuccessResponse(void * context, const LaunchResponse::DecodableType & response); + static void OnContentLauncherFailureResponse(void * context, CHIP_ERROR error); + +private: + static CastingServer * castingServer_; + CastingServer() {} + + bool mInited = false; + TargetVideoPlayerInfo mTargetVideoPlayerInfo; + CommissionableNodeController mCommissionableNodeController; +}; diff --git a/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h b/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h new file mode 100644 index 00000000000000..b9845cbeff574d --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h @@ -0,0 +1,42 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +using namespace chip; + +class TargetEndpointInfo +{ +public: + void Initialize(EndpointId endpointId); + void Reset() { mInitialized = false; } + bool IsInitialized() { return mInitialized; } + EndpointId GetEndpointId() const { return mEndpointId; } + + bool HasCluster(ClusterId clusterId); + bool AddCluster(ClusterId clusterId); + void PrintInfo(); + +private: + static constexpr size_t kMaxNumberOfClustersPerEndpoint = 10; + ClusterId mClusters[kMaxNumberOfClustersPerEndpoint] = {}; + EndpointId mEndpointId; + bool mInitialized = false; +}; diff --git a/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h new file mode 100644 index 00000000000000..5774a3e2261d07 --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h @@ -0,0 +1,70 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "TargetEndpointInfo.h" +#include "app/clusters/bindings/BindingManager.h" +#include + +using namespace chip; + +class TargetVideoPlayerInfo +{ +public: + TargetVideoPlayerInfo() : + mOnConnectedCallback(HandleDeviceConnected, this), mOnConnectionFailureCallback(HandleDeviceConnectionFailure, this) + {} + + bool IsInitialized() { return mInitialized; } + NodeId GetNodeId() const { return mNodeId; } + FabricIndex GetFabricIndex() const { return mFabricIndex; } + OperationalDeviceProxy * GetOperationalDeviceProxy() const { return mOperationalDeviceProxy; } + + CHIP_ERROR Initialize(NodeId nodeId, FabricIndex fabricIndex); + TargetEndpointInfo * GetOrAddEndpoint(EndpointId endpointId); + TargetEndpointInfo * GetEndpoint(EndpointId endpointId); + bool HasEndpoint(EndpointId endpointId); + void PrintInfo(); + +private: + static void HandleDeviceConnected(void * context, OperationalDeviceProxy * device) + { + TargetVideoPlayerInfo * _this = static_cast(context); + _this->mOperationalDeviceProxy = device; + _this->mInitialized = true; + ChipLogProgress(AppServer, "HandleDeviceConnected created an instance of OperationalDeviceProxy"); + } + + static void HandleDeviceConnectionFailure(void * context, PeerId peerId, CHIP_ERROR error) + { + TargetVideoPlayerInfo * _this = static_cast(context); + _this->mOperationalDeviceProxy = nullptr; + } + + static constexpr size_t kMaxNumberOfEndpoints = 5; + TargetEndpointInfo mEndpoints[kMaxNumberOfEndpoints]; + NodeId mNodeId; + FabricIndex mFabricIndex; + OperationalDeviceProxy * mOperationalDeviceProxy; + + Callback::Callback mOnConnectedCallback; + Callback::Callback mOnConnectionFailureCallback; + + bool mInitialized = false; +}; diff --git a/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp b/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp new file mode 100644 index 00000000000000..6555550999f1ab --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp @@ -0,0 +1,203 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CastingServer.h" + +CastingServer * CastingServer::castingServer_ = nullptr; +; + +CastingServer * CastingServer::GetInstance() +{ + if (castingServer_ == nullptr) + { + castingServer_ = new CastingServer(); + } + return castingServer_; +} + +void CastingServer::InitServer() +{ + if (mInited) + { + return; + } + // DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init("/tmp/chip_tv_casting_kvs"); + DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init(CHIP_CONFIG_KVS_PATH); + + // Enter commissioning mode, open commissioning window + static chip::CommonCaseDeviceServerInitParams initParams; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + chip::Server::GetInstance().Init(initParams); + + // Initialize binding handlers + ReturnOnFailure(InitBindingHandlers()); + + mInited = true; +} + +CHIP_ERROR CastingServer::InitBindingHandlers() +{ + auto & server = chip::Server::GetInstance(); + chip::BindingManager::GetInstance().Init( + { &server.GetFabricTable(), server.GetCASESessionManager(), &server.GetPersistentStorage() }); + return CHIP_NO_ERROR; +} + +CHIP_ERROR CastingServer::TargetVideoPlayerInfoInit(NodeId nodeId, FabricIndex fabricIndex) +{ + InitServer(); + return mTargetVideoPlayerInfo.Initialize(nodeId, fabricIndex); +} + +CHIP_ERROR CastingServer::DiscoverCommissioners() +{ + // Send discover commissioners request + return mCommissionableNodeController.DiscoverCommissioners(Dnssd::DiscoveryFilter()); +} + +CHIP_ERROR CastingServer::OpenBasicCommissioningWindow() +{ + Server::GetInstance().GetFabricTable().DeleteAllFabrics(); + return Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(kCommissioningWindowTimeout); +} + +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT +CHIP_ERROR CastingServer::SendUserDirectedCommissioningRequest(chip::Transport::PeerAddress commissioner) +{ + return Server::GetInstance().SendUserDirectedCommissioningRequest(commissioner); +} +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + +const Dnssd::DiscoveredNodeData * CastingServer::GetDiscoveredCommissioner(int index) +{ + return mCommissionableNodeController.GetDiscoveredCommissioner(index); +} + +void CastingServer::ReadServerClustersForNode(NodeId nodeId) +{ + ChipLogProgress(NotSpecified, "ReadServerClustersForNode nodeId=0x" ChipLogFormatX64, ChipLogValueX64(nodeId)); + for (const auto & binding : BindingTable::GetInstance()) + { + ChipLogProgress(NotSpecified, + "Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64 + " groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI, + binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local, + binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0))); + if (binding.type == EMBER_UNICAST_BINDING && nodeId == binding.nodeId) + { + if (!mTargetVideoPlayerInfo.HasEndpoint(binding.remote)) + { + ReadServerClusters(binding.remote); + } + else + { + TargetEndpointInfo * endpointInfo = mTargetVideoPlayerInfo.GetEndpoint(binding.remote); + if (endpointInfo != nullptr && endpointInfo->IsInitialized()) + { + endpointInfo->PrintInfo(); + } + } + } + } +} + +void CastingServer::ReadServerClusters(EndpointId endpointId) +{ + OperationalDeviceProxy * operationalDeviceProxy = mTargetVideoPlayerInfo.GetOperationalDeviceProxy(); + if (operationalDeviceProxy == nullptr) + { + ChipLogError(AppServer, "Failed in getting an instance of OperationalDeviceProxy"); + return; + } + + chip::Controller::DescriptorCluster cluster; + CHIP_ERROR err = cluster.Associate(operationalDeviceProxy, endpointId); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "Associate() failed: %" CHIP_ERROR_FORMAT, err.Format()); + return; + } + + TargetEndpointInfo * endpointInfo = mTargetVideoPlayerInfo.GetOrAddEndpoint(endpointId); + + if (cluster.ReadAttribute( + endpointInfo, CastingServer::OnDescriptorReadSuccessResponse, CastingServer::OnDescriptorReadFailureResponse) != + CHIP_NO_ERROR) + { + ChipLogError(Controller, "Could not read Descriptor cluster ServerList"); + } + + ChipLogProgress(Controller, "Sent descriptor read for remote endpoint=%d", endpointId); +} + +void CastingServer::OnDescriptorReadSuccessResponse(void * context, const app::DataModel::DecodableList & responseList) +{ + TargetEndpointInfo * endpointInfo = static_cast(context); + + ChipLogProgress(AppServer, "Descriptor: Default Success Response endpoint=%d", endpointInfo->GetEndpointId()); + + auto iter = responseList.begin(); + while (iter.Next()) + { + auto & clusterId = iter.GetValue(); + endpointInfo->AddCluster(clusterId); + } + // Always print the target info after handling descriptor read response + // Even when we get nothing back for any reasons + CastingServer::GetInstance()->mTargetVideoPlayerInfo.PrintInfo(); +} + +void CastingServer::OnDescriptorReadFailureResponse(void * context, CHIP_ERROR error) +{ + ChipLogError(AppServer, "Descriptor: Default Failure Response: %" CHIP_ERROR_FORMAT, error.Format()); +} + +CHIP_ERROR CastingServer::ContentLauncherLaunchURL(const char * contentUrl, const char * contentDisplayStr) +{ + OperationalDeviceProxy * operationalDeviceProxy = mTargetVideoPlayerInfo.GetOperationalDeviceProxy(); + if (operationalDeviceProxy == nullptr) + { + ChipLogError(AppServer, "Failed in getting an instance of OperationalDeviceProxy"); + return CHIP_ERROR_PEER_NODE_NOT_FOUND; + } + + ContentLauncherCluster cluster; + CHIP_ERROR err = cluster.Associate(operationalDeviceProxy, kTvEndpoint); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "Associate() failed: %" CHIP_ERROR_FORMAT, err.Format()); + return err; + } + LaunchURL::Type request; + request.contentURL = chip::CharSpan::fromCharString(contentUrl); + request.displayString = Optional(chip::CharSpan::fromCharString(contentDisplayStr)); + request.brandingInformation = MakeOptional(chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type()); + cluster.InvokeCommand(request, nullptr, CastingServer::OnContentLauncherSuccessResponse, + CastingServer::OnContentLauncherFailureResponse); + return CHIP_NO_ERROR; +} + +void CastingServer::OnContentLauncherSuccessResponse(void * context, const LaunchResponse::DecodableType & response) +{ + ChipLogProgress(AppServer, "ContentLauncher: Default Success Response"); +} + +void CastingServer::OnContentLauncherFailureResponse(void * context, CHIP_ERROR error) +{ + ChipLogError(AppServer, "ContentLauncher: Default Failure Response: %" CHIP_ERROR_FORMAT, error.Format()); +} diff --git a/examples/tv-casting-app/tv-casting-common/src/TargetEndpointInfo.cpp b/examples/tv-casting-app/tv-casting-common/src/TargetEndpointInfo.cpp new file mode 100644 index 00000000000000..1b809dc23f3958 --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/src/TargetEndpointInfo.cpp @@ -0,0 +1,70 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "TargetEndpointInfo.h" + +void TargetEndpointInfo::Initialize(EndpointId endpointId) +{ + mEndpointId = endpointId; + for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint; i++) + { + mClusters[i] = kInvalidClusterId; + } + mInitialized = true; +} + +bool TargetEndpointInfo::HasCluster(ClusterId clusterId) +{ + for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint; i++) + { + if (mClusters[i] == clusterId) + { + return true; + } + } + return false; +} + +bool TargetEndpointInfo::AddCluster(ClusterId clusterId) +{ + for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint; i++) + { + if (mClusters[i] == clusterId) + { + return true; + } + if (mClusters[i] == kInvalidClusterId) + { + mClusters[i] = clusterId; + return true; + } + } + return false; +} + +void TargetEndpointInfo::PrintInfo() +{ + ChipLogProgress(NotSpecified, " endpoint=%d", mEndpointId); + for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint; i++) + { + if (mClusters[i] != kInvalidClusterId) + { + + ChipLogProgress(NotSpecified, " cluster=" ChipLogFormatMEI, ChipLogValueMEI(mClusters[i])); + } + } +} diff --git a/examples/tv-casting-app/tv-casting-common/src/TargetVideoPlayerInfo.cpp b/examples/tv-casting-app/tv-casting-common/src/TargetVideoPlayerInfo.cpp new file mode 100644 index 00000000000000..1e41faa0ccd93d --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/src/TargetVideoPlayerInfo.cpp @@ -0,0 +1,144 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "TargetVideoPlayerInfo.h" + +CASEClientPool gCASEClientPool; + +CHIP_ERROR TargetVideoPlayerInfo::Initialize(NodeId nodeId, FabricIndex fabricIndex) +{ + ChipLogProgress(NotSpecified, "TargetVideoPlayerInfo nodeId=0x" ChipLogFormatX64 " fabricIndex=%d", ChipLogValueX64(nodeId), + fabricIndex); + mNodeId = nodeId; + mFabricIndex = fabricIndex; + for (auto & endpointInfo : mEndpoints) + { + endpointInfo.Reset(); + } + + Server * server = &(chip::Server::GetInstance()); + chip::FabricInfo * fabric = server->GetFabricTable().FindFabricWithIndex(fabricIndex); + if (fabric == nullptr) + { + ChipLogError(AppServer, "Did not find fabric for index %d", fabricIndex); + return CHIP_ERROR_INVALID_FABRIC_ID; + } + + chip::DeviceProxyInitParams initParams = { + .sessionManager = &(server->GetSecureSessionManager()), + .sessionResumptionStorage = server->GetSessionResumptionStorage(), + .exchangeMgr = &(server->GetExchangeManager()), + .fabricTable = &(server->GetFabricTable()), + .clientPool = &gCASEClientPool, + }; + + PeerId peerID = fabric->GetPeerIdForNode(nodeId); + + // + // TODO: The code here is assuming that we can create an OperationalDeviceProxy instance and attach it immediately + // to a CASE session that just got established to us by the tv-app. While this will work most of the time, + // this is a dangerous assumption to make since it is entirely possible for that secure session to have been + // evicted in the time since that session was established to the point here when we desire to interact back + // with that peer. If that is the case, our `OnConnected` callback will not get invoked syncronously and + // mOperationalDeviceProxy will still have a value of null, triggering the check below to fail. + // + mOperationalDeviceProxy = nullptr; + CHIP_ERROR err = + server->GetCASESessionManager()->FindOrEstablishSession(peerID, &mOnConnectedCallback, &mOnConnectionFailureCallback); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "Could not establish a session to the peer"); + return err; + } + + if (mOperationalDeviceProxy == nullptr) + { + ChipLogError(AppServer, "Failed to find an existing instance of OperationalDeviceProxy to the peer"); + return CHIP_ERROR_INVALID_ARGUMENT; + } + ChipLogProgress(AppServer, "Created an instance of OperationalDeviceProxy"); + + mInitialized = true; + return CHIP_NO_ERROR; +} + +TargetEndpointInfo * TargetVideoPlayerInfo::GetOrAddEndpoint(EndpointId endpointId) +{ + if (!mInitialized) + { + return nullptr; + } + TargetEndpointInfo * endpoint = GetEndpoint(endpointId); + if (endpoint != nullptr) + { + return endpoint; + } + for (auto & endpointInfo : mEndpoints) + { + if (!endpointInfo.IsInitialized()) + { + endpointInfo.Initialize(endpointId); + return &endpointInfo; + } + } + return nullptr; +} + +TargetEndpointInfo * TargetVideoPlayerInfo::GetEndpoint(EndpointId endpointId) +{ + if (!mInitialized) + { + return nullptr; + } + for (auto & endpointInfo : mEndpoints) + { + if (endpointInfo.IsInitialized() && endpointInfo.GetEndpointId() == endpointId) + { + return &endpointInfo; + } + } + return nullptr; +} + +bool TargetVideoPlayerInfo::HasEndpoint(EndpointId endpointId) +{ + if (!mInitialized) + { + return false; + } + for (auto & endpointInfo : mEndpoints) + { + if (endpointInfo.IsInitialized() && endpointInfo.GetEndpointId() == endpointId) + { + return true; + } + } + return false; +} + +void TargetVideoPlayerInfo::PrintInfo() +{ + ChipLogProgress(NotSpecified, " TargetVideoPlayerInfo nodeId=0x" ChipLogFormatX64 " fabric index=%d", ChipLogValueX64(mNodeId), + mFabricIndex); + for (auto & endpointInfo : mEndpoints) + { + if (endpointInfo.IsInitialized()) + { + endpointInfo.PrintInfo(); + } + } +} From a451ce1f78ad12810c4e91116ed4bdf844c58e04 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 28 Apr 2022 21:33:05 -0400 Subject: [PATCH 34/59] Implement Reboot command for chip-tool-darwin. (#17854) * Implement Reboot command for chip-tool-darwin. Enables a few tests that needed Reboot to be enabled. Aligns the general test list better with chip-tool, so it's easier to see what's still missing/disabled. Fixes https://github.com/project-chip/connectedhomeip/issues/16514 * Address review comment. --- .../commands/tests/TestCommandBridge.h | 33 +- .../tests/partials/test_cluster.zapt | 2 +- .../chip-tool-darwin/templates/tests/tests.js | 124 +- .../zap-generated/test/Commands.h | 31932 ++++++++++------ 4 files changed, 20461 insertions(+), 11630 deletions(-) diff --git a/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h b/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h index e71085f05163ca..26b9bf7b816b8d 100644 --- a/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h +++ b/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h @@ -19,17 +19,23 @@ #pragma once #include "../common/CHIPCommandBridge.h" +#include #include #include #include #include #include +#import #import constexpr uint16_t kTimeoutInSeconds = 90; -class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public ConstraintsChecker, public PICSChecker { +class TestCommandBridge : public CHIPCommandBridge, + public ValueChecker, + public ConstraintsChecker, + public PICSChecker, + public SystemCommands { public: TestCommandBridge(const char * _Nonnull commandName) : CHIPCommandBridge(commandName) @@ -63,13 +69,13 @@ class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public SetCommandExitStatus(err); } - /////////// GlobalCommands Interface ///////// void Log(NSString * _Nonnull message) { NSLog(@"%@", message); NextTest(); } + /////////// DelayCommands-like Interface ///////// void WaitForMs(unsigned int ms) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, ms * NSEC_PER_MSEC), mCallbackQueue, ^{ @@ -84,6 +90,17 @@ class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public CHIPDeviceController * controller = CurrentCommissioner(); VerifyOrReturn(controller != nil, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + // Disconnect our existing device; otherwise getConnectedDevice will + // just hand it right back to us without establishing a new CASE + // session. + if (mConnectedDevice != nil) { + auto device = [mConnectedDevice internalDevice]; + if (device != nullptr) { + device->Disconnect(); + } + mConnectedDevice = nil; + } + [controller getConnectedDevice:nodeId queue:mCallbackQueue completionHandler:^(CHIPDevice * _Nullable device, NSError * _Nullable error) { @@ -95,6 +112,18 @@ class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public }]; } + /////////// SystemCommands Interface ///////// + CHIP_ERROR ContinueOnChipMainThread(CHIP_ERROR err) override + { + if (CHIP_NO_ERROR == err) { + WaitForMs(0); + + } else { + Exit(chip::ErrorStr(err), err); + } + return CHIP_NO_ERROR; + } + CHIPDevice * _Nullable GetConnectedDevice(void) { return mConnectedDevice; } protected: diff --git a/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt b/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt index 977d844374d04c..fe95b6f59304c2 100644 --- a/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt +++ b/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt @@ -108,7 +108,7 @@ class {{filename}}: public TestCommandBridge {{~#not_first}}, {{/not_first~}} {{#*inline "defaultValue"}}{{asTypedLiteral (chip_tests_config_get_default_value definedValue) (chip_tests_config_get_type definedValue)}}{{/inline}} {{~#if (chip_tests_config_has definedValue)~}} - m{{asUpperCamelCase definedValue}}.HasValue() ? m{{asUpperCamelCase definedValue}}.Value() : {{>defaultValue}} + m{{asUpperCamelCase definedValue}}.HasValue() ? m{{asUpperCamelCase definedValue}}.Value() : {{~#if (isString type)}}chip::CharSpan::fromCharString("{{>defaultValue}}"){{else}}{{>defaultValue}}{{/if~}} {{else}} {{#if (isString type)}}@"{{/if}}{{definedValue}}{{#if (isString type)}}"{{/if}} {{~/if~}} diff --git a/examples/chip-tool-darwin/templates/tests/tests.js b/examples/chip-tool-darwin/templates/tests/tests.js index ca7c68cf2779fb..631f591f8ff06c 100644 --- a/examples/chip-tool-darwin/templates/tests/tests.js +++ b/examples/chip-tool-darwin/templates/tests/tests.js @@ -79,10 +79,7 @@ function getTests() { const DeviceManagement = [ 'Test_TC_DM_1_1', 'Test_TC_DM_3_1', - ]; - - const DoorLock = [ - 'Test_TC_DL_1_3', + 'Test_TC_DM_2_2', ]; const ElectricalMeasurement = [ @@ -104,17 +101,17 @@ function getTests() { 'Test_TC_GC_1_1', ]; - const IlluminanceMeasurement = [ - 'Test_TC_ILL_1_1', - 'Test_TC_ILL_2_1', - ]; - const Identify = [ 'Test_TC_I_1_1', 'Test_TC_I_2_1', 'Test_TC_I_2_3', ]; + const IlluminanceMeasurement = [ + 'Test_TC_ILL_1_1', + 'Test_TC_ILL_2_1', + ]; + const OccupancySensing = [ 'Test_TC_OCC_1_1', 'Test_TC_OCC_2_1', @@ -131,6 +128,10 @@ function getTests() { 'Test_TC_LVL_6_1', ]; + const UserLabel = [ + 'Test_TC_LC_1_2', + ]; + const MediaControl = [ 'Test_TC_MC_1_1', 'Test_TC_MC_1_2', @@ -174,12 +175,21 @@ function getTests() { 'Test_TC_MOD_1_1', ]; + const MultipleFabrics = [ + // TODO: These tests all need PairWithQRCode + //'Test_TC_MF_1_3', + //'Test_TC_MF_1_4', + //'Test_TC_MF_1_5', + //'Test_TC_MF_1_6', + //'Test_TC_MF_1_15', + ]; + const OnOff = [ 'Test_TC_OO_1_1', 'Test_TC_OO_2_1', 'Test_TC_OO_2_2', 'Test_TC_OO_2_3', - // 'Test_TC_OO_2_4', Disable this Test for now as Darwin does not support reboot commands currently + 'Test_TC_OO_2_4', ]; const PowerSource = [ @@ -210,6 +220,11 @@ function getTests() { 'Test_TC_RH_2_2', ]; + const SecureChannel = [ + // TODO: This test needs FindCommissionable + //'Test_TC_SC_4_2', + ]; + const Switch = [ 'Test_TC_SWTCH_2_1', 'Test_TC_SWTCH_2_2', @@ -238,53 +253,79 @@ function getTests() { 'Test_TC_DIAG_TH_NW_1_2', ]; - const UserLabel = [ - 'Test_TC_LC_1_2', - ]; - const WiFiNetworkDiagnostics = [ 'Test_TC_WIFIDIAG_1_1', 'Test_TC_WIFIDIAG_3_1', ]; const WindowCovering = [ - // WindowCovering is make uses of multiples "subscribeAttribute", but it triggers - // some failures on darwin supposely because the ReadClient stays open for the - // whole duration of the tests and that goes past some internal limits. - // Because of this, some of the tests are disabled on darwin. 'Test_TC_WNCV_1_1', 'Test_TC_WNCV_2_1', 'Test_TC_WNCV_2_2', 'Test_TC_WNCV_2_3', 'Test_TC_WNCV_2_4', 'Test_TC_WNCV_2_5', - //'Test_TC_WNCV_3_1', - //'Test_TC_WNCV_3_2', - //'Test_TC_WNCV_3_3', + 'Test_TC_WNCV_3_1', + 'Test_TC_WNCV_3_2', + 'Test_TC_WNCV_3_3', 'Test_TC_WNCV_3_4', 'Test_TC_WNCV_3_5', + 'Test_TC_WNCV_4_1', + 'Test_TC_WNCV_4_2', 'Test_TC_WNCV_4_3', 'Test_TC_WNCV_4_4', - //'Test_TC_WNCV_4_5', Disable this Test for now as Darwin does not support reboot commands currently + 'Test_TC_WNCV_4_5', + ]; + + const TV = [ + 'TV_TargetNavigatorCluster', + 'TV_AudioOutputCluster', + 'TV_ApplicationLauncherCluster', + 'TV_KeypadInputCluster', + 'TV_AccountLoginCluster', + 'TV_WakeOnLanCluster', + 'TV_ApplicationBasicCluster', + 'TV_MediaPlaybackCluster', + 'TV_ChannelCluster', + 'TV_LowPowerCluster', + 'TV_ContentLauncherCluster', + 'TV_MediaInputCluster', ]; const Others = [ 'TestCluster', - 'TestSaveAs', + // TestClusterComplexTypes requires representing nullable optionals in ways + // that can differentiate missing and null, which Darwin can't right now. + //'TestClusterComplexTypes', 'TestConstraints', 'TestDelayCommands', + // TODO: TestEvents not supported in the codegen yet. + //'TestEvents', + // TODO: TestDiscovery needs FindCommissionable + //'TestDiscovery', + 'TestLogCommands', + 'TestSaveAs', + // TODO: TestConfigVariables not supported properly in codegen yet. + //'TestConfigVariables', 'TestDescriptorCluster', - // TestBasicInformation needs Reboot - //'TestBasicInformation', - // TestGeneralCommissioning needs Reboot + 'TestBasicInformation', + // TODO: TestGeneralCommissioning needs PairWithQRCode //'TestGeneralCommissioning', - 'TestGroupsCluster', - 'TestGroupKeyManagementCluster', 'TestIdentifyCluster', - 'TestLogCommands', 'TestOperationalCredentialsCluster', + 'TestModeSelectCluster', 'TestSelfFabricRemoval', + // TODO: TestSystemCommands needs codegen changes or changes to the system + // command implementation. + //'TestSystemCommands', 'TestBinding', + 'TestUserLabelCluster', + 'TestArmFailSafe', + ]; + + const MultiAdmin = [ + // TODO: TestMultiAdmin needs PairWithQRCode + //'TestMultiAdmin', ]; const SoftwareDiagnostics = [ @@ -297,6 +338,22 @@ function getTests() { 'TestSubscribe_OnOff', ]; + const DoorLock = [ + // TODO: DL_UsersAndCredentials needs some sort of codegen fixes to produce compiling code. + //'DL_UsersAndCredentials', + 'DL_LockUnlock', + // TODO: DL_Schedules needs some sort of codegen fixes to produce compiling code. + //'DL_Schedules', + 'Test_TC_DL_1_3', + ]; + + const Groups = [ + // TestGroupMessaging does not work on Darwin for now. + //'TestGroupMessaging', + 'TestGroupsCluster', + 'TestGroupKeyManagementCluster', + ]; + const tests = [ AccessControl, // BinaryInput, // @@ -305,16 +362,16 @@ function getTests() { ColorControl, // DeviceDiscovery, // DeviceManagement, // - DoorLock, // ElectricalMeasurement, // EthernetNetworkDiagnostics, // FlowMeasurement, // GeneralCommissioning, // - IlluminanceMeasurement, // Identify, // + IlluminanceMeasurement, // LevelControl, // MediaControl, // ModeSelect, // + MultipleFabrics, // OccupancySensing, // OnOff, // PowerSource, // @@ -322,6 +379,7 @@ function getTests() { PumpConfigurationControl, // PowerSourceConfiguration, // RelativeHumidityMeasurement, // + SecureChannel, // Switch, // TemperatureMeasurement, // Thermostat, // @@ -330,9 +388,13 @@ function getTests() { UserLabel, // WiFiNetworkDiagnostics, // WindowCovering, // + TV, // Others, // + MultiAdmin, // SoftwareDiagnostics, // Subscriptions, // + DoorLock, // + Groups, // ]; return tests.flat(1); } diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index a6a807e8f3f568..9606506ee4f4dd 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -71,7 +71,7 @@ class TestList : public Command { printf("Test_TC_DD_1_9\n"); printf("Test_TC_DM_1_1\n"); printf("Test_TC_DM_3_1\n"); - printf("Test_TC_DL_1_3\n"); + printf("Test_TC_DM_2_2\n"); printf("Test_TC_EMR_1_1\n"); printf("Test_TC_ETHDIAG_1_1\n"); printf("Test_TC_ETHDIAG_2_1\n"); @@ -79,11 +79,11 @@ class TestList : public Command { printf("Test_TC_FLW_2_1\n"); printf("Test_TC_FLW_2_2\n"); printf("Test_TC_GC_1_1\n"); - printf("Test_TC_ILL_1_1\n"); - printf("Test_TC_ILL_2_1\n"); printf("Test_TC_I_1_1\n"); printf("Test_TC_I_2_1\n"); printf("Test_TC_I_2_3\n"); + printf("Test_TC_ILL_1_1\n"); + printf("Test_TC_ILL_2_1\n"); printf("Test_TC_LVL_1_1\n"); printf("Test_TC_LVL_2_1\n"); printf("Test_TC_LVL_2_2\n"); @@ -135,6 +135,7 @@ class TestList : public Command { printf("Test_TC_OO_2_1\n"); printf("Test_TC_OO_2_2\n"); printf("Test_TC_OO_2_3\n"); + printf("Test_TC_OO_2_4\n"); printf("Test_TC_PS_1_1\n"); printf("Test_TC_PS_2_1\n"); printf("Test_TC_PRS_1_1\n"); @@ -170,26 +171,50 @@ class TestList : public Command { printf("Test_TC_WNCV_2_3\n"); printf("Test_TC_WNCV_2_4\n"); printf("Test_TC_WNCV_2_5\n"); + printf("Test_TC_WNCV_3_1\n"); + printf("Test_TC_WNCV_3_2\n"); + printf("Test_TC_WNCV_3_3\n"); printf("Test_TC_WNCV_3_4\n"); printf("Test_TC_WNCV_3_5\n"); + printf("Test_TC_WNCV_4_1\n"); + printf("Test_TC_WNCV_4_2\n"); printf("Test_TC_WNCV_4_3\n"); printf("Test_TC_WNCV_4_4\n"); + printf("Test_TC_WNCV_4_5\n"); + printf("TV_TargetNavigatorCluster\n"); + printf("TV_AudioOutputCluster\n"); + printf("TV_ApplicationLauncherCluster\n"); + printf("TV_KeypadInputCluster\n"); + printf("TV_AccountLoginCluster\n"); + printf("TV_WakeOnLanCluster\n"); + printf("TV_ApplicationBasicCluster\n"); + printf("TV_MediaPlaybackCluster\n"); + printf("TV_ChannelCluster\n"); + printf("TV_LowPowerCluster\n"); + printf("TV_ContentLauncherCluster\n"); + printf("TV_MediaInputCluster\n"); printf("TestCluster\n"); - printf("TestSaveAs\n"); printf("TestConstraints\n"); printf("TestDelayCommands\n"); + printf("TestLogCommands\n"); + printf("TestSaveAs\n"); printf("TestDescriptorCluster\n"); - printf("TestGroupsCluster\n"); - printf("TestGroupKeyManagementCluster\n"); + printf("TestBasicInformation\n"); printf("TestIdentifyCluster\n"); - printf("TestLogCommands\n"); printf("TestOperationalCredentialsCluster\n"); + printf("TestModeSelectCluster\n"); printf("TestSelfFabricRemoval\n"); printf("TestBinding\n"); + printf("TestUserLabelCluster\n"); + printf("TestArmFailSafe\n"); printf("Test_TC_SWDIAG_1_1\n"); printf("Test_TC_SWDIAG_2_1\n"); printf("Test_TC_SWDIAG_3_1\n"); printf("TestSubscribe_OnOff\n"); + printf("DL_LockUnlock\n"); + printf("Test_TC_DL_1_3\n"); + printf("TestGroupsCluster\n"); + printf("TestGroupKeyManagementCluster\n"); return CHIP_NO_ERROR; } @@ -15837,11 +15862,11 @@ class Test_TC_DM_3_1 : public TestCommandBridge { } }; -class Test_TC_DL_1_3 : public TestCommandBridge { +class Test_TC_DM_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DL_1_3() - : TestCommandBridge("Test_TC_DL_1_3") + Test_TC_DM_2_2() + : TestCommandBridge("Test_TC_DM_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -15851,7 +15876,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DL_1_3() {} + ~Test_TC_DM_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -15859,11 +15884,11 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_1_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_1_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -15880,36 +15905,20 @@ class Test_TC_DL_1_3 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); - err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Query fabrics list\n"); + err = TestQueryFabricsList_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); - err = TestPreconditionDoorIsInLockedState_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Query Supported Fabrics\n"); + err = TestQuerySupportedFabrics_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); - err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Query Commissioned Fabrics\n"); + err = TestQueryCommissionedFabrics_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock Door command to the DUT with valid PINCode\n"); - err = TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); - err = TestThReadsAutoRelockTimeAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10000ms\n"); - err = TestWait10000ms_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attriute\n"); - err = TestThReadsLockStateAttriute_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Clean the created credential\n"); - err = TestCleanTheCreatedCredential_8(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Query User Trusted Root Certificates\n"); + err = TestQueryUserTrustedRootCertificates_4(); break; } @@ -15926,7 +15935,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -15939,182 +15948,102 @@ class Test_TC_DL_1_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0]; - params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; - [cluster - setCredentialWithParams:params - completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } - - { - id actualValue = values.nextCredentialIndex; - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); - VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestPreconditionDoorIsInLockedState_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition: Door is in locked state Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() + CHIP_ERROR TestQueryFabricsList_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id autoRelockTimeArgument; - autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; - [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query fabrics list Error: %@", err); - __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster unlockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends the unlock Door command to the DUT with valid PINCode Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + } - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() + CHIP_ERROR TestQuerySupportedFabrics_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); + [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query Supported Fabrics Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); + VerifyOrReturn(CheckValue("SupportedFabrics", actualValue, 16)); } + VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_6() - { - WaitForMs(10000); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsLockStateAttriute_7() + CHIP_ERROR TestQueryCommissionedFabrics_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LockState attriute Error: %@", err); + [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query Commissioned Fabrics Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); - VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + VerifyOrReturn(CheckValue("CommissionedFabrics", actualValue, 1)); } + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanTheCreatedCredential_8() + CHIP_ERROR TestQueryUserTrustedRootCertificates_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; - params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - [cluster clearCredentialWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clean the created credential Error: %@", err); + [cluster readAttributeTrustedRootCertificatesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query User Trusted Root Certificates Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("trustedRootCertificates", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -17681,11 +17610,11 @@ class Test_TC_GC_1_1 : public TestCommandBridge { } }; -class Test_TC_ILL_1_1 : public TestCommandBridge { +class Test_TC_I_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_ILL_1_1() - : TestCommandBridge("Test_TC_ILL_1_1") + Test_TC_I_1_1() + : TestCommandBridge("Test_TC_I_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -17695,7 +17624,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_ILL_1_1() {} + ~Test_TC_I_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -17703,11 +17632,11 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -17724,8 +17653,8 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); + err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); @@ -17736,22 +17665,22 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + case 6: ChipLogProgress(chipTool, - " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " "supported events.\n"); if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); break; case 7: ChipLogProgress(chipTool, @@ -17791,22 +17720,20 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); } NextTest(); @@ -17818,9 +17745,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -17838,9 +17763,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -17850,16 +17773,13 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(9))); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 65533UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); } VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); @@ -17869,18 +17789,10 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() - { - UserPrompt(@"Please enter 'y' for success", @"y"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -17890,7 +17802,10 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 64UL)); } VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); @@ -17900,12 +17815,10 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -17915,7 +17828,8 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); } VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); @@ -17925,6 +17839,12 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() { UserPrompt(@"Please enter '0' for success", @"0"); @@ -17932,11 +17852,11 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { } }; -class Test_TC_ILL_2_1 : public TestCommandBridge { +class Test_TC_I_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_ILL_2_1() - : TestCommandBridge("Test_TC_ILL_2_1") + Test_TC_I_2_1() + : TestCommandBridge("Test_TC_I_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -17946,7 +17866,7 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_ILL_2_1() {} + ~Test_TC_I_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -17954,11 +17874,11 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -17975,20 +17895,12 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads MinMeasuredValue attribute from DUT\n"); - err = TestThReadsMinMeasuredValueAttributeFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the IdentifyTime attribute from the DUT\n"); + err = TestThReadsTheIdentifyTimeAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads MaxMeasuredValue attribute from DUT\n"); - err = TestThReadsMaxMeasuredValueAttributeFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads Tolerance attribute from DUT\n"); - err = TestThReadsToleranceAttributeFromDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads LightSensorType attribute from DUT\n"); - err = TestThReadsLightSensorTypeAttributeFromDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the IdentifyType attribute from the DUT\n"); + err = TestThReadsTheIdentifyTypeAttributeFromTheDut_2(); break; } @@ -18005,7 +17917,7 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -18018,79 +17930,41 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsMinMeasuredValueAttributeFromDut_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads MinMeasuredValue attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 1U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsMaxMeasuredValueAttributeFromDut_2() + CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads MaxMeasuredValue attribute from DUT Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 2U)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); - } - + VerifyOrReturn(CheckConstraintType("identifyTime", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsToleranceAttributeFromDut_3() + CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); + [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + VerifyOrReturn(CheckConstraintType("identifyType", "", "enum8")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5)); } NextTest(); @@ -18098,33 +17972,13 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - - CHIP_ERROR TestThReadsLightSensorTypeAttributeFromDut_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("lightSensorType", "", "enum8")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } }; -class Test_TC_I_1_1 : public TestCommandBridge { +class Test_TC_I_2_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_1_1() - : TestCommandBridge("Test_TC_I_1_1") + Test_TC_I_2_3() + : TestCommandBridge("Test_TC_I_2_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -18134,7 +17988,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_I_1_1() {} + ~Test_TC_I_2_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -18142,11 +17996,11 @@ class Test_TC_I_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -18159,408 +18013,44 @@ class Test_TC_I_1_1 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : 1.Wait for the commissioned device to be retrieved\n"); + err = Test1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); - err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " + "the effect variant field set to 0x00 default\n"); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Manually check DUT executes a blink effect\n"); + err = TestManuallyCheckDutExecutesABlinkEffect_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " + "and the effect variant field set to 0x00 default\n"); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : check DUT executes a breathe effect\n"); + err = TestCheckDutExecutesABreatheEffect_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and " + "the effect variant field set to 0x00 default\n"); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " - "supported events.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : check DUT executes an okay effect\n"); + err = TestCheckDutExecutesAnOkayEffect_6(); break; case 7: ChipLogProgress(chipTool, - " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " - "attribute has the value 0\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); - } - - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 64UL)); - } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() - { - UserPrompt(@"Please enter 'y' for success", @"y"); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() - { - UserPrompt(@"Please enter '0' for success", @"0"); - return CHIP_NO_ERROR; - } -}; - -class Test_TC_I_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_1() - : TestCommandBridge("Test_TC_I_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_I_2_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the IdentifyTime attribute from the DUT\n"); - err = TestThReadsTheIdentifyTimeAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the IdentifyType attribute from the DUT\n"); - err = TestThReadsTheIdentifyTypeAttributeFromTheDut_2(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("identifyTime", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("identifyType", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_I_2_3 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_3() - : TestCommandBridge("Test_TC_I_2_3") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_I_2_3() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_3\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 1.Wait for the commissioned device to be retrieved\n"); - err = Test1WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " - "the effect variant field set to 0x00 default\n"); - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Manually check DUT executes a blink effect\n"); - err = TestManuallyCheckDutExecutesABlinkEffect_2(); - break; - case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " - "and the effect variant field set to 0x00 default\n"); - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : check DUT executes a breathe effect\n"); - err = TestCheckDutExecutesABreatheEffect_4(); - break; - case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and " - "the effect variant field set to 0x00 default\n"); - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : check DUT executes an okay effect\n"); - err = TestCheckDutExecutesAnOkayEffect_6(); - break; - case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel " - "change and the effect variant field set to 0x00 default\n"); - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7(); + " ***** Test Step 7 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel " + "change and the effect variant field set to 0x00 default\n"); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : check DUT executes a channel change effect\n"); @@ -18957,11 +18447,11 @@ class Test_TC_I_2_3 : public TestCommandBridge { } }; -class Test_TC_LVL_1_1 : public TestCommandBridge { +class Test_TC_ILL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_1_1() - : TestCommandBridge("Test_TC_LVL_1_1") + Test_TC_ILL_1_1() + : TestCommandBridge("Test_TC_ILL_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -18971,7 +18461,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_1_1() {} + ~Test_TC_ILL_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -18979,11 +18469,11 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -19009,10 +18499,6 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: @@ -19030,8 +18516,18 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeAcceptedCommandList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); break; } @@ -19048,7 +18544,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -19064,7 +18560,9 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -19074,7 +18572,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); } NextTest(); @@ -19086,7 +18584,9 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -19104,7 +18604,9 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -19114,21 +18616,16 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(14))); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(9))); VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); - VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); - VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); - VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); - VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); - VerifyOrReturn(CheckValue("", actualValue[13], 16384UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 65533UL)); } VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); @@ -19147,7 +18644,9 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -19157,15 +18656,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(8))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); } VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); @@ -19175,34 +18666,43 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 3UL)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; -class Test_TC_LVL_2_1 : public TestCommandBridge { +class Test_TC_ILL_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_2_1() - : TestCommandBridge("Test_TC_LVL_2_1") + Test_TC_ILL_2_1() + : TestCommandBridge("Test_TC_ILL_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -19212,7 +18712,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_2_1() {} + ~Test_TC_ILL_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -19220,11 +18720,11 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -19241,64 +18741,20 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reset level to 254\n"); - err = TestResetLevelTo254_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads MinMeasuredValue attribute from DUT\n"); + err = TestThReadsMinMeasuredValueAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Wait 100ms\n"); - err = TestWait100ms_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads MaxMeasuredValue attribute from DUT\n"); + err = TestThReadsMaxMeasuredValueAttributeFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the CurrentLevel attribute\n"); - err = TestReadsTheCurrentLevelAttribute_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads Tolerance attribute from DUT\n"); + err = TestThReadsToleranceAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the RemainingTime attribute\n"); - err = TestReadsTheRemainingTimeAttribute_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the MinLevel attribute\n"); - err = TestReadsTheMinLevelAttribute_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the MaxLevel attribute\n"); - err = TestReadsTheMaxLevelAttribute_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads the CurrentFrequency attribute\n"); - err = TestReadsTheCurrentFrequencyAttribute_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the MinFrequency attribute\n"); - err = TestReadsTheMinFrequencyAttribute_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the MaxFrequency attribute\n"); - err = TestReadsTheMaxFrequencyAttribute_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the OnOffTransitionTime attribute\n"); - err = TestReadsTheOnOffTransitionTimeAttribute_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the OnLevel attribute \n"); - err = TestReadsTheOnLevelAttribute_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the OnTransitionTime attribute \n"); - err = TestReadsTheOnTransitionTimeAttribute_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the OffTransitionTime attribute \n"); - err = TestReadsTheOffTransitionTimeAttribute_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the DefaultMoveRate attribute \n"); - err = TestReadsTheDefaultMoveRateAttribute_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the Options attribute \n"); - err = TestReadsTheOptionsAttribute_15(); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads LightSensorType attribute from DUT\n"); + err = TestThReadsLightSensorTypeAttributeFromDut_4(); break; } @@ -19315,7 +18771,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -19328,24 +18784,497 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestResetLevelTo254_1() + CHIP_ERROR TestThReadsMinMeasuredValueAttributeFromDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:254]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset level to 254 Error: %@", err); + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads MinMeasuredValue attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsMaxMeasuredValueAttributeFromDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads MaxMeasuredValue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 2U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsToleranceAttributeFromDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsLightSensorTypeAttributeFromDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("lightSensorType", "", "enum8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LVL_1_1() + : TestCommandBridge("Test_TC_LVL_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_LVL_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(14))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 16384UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(8))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 3UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LVL_2_1() + : TestCommandBridge("Test_TC_LVL_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_LVL_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reset level to 254\n"); + err = TestResetLevelTo254_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Wait 100ms\n"); + err = TestWait100ms_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the CurrentLevel attribute\n"); + err = TestReadsTheCurrentLevelAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the RemainingTime attribute\n"); + err = TestReadsTheRemainingTimeAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the MinLevel attribute\n"); + err = TestReadsTheMinLevelAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the MaxLevel attribute\n"); + err = TestReadsTheMaxLevelAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Reads the CurrentFrequency attribute\n"); + err = TestReadsTheCurrentFrequencyAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the MinFrequency attribute\n"); + err = TestReadsTheMinFrequencyAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the MaxFrequency attribute\n"); + err = TestReadsTheMaxFrequencyAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the OnOffTransitionTime attribute\n"); + err = TestReadsTheOnOffTransitionTimeAttribute_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the OnLevel attribute \n"); + err = TestReadsTheOnLevelAttribute_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the OnTransitionTime attribute \n"); + err = TestReadsTheOnTransitionTimeAttribute_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the OffTransitionTime attribute \n"); + err = TestReadsTheOffTransitionTimeAttribute_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the DefaultMoveRate attribute \n"); + err = TestReadsTheDefaultMoveRateAttribute_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the Options attribute \n"); + err = TestReadsTheOptionsAttribute_15(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 16; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestResetLevelTo254_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:254]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionMask = [NSNumber numberWithUnsignedChar:1]; + params.optionOverride = [NSNumber numberWithUnsignedChar:1]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Reset level to 254 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); }]; return CHIP_NO_ERROR; @@ -31097,6 +31026,520 @@ class Test_TC_OO_2_3 : public TestCommandBridge { } }; +class Test_TC_OO_2_4 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OO_2_4() + : TestCommandBridge("Test_TC_OO_2_4") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_OO_2_4() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_4\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_4\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH sends On command to DUT\n"); + err = TestThSendsOnCommandToDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH writes a value of 0 to StartUpOnOff attribute of DUT\n"); + err = TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the StartUpOnOff attribute from the DUT\n"); + err = TestThReadsTheStartUpOnOffAttributeFromTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Power off DUT\n"); + err = TestPowerOffDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH writes a value of 1 to StartUpOnOff attribute of DUT\n"); + err = TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Power off DUT\n"); + err = TestPowerOffDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH writes a value of 2 to StartUpOnOff attribute of DUT\n"); + err = TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Power off DUT\n"); + err = TestPowerOffDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Power off DUT\n"); + err = TestPowerOffDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH writes NULL to StartUpOnOff attribute of DUT\n"); + err = TestThWritesNullToStartUpOnOffAttributeOfDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Power off DUT\n"); + err = TestPowerOffDut_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH sends Off command to DUT\n"); + err = TestThSendsOffCommandToDut_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Power off DUT\n"); + err = TestPowerOffDut_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads the OnOff attribute from the DUT\n"); + err = TestThReadsTheOnOffAttributeFromTheDut_25(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 26; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOnCommandToDut_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends On command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 0 to StartUpOnOff attribute of DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheStartUpOnOffAttributeFromTheDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the StartUpOnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StartUpOnOff", actualValue)); + VerifyOrReturn(CheckValue("StartUpOnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_4() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_5() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 1 to StartUpOnOff attribute of DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_8() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_9() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 2 to StartUpOnOff attribute of DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_12() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_13() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_15() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_16() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_17() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesNullToStartUpOnOffAttributeOfDut_18() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpOnOffArgument; + startUpOnOffArgument = nil; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes NULL to StartUpOnOff attribute of DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_19() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_20() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOffCommandToDut_22() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Off command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPowerOffDut_23() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_24() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_25() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_PS_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -46553,23 +46996,21 @@ class Test_TC_WNCV_2_5 : public TestCommandBridge { } }; -class Test_TC_WNCV_3_4 : public TestCommandBridge { +class Test_TC_WNCV_3_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_3_4() - : TestCommandBridge("Test_TC_WNCV_3_4") + Test_TC_WNCV_3_1() + : TestCommandBridge("Test_TC_WNCV_3_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); - AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_3_4() {} + ~Test_TC_WNCV_3_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -46577,11 +47018,11 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -46603,54 +47044,154 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : 1b: TH Waits for fastMotionDuration seconds movement(s) on the device\n"); - err = Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH Waits for 10 seconds movement(s) on the device\n"); + err = Test1bThWaitsFor10SecondsMovementsOnTheDevice_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2a: TH sends UpOrOpen command to DUT\n"); - err = Test2aThSendsUpOrOpenCommandToDut_3(); + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3(); break; case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : 2b: TH Waits for fullMotionDuration seconds movement(s) on the device\n"); - err = Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : 1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4(); break; case 5: ChipLogProgress( - chipTool, " ***** Test Step 5 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + chipTool, " ***** Test Step 5 : 1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { NextTest(); return; } - err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5(); + err = Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5(); break; case 6: ChipLogProgress(chipTool, - " ***** Test Step 6 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + " ***** Test Step 6 : 1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { NextTest(); return; } - err = Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6(); + err = Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6(); break; case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Report: 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = Test2SubscribeToDutReportsOnOperationalStatusAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 2a: TH sends UpOrOpen command to DUT\n"); + err = Test2aThSendsUpOrOpenCommandToDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_10(); + break; + case 11: ChipLogProgress( - chipTool, " ***** Test Step 7 : 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + chipTool, " ***** Test Step 11 : 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 2e: TH leave the device moving for 2 seconds\n"); + err = Test2eThLeaveTheDeviceMovingFor2Seconds_12(); + break; + case 13: + ChipLogProgress( + chipTool, " ***** Test Step 13 : 3a1: Verify DUT reports OperationalStatus attribute to TH after a UpOrOpen\n"); + err = Test3a1VerifyDutReportsOperationalStatusAttributeToThAfterAUpOrOpen_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : 3a2: DUT updates its attributes\n"); + err = Test3a2DutUpdatesItsAttributes_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16(); + break; + case 17: + ChipLogProgress( + chipTool, " ***** Test Step 17 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { NextTest(); return; } - err = Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7(); + err = Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17(); break; - case 8: + case 18: ChipLogProgress(chipTool, - " ***** Test Step 8 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + " ***** Test Step 18 : 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { NextTest(); return; } - err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); + err = Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : 4a: TH sends a StopMotion command to DUT\n"); + err = Test4aThSendsAStopMotionCommandToDut_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : 4b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); + err = Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion\n"); + err = Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : 5a: TH waits for x seconds attributes update on the device\n"); + err = Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23(); + break; + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24(); break; } @@ -46667,13 +47208,11 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 25; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mFastMotionDuration; - chip::Optional mFullMotionDuration; chip::Optional mTimeout; CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() @@ -46699,36 +47238,13 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() - { - WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() + CHIP_ERROR Test1bThWaitsFor10SecondsMovementsOnTheDevice_2() { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + WaitForMs(10000); return CHIP_NO_ERROR; } - CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -46736,14 +47252,18 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + NSLog(@"1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); } NextTest(); @@ -46752,7 +47272,7 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + CHIP_ERROR Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -46760,14 +47280,18 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + NSLog(@"1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); } NextTest(); @@ -46776,7 +47300,7 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + CHIP_ERROR Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -46784,14 +47308,18 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + NSLog(@"1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); } NextTest(); @@ -46800,7 +47328,7 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + CHIP_ERROR Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -46808,14 +47336,18 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + NSLog(@"1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); } NextTest(); @@ -46823,184 +47355,144 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; + bool testSendClusterTest_TC_WNCV_3_1_000007_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_Test_TC_WNCV_3_1_OperationalStatus_Reported = nil; -class Test_TC_WNCV_3_5 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_3_5() - : TestCommandBridge("Test_TC_WNCV_3_5") - , mTestIndex(0) + CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); - AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_WNCV_3_5() {} + test_Test_TC_WNCV_3_1_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("status", err, 0)); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_5\n"); - } + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + testSendClusterTest_TC_WNCV_3_1_000007_WaitForReport_Fulfilled = true; + }; - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_5\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + NextTest(); + return CHIP_NO_ERROR; + } - Wait(); + CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); - err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : 1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); - err = Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1(); - break; - case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : 1b: TH Waits for fastMotionDuration seconds movement(s) on the device\n"); - err = Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2a: TH sends DownOrClose command to DUT\n"); - err = Test2aThSendsDownOrCloseCommandToDut_3(); - break; - case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : 2b: TH Waits for fullMotionDuration seconds movement(s) on the device\n"); - err = Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4(); - break; - case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { - NextTest(); - return; - } - err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { - NextTest(); - return; - } - err = Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6(); - break; - case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { - NextTest(); - return; - } - err = Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + uint16_t minIntervalArgument = 4U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeOperationalStatusWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn(testSendClusterTest_TC_WNCV_3_1_000007_WaitForReport_Fulfilled, + SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); NextTest(); - return; } - err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); - break; - } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_Test_TC_WNCV_3_1_OperationalStatus_Reported != nil) { + ResponseHandler callback = test_Test_TC_WNCV_3_1_OperationalStatus_Reported; + test_Test_TC_WNCV_3_1_OperationalStatus_Reported = nil; + callback(value, err); + } + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_9() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mFastMotionDuration; - chip::Optional mFullMotionDuration; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bDutUpdatesItsAttributes_10() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + WaitForMs(100); return CHIP_NO_ERROR; } - CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() + CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err); + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() + CHIP_ERROR Test2eThLeaveTheDeviceMovingFor2Seconds_12() { - WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); + WaitForMs(2000); return CHIP_NO_ERROR; } - CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_3() + CHIP_ERROR Test3a1VerifyDutReportsOperationalStatusAttributeToThAfterAUpOrOpen_13() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); + test_Test_TC_WNCV_3_1_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a1: Verify DUT reports OperationalStatus attribute to TH after a UpOrOpen Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("operationalStatus", [value unsignedCharValue], 5)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", [value unsignedCharValue], 21)); + } + NextTest(); - }]; + }; return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() + CHIP_ERROR Test3a2DutUpdatesItsAttributes_14() { - WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + WaitForMs(2000); return CHIP_NO_ERROR; } - CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47008,14 +47500,18 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 10000U)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 9999U)); } NextTest(); @@ -47024,7 +47520,7 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + CHIP_ERROR Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47032,14 +47528,18 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + NSLog(@"3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 100)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 99)); } NextTest(); @@ -47048,7 +47548,7 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47056,14 +47556,18 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 10000U)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); } NextTest(); @@ -47072,7 +47576,7 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + CHIP_ERROR Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47080,14 +47584,18 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + NSLog(@"3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); - VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 100)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 99)); } NextTest(); @@ -47095,13 +47603,120 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR Test4aThSendsAStopMotionCommandToDut_19() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends a StopMotion command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20() + { + WaitForMs(3000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22() + { + WaitForMs(1000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 9999U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; -class Test_TC_WNCV_4_3 : public TestCommandBridge { +class Test_TC_WNCV_3_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_4_3() - : TestCommandBridge("Test_TC_WNCV_4_3") + Test_TC_WNCV_3_2() + : TestCommandBridge("Test_TC_WNCV_3_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -47111,7 +47726,7 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_4_3() {} + ~Test_TC_WNCV_3_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -47119,11 +47734,11 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -47141,44 +47756,158 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { break; case 1: ChipLogProgress( - chipTool, " ***** Test Step 1 : 1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT\n"); + chipTool, " ***** Test Step 1 : 1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH Waits for 10 seconds movement(s) on the device\n"); + err = Test1bThWaitsFor10SecondsMovementsOnTheDevice_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { NextTest(); return; } - err = Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1(); + err = Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT\n"); + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : 1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { NextTest(); return; } - err = Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2(); + err = Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH sends GoToLiftPercentage command with BadParam to DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : 1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { NextTest(); return; } - err = Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3(); + err = Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 3a: TH sends GoToLiftPercentage command with 10001 to DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : 1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { NextTest(); return; } - err = Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4(); + err = Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Report: 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = Test2SubscribeToDutReportsOnOperationalStatusAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 2a: TH sends DownOrClose command to DUT\n"); + err = Test2aThSendsDownOrCloseCommandToDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_10(); + break; + case 11: + ChipLogProgress( + chipTool, " ***** Test Step 11 : 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { NextTest(); return; } - err = Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5(); + err = Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 2e: TH leave the device moving for 2 seconds\n"); + err = Test2eThLeaveTheDeviceMovingFor2Seconds_12(); + break; + case 13: + ChipLogProgress( + chipTool, " ***** Test Step 13 : 3a: Verify DUT reports OperationalStatus attribute to TH after a DownOrClose\n"); + err = Test3aVerifyDutReportsOperationalStatusAttributeToThAfterADownOrClose_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : 3a2: DUT updates its attributes\n"); + err = Test3a2DutUpdatesItsAttributes_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16(); + break; + case 17: + ChipLogProgress( + chipTool, " ***** Test Step 17 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : 4a: TH sends a StopMotion command to DUT\n"); + err = Test4aThSendsAStopMotionCommandToDut_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : 4b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); + err = Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion\n"); + err = Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : 5a: TH waits for x seconds attributes update on the device\n"); + err = Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23(); + break; + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24(); break; } @@ -47195,7 +47924,7 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 25; chip::Optional mNodeId; chip::Optional mCluster; @@ -47207,9 +47936,31 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; - CHIP_ERROR Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1() + CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsFor10SecondsMovementsOnTheDevice_2() + { + WaitForMs(10000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47217,20 +47968,18 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err); + NSLog(@"1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); if (value != nil) { VerifyOrReturn(CheckConstraintMinValue( "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); } if (value != nil) { VerifyOrReturn(CheckConstraintMaxValue( - "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); - } - { - attrCurrentPositionLiftPercent100ths = value; + "currentPositionLiftPercent100ths", [value unsignedShortValue], 9999U)); } NextTest(); @@ -47238,9 +47987,8 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionLiftPercentage; - CHIP_ERROR Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2() + CHIP_ERROR Test1dIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47248,20 +47996,18 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { [cluster readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT Error: %@", err); + NSLog(@"1d: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); if (value != nil) { VerifyOrReturn( CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); } if (value != nil) { VerifyOrReturn( - CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); - } - { - attrCurrentPositionLiftPercentage = value; + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 99)); } NextTest(); @@ -47270,180 +48016,255 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3() + CHIP_ERROR Test1eIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:63]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2b: TH sends GoToLiftPercentage command with BadParam to DUT Error: %@", err); + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1e: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 9999U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4() + CHIP_ERROR Test1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:100]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: TH sends GoToLiftPercentage command with 10001 to DUT Error: %@", err); + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1f: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 99)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } + bool testSendClusterTest_TC_WNCV_3_2_000007_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_Test_TC_WNCV_3_2_OperationalStatus_Reported = nil; - CHIP_ERROR Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5() + CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:255]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT Error: %@", err); + test_Test_TC_WNCV_3_2_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + testSendClusterTest_TC_WNCV_3_2_000007_WaitForReport_Fulfilled = true; + }; + NextTest(); return CHIP_NO_ERROR; } -}; -class Test_TC_WNCV_4_4 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WNCV_4_4() - : TestCommandBridge("Test_TC_WNCV_4_4") - , mTestIndex(0) + CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_8() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + uint16_t minIntervalArgument = 4U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeOperationalStatusWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn(testSendClusterTest_TC_WNCV_3_2_000007_WaitForReport_Fulfilled, + SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + NextTest(); + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_Test_TC_WNCV_3_2_OperationalStatus_Reported != nil) { + ResponseHandler callback = test_Test_TC_WNCV_3_2_OperationalStatus_Reported; + test_Test_TC_WNCV_3_2_OperationalStatus_Reported = nil; + callback(value, err); + } + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WNCV_4_4() {} + CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bDutUpdatesItsAttributes_10() { - CHIP_ERROR err = CHIP_NO_ERROR; + WaitForMs(100); + return CHIP_NO_ERROR; + } - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_4\n"); - } + CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_4\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err, 0)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); - err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : 1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { - NextTest(); - return; - } - err = Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { - NextTest(); - return; - } - err = Test1bIfPaTlTlThReadsCurrentPositionTiltPercentageFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH sends GoToTiltPercentage command with BadParam to DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { - NextTest(); - return; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 10000U)); } - err = Test2bThSendsGoToTiltPercentageCommandWithBadParamToDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 3a: TH sends GoToTiltPercentage command with 10001 to DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { - NextTest(); - return; + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2eThLeaveTheDeviceMovingFor2Seconds_12() + { + WaitForMs(2000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aVerifyDutReportsOperationalStatusAttributeToThAfterADownOrClose_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + test_Test_TC_WNCV_3_2_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: Verify DUT reports OperationalStatus attribute to TH after a DownOrClose Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("operationalStatus", [value unsignedCharValue], 10)); } - err = Test3aThSendsGoToTiltPercentageCommandWith10001ToDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT\n"); - if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { - NextTest(); - return; + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", [value unsignedCharValue], 42)); } - err = Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5(); - break; - } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + NextTest(); + }; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR Test3a2DutUpdatesItsAttributes_14() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + WaitForMs(2000); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); - CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_16() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 1)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionTiltPercent100ths; - CHIP_ERROR Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1() + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_17() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47451,30 +48272,27 @@ class Test_TC_WNCV_4_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err); + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); if (value != nil) { VerifyOrReturn(CheckConstraintMinValue( - "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + "currentPositionTiltPercent100ths", [value unsignedShortValue], 1U)); } if (value != nil) { VerifyOrReturn(CheckConstraintMaxValue( "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); } - { - attrCurrentPositionTiltPercent100ths = value; - } NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionTiltPercentage; - CHIP_ERROR Test1bIfPaTlTlThReadsCurrentPositionTiltPercentageFromDut_2() + CHIP_ERROR Test3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_18() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -47482,21 +48300,19 @@ class Test_TC_WNCV_4_4 : public TestCommandBridge { [cluster readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT Error: %@", err); + NSLog(@"3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); if (value != nil) { VerifyOrReturn( - CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 1)); } if (value != nil) { VerifyOrReturn( CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); } - { - attrCurrentPositionTiltPercentage = value; - } NextTest(); }]; @@ -47504,72 +48320,119 @@ class Test_TC_WNCV_4_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test2bThSendsGoToTiltPercentageCommandWithBadParamToDut_3() + CHIP_ERROR Test4aThSendsAStopMotionCommandToDut_19() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:63]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2b: TH sends GoToTiltPercentage command with BadParam to DUT Error: %@", err); + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends a StopMotion command to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test3aThSendsGoToTiltPercentageCommandWith10001ToDut_4() + CHIP_ERROR Test4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_20() + { + WaitForMs(3000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_21() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:100]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: TH sends GoToTiltPercentage command with 10001 to DUT Error: %@", err); + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5() + CHIP_ERROR Test5aThWaitsForXSecondsAttributesUpdateOnTheDevice_22() + { + WaitForMs(1000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_23() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:255]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT Error: %@", err); + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_24() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 1U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "targetPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class TestCluster : public TestCommandBridge { +class Test_TC_WNCV_3_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestCluster() - : TestCommandBridge("TestCluster") + Test_TC_WNCV_3_3() + : TestCommandBridge("Test_TC_WNCV_3_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -47579,7 +48442,7 @@ class TestCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestCluster() {} + ~Test_TC_WNCV_3_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -47587,11 +48450,11 @@ class TestCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -47604,2108 +48467,8930 @@ class TestCluster : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Command\n"); - err = TestSendTestCommand_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Not Handled Command\n"); - err = TestSendTestNotHandledCommand_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH Waits for 6-8 seconds movement(s) on the device\n"); + err = Test1bThWaitsFor68SecondsMovementsOnTheDevice_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Specific Command\n"); - err = TestSendTestSpecificCommand_3(); + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); + err = Test1cThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : 1d: TH Waits for 2 seconds movement(s) on the device\n"); + err = Test1dThWaitsFor2SecondsMovementsOnTheDevice_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send failing Test Add Arguments Command\n"); - err = TestSendFailingTestAddArgumentsCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Report: 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Default Value\n"); - err = TestReadAttributeBooleanDefaultValue_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : 2: Subscribe to DUT reports on OperationalStatus attribute\n"); + err = Test2SubscribeToDutReportsOnOperationalStatusAttribute_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN True\n"); - err = TestWriteAttributeBooleanTrue_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : 2a: TH sends a StopMotion command to DUT\n"); + err = Test2aThSendsAStopMotionCommandToDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN True\n"); - err = TestReadAttributeBooleanTrue_8(); + ChipLogProgress( + chipTool, " ***** Test Step 8 : 2b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); + err = Test2bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write attribute BOOLEAN False\n"); - err = TestWriteAttributeBooleanFalse_9(); + ChipLogProgress( + chipTool, " ***** Test Step 9 : 2c: Verify DUT reports OperationalStatus attribute to TH after a StopMotion\n"); + err = Test2cVerifyDutReportsOperationalStatusAttributeToThAfterAStopMotion_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute BOOLEAN False\n"); - err = TestReadAttributeBooleanFalse_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : 2d: TH waits for 100ms - 3s attributes update on the device\n"); + err = Test2dThWaitsFor100ms3sAttributesUpdateOnTheDevice_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Default Value\n"); - err = TestReadAttributeBitmap8DefaultValue_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : 2e: TH reads OperationalStatus attribute from DUT\n"); + err = Test2eThReadsOperationalStatusAttributeFromDut_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Max Value\n"); - err = TestWriteAttributeBitmap8MaxValue_12(); + ChipLogProgress( + chipTool, " ***** Test Step 12 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Max Value\n"); - err = TestReadAttributeBitmap8MaxValue_13(); + ChipLogProgress(chipTool, + " ***** Test Step 13 : 3b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute 3c: it Must be equal " + "with CurrentPositionLiftPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsTargetPositionLiftPercent100thsAttribute3cItMustBeEqualWithCurrentPositionLiftPercent100thsFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute BITMAP8 Min Value\n"); - err = TestWriteAttributeBitmap8MinValue_14(); + ChipLogProgress( + chipTool, " ***** Test Step 14 : 4a: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test4aIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute BITMAP8 Min Value\n"); - err = TestReadAttributeBitmap8MinValue_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute BITMAP16 Default Value\n"); - err = TestReadAttributeBitmap16DefaultValue_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute BITMAP16 Max Value\n"); - err = TestWriteAttributeBitmap16MaxValue_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute BITMAP16 Max Value\n"); - err = TestReadAttributeBitmap16MaxValue_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute BITMAP16 Min Value\n"); - err = TestWriteAttributeBitmap16MinValue_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute BITMAP16 Min Value\n"); - err = TestReadAttributeBitmap16MinValue_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute BITMAP32 Default Value\n"); - err = TestReadAttributeBitmap32DefaultValue_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute BITMAP32 Max Value\n"); - err = TestWriteAttributeBitmap32MaxValue_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute BITMAP32 Max Value\n"); - err = TestReadAttributeBitmap32MaxValue_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Write attribute BITMAP32 Min Value\n"); - err = TestWriteAttributeBitmap32MinValue_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Read attribute BITMAP32 Min Value\n"); - err = TestReadAttributeBitmap32MinValue_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Max Value\n"); - err = TestWriteAttributeBitmap64MaxValue_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Max Value\n"); - err = TestReadAttributeBitmap64MaxValue_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Write attribute BITMAP64 Min Value\n"); - err = TestWriteAttributeBitmap64MinValue_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Read attribute BITMAP64 Min Value\n"); - err = TestReadAttributeBitmap64MinValue_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Max Value\n"); - err = TestWriteAttributeInt8uMaxValue_32(); + ChipLogProgress(chipTool, + " ***** Test Step 15 : 4b: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute 4c: it Must be equal " + "with CurrentPositionTiltPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test4bIfPaTlThReadsTargetPositionTiltPercent100thsAttribute4cItMustBeEqualWithCurrentPositionTiltPercent100thsFromDut_15(); break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Max Value\n"); - err = TestReadAttributeInt8uMaxValue_33(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 16; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsFor68SecondsMovementsOnTheDevice_2() + { + WaitForMs(6000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1c: TH sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1dThWaitsFor2SecondsMovementsOnTheDevice_4() + { + WaitForMs(2000); + return CHIP_NO_ERROR; + } + bool testSendClusterTest_TC_WNCV_3_3_000005_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_Test_TC_WNCV_3_3_OperationalStatus_Reported = nil; + + CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + test_Test_TC_WNCV_3_3_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + testSendClusterTest_TC_WNCV_3_3_000005_WaitForReport_Fulfilled = true; + }; + + NextTest(); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2SubscribeToDutReportsOnOperationalStatusAttribute_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + uint16_t minIntervalArgument = 4U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeOperationalStatusWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn(testSendClusterTest_TC_WNCV_3_3_000005_WaitForReport_Fulfilled, + SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + NextTest(); + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_Test_TC_WNCV_3_3_OperationalStatus_Reported != nil) { + ResponseHandler callback = test_Test_TC_WNCV_3_3_OperationalStatus_Reported; + test_Test_TC_WNCV_3_3_OperationalStatus_Reported = nil; + callback(value, err); + } + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsAStopMotionCommandToDut_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends a StopMotion command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_8() + { + WaitForMs(3000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cVerifyDutReportsOperationalStatusAttributeToThAfterAStopMotion_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + test_Test_TC_WNCV_3_3_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: Verify DUT reports OperationalStatus attribute to TH after a StopMotion Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2dThWaitsFor100ms3sAttributesUpdateOnTheDevice_10() + { + WaitForMs(2000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2eThReadsOperationalStatusAttributeFromDut_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2e: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLift; + + CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + { + attrCurrentPositionLift = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + Test3bIfPaLfThReadsTargetPositionLiftPercent100thsAttribute3cItMustBeEqualWithCurrentPositionLiftPercent100thsFromDut_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute 3c: it Must be equal with " + @"CurrentPositionLiftPercent100ths from DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + if (attrCurrentPositionLift == nil) { + VerifyOrReturn(CheckValueNull("TargetPositionLiftPercent100ths", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, attrCurrentPositionLift)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionTilt; + + CHIP_ERROR Test4aIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4a: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); + } + { + attrCurrentPositionTilt = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + Test4bIfPaTlThReadsTargetPositionTiltPercent100thsAttribute4cItMustBeEqualWithCurrentPositionTiltPercent100thsFromDut_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4b: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute 4c: it Must be equal with " + @"CurrentPositionTiltPercent100ths from DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + if (attrCurrentPositionTilt == nil) { + VerifyOrReturn(CheckValueNull("TargetPositionTiltPercent100ths", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("TargetPositionTiltPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionTiltPercent100ths", actualValue, attrCurrentPositionTilt)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_3_4 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_3_4() + : TestCommandBridge("Test_TC_WNCV_3_4") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_3_4() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_4\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_4\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Write attribute INT8U Min Value\n"); - err = TestWriteAttributeInt8uMinValue_34(); + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute INT8U Min Value\n"); - err = TestReadAttributeInt8uMinValue_35(); + case 2: + ChipLogProgress( + chipTool, " ***** Test Step 2 : 1b: TH Waits for fastMotionDuration seconds movement(s) on the device\n"); + err = Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2(); break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_36(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 2a: TH sends UpOrOpen command to DUT\n"); + err = Test2aThSendsUpOrOpenCommandToDut_3(); break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Max Value\n"); - err = TestWriteAttributeInt16uMaxValue_37(); + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : 2b: TH Waits for fullMotionDuration seconds movement(s) on the device\n"); + err = Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4(); break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Max Value\n"); - err = TestReadAttributeInt16uMaxValue_38(); + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5(); break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Write attribute INT16U Min Value\n"); - err = TestWriteAttributeInt16uMinValue_39(); + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6(); break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute INT16U Min Value\n"); - err = TestReadAttributeInt16uMinValue_40(); + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7(); break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_41(); + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Max Value\n"); - err = TestWriteAttributeInt32uMaxValue_42(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFastMotionDuration; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() + { + WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_3_5 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_3_5() + : TestCommandBridge("Test_TC_WNCV_3_5") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fastMotionDuration", 0, UINT16_MAX, &mFastMotionDuration); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_3_5() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_5\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_5\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Max Value\n"); - err = TestReadAttributeInt32uMaxValue_43(); + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : 1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1(); break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute INT32U Min Value\n"); - err = TestWriteAttributeInt32uMinValue_44(); + case 2: + ChipLogProgress( + chipTool, " ***** Test Step 2 : 1b: TH Waits for fastMotionDuration seconds movement(s) on the device\n"); + err = Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2(); break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute INT32U Min Value\n"); - err = TestReadAttributeInt32uMinValue_45(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 2a: TH sends DownOrClose command to DUT\n"); + err = Test2aThSendsDownOrCloseCommandToDut_3(); break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_46(); + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : 2b: TH Waits for fullMotionDuration seconds movement(s) on the device\n"); + err = Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4(); break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Max Value\n"); - err = TestWriteAttributeInt64uMaxValue_47(); + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : 3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5(); break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Max Value\n"); - err = TestReadAttributeInt64uMaxValue_48(); + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : 3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6(); break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Write attribute INT64U Min Value\n"); - err = TestWriteAttributeInt64uMinValue_49(); + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : 3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7(); break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute INT64U Min Value\n"); - err = TestReadAttributeInt64uMinValue_50(); + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : 3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8(); break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_51(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFastMotionDuration; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsUpOrOpenCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsForFastMotionDurationSecondsMovementsOnTheDevice_2() + { + WaitForMs(mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThWaitsForFullMotionDurationSecondsMovementsOnTheDevice_4() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercent100ths", actualValue, 10000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionLiftPercentage", actualValue, 100)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercent100ths", actualValue, 10000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3dIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercentage", actualValue)); + VerifyOrReturn(CheckValue("CurrentPositionTiltPercentage", actualValue, 100)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_1() + : TestCommandBridge("Test_TC_WNCV_4_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_4_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Max Value\n"); - err = TestWriteAttributeInt8sMaxValue_52(); + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Max Value\n"); - err = TestReadAttributeInt8sMaxValue_53(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH waits for x seconds movement(s) on the DUT\n"); + err = Test1bThWaitsForXSecondsMovementsOnTheDut_2(); break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute INT8S Min Value\n"); - err = TestWriteAttributeInt8sMinValue_54(); - break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Read attribute INT8S Min Value\n"); - err = TestReadAttributeInt8sMinValue_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Write attribute INT8S Default Value\n"); - err = TestWriteAttributeInt8sDefaultValue_56(); - break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_57(); - break; - case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_58(); - break; - case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Write attribute INT16S Max Value\n"); - err = TestWriteAttributeInt16sMaxValue_59(); - break; - case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Read attribute INT16S Max Value\n"); - err = TestReadAttributeInt16sMaxValue_60(); - break; - case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : Write attribute INT16S Min Value\n"); - err = TestWriteAttributeInt16sMinValue_61(); - break; - case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Read attribute INT16S Min Value\n"); - err = TestReadAttributeInt16sMinValue_62(); - break; - case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Write attribute INT16S Default Value\n"); - err = TestWriteAttributeInt16sDefaultValue_63(); - break; - case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_64(); - break; - case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_65(); - break; - case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Write attribute INT32S Max Value\n"); - err = TestWriteAttributeInt32sMaxValue_66(); - break; - case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Read attribute INT32S Max Value\n"); - err = TestReadAttributeInt32sMaxValue_67(); - break; - case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Write attribute INT32S Min Value\n"); - err = TestWriteAttributeInt32sMinValue_68(); - break; - case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute INT32S Min Value\n"); - err = TestReadAttributeInt32sMinValue_69(); - break; - case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute INT32S Default Value\n"); - err = TestWriteAttributeInt32sDefaultValue_70(); - break; - case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_71(); - break; - case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_72(); - break; - case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Write attribute INT64S Max Value\n"); - err = TestWriteAttributeInt64sMaxValue_73(); - break; - case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute INT64S Max Value\n"); - err = TestReadAttributeInt64sMaxValue_74(); - break; - case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute INT64S Min Value\n"); - err = TestWriteAttributeInt64sMinValue_75(); - break; - case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute INT64S Min Value\n"); - err = TestReadAttributeInt64sMinValue_76(); - break; - case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute INT64S Default Value\n"); - err = TestWriteAttributeInt64sDefaultValue_77(); - break; - case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_78(); - break; - case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute SINGLE Default Value\n"); - err = TestReadAttributeSingleDefaultValue_79(); - break; - case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute SINGLE medium Value\n"); - err = TestWriteAttributeSingleMediumValue_80(); - break; - case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute SINGLE medium Value\n"); - err = TestReadAttributeSingleMediumValue_81(); - break; - case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute SINGLE large Value\n"); - err = TestWriteAttributeSingleLargeValue_82(); - break; - case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute SINGLE large Value\n"); - err = TestReadAttributeSingleLargeValue_83(); - break; - case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Write attribute SINGLE small Value\n"); - err = TestWriteAttributeSingleSmallValue_84(); - break; - case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Read attribute SINGLE small Value\n"); - err = TestReadAttributeSingleSmallValue_85(); - break; - case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Write attribute SINGLE Default Value\n"); - err = TestWriteAttributeSingleDefaultValue_86(); - break; - case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Read attribute SINGLE Default Value\n"); - err = TestReadAttributeSingleDefaultValue_87(); - break; - case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute DOUBLE Default Value\n"); - err = TestReadAttributeDoubleDefaultValue_88(); - break; - case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Write attribute DOUBLE medium Value\n"); - err = TestWriteAttributeDoubleMediumValue_89(); - break; - case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Read attribute DOUBLE medium Value\n"); - err = TestReadAttributeDoubleMediumValue_90(); - break; - case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Write attribute DOUBLE large Value\n"); - err = TestWriteAttributeDoubleLargeValue_91(); - break; - case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Read attribute DOUBLE large Value\n"); - err = TestReadAttributeDoubleLargeValue_92(); - break; - case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Write attribute DOUBLE small Value\n"); - err = TestWriteAttributeDoubleSmallValue_93(); - break; - case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute DOUBLE small Value\n"); - err = TestReadAttributeDoubleSmallValue_94(); - break; - case 95: - ChipLogProgress(chipTool, " ***** Test Step 95 : Write attribute DOUBLE Default Value\n"); - err = TestWriteAttributeDoubleDefaultValue_95(); - break; - case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Read attribute DOUBLE Default Value\n"); - err = TestReadAttributeDoubleDefaultValue_96(); - break; - case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_97(); + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_PA_LF && WNCV_LF")) { + NextTest(); + return; + } + err = Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3(); break; - case 98: - ChipLogProgress(chipTool, " ***** Test Step 98 : Write attribute ENUM8 Max Value\n"); - err = TestWriteAttributeEnum8MaxValue_98(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 2a: TH sends GoToLiftPercentage command with 25 percent to DUT\n"); + if (ShouldSkip("WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test2aThSendsGoToLiftPercentageCommandWith25PercentToDut_4(); break; - case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Read attribute ENUM8 Max Value\n"); - err = TestReadAttributeEnum8MaxValue_99(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_5(); break; - case 100: - ChipLogProgress(chipTool, " ***** Test Step 100 : Write attribute ENUM8 Min Value\n"); - err = TestWriteAttributeEnum8MinValue_100(); + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_PA_LF && WNCV_LF")) { + NextTest(); + return; + } + err = Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_6(); break; - case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Read attribute ENUM8 Min Value\n"); - err = TestReadAttributeEnum8MinValue_101(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 3a: TH set a timeout of X minutes for failure\n"); + err = Test3aThSetATimeoutOfXMinutesForFailure_7(); break; - case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_102(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 3b: TH reads OperationalStatus attribute from DUT\n"); + err = Test3bThReadsOperationalStatusAttributeFromDut_8(); break; - case 103: - ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute ENUM16 Max Value\n"); - err = TestWriteAttributeEnum16MaxValue_103(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 4a: TH sends GoToLiftPercentage command with 75.20 percent to DUT\n"); + if (ShouldSkip("WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test4aThSendsGoToLiftPercentageCommandWith7520PercentToDut_9(); break; - case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute ENUM16 Max Value\n"); - err = TestReadAttributeEnum16MaxValue_104(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 4b: DUT updates its attributes\n"); + err = Test4bDutUpdatesItsAttributes_10(); break; - case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Write attribute ENUM16 Min Value\n"); - err = TestWriteAttributeEnum16MinValue_105(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : 5a: TH waits for x seconds movement(s) on the DUT\n"); + err = Test5aThWaitsForXSecondsMovementsOnTheDut_11(); break; - case 106: - ChipLogProgress(chipTool, " ***** Test Step 106 : Read attribute ENUM16 Min Value\n"); - err = TestReadAttributeEnum16MinValue_106(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 5b: TH reads OperationalStatus attribute from DUT\n"); + err = Test5bThReadsOperationalStatusAttributeFromDut_12(); break; - case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute OCTET_STRING Default Value\n"); - err = TestReadAttributeOctetStringDefaultValue_107(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 13; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsForXSecondsMovementsOnTheDut_2() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", value, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsGoToLiftPercentageCommandWith25PercentToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:25]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:2500U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends GoToLiftPercentage command with 25 percent to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bDutUpdatesItsAttributes_5() + { + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionLiftPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionLiftPercent100ths", actualValue, 2500U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aThSetATimeoutOfXMinutesForFailure_7() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bThReadsOperationalStatusAttributeFromDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4aThSendsGoToLiftPercentageCommandWith7520PercentToDut_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:75]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:7520U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends GoToLiftPercentage command with 75.20 percent to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4bDutUpdatesItsAttributes_10() + { + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5aThWaitsForXSecondsMovementsOnTheDut_11() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bThReadsOperationalStatusAttributeFromDut_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_2() + : TestCommandBridge("Test_TC_WNCV_4_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("fullMotionDuration", 0, UINT16_MAX, &mFullMotionDuration); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_4_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 108: - ChipLogProgress(chipTool, " ***** Test Step 108 : Write attribute OCTET_STRING with embedded null\n"); - err = TestWriteAttributeOctetStringWithEmbeddedNull_108(); + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : 1a: TH sends DownOrClose command to preposition the DUT in the opposite direction\n"); + err = Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; - case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute OCTET_STRING with embedded null\n"); - err = TestReadAttributeOctetStringWithEmbeddedNull_109(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: TH waits for x seconds movement(s) on the DUT\n"); + err = Test1bThWaitsForXSecondsMovementsOnTheDut_2(); break; - case 110: - ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute OCTET_STRING with weird chars\n"); - err = TestWriteAttributeOctetStringWithWeirdChars_110(); + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : 1c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_PA_TL && WNCV_TL")) { + NextTest(); + return; + } + err = Test1cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_3(); break; - case 111: - ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute OCTET_STRING with weird chars\n"); - err = TestReadAttributeOctetStringWithWeirdChars_111(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 2a: TH sends GoToTiltPercentage command with 30 percent to DUT\n"); + if (ShouldSkip("WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test2aThSendsGoToTiltPercentageCommandWith30PercentToDut_4(); break; - case 112: - ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_112(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 2b: DUT updates its attributes\n"); + err = Test2bDutUpdatesItsAttributes_5(); break; - case 113: - ChipLogProgress(chipTool, " ***** Test Step 113 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_113(); + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : 2c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + if (ShouldSkip("WNCV_PA_TL && WNCV_TL")) { + NextTest(); + return; + } + err = Test2cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_6(); break; - case 114: - ChipLogProgress(chipTool, " ***** Test Step 114 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_114(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 3a: TH set a timeout of X minutes for failure\n"); + err = Test3aThSetATimeoutOfXMinutesForFailure_7(); break; - case 115: - ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_115(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 3b: TH reads OperationalStatus attribute from DUT\n"); + err = Test3bThReadsOperationalStatusAttributeFromDut_8(); break; - case 116: - ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_116(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 4a: TH sends GoToTiltPercentage command with 60.20 percent to DUT\n"); + if (ShouldSkip("WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test4aThSendsGoToTiltPercentageCommandWith6020PercentToDut_9(); break; - case 117: - ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute LONG_OCTET_STRING Default Value\n"); - err = TestReadAttributeLongOctetStringDefaultValue_117(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 4b: DUT updates its attributes\n"); + err = Test4bDutUpdatesItsAttributes_10(); break; - case 118: - ChipLogProgress(chipTool, " ***** Test Step 118 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_118(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : 5a: TH waits for x seconds movement(s) on the DUT\n"); + err = Test5aThWaitsForXSecondsMovementsOnTheDut_11(); break; - case 119: - ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute LONG_OCTET_STRING\n"); - err = TestReadAttributeLongOctetString_119(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 5b: TH reads OperationalStatus attribute from DUT\n"); + err = Test5bThReadsOperationalStatusAttributeFromDut_12(); break; - case 120: - ChipLogProgress(chipTool, " ***** Test Step 120 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_120(); - break; - case 121: - ChipLogProgress(chipTool, " ***** Test Step 121 : Read attribute CHAR_STRING Default Value\n"); - err = TestReadAttributeCharStringDefaultValue_121(); - break; - case 122: - ChipLogProgress(chipTool, " ***** Test Step 122 : Write attribute CHAR_STRING\n"); - err = TestWriteAttributeCharString_122(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 13; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mFullMotionDuration; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsForXSecondsMovementsOnTheDut_2() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", value, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aThSendsGoToTiltPercentageCommandWith30PercentToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:30]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:3000U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: TH sends GoToTiltPercentage command with 30 percent to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bDutUpdatesItsAttributes_5() + { + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"2c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("TargetPositionTiltPercent100ths", actualValue)); + VerifyOrReturn(CheckValue("TargetPositionTiltPercent100ths", actualValue, 3000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aThSetATimeoutOfXMinutesForFailure_7() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3bThReadsOperationalStatusAttributeFromDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4aThSendsGoToTiltPercentageCommandWith6020PercentToDut_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:60]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:6005U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends GoToTiltPercentage command with 60.20 percent to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4bDutUpdatesItsAttributes_10() + { + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5aThWaitsForXSecondsMovementsOnTheDut_11() + { + WaitForMs(mFullMotionDuration.HasValue() ? mFullMotionDuration.Value() : 6000U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test5bThReadsOperationalStatusAttributeFromDut_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"5b: TH reads OperationalStatus attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OperationalStatus", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_3() + : TestCommandBridge("Test_TC_WNCV_4_3") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_4_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 123: - ChipLogProgress(chipTool, " ***** Test Step 123 : Read attribute CHAR_STRING\n"); - err = TestReadAttributeCharString_123(); + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : 1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1(); break; - case 124: - ChipLogProgress(chipTool, " ***** Test Step 124 : Write attribute CHAR_STRING - Value too long\n"); - err = TestWriteAttributeCharStringValueTooLong_124(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2(); break; - case 125: - ChipLogProgress(chipTool, " ***** Test Step 125 : Read attribute CHAR_STRING\n"); - err = TestReadAttributeCharString_125(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH sends GoToLiftPercentage command with BadParam to DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3(); break; - case 126: - ChipLogProgress(chipTool, " ***** Test Step 126 : Write attribute CHAR_STRING - Empty\n"); - err = TestWriteAttributeCharStringEmpty_126(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 3a: TH sends GoToLiftPercentage command with 10001 to DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4(); break; - case 127: - ChipLogProgress(chipTool, " ***** Test Step 127 : Read attribute LONG_CHAR_STRING Default Value\n"); - err = TestReadAttributeLongCharStringDefaultValue_127(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { + NextTest(); + return; + } + err = Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5(); break; - case 128: - ChipLogProgress(chipTool, " ***** Test Step 128 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_128(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; + + CHIP_ERROR Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLiftPercent100ths", [value unsignedShortValue], 10000U)); + } + { + attrCurrentPositionLiftPercent100ths = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLiftPercentage; + + CHIP_ERROR Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); + } + { + attrCurrentPositionLiftPercentage = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:63]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2b: TH sends GoToLiftPercentage command with BadParam to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:100]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: TH sends GoToLiftPercentage command with 10001 to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:255]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_4 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_4() + : TestCommandBridge("Test_TC_WNCV_4_4") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_4_4() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_4\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_4\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0: Wait for the commissioned device to be retrieved\n"); + err = Test0WaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 129: - ChipLogProgress(chipTool, " ***** Test Step 129 : Read attribute LONG_CHAR_STRING\n"); - err = TestReadAttributeLongCharString_129(); + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : 1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1(); break; - case 130: - ChipLogProgress(chipTool, " ***** Test Step 130 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_130(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL && A_CURRENTPOSITIONTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test1bIfPaTlTlThReadsCurrentPositionTiltPercentageFromDut_2(); break; - case 131: - ChipLogProgress(chipTool, " ***** Test Step 131 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); - err = TestReadAttributeListLongOctetStringForChunkedRead_131(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH sends GoToTiltPercentage command with BadParam to DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test2bThSendsGoToTiltPercentageCommandWithBadParamToDut_3(); break; - case 132: - ChipLogProgress(chipTool, " ***** Test Step 132 : Write attribute LIST_LONG_OCTET_STRING (for chunked write)\n"); - err = TestWriteAttributeListLongOctetStringForChunkedWrite_132(); - break; - case 133: - ChipLogProgress(chipTool, " ***** Test Step 133 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); - err = TestReadAttributeListLongOctetStringForChunkedRead_133(); - break; - case 134: - ChipLogProgress(chipTool, " ***** Test Step 134 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_134(); - break; - case 135: - ChipLogProgress(chipTool, " ***** Test Step 135 : Write attribute EPOCH_US Max Value\n"); - err = TestWriteAttributeEpochUsMaxValue_135(); - break; - case 136: - ChipLogProgress(chipTool, " ***** Test Step 136 : Read attribute EPOCH_US Max Value\n"); - err = TestReadAttributeEpochUsMaxValue_136(); - break; - case 137: - ChipLogProgress(chipTool, " ***** Test Step 137 : Write attribute EPOCH_US Min Value\n"); - err = TestWriteAttributeEpochUsMinValue_137(); - break; - case 138: - ChipLogProgress(chipTool, " ***** Test Step 138 : Read attribute EPOCH_US Min Value\n"); - err = TestReadAttributeEpochUsMinValue_138(); - break; - case 139: - ChipLogProgress(chipTool, " ***** Test Step 139 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_139(); - break; - case 140: - ChipLogProgress(chipTool, " ***** Test Step 140 : Write attribute EPOCH_S Max Value\n"); - err = TestWriteAttributeEpochSMaxValue_140(); - break; - case 141: - ChipLogProgress(chipTool, " ***** Test Step 141 : Read attribute EPOCH_S Max Value\n"); - err = TestReadAttributeEpochSMaxValue_141(); - break; - case 142: - ChipLogProgress(chipTool, " ***** Test Step 142 : Write attribute EPOCH_S Min Value\n"); - err = TestWriteAttributeEpochSMinValue_142(); - break; - case 143: - ChipLogProgress(chipTool, " ***** Test Step 143 : Read attribute EPOCH_S Min Value\n"); - err = TestReadAttributeEpochSMinValue_143(); - break; - case 144: - ChipLogProgress(chipTool, " ***** Test Step 144 : Read attribute UNSUPPORTED\n"); - err = TestReadAttributeUnsupported_144(); - break; - case 145: - ChipLogProgress(chipTool, " ***** Test Step 145 : Writeattribute UNSUPPORTED\n"); - err = TestWriteattributeUnsupported_145(); - break; - case 146: - ChipLogProgress(chipTool, " ***** Test Step 146 : Send Test Command to unsupported endpoint\n"); - err = TestSendTestCommandToUnsupportedEndpoint_146(); - break; - case 147: - ChipLogProgress(chipTool, " ***** Test Step 147 : Send Test Command to unsupported cluster\n"); - err = TestSendTestCommandToUnsupportedCluster_147(); - break; - case 148: - ChipLogProgress(chipTool, " ***** Test Step 148 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_148(); - break; - case 149: - ChipLogProgress(chipTool, " ***** Test Step 149 : Write attribute vendor_id\n"); - err = TestWriteAttributeVendorId_149(); - break; - case 150: - ChipLogProgress(chipTool, " ***** Test Step 150 : Read attribute vendor_id\n"); - err = TestReadAttributeVendorId_150(); - break; - case 151: - ChipLogProgress(chipTool, " ***** Test Step 151 : Restore attribute vendor_id\n"); - err = TestRestoreAttributeVendorId_151(); - break; - case 152: - ChipLogProgress(chipTool, " ***** Test Step 152 : Send a command with a vendor_id and enum\n"); - err = TestSendACommandWithAVendorIdAndEnum_152(); - break; - case 153: - ChipLogProgress(chipTool, " ***** Test Step 153 : Send Test Command With Struct Argument and arg1.b is true\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153(); - break; - case 154: - ChipLogProgress(chipTool, " ***** Test Step 154 : Send Test Command With Struct Argument and arg1.b is false\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154(); - break; - case 155: - ChipLogProgress( - chipTool, " ***** Test Step 155 : Send Test Command With Nested Struct Argument and arg1.c.b is true\n"); - err = TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_155(); - break; - case 156: - ChipLogProgress(chipTool, " ***** Test Step 156 : Send Test Command With Nested Struct Argument arg1.c.b is false\n"); - err = TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156(); - break; - case 157: - ChipLogProgress(chipTool, - " ***** Test Step 157 : Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_157(); - break; - case 158: - ChipLogProgress(chipTool, - " ***** Test Step 158 : Send Test Command With Nested Struct List Argument and some fields b of arg1.d are " - "false\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_158(); - break; - case 159: - ChipLogProgress(chipTool, " ***** Test Step 159 : Send Test Command With Struct Argument and see what we get back\n"); - err = TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159(); - break; - case 160: - ChipLogProgress(chipTool, " ***** Test Step 160 : Send Test Command With List of INT8U and none of them is set to 0\n"); - err = TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_160(); - break; - case 161: - ChipLogProgress(chipTool, " ***** Test Step 161 : Send Test Command With List of INT8U and one of them is set to 0\n"); - err = TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_161(); - break; - case 162: - ChipLogProgress(chipTool, " ***** Test Step 162 : Send Test Command With List of INT8U and get it reversed\n"); - err = TestSendTestCommandWithListOfInt8uAndGetItReversed_162(); - break; - case 163: - ChipLogProgress( - chipTool, " ***** Test Step 163 : Send Test Command With empty List of INT8U and get an empty list back\n"); - err = TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_163(); - break; - case 164: - ChipLogProgress(chipTool, - " ***** Test Step 164 : Send Test Command With List of Struct Argument and arg1.b of first item is true\n"); - err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_164(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 3a: TH sends GoToTiltPercentage command with 10001 to DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test3aThSendsGoToTiltPercentageCommandWith10001ToDut_4(); break; - case 165: - ChipLogProgress(chipTool, - " ***** Test Step 165 : Send Test Command With List of Struct Argument and arg1.b of first item is false\n"); - err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_165(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL || WNCV_TL && CR_GOTOTILTPERCENTAGE")) { + NextTest(); + return; + } + err = Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5(); break; - case 166: - ChipLogProgress(chipTool, - " ***** Test Step 166 : Send Test Command With List of Nested Struct List Argument and all fields b of elements of " - "arg1.d are true\n"); - err = TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_166(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR Test0WaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionTiltPercent100ths; + + CHIP_ERROR Test1aIfPaTlTlThReadsCurrentPositionTiltPercent100thsFromDut_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTiltPercent100ths", [value unsignedShortValue], 10000U)); + } + { + attrCurrentPositionTiltPercent100ths = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionTiltPercentage; + + CHIP_ERROR Test1bIfPaTlTlThReadsCurrentPositionTiltPercentageFromDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercentage", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("currentPositionTiltPercentage", [value unsignedCharValue], 100)); + } + { + attrCurrentPositionTiltPercentage = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThSendsGoToTiltPercentageCommandWithBadParamToDut_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:63]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2b: TH sends GoToTiltPercentage command with BadParam to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3aThSendsGoToTiltPercentageCommandWith10001ToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:100]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"3a: TH sends GoToTiltPercentage command with 10001 to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test4aThSendsGoToTiltPercentageCommandWith0xFFFFToDut_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:255]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WNCV_4_5 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WNCV_4_5() + : TestCommandBridge("Test_TC_WNCV_4_5") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WNCV_4_5() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_4_5\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_4_5\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 0a: Wait for the commissioned device to be retrieved\n"); + err = Test0aWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 167: - ChipLogProgress(chipTool, - " ***** Test Step 167 : Send Test Command With Nested Struct List Argument and some fields b of elements of arg1.d " - "are false\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_167(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : 0b: TH sends UpOrOpen command to preposition the DUT\n"); + err = Test0bThSendsUpOrOpenCommandToPrepositionTheDut_1(); break; - case 168: + case 2: ChipLogProgress( - chipTool, " ***** Test Step 168 : Write attribute LIST With List of INT8U and none of them is set to 0\n"); - err = TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168(); - break; - case 169: - ChipLogProgress(chipTool, " ***** Test Step 169 : Read attribute LIST With List of INT8U\n"); - err = TestReadAttributeListWithListOfInt8u_169(); - break; - case 170: - ChipLogProgress(chipTool, " ***** Test Step 170 : Write attribute LIST With List of OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfOctetString_170(); - break; - case 171: - ChipLogProgress(chipTool, " ***** Test Step 171 : Read attribute LIST With List of OCTET_STRING\n"); - err = TestReadAttributeListWithListOfOctetString_171(); - break; - case 172: - ChipLogProgress(chipTool, " ***** Test Step 172 : Write attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfListStructOctetString_172(); - break; - case 173: - ChipLogProgress(chipTool, " ***** Test Step 173 : Read attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestReadAttributeListWithListOfListStructOctetString_173(); - break; - case 174: - ChipLogProgress(chipTool, " ***** Test Step 174 : Send Test Command with optional arg set.\n"); - err = TestSendTestCommandWithOptionalArgSet_174(); + chipTool, " ***** Test Step 2 : 1a: If (PA_LF & LF) TH sends GoToLiftPercentage command with 90%% to DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test1aIfPaLfLfThSendsGoToLiftPercentageCommandWith90ToDut_2(); break; - case 175: - ChipLogProgress(chipTool, " ***** Test Step 175 : Send Test Command without its optional arg.\n"); - err = TestSendTestCommandWithoutItsOptionalArg_175(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : 1b: TH Waits for 100ms-1s\n"); + err = Test1bThWaitsFor100ms1s_3(); break; - case 176: - ChipLogProgress(chipTool, " ***** Test Step 176 : Read list of structs containing nullables and optionals\n"); - err = TestReadListOfStructsContainingNullablesAndOptionals_176(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : 1c: TH sends StopMotion command to DUT\n"); + err = Test1cThSendsStopMotionCommandToDut_4(); break; - case 177: - ChipLogProgress(chipTool, " ***** Test Step 177 : Write list of structs containing nullables and optionals\n"); - err = TestWriteListOfStructsContainingNullablesAndOptionals_177(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : 1d: TH Waits for 100ms-1s\n"); + err = Test1dThWaitsFor100ms1s_5(); break; - case 178: + case 6: ChipLogProgress( - chipTool, " ***** Test Step 178 : Read list of structs containing nullables and optionals after writing\n"); - err = TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178(); - break; - case 179: - ChipLogProgress(chipTool, " ***** Test Step 179 : Write attribute NULLABLE_BOOLEAN null\n"); - err = TestWriteAttributeNullableBooleanNull_179(); - break; - case 180: - ChipLogProgress(chipTool, " ***** Test Step 180 : Read attribute NULLABLE_BOOLEAN null\n"); - err = TestReadAttributeNullableBooleanNull_180(); - break; - case 181: - ChipLogProgress(chipTool, " ***** Test Step 181 : Write attribute NULLABLE_BOOLEAN True\n"); - err = TestWriteAttributeNullableBooleanTrue_181(); - break; - case 182: - ChipLogProgress(chipTool, " ***** Test Step 182 : Read attribute NULLABLE_BOOLEAN True\n"); - err = TestReadAttributeNullableBooleanTrue_182(); - break; - case 183: - ChipLogProgress(chipTool, " ***** Test Step 183 : Write attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestWriteAttributeNullableBitmap8MaxValue_183(); - break; - case 184: - ChipLogProgress(chipTool, " ***** Test Step 184 : Read attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestReadAttributeNullableBitmap8MaxValue_184(); - break; - case 185: - ChipLogProgress(chipTool, " ***** Test Step 185 : Write attribute NULLABLE_BITMAP8 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap8InvalidValue_185(); - break; - case 186: - ChipLogProgress(chipTool, " ***** Test Step 186 : Read attribute NULLABLE_BITMAP8 unchanged Value\n"); - err = TestReadAttributeNullableBitmap8UnchangedValue_186(); - break; - case 187: - ChipLogProgress(chipTool, " ***** Test Step 187 : Write attribute NULLABLE_BITMAP8 null Value\n"); - err = TestWriteAttributeNullableBitmap8NullValue_187(); - break; - case 188: - ChipLogProgress(chipTool, " ***** Test Step 188 : Read attribute NULLABLE_BITMAP8 null Value\n"); - err = TestReadAttributeNullableBitmap8NullValue_188(); - break; - case 189: - ChipLogProgress(chipTool, " ***** Test Step 189 : Write attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestWriteAttributeNullableBitmap16MaxValue_189(); - break; - case 190: - ChipLogProgress(chipTool, " ***** Test Step 190 : Read attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestReadAttributeNullableBitmap16MaxValue_190(); - break; - case 191: - ChipLogProgress(chipTool, " ***** Test Step 191 : Write attribute NULLABLE_BITMAP16 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap16InvalidValue_191(); - break; - case 192: - ChipLogProgress(chipTool, " ***** Test Step 192 : Read attribute NULLABLE_BITMAP16 unchanged Value\n"); - err = TestReadAttributeNullableBitmap16UnchangedValue_192(); + chipTool, " ***** Test Step 6 : 2a: If (PA_TL & TL) TH sends GoToTiltPercentage command with 90%% to DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test2aIfPaTlTlThSendsGoToTiltPercentageCommandWith90ToDut_6(); break; - case 193: - ChipLogProgress(chipTool, " ***** Test Step 193 : Write attribute NULLABLE_BITMAP16 null Value\n"); - err = TestWriteAttributeNullableBitmap16NullValue_193(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : 2b: TH Waits for 100ms-1s\n"); + err = Test2bThWaitsFor100ms1s_7(); break; - case 194: - ChipLogProgress(chipTool, " ***** Test Step 194 : Read attribute NULLABLE_BITMAP16 null Value\n"); - err = TestReadAttributeNullableBitmap16NullValue_194(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : 2c: TH sends StopMotion command to DUT\n"); + err = Test2cThSendsStopMotionCommandToDut_8(); break; - case 195: - ChipLogProgress(chipTool, " ***** Test Step 195 : Write attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestWriteAttributeNullableBitmap32MaxValue_195(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : 2d: TH Waits for 100ms-1s\n"); + err = Test2dThWaitsFor100ms1s_9(); break; - case 196: - ChipLogProgress(chipTool, " ***** Test Step 196 : Read attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestReadAttributeNullableBitmap32MaxValue_196(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : 3a: TH reads CurrentPositionLiftPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3aThReadsCurrentPositionLiftPercent100thsFromDut_10(); break; - case 197: - ChipLogProgress(chipTool, " ***** Test Step 197 : Write attribute NULLABLE_BITMAP32 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap32InvalidValue_197(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : 3b: TH reads CurrentPositionTiltPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3bThReadsCurrentPositionTiltPercent100thsFromDut_11(); break; - case 198: - ChipLogProgress(chipTool, " ***** Test Step 198 : Read attribute NULLABLE_BITMAP32 unchanged Value\n"); - err = TestReadAttributeNullableBitmap32UnchangedValue_198(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : 3c: reboot/restart the DUT\n"); + err = Test3cRebootRestartTheDut_12(); break; - case 199: - ChipLogProgress(chipTool, " ***** Test Step 199 : Write attribute NULLABLE_BITMAP32 null Value\n"); - err = TestWriteAttributeNullableBitmap32NullValue_199(); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : 3d: Wait for the commissioned device to be retrieved\n"); + err = Test3dWaitForTheCommissionedDeviceToBeRetrieved_13(); break; - case 200: - ChipLogProgress(chipTool, " ***** Test Step 200 : Read attribute NULLABLE_BITMAP32 null Value\n"); - err = TestReadAttributeNullableBitmap32NullValue_200(); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : 3e: TH reads CurrentPositionLiftPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF")) { + NextTest(); + return; + } + err = Test3eThReadsCurrentPositionLiftPercent100thsFromDut_14(); break; - case 201: - ChipLogProgress(chipTool, " ***** Test Step 201 : Write attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestWriteAttributeNullableBitmap64MaxValue_201(); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : 3f: TH reads CurrentPositionTiltPercent100ths from DUT\n"); + if (ShouldSkip("WNCV_TL && WNCV_PA_TL")) { + NextTest(); + return; + } + err = Test3fThReadsCurrentPositionTiltPercent100thsFromDut_15(); break; - case 202: - ChipLogProgress(chipTool, " ***** Test Step 202 : Read attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestReadAttributeNullableBitmap64MaxValue_202(); - break; - case 203: - ChipLogProgress(chipTool, " ***** Test Step 203 : Write attribute NULLABLE_BITMAP64 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap64InvalidValue_203(); - break; - case 204: - ChipLogProgress(chipTool, " ***** Test Step 204 : Read attribute NULLABLE_BITMAP64 unchanged Value\n"); - err = TestReadAttributeNullableBitmap64UnchangedValue_204(); - break; - case 205: - ChipLogProgress(chipTool, " ***** Test Step 205 : Write attribute NULLABLE_BITMAP64 null Value\n"); - err = TestWriteAttributeNullableBitmap64NullValue_205(); - break; - case 206: - ChipLogProgress(chipTool, " ***** Test Step 206 : Read attribute NULLABLE_BITMAP64 null Value\n"); - err = TestReadAttributeNullableBitmap64NullValue_206(); - break; - case 207: - ChipLogProgress(chipTool, " ***** Test Step 207 : Write attribute NULLABLE_INT8U Min Value\n"); - err = TestWriteAttributeNullableInt8uMinValue_207(); - break; - case 208: - ChipLogProgress(chipTool, " ***** Test Step 208 : Read attribute NULLABLE_INT8U Min Value\n"); - err = TestReadAttributeNullableInt8uMinValue_208(); - break; - case 209: - ChipLogProgress(chipTool, " ***** Test Step 209 : Write attribute NULLABLE_INT8U Max Value\n"); - err = TestWriteAttributeNullableInt8uMaxValue_209(); - break; - case 210: - ChipLogProgress(chipTool, " ***** Test Step 210 : Read attribute NULLABLE_INT8U Max Value\n"); - err = TestReadAttributeNullableInt8uMaxValue_210(); - break; - case 211: - ChipLogProgress(chipTool, " ***** Test Step 211 : Write attribute NULLABLE_INT8U Invalid Value\n"); - err = TestWriteAttributeNullableInt8uInvalidValue_211(); - break; - case 212: - ChipLogProgress(chipTool, " ***** Test Step 212 : Read attribute NULLABLE_INT8U unchanged Value\n"); - err = TestReadAttributeNullableInt8uUnchangedValue_212(); - break; - case 213: - ChipLogProgress(chipTool, " ***** Test Step 213 : Read attribute NULLABLE_INT8U unchanged Value with constraint\n"); - err = TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213(); - break; - case 214: - ChipLogProgress(chipTool, " ***** Test Step 214 : Write attribute NULLABLE_INT8U null Value\n"); - err = TestWriteAttributeNullableInt8uNullValue_214(); - break; - case 215: - ChipLogProgress(chipTool, " ***** Test Step 215 : Read attribute NULLABLE_INT8U null Value\n"); - err = TestReadAttributeNullableInt8uNullValue_215(); - break; - case 216: - ChipLogProgress(chipTool, " ***** Test Step 216 : Read attribute NULLABLE_INT8U null Value & range\n"); - err = TestReadAttributeNullableInt8uNullValueRange_216(); - break; - case 217: - ChipLogProgress(chipTool, " ***** Test Step 217 : Read attribute NULLABLE_INT8U null Value & not\n"); - err = TestReadAttributeNullableInt8uNullValueNot_217(); - break; - case 218: - ChipLogProgress(chipTool, " ***** Test Step 218 : Write attribute NULLABLE_INT8U Value\n"); - err = TestWriteAttributeNullableInt8uValue_218(); - break; - case 219: - ChipLogProgress(chipTool, " ***** Test Step 219 : Read attribute NULLABLE_INT8U Value in range\n"); - err = TestReadAttributeNullableInt8uValueInRange_219(); - break; - case 220: - ChipLogProgress(chipTool, " ***** Test Step 220 : Read attribute NULLABLE_INT8U notValue OK\n"); - err = TestReadAttributeNullableInt8uNotValueOk_220(); - break; - case 221: - ChipLogProgress(chipTool, " ***** Test Step 221 : Write attribute NULLABLE_INT16U Min Value\n"); - err = TestWriteAttributeNullableInt16uMinValue_221(); - break; - case 222: - ChipLogProgress(chipTool, " ***** Test Step 222 : Read attribute NULLABLE_INT16U Min Value\n"); - err = TestReadAttributeNullableInt16uMinValue_222(); - break; - case 223: - ChipLogProgress(chipTool, " ***** Test Step 223 : Write attribute NULLABLE_INT16U Max Value\n"); - err = TestWriteAttributeNullableInt16uMaxValue_223(); - break; - case 224: - ChipLogProgress(chipTool, " ***** Test Step 224 : Read attribute NULLABLE_INT16U Max Value\n"); - err = TestReadAttributeNullableInt16uMaxValue_224(); - break; - case 225: - ChipLogProgress(chipTool, " ***** Test Step 225 : Write attribute NULLABLE_INT16U Invalid Value\n"); - err = TestWriteAttributeNullableInt16uInvalidValue_225(); - break; - case 226: - ChipLogProgress(chipTool, " ***** Test Step 226 : Read attribute NULLABLE_INT16U unchanged Value\n"); - err = TestReadAttributeNullableInt16uUnchangedValue_226(); - break; - case 227: - ChipLogProgress(chipTool, " ***** Test Step 227 : Write attribute NULLABLE_INT16U null Value\n"); - err = TestWriteAttributeNullableInt16uNullValue_227(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 16; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mTimeout; + + CHIP_ERROR Test0aWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test0bThSendsUpOrOpenCommandToPrepositionTheDut_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"0b: TH sends UpOrOpen command to preposition the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1aIfPaLfLfThSendsGoToLiftPercentageCommandWith90ToDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:90]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:9000U]; + [cluster goToLiftPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"1a: If (PA_LF & LF) TH sends GoToLiftPercentage command with 90%% to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1bThWaitsFor100ms1s_3() + { + WaitForMs(500); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1cThSendsStopMotionCommandToDut_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"1c: TH sends StopMotion command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test1dThWaitsFor100ms1s_5() + { + WaitForMs(500); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2aIfPaTlTlThSendsGoToTiltPercentageCommandWith90ToDut_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:90]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:9000U]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"2a: If (PA_TL & TL) TH sends GoToTiltPercentage command with 90%% to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2bThWaitsFor100ms1s_7() + { + WaitForMs(500); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2cThSendsStopMotionCommandToDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"2c: TH sends StopMotion command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test2dThWaitsFor100ms1s_9() + { + WaitForMs(500); + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; + + CHIP_ERROR Test3aThReadsCurrentPositionLiftPercent100thsFromDut_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", value, 0U)); + } + { + attrCurrentPositionLiftPercent100ths = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable attrCurrentPositionTiltPercent100ths; + + CHIP_ERROR Test3bThReadsCurrentPositionTiltPercent100thsFromDut_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", value, 0U)); + } + { + attrCurrentPositionTiltPercent100ths = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3cRebootRestartTheDut_12() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3dWaitForTheCommissionedDeviceToBeRetrieved_13() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3eThReadsCurrentPositionLiftPercent100thsFromDut_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3e: TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + if (attrCurrentPositionLiftPercent100ths == nil) { + VerifyOrReturn(CheckValueNull("CurrentPositionLiftPercent100ths", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("CurrentPositionLiftPercent100ths", actualValue)); + VerifyOrReturn( + CheckValue("CurrentPositionLiftPercent100ths", actualValue, attrCurrentPositionLiftPercent100ths)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR Test3fThReadsCurrentPositionTiltPercent100thsFromDut_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3f: TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + if (attrCurrentPositionTiltPercent100ths == nil) { + VerifyOrReturn(CheckValueNull("CurrentPositionTiltPercent100ths", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("CurrentPositionTiltPercent100ths", actualValue)); + VerifyOrReturn( + CheckValue("CurrentPositionTiltPercent100ths", actualValue, attrCurrentPositionTiltPercent100ths)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_TargetNavigatorCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_TargetNavigatorCluster() + : TestCommandBridge("TV_TargetNavigatorCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_TargetNavigatorCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_TargetNavigatorCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_TargetNavigatorCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 228: - ChipLogProgress(chipTool, " ***** Test Step 228 : Read attribute NULLABLE_INT16U null Value\n"); - err = TestReadAttributeNullableInt16uNullValue_228(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Target Navigator list\n"); + err = TestReadAttributeTargetNavigatorList_1(); break; - case 229: - ChipLogProgress(chipTool, " ***** Test Step 229 : Read attribute NULLABLE_INT16U null Value & range\n"); - err = TestReadAttributeNullableInt16uNullValueRange_229(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current navigator target\n"); + err = TestReadAttributeCurrentNavigatorTarget_2(); break; - case 230: - ChipLogProgress(chipTool, " ***** Test Step 230 : Read attribute NULLABLE_INT16U null Value & not\n"); - err = TestReadAttributeNullableInt16uNullValueNot_230(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Navigate Target Request Command\n"); + err = TestNavigateTargetRequestCommand_3(); break; - case 231: - ChipLogProgress(chipTool, " ***** Test Step 231 : Write attribute NULLABLE_INT16U Value\n"); - err = TestWriteAttributeNullableInt16uValue_231(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeTargetNavigatorList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Target Navigator list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TargetList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("identifier", ((CHIPTargetNavigatorClusterTargetInfo *) actualValue[0]).identifier, 1)); + VerifyOrReturn( + CheckValueAsString("name", ((CHIPTargetNavigatorClusterTargetInfo *) actualValue[0]).name, @"exampleName")); + VerifyOrReturn(CheckValue("identifier", ((CHIPTargetNavigatorClusterTargetInfo *) actualValue[1]).identifier, 2)); + VerifyOrReturn( + CheckValueAsString("name", ((CHIPTargetNavigatorClusterTargetInfo *) actualValue[1]).name, @"exampleName")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCurrentNavigatorTarget_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute current navigator target Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentTarget", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestNavigateTargetRequestCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPTargetNavigatorClusterNavigateTargetParams alloc] init]; + params.target = [NSNumber numberWithUnsignedChar:1]; + params.data = @"1"; + [cluster navigateTargetWithParams:params + completionHandler:^( + CHIPTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Navigate Target Request Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_AudioOutputCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_AudioOutputCluster() + : TestCommandBridge("TV_AudioOutputCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_AudioOutputCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_AudioOutputCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_AudioOutputCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 232: - ChipLogProgress(chipTool, " ***** Test Step 232 : Read attribute NULLABLE_INT16U Value in range\n"); - err = TestReadAttributeNullableInt16uValueInRange_232(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Audio Output list\n"); + err = TestReadAttributeAudioOutputList_1(); break; - case 233: - ChipLogProgress(chipTool, " ***** Test Step 233 : Read attribute NULLABLE_INT16U notValue OK\n"); - err = TestReadAttributeNullableInt16uNotValueOk_233(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current audio output\n"); + err = TestReadAttributeCurrentAudioOutput_2(); break; - case 234: - ChipLogProgress(chipTool, " ***** Test Step 234 : Write attribute NULLABLE_INT32U Min Value\n"); - err = TestWriteAttributeNullableInt32uMinValue_234(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Select Output Command\n"); + err = TestSelectOutputCommand_3(); break; - case 235: - ChipLogProgress(chipTool, " ***** Test Step 235 : Read attribute NULLABLE_INT32U Min Value\n"); - err = TestReadAttributeNullableInt32uMinValue_235(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Rename Output Command\n"); + err = TestRenameOutputCommand_4(); break; - case 236: - ChipLogProgress(chipTool, " ***** Test Step 236 : Write attribute NULLABLE_INT32U Max Value\n"); - err = TestWriteAttributeNullableInt32uMaxValue_236(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute Audio Output list\n"); + err = TestReadAttributeAudioOutputList_5(); break; - case 237: - ChipLogProgress(chipTool, " ***** Test Step 237 : Read attribute NULLABLE_INT32U Max Value\n"); - err = TestReadAttributeNullableInt32uMaxValue_237(); - break; - case 238: - ChipLogProgress(chipTool, " ***** Test Step 238 : Write attribute NULLABLE_INT32U Invalid Value\n"); - err = TestWriteAttributeNullableInt32uInvalidValue_238(); - break; - case 239: - ChipLogProgress(chipTool, " ***** Test Step 239 : Read attribute NULLABLE_INT32U unchanged Value\n"); - err = TestReadAttributeNullableInt32uUnchangedValue_239(); - break; - case 240: - ChipLogProgress(chipTool, " ***** Test Step 240 : Write attribute NULLABLE_INT32U null Value\n"); - err = TestWriteAttributeNullableInt32uNullValue_240(); - break; - case 241: - ChipLogProgress(chipTool, " ***** Test Step 241 : Read attribute NULLABLE_INT32U null Value\n"); - err = TestReadAttributeNullableInt32uNullValue_241(); - break; - case 242: - ChipLogProgress(chipTool, " ***** Test Step 242 : Read attribute NULLABLE_INT32U null Value & range\n"); - err = TestReadAttributeNullableInt32uNullValueRange_242(); - break; - case 243: - ChipLogProgress(chipTool, " ***** Test Step 243 : Read attribute NULLABLE_INT32U null Value & not\n"); - err = TestReadAttributeNullableInt32uNullValueNot_243(); - break; - case 244: - ChipLogProgress(chipTool, " ***** Test Step 244 : Write attribute NULLABLE_INT32U Value\n"); - err = TestWriteAttributeNullableInt32uValue_244(); - break; - case 245: - ChipLogProgress(chipTool, " ***** Test Step 245 : Read attribute NULLABLE_INT32U Value in range\n"); - err = TestReadAttributeNullableInt32uValueInRange_245(); - break; - case 246: - ChipLogProgress(chipTool, " ***** Test Step 246 : Read attribute NULLABLE_INT32U notValue OK\n"); - err = TestReadAttributeNullableInt32uNotValueOk_246(); - break; - case 247: - ChipLogProgress(chipTool, " ***** Test Step 247 : Write attribute NULLABLE_INT64U Min Value\n"); - err = TestWriteAttributeNullableInt64uMinValue_247(); - break; - case 248: - ChipLogProgress(chipTool, " ***** Test Step 248 : Read attribute NULLABLE_INT64U Min Value\n"); - err = TestReadAttributeNullableInt64uMinValue_248(); - break; - case 249: - ChipLogProgress(chipTool, " ***** Test Step 249 : Write attribute NULLABLE_INT64U Max Value\n"); - err = TestWriteAttributeNullableInt64uMaxValue_249(); - break; - case 250: - ChipLogProgress(chipTool, " ***** Test Step 250 : Read attribute NULLABLE_INT64U Max Value\n"); - err = TestReadAttributeNullableInt64uMaxValue_250(); - break; - case 251: - ChipLogProgress(chipTool, " ***** Test Step 251 : Write attribute NULLABLE_INT64U Invalid Value\n"); - err = TestWriteAttributeNullableInt64uInvalidValue_251(); - break; - case 252: - ChipLogProgress(chipTool, " ***** Test Step 252 : Read attribute NULLABLE_INT64U unchanged Value\n"); - err = TestReadAttributeNullableInt64uUnchangedValue_252(); - break; - case 253: - ChipLogProgress(chipTool, " ***** Test Step 253 : Write attribute NULLABLE_INT64U null Value\n"); - err = TestWriteAttributeNullableInt64uNullValue_253(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeAudioOutputList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Audio Output list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OutputList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).index, 1)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).name, @"HDMI")); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).index, 2)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).name, @"HDMI")); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).index, 3)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).name, @"HDMI")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCurrentAudioOutput_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentOutputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute current audio output Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentOutput", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSelectOutputCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAudioOutputClusterSelectOutputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1]; + [cluster selectOutputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Select Output Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRenameOutputCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAudioOutputClusterRenameOutputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1]; + params.name = @"HDMI Test"; + [cluster renameOutputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Rename Output Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeAudioOutputList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:2 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Audio Output list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OutputList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).index, 1)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).outputType, 0)); + VerifyOrReturn( + CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[0]).name, @"HDMI Test")); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).index, 2)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[1]).name, @"HDMI")); + VerifyOrReturn(CheckValue("index", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).index, 3)); + VerifyOrReturn(CheckValue("outputType", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).outputType, 0)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPAudioOutputClusterOutputInfo *) actualValue[2]).name, @"HDMI")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_ApplicationLauncherCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_ApplicationLauncherCluster() + : TestCommandBridge("TV_ApplicationLauncherCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_ApplicationLauncherCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_ApplicationLauncherCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_ApplicationLauncherCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 254: - ChipLogProgress(chipTool, " ***** Test Step 254 : Read attribute NULLABLE_INT64U null Value\n"); - err = TestReadAttributeNullableInt64uNullValue_254(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Application Launcher list\n"); + err = TestReadAttributeApplicationLauncherList_1(); break; - case 255: - ChipLogProgress(chipTool, " ***** Test Step 255 : Read attribute NULLABLE_INT64U null Value & range\n"); - err = TestReadAttributeNullableInt64uNullValueRange_255(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute application launcher app\n"); + err = TestReadAttributeApplicationLauncherApp_2(); break; - case 256: - ChipLogProgress(chipTool, " ***** Test Step 256 : Read attribute NULLABLE_INT64U null Value & not\n"); - err = TestReadAttributeNullableInt64uNullValueNot_256(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Launch App Command\n"); + err = TestLaunchAppCommand_3(); break; - case 257: - ChipLogProgress(chipTool, " ***** Test Step 257 : Write attribute NULLABLE_INT64U Value\n"); - err = TestWriteAttributeNullableInt64uValue_257(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Stop App Command\n"); + err = TestStopAppCommand_4(); break; - case 258: - ChipLogProgress(chipTool, " ***** Test Step 258 : Read attribute NULLABLE_INT64U Value in range\n"); - err = TestReadAttributeNullableInt64uValueInRange_258(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Hide App Command\n"); + err = TestHideAppCommand_5(); break; - case 259: - ChipLogProgress(chipTool, " ***** Test Step 259 : Read attribute NULLABLE_INT64U notValue OK\n"); - err = TestReadAttributeNullableInt64uNotValueOk_259(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationLauncherList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCatalogListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Application Launcher list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CatalogList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("", actualValue[0], 123U)); + VerifyOrReturn(CheckValue("", actualValue[1], 456U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationLauncherApp_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentAppWithCompletionHandler:^( + CHIPApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application launcher app Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("CurrentApp", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLaunchAppCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPApplicationLauncherClusterLaunchAppParams alloc] init]; + params.application = [[CHIPApplicationLauncherClusterApplication alloc] init]; + ((CHIPApplicationLauncherClusterApplication *) params.application).catalogVendorId = + [NSNumber numberWithUnsignedShort:123U]; + ((CHIPApplicationLauncherClusterApplication *) params.application).applicationId = @"applicationId"; + + params.data = [[NSData alloc] initWithBytes:"data" length:4]; + [cluster launchAppWithParams:params + completionHandler:^( + CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Launch App Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopAppCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPApplicationLauncherClusterStopAppParams alloc] init]; + params.application = [[CHIPApplicationLauncherClusterApplication alloc] init]; + ((CHIPApplicationLauncherClusterApplication *) params.application).catalogVendorId = + [NSNumber numberWithUnsignedShort:123U]; + ((CHIPApplicationLauncherClusterApplication *) params.application).applicationId = @"applicationId"; + + [cluster + stopAppWithParams:params + completionHandler:^(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Stop App Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestHideAppCommand_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPApplicationLauncherClusterHideAppParams alloc] init]; + params.application = [[CHIPApplicationLauncherClusterApplication alloc] init]; + ((CHIPApplicationLauncherClusterApplication *) params.application).catalogVendorId = + [NSNumber numberWithUnsignedShort:123U]; + ((CHIPApplicationLauncherClusterApplication *) params.application).applicationId = @"applicationId"; + + [cluster + hideAppWithParams:params + completionHandler:^(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Hide App Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, [[NSData alloc] initWithBytes:"data" length:4])); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_KeypadInputCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_KeypadInputCluster() + : TestCommandBridge("TV_KeypadInputCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_KeypadInputCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_KeypadInputCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_KeypadInputCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 260: - ChipLogProgress(chipTool, " ***** Test Step 260 : Write attribute NULLABLE_INT8S Min Value\n"); - err = TestWriteAttributeNullableInt8sMinValue_260(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Key Command\n"); + err = TestSendKeyCommand_1(); break; - case 261: - ChipLogProgress(chipTool, " ***** Test Step 261 : Read attribute NULLABLE_INT8S Min Value\n"); - err = TestReadAttributeNullableInt8sMinValue_261(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendKeyCommand_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:3]; + [cluster sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Key Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_AccountLoginCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_AccountLoginCluster() + : TestCommandBridge("TV_AccountLoginCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_AccountLoginCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_AccountLoginCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_AccountLoginCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 262: - ChipLogProgress(chipTool, " ***** Test Step 262 : Write attribute NULLABLE_INT8S Invalid Value\n"); - err = TestWriteAttributeNullableInt8sInvalidValue_262(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Get Setup PIN Command\n"); + err = TestGetSetupPinCommand_1(); break; - case 263: - ChipLogProgress(chipTool, " ***** Test Step 263 : Read attribute NULLABLE_INT8S unchanged Value\n"); - err = TestReadAttributeNullableInt8sUnchangedValue_263(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Login Command\n"); + err = TestLoginCommand_2(); break; - case 264: - ChipLogProgress(chipTool, " ***** Test Step 264 : Write attribute NULLABLE_INT8S null Value\n"); - err = TestWriteAttributeNullableInt8sNullValue_264(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Logout Command\n"); + err = TestLogoutCommand_3(); break; - case 265: - ChipLogProgress(chipTool, " ***** Test Step 265 : Read attribute NULLABLE_INT8S null Value\n"); - err = TestReadAttributeNullableInt8sNullValue_265(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetSetupPinCommand_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAccountLoginClusterGetSetupPINParams alloc] init]; + params.tempAccountIdentifier = @"asdf"; + [cluster + getSetupPINWithParams:params + completionHandler:^(CHIPAccountLoginClusterGetSetupPINResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Setup PIN Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.setupPIN; + VerifyOrReturn(CheckValueAsString("setupPIN", actualValue, @"tempPin123")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLoginCommand_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAccountLoginClusterLoginParams alloc] init]; + params.tempAccountIdentifier = @"asdf"; + params.setupPIN = @"tempPin123"; + [cluster loginWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Login Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLogoutCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster logoutWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Logout Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_WakeOnLanCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_WakeOnLanCluster() + : TestCommandBridge("TV_WakeOnLanCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_WakeOnLanCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_WakeOnLanCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_WakeOnLanCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 266: - ChipLogProgress(chipTool, " ***** Test Step 266 : Read attribute NULLABLE_INT8S null Value & range\n"); - err = TestReadAttributeNullableInt8sNullValueRange_266(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read mac address\n"); + err = TestReadMacAddress_1(); break; - case 267: - ChipLogProgress(chipTool, " ***** Test Step 267 : Read attribute NULLABLE_INT8S null Value & not\n"); - err = TestReadAttributeNullableInt8sNullValueNot_267(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadMacAddress_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMACAddressWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read mac address Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("MACAddress", actualValue, @"00:00:00:00:00")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_ApplicationBasicCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_ApplicationBasicCluster() + : TestCommandBridge("TV_ApplicationBasicCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_ApplicationBasicCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_ApplicationBasicCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_ApplicationBasicCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 268: - ChipLogProgress(chipTool, " ***** Test Step 268 : Write attribute NULLABLE_INT8S Value\n"); - err = TestWriteAttributeNullableInt8sValue_268(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute vendor name\n"); + err = TestReadAttributeVendorName_1(); break; - case 269: - ChipLogProgress(chipTool, " ***** Test Step 269 : Read attribute NULLABLE_INT8S Value in range\n"); - err = TestReadAttributeNullableInt8sValueInRange_269(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute vendor id\n"); + err = TestReadAttributeVendorId_2(); break; - case 270: - ChipLogProgress(chipTool, " ***** Test Step 270 : Read attribute NULLABLE_INT8S notValue OK\n"); - err = TestReadAttributeNullableInt8sNotValueOk_270(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute application name\n"); + err = TestReadAttributeApplicationName_3(); break; - case 271: - ChipLogProgress(chipTool, " ***** Test Step 271 : Write attribute NULLABLE_INT16S Min Value\n"); - err = TestWriteAttributeNullableInt16sMinValue_271(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute product id\n"); + err = TestReadAttributeProductId_4(); break; - case 272: - ChipLogProgress(chipTool, " ***** Test Step 272 : Read attribute NULLABLE_INT16S Min Value\n"); - err = TestReadAttributeNullableInt16sMinValue_272(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute application status\n"); + err = TestReadAttributeApplicationStatus_5(); break; - case 273: - ChipLogProgress(chipTool, " ***** Test Step 273 : Write attribute NULLABLE_INT16S Invalid Value\n"); - err = TestWriteAttributeNullableInt16sInvalidValue_273(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute application status\n"); + err = TestReadAttributeApplicationStatus_6(); break; - case 274: - ChipLogProgress(chipTool, " ***** Test Step 274 : Read attribute NULLABLE_INT16S unchanged Value\n"); - err = TestReadAttributeNullableInt16sUnchangedValue_274(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute application version\n"); + err = TestReadAttributeApplicationVersion_7(); break; - case 275: - ChipLogProgress(chipTool, " ***** Test Step 275 : Write attribute NULLABLE_INT16S null Value\n"); - err = TestWriteAttributeNullableInt16sNullValue_275(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute application allowed vendor list\n"); + err = TestReadAttributeApplicationAllowedVendorList_8(); break; - case 276: - ChipLogProgress(chipTool, " ***** Test Step 276 : Read attribute NULLABLE_INT16S null Value\n"); - err = TestReadAttributeNullableInt16sNullValue_276(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeVendorName_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor name Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("VendorName", actualValue, @"exampleVendorName1")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeVendorId_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor id Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("VendorID", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationName_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeApplicationNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application name Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("ApplicationName", actualValue, @"exampleName1")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeProductId_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute product id Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ProductID", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationStatus_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application status Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Status", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationStatus_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeApplicationWithCompletionHandler:^( + CHIPApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application status Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("catalogVendorId", + ((CHIPApplicationBasicClusterApplicationBasicApplication *) actualValue).catalogVendorId, 123U)); + VerifyOrReturn(CheckValueAsString("applicationId", + ((CHIPApplicationBasicClusterApplicationBasicApplication *) actualValue).applicationId, @"applicationId")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationVersion_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeApplicationVersionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application version Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("ApplicationVersion", actualValue, @"exampleVersion")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeApplicationAllowedVendorList_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAllowedVendorListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute application allowed vendor list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AllowedVendorList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("", actualValue[0], 1U)); + VerifyOrReturn(CheckValue("", actualValue[1], 456U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_MediaPlaybackCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_MediaPlaybackCluster() + : TestCommandBridge("TV_MediaPlaybackCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_MediaPlaybackCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_MediaPlaybackCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_MediaPlaybackCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 277: - ChipLogProgress(chipTool, " ***** Test Step 277 : Read attribute NULLABLE_INT16S null Value & range\n"); - err = TestReadAttributeNullableInt16sNullValueRange_277(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute playback state\n"); + err = TestReadAttributePlaybackState_1(); break; - case 278: - ChipLogProgress(chipTool, " ***** Test Step 278 : Read attribute NULLABLE_INT16S null Value & not\n"); - err = TestReadAttributeNullableInt16sNullValueNot_278(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute start time\n"); + err = TestReadAttributeStartTime_2(); break; - case 279: - ChipLogProgress(chipTool, " ***** Test Step 279 : Write attribute NULLABLE_INT16S Value\n"); - err = TestWriteAttributeNullableInt16sValue_279(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute duration\n"); + err = TestReadAttributeDuration_3(); break; - case 280: - ChipLogProgress(chipTool, " ***** Test Step 280 : Read attribute NULLABLE_INT16S Value in range\n"); - err = TestReadAttributeNullableInt16sValueInRange_280(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute position\n"); + err = TestReadAttributePosition_4(); break; - case 281: - ChipLogProgress(chipTool, " ***** Test Step 281 : Read attribute NULLABLE_INT16S notValue OK\n"); - err = TestReadAttributeNullableInt16sNotValueOk_281(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute playback speed\n"); + err = TestReadAttributePlaybackSpeed_5(); break; - case 282: - ChipLogProgress(chipTool, " ***** Test Step 282 : Write attribute NULLABLE_INT32S Min Value\n"); - err = TestWriteAttributeNullableInt32sMinValue_282(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute seek range end\n"); + err = TestReadAttributeSeekRangeEnd_6(); break; - case 283: - ChipLogProgress(chipTool, " ***** Test Step 283 : Read attribute NULLABLE_INT32S Min Value\n"); - err = TestReadAttributeNullableInt32sMinValue_283(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute seek range start\n"); + err = TestReadAttributeSeekRangeStart_7(); break; - case 284: - ChipLogProgress(chipTool, " ***** Test Step 284 : Write attribute NULLABLE_INT32S Invalid Value\n"); - err = TestWriteAttributeNullableInt32sInvalidValue_284(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Media Playback Play Command\n"); + err = TestMediaPlaybackPlayCommand_8(); break; - case 285: - ChipLogProgress(chipTool, " ***** Test Step 285 : Read attribute NULLABLE_INT32S unchanged Value\n"); - err = TestReadAttributeNullableInt32sUnchangedValue_285(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Media Playback Pause Command\n"); + err = TestMediaPlaybackPauseCommand_9(); break; - case 286: - ChipLogProgress(chipTool, " ***** Test Step 286 : Write attribute NULLABLE_INT32S null Value\n"); - err = TestWriteAttributeNullableInt32sNullValue_286(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Media Playback Stop Command\n"); + err = TestMediaPlaybackStopCommand_10(); break; - case 287: - ChipLogProgress(chipTool, " ***** Test Step 287 : Read attribute NULLABLE_INT32S null Value\n"); - err = TestReadAttributeNullableInt32sNullValue_287(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Media Playback Start Over Command\n"); + err = TestMediaPlaybackStartOverCommand_11(); break; - case 288: - ChipLogProgress(chipTool, " ***** Test Step 288 : Read attribute NULLABLE_INT32S null Value & range\n"); - err = TestReadAttributeNullableInt32sNullValueRange_288(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Media Playback Previous Command\n"); + err = TestMediaPlaybackPreviousCommand_12(); break; - case 289: - ChipLogProgress(chipTool, " ***** Test Step 289 : Read attribute NULLABLE_INT32S null Value & not\n"); - err = TestReadAttributeNullableInt32sNullValueNot_289(); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Media Playback Next Command\n"); + err = TestMediaPlaybackNextCommand_13(); break; - case 290: - ChipLogProgress(chipTool, " ***** Test Step 290 : Write attribute NULLABLE_INT32S Value\n"); - err = TestWriteAttributeNullableInt32sValue_290(); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Media Playback Rewind Command\n"); + err = TestMediaPlaybackRewindCommand_14(); break; - case 291: - ChipLogProgress(chipTool, " ***** Test Step 291 : Read attribute NULLABLE_INT32S Value in range\n"); - err = TestReadAttributeNullableInt32sValueInRange_291(); - break; - case 292: - ChipLogProgress(chipTool, " ***** Test Step 292 : Read attribute NULLABLE_INT32S notValue OK\n"); - err = TestReadAttributeNullableInt32sNotValueOk_292(); - break; - case 293: - ChipLogProgress(chipTool, " ***** Test Step 293 : Write attribute NULLABLE_INT64S Min Value\n"); - err = TestWriteAttributeNullableInt64sMinValue_293(); - break; - case 294: - ChipLogProgress(chipTool, " ***** Test Step 294 : Read attribute NULLABLE_INT64S Min Value\n"); - err = TestReadAttributeNullableInt64sMinValue_294(); - break; - case 295: - ChipLogProgress(chipTool, " ***** Test Step 295 : Write attribute NULLABLE_INT64S Invalid Value\n"); - err = TestWriteAttributeNullableInt64sInvalidValue_295(); - break; - case 296: - ChipLogProgress(chipTool, " ***** Test Step 296 : Read attribute NULLABLE_INT64S unchanged Value\n"); - err = TestReadAttributeNullableInt64sUnchangedValue_296(); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Media Playback Fast Forward Command\n"); + err = TestMediaPlaybackFastForwardCommand_15(); break; - case 297: - ChipLogProgress(chipTool, " ***** Test Step 297 : Write attribute NULLABLE_INT64S null Value\n"); - err = TestWriteAttributeNullableInt64sNullValue_297(); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Media Playback Skip Forward Command\n"); + err = TestMediaPlaybackSkipForwardCommand_16(); break; - case 298: - ChipLogProgress(chipTool, " ***** Test Step 298 : Read attribute NULLABLE_INT64S null Value\n"); - err = TestReadAttributeNullableInt64sNullValue_298(); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read attribute position after skip forward\n"); + err = TestReadAttributePositionAfterSkipForward_17(); break; - case 299: - ChipLogProgress(chipTool, " ***** Test Step 299 : Read attribute NULLABLE_INT64S null Value & range\n"); - err = TestReadAttributeNullableInt64sNullValueRange_299(); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Media Playback Skip Backward Command\n"); + err = TestMediaPlaybackSkipBackwardCommand_18(); break; - case 300: - ChipLogProgress(chipTool, " ***** Test Step 300 : Read attribute NULLABLE_INT64S null Value & not\n"); - err = TestReadAttributeNullableInt64sNullValueNot_300(); + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute position after skip backward\n"); + err = TestReadAttributePositionAfterSkipBackward_19(); break; - case 301: - ChipLogProgress(chipTool, " ***** Test Step 301 : Write attribute NULLABLE_INT64S Value\n"); - err = TestWriteAttributeNullableInt64sValue_301(); + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Media Playback Seek Command\n"); + err = TestMediaPlaybackSeekCommand_20(); break; - case 302: - ChipLogProgress(chipTool, " ***** Test Step 302 : Read attribute NULLABLE_INT64S Value in range\n"); - err = TestReadAttributeNullableInt64sValueInRange_302(); + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute position after seek\n"); + err = TestReadAttributePositionAfterSeek_21(); break; - case 303: - ChipLogProgress(chipTool, " ***** Test Step 303 : Read attribute NULLABLE_INT64S notValue OK\n"); - err = TestReadAttributeNullableInt64sNotValueOk_303(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 22; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePlaybackState_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute playback state Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentState", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeStartTime_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute start time Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StartTime", actualValue)); + VerifyOrReturn(CheckValue("StartTime", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeDuration_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDurationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute duration Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("Duration", actualValue)); + VerifyOrReturn(CheckValue("Duration", actualValue, 80000ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePosition_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute position Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("updatedAt", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position)); + VerifyOrReturn(CheckValue("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePlaybackSpeed_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute playback speed Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 0.0f)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeSeekRangeEnd_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSeekRangeEndWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute seek range end Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SeekRangeEnd", actualValue)); + VerifyOrReturn(CheckValue("SeekRangeEnd", actualValue, 80000ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeSeekRangeStart_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSeekRangeStartWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute seek range start Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SeekRangeStart", actualValue)); + VerifyOrReturn(CheckValue("SeekRangeStart", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackPlayCommand_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster playWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Play Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackPauseCommand_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster pauseWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Pause Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackStopCommand_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster stopPlaybackWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Stop Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackStartOverCommand_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster startOverWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Start Over Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackPreviousCommand_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster previousWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Previous Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackNextCommand_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster nextWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Next Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackRewindCommand_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster rewindWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Rewind Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackFastForwardCommand_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster fastForwardWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Fast Forward Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackSkipForwardCommand_16() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaPlaybackClusterSkipForwardParams alloc] init]; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:500ULL]; + [cluster + skipForwardWithParams:params + completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Skip Forward Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePositionAfterSkipForward_17() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute position after skip forward Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("updatedAt", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position)); + VerifyOrReturn(CheckValue("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position, 500ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackSkipBackwardCommand_18() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaPlaybackClusterSkipBackwardParams alloc] init]; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:100ULL]; + [cluster + skipBackwardWithParams:params + completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Skip Backward Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePositionAfterSkipBackward_19() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute position after skip backward Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("updatedAt", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position)); + VerifyOrReturn(CheckValue("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position, 400ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMediaPlaybackSeekCommand_20() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaPlaybackClusterSeekParams alloc] init]; + params.position = [NSNumber numberWithUnsignedLongLong:1000ULL]; + [cluster seekWithParams:params + completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Media Playback Seek Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributePositionAfterSeek_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:3 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute position after seek Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("updatedAt", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).updatedAt, 0ULL)); + VerifyOrReturn(CheckValueNonNull("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position)); + VerifyOrReturn( + CheckValue("position", ((CHIPMediaPlaybackClusterPlaybackPosition *) actualValue).position, 1000ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_ChannelCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_ChannelCluster() + : TestCommandBridge("TV_ChannelCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_ChannelCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_ChannelCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_ChannelCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 304: - ChipLogProgress(chipTool, " ***** Test Step 304 : Write attribute NULLABLE_SINGLE medium Value\n"); - err = TestWriteAttributeNullableSingleMediumValue_304(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Channel list\n"); + err = TestReadAttributeChannelList_1(); break; - case 305: - ChipLogProgress(chipTool, " ***** Test Step 305 : Read attribute NULLABLE_SINGLE medium Value\n"); - err = TestReadAttributeNullableSingleMediumValue_305(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute channel lineup\n"); + err = TestReadAttributeChannelLineup_2(); break; - case 306: - ChipLogProgress(chipTool, " ***** Test Step 306 : Write attribute NULLABLE_SINGLE largest Value\n"); - err = TestWriteAttributeNullableSingleLargestValue_306(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute current channel\n"); + err = TestReadAttributeCurrentChannel_3(); break; - case 307: - ChipLogProgress(chipTool, " ***** Test Step 307 : Read attribute NULLABLE_SINGLE largest Value\n"); - err = TestReadAttributeNullableSingleLargestValue_307(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Change Channel Command\n"); + err = TestChangeChannelCommand_4(); break; - case 308: - ChipLogProgress(chipTool, " ***** Test Step 308 : Write attribute NULLABLE_SINGLE smallest Value\n"); - err = TestWriteAttributeNullableSingleSmallestValue_308(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Change Channel By Number Command\n"); + err = TestChangeChannelByNumberCommand_5(); break; - case 309: - ChipLogProgress(chipTool, " ***** Test Step 309 : Read attribute NULLABLE_SINGLE smallest Value\n"); - err = TestReadAttributeNullableSingleSmallestValue_309(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Skip Channel Command\n"); + err = TestSkipChannelCommand_6(); break; - case 310: - ChipLogProgress(chipTool, " ***** Test Step 310 : Write attribute NULLABLE_SINGLE null Value\n"); - err = TestWriteAttributeNullableSingleNullValue_310(); - break; - case 311: - ChipLogProgress(chipTool, " ***** Test Step 311 : Read attribute NULLABLE_SINGLE null Value\n"); - err = TestReadAttributeNullableSingleNullValue_311(); - break; - case 312: - ChipLogProgress(chipTool, " ***** Test Step 312 : Write attribute NULLABLE_SINGLE 0 Value\n"); - err = TestWriteAttributeNullableSingle0Value_312(); - break; - case 313: - ChipLogProgress(chipTool, " ***** Test Step 313 : Read attribute NULLABLE_SINGLE 0 Value\n"); - err = TestReadAttributeNullableSingle0Value_313(); - break; - case 314: - ChipLogProgress(chipTool, " ***** Test Step 314 : Write attribute NULLABLE_DOUBLE medium Value\n"); - err = TestWriteAttributeNullableDoubleMediumValue_314(); - break; - case 315: - ChipLogProgress(chipTool, " ***** Test Step 315 : Read attribute NULLABLE_DOUBLE medium Value\n"); - err = TestReadAttributeNullableDoubleMediumValue_315(); - break; - case 316: - ChipLogProgress(chipTool, " ***** Test Step 316 : Write attribute NULLABLE_DOUBLE largest Value\n"); - err = TestWriteAttributeNullableDoubleLargestValue_316(); - break; - case 317: - ChipLogProgress(chipTool, " ***** Test Step 317 : Read attribute NULLABLE_DOUBLE largest Value\n"); - err = TestReadAttributeNullableDoubleLargestValue_317(); - break; - case 318: - ChipLogProgress(chipTool, " ***** Test Step 318 : Write attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestWriteAttributeNullableDoubleSmallestValue_318(); - break; - case 319: - ChipLogProgress(chipTool, " ***** Test Step 319 : Read attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestReadAttributeNullableDoubleSmallestValue_319(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeChannelList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Channel list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ChannelList", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[0]).majorNumber, 6U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[0]).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue[0]).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue[0]).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue[0]).affiliateCallSign, @"KAAL")); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[1]).majorNumber, 9U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[1]).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue[1]).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue[1]).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue[1]).affiliateCallSign, @"KCTS")); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[2]).majorNumber, 9U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[2]).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue[2]).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue[2]).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue[2]).affiliateCallSign, @"KCTS")); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[3]).majorNumber, 9U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue[3]).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue[3]).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue[3]).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue[3]).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeChannelLineup_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeLineupWithCompletionHandler:^(CHIPChannelClusterLineupInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute channel lineup Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("Lineup", actualValue)); + VerifyOrReturn(CheckValueAsString( + "operatorName", ((CHIPChannelClusterLineupInfo *) actualValue).operatorName, @"Comcast")); + VerifyOrReturn(CheckValueAsString( + "lineupName", ((CHIPChannelClusterLineupInfo *) actualValue).lineupName, @"Comcast King County")); + VerifyOrReturn( + CheckValueAsString("postalCode", ((CHIPChannelClusterLineupInfo *) actualValue).postalCode, @"98052")); + VerifyOrReturn(CheckValue("lineupInfoType", ((CHIPChannelClusterLineupInfo *) actualValue).lineupInfoType, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCurrentChannel_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletionHandler:^( + CHIPChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("majorNumber", ((CHIPChannelClusterChannelInfo *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("minorNumber", ((CHIPChannelClusterChannelInfo *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPChannelClusterChannelInfo *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("callSign", ((CHIPChannelClusterChannelInfo *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "affiliateCallSign", ((CHIPChannelClusterChannelInfo *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestChangeChannelCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPChannelClusterChangeChannelParams alloc] init]; + params.match = @"PBS"; + [cluster + changeChannelWithParams:params + completionHandler:^(CHIPChannelClusterChangeChannelResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Change Channel Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"data response")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestChangeChannelByNumberCommand_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:6U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:0U]; + [cluster changeChannelByNumberWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change Channel By Number Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSkipChannelCommand_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithUnsignedShort:1U]; + [cluster skipChannelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Skip Channel Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_LowPowerCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_LowPowerCluster() + : TestCommandBridge("TV_LowPowerCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_LowPowerCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_LowPowerCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_LowPowerCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 320: - ChipLogProgress(chipTool, " ***** Test Step 320 : Write attribute NULLABLE_DOUBLE null Value\n"); - err = TestWriteAttributeNullableDoubleNullValue_320(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Sleep Input Status Command\n"); + err = TestSleepInputStatusCommand_1(); break; - case 321: - ChipLogProgress(chipTool, " ***** Test Step 321 : Read attribute NULLABLE_DOUBLE null Value\n"); - err = TestReadAttributeNullableDoubleNullValue_321(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSleepInputStatusCommand_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster sleepWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Sleep Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_ContentLauncherCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_ContentLauncherCluster() + : TestCommandBridge("TV_ContentLauncherCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_ContentLauncherCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_ContentLauncherCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_ContentLauncherCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 322: - ChipLogProgress(chipTool, " ***** Test Step 322 : Write attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestWriteAttributeNullableDouble0Value_322(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute accept header list\n"); + err = TestReadAttributeAcceptHeaderList_1(); break; - case 323: - ChipLogProgress(chipTool, " ***** Test Step 323 : Read attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestReadAttributeNullableDouble0Value_323(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute supported streaming protocols\n"); + err = TestReadAttributeSupportedStreamingProtocols_2(); break; - case 324: - ChipLogProgress(chipTool, " ***** Test Step 324 : Write attribute NULLABLE_ENUM8 Min Value\n"); - err = TestWriteAttributeNullableEnum8MinValue_324(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Launch Content Command\n"); + err = TestLaunchContentCommand_3(); break; - case 325: - ChipLogProgress(chipTool, " ***** Test Step 325 : Read attribute NULLABLE_ENUM8 Min Value\n"); - err = TestReadAttributeNullableEnum8MinValue_325(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Launch URL Command\n"); + err = TestLaunchUrlCommand_4(); break; - case 326: - ChipLogProgress(chipTool, " ***** Test Step 326 : Write attribute NULLABLE_ENUM8 Max Value\n"); - err = TestWriteAttributeNullableEnum8MaxValue_326(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeAcceptHeaderList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptHeaderWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute accept header list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptHeader", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValueAsString("", actualValue[0], @"example")); + VerifyOrReturn(CheckValueAsString("", actualValue[1], @"example")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeSupportedStreamingProtocols_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeSupportedStreamingProtocolsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute supported streaming protocols Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("SupportedStreamingProtocols", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLaunchContentCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[CHIPContentLauncherClusterContentSearch alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[CHIPContentLauncherClusterParameter alloc] init]; + ((CHIPContentLauncherClusterParameter *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:1]; + ((CHIPContentLauncherClusterParameter *) temp_1[0]).value = @"exampleValue"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = [[CHIPContentLauncherClusterAdditionalInfo alloc] init]; + ((CHIPContentLauncherClusterAdditionalInfo *) temp_4[0]).name = @"name"; + ((CHIPContentLauncherClusterAdditionalInfo *) temp_4[0]).value = @"value"; + + ((CHIPContentLauncherClusterParameter *) temp_1[0]).externalIDList = temp_4; + } + + ((CHIPContentLauncherClusterContentSearch *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + params.data = @"exampleData"; + [cluster + launchContentWithParams:params + completionHandler:^(CHIPContentLauncherClusterLaunchResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Launch Content Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"exampleData")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLaunchUrlCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPContentLauncherClusterLaunchURLParams alloc] init]; + params.contentURL = @"exampleUrl"; + params.displayString = @"exampleDisplayString"; + params.brandingInformation = [[CHIPContentLauncherClusterBrandingInformation alloc] init]; + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).providerName = @"exampleName"; + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).background = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .background) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).logo = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .logo) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).progressBar = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .progressBar) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).splash = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .splash) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + ((CHIPContentLauncherClusterBrandingInformation *) params.brandingInformation).waterMark = + [[CHIPContentLauncherClusterStyleInformation alloc] init]; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .imageUrl + = @"exampleUrl"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .color + = @"exampleColor"; + ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .size + = [[CHIPContentLauncherClusterDimension alloc] init]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .size) + .width + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .size) + .height + = [NSNumber numberWithDouble:0]; + ((CHIPContentLauncherClusterDimension *) ((CHIPContentLauncherClusterStyleInformation *) ((CHIPContentLauncherClusterBrandingInformation *) + params.brandingInformation) + .waterMark) + .size) + .metric + = [NSNumber numberWithUnsignedChar:0]; + + [cluster launchURLWithParams:params + completionHandler:^(CHIPContentLauncherClusterLaunchResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Launch URL Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("data", actualValue, @"exampleData")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TV_MediaInputCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TV_MediaInputCluster() + : TestCommandBridge("TV_MediaInputCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TV_MediaInputCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TV_MediaInputCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TV_MediaInputCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 327: - ChipLogProgress(chipTool, " ***** Test Step 327 : Read attribute NULLABLE_ENUM8 Max Value\n"); - err = TestReadAttributeNullableEnum8MaxValue_327(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute media input list\n"); + err = TestReadAttributeMediaInputList_1(); break; - case 328: - ChipLogProgress(chipTool, " ***** Test Step 328 : Write attribute NULLABLE_ENUM8 Invalid Value\n"); - err = TestWriteAttributeNullableEnum8InvalidValue_328(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read current media input\n"); + err = TestReadCurrentMediaInput_2(); break; - case 329: - ChipLogProgress(chipTool, " ***** Test Step 329 : Read attribute NULLABLE_ENUM8 unchanged Value\n"); - err = TestReadAttributeNullableEnum8UnchangedValue_329(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Select Input Command\n"); + err = TestSelectInputCommand_3(); break; - case 330: - ChipLogProgress(chipTool, " ***** Test Step 330 : Write attribute NULLABLE_ENUM8 null Value\n"); - err = TestWriteAttributeNullableEnum8NullValue_330(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Hide Input Status Command\n"); + err = TestHideInputStatusCommand_4(); break; - case 331: - ChipLogProgress(chipTool, " ***** Test Step 331 : Read attribute NULLABLE_ENUM8 null Value\n"); - err = TestReadAttributeNullableEnum8NullValue_331(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Show Input Status Command\n"); + err = TestShowInputStatusCommand_5(); break; - case 332: - ChipLogProgress(chipTool, " ***** Test Step 332 : Write attribute NULLABLE_ENUM16 Min Value\n"); - err = TestWriteAttributeNullableEnum16MinValue_332(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Rename Input Command\n"); + err = TestRenameInputCommand_6(); break; - case 333: - ChipLogProgress(chipTool, " ***** Test Step 333 : Read attribute NULLABLE_ENUM16 Min Value\n"); - err = TestReadAttributeNullableEnum16MinValue_333(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute media input list\n"); + err = TestReadAttributeMediaInputList_7(); break; - case 334: - ChipLogProgress(chipTool, " ***** Test Step 334 : Write attribute NULLABLE_ENUM16 Max Value\n"); - err = TestWriteAttributeNullableEnum16MaxValue_334(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeMediaInputList_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute media input list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("InputList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("index", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).index, 1)); + VerifyOrReturn(CheckValue("inputType", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).inputType, 4)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).name, @"HDMI")); + VerifyOrReturn( + CheckValueAsString("description", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).descriptionString, + @"High-Definition Multimedia Interface")); + VerifyOrReturn(CheckValue("index", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).index, 2)); + VerifyOrReturn(CheckValue("inputType", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).inputType, 4)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).name, @"HDMI")); + VerifyOrReturn( + CheckValueAsString("description", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).descriptionString, + @"High-Definition Multimedia Interface")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentMediaInput_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentInputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current media input Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentInput", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSelectInputCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaInputClusterSelectInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1]; + [cluster selectInputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Select Input Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestHideInputStatusCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster hideInputStatusWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Hide Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestShowInputStatusCommand_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster showInputStatusWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Show Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRenameInputCommand_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPMediaInputClusterRenameInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1]; + params.name = @"HDMI Test"; + [cluster renameInputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Rename Input Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeMediaInputList_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute media input list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("InputList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("index", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).index, 1)); + VerifyOrReturn(CheckValue("inputType", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).inputType, 4)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).name, @"HDMI Test")); + VerifyOrReturn( + CheckValueAsString("description", ((CHIPMediaInputClusterInputInfo *) actualValue[0]).descriptionString, + @"High-Definition Multimedia Interface")); + VerifyOrReturn(CheckValue("index", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).index, 2)); + VerifyOrReturn(CheckValue("inputType", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).inputType, 4)); + VerifyOrReturn(CheckValueAsString("name", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).name, @"HDMI")); + VerifyOrReturn( + CheckValueAsString("description", ((CHIPMediaInputClusterInputInfo *) actualValue[1]).descriptionString, + @"High-Definition Multimedia Interface")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class TestCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestCluster() + : TestCommandBridge("TestCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TestCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 335: - ChipLogProgress(chipTool, " ***** Test Step 335 : Read attribute NULLABLE_ENUM16 Max Value\n"); - err = TestReadAttributeNullableEnum16MaxValue_335(); + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Command\n"); + err = TestSendTestCommand_1(); break; - case 336: - ChipLogProgress(chipTool, " ***** Test Step 336 : Write attribute NULLABLE_ENUM16 Invalid Value\n"); - err = TestWriteAttributeNullableEnum16InvalidValue_336(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Not Handled Command\n"); + err = TestSendTestNotHandledCommand_2(); break; - case 337: - ChipLogProgress(chipTool, " ***** Test Step 337 : Read attribute NULLABLE_ENUM16 unchanged Value\n"); - err = TestReadAttributeNullableEnum16UnchangedValue_337(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Specific Command\n"); + err = TestSendTestSpecificCommand_3(); break; - case 338: - ChipLogProgress(chipTool, " ***** Test Step 338 : Write attribute NULLABLE_ENUM16 null Value\n"); - err = TestWriteAttributeNullableEnum16NullValue_338(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_4(); break; - case 339: - ChipLogProgress(chipTool, " ***** Test Step 339 : Read attribute NULLABLE_ENUM16 null Value\n"); - err = TestReadAttributeNullableEnum16NullValue_339(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Send failing Test Add Arguments Command\n"); + err = TestSendFailingTestAddArgumentsCommand_5(); break; - case 340: - ChipLogProgress(chipTool, " ***** Test Step 340 : Write attribute NULLABLE_SIMPLE_ENUM Min Value\n"); - err = TestWriteAttributeNullableSimpleEnumMinValue_340(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Default Value\n"); + err = TestReadAttributeBooleanDefaultValue_6(); break; - case 341: - ChipLogProgress(chipTool, " ***** Test Step 341 : Read attribute NULLABLE_SIMPLE_ENUM Min Value\n"); - err = TestReadAttributeNullableSimpleEnumMinValue_341(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN True\n"); + err = TestWriteAttributeBooleanTrue_7(); break; - case 342: - ChipLogProgress(chipTool, " ***** Test Step 342 : Write attribute NULLABLE_SIMPLE_ENUM Max Value\n"); - err = TestWriteAttributeNullableSimpleEnumMaxValue_342(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN True\n"); + err = TestReadAttributeBooleanTrue_8(); break; - case 343: - ChipLogProgress(chipTool, " ***** Test Step 343 : Read attribute NULLABLE_SIMPLE_ENUM Max Value\n"); - err = TestReadAttributeNullableSimpleEnumMaxValue_343(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Write attribute BOOLEAN False\n"); + err = TestWriteAttributeBooleanFalse_9(); break; - case 344: - ChipLogProgress(chipTool, " ***** Test Step 344 : Write attribute NULLABLE_SIMPLE_ENUM Invalid Value\n"); - err = TestWriteAttributeNullableSimpleEnumInvalidValue_344(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute BOOLEAN False\n"); + err = TestReadAttributeBooleanFalse_10(); break; - case 345: - ChipLogProgress(chipTool, " ***** Test Step 345 : Read attribute NULLABLE_SIMPLE_ENUM unchanged Value\n"); - err = TestReadAttributeNullableSimpleEnumUnchangedValue_345(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Default Value\n"); + err = TestReadAttributeBitmap8DefaultValue_11(); break; - case 346: - ChipLogProgress(chipTool, " ***** Test Step 346 : Write attribute NULLABLE_SIMPLE_ENUM null Value\n"); - err = TestWriteAttributeNullableSimpleEnumNullValue_346(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Max Value\n"); + err = TestWriteAttributeBitmap8MaxValue_12(); break; - case 347: - ChipLogProgress(chipTool, " ***** Test Step 347 : Read attribute NULLABLE_SIMPLE_ENUM null Value\n"); - err = TestReadAttributeNullableSimpleEnumNullValue_347(); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Max Value\n"); + err = TestReadAttributeBitmap8MaxValue_13(); break; - case 348: - ChipLogProgress(chipTool, " ***** Test Step 348 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); - err = TestReadAttributeNullableOctetStringDefaultValue_348(); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute BITMAP8 Min Value\n"); + err = TestWriteAttributeBitmap8MinValue_14(); break; - case 349: - ChipLogProgress(chipTool, " ***** Test Step 349 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_349(); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute BITMAP8 Min Value\n"); + err = TestReadAttributeBitmap8MinValue_15(); break; - case 350: - ChipLogProgress(chipTool, " ***** Test Step 350 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_350(); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute BITMAP16 Default Value\n"); + err = TestReadAttributeBitmap16DefaultValue_16(); break; - case 351: - ChipLogProgress(chipTool, " ***** Test Step 351 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_351(); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute BITMAP16 Max Value\n"); + err = TestWriteAttributeBitmap16MaxValue_17(); break; - case 352: - ChipLogProgress(chipTool, " ***** Test Step 352 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_352(); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute BITMAP16 Max Value\n"); + err = TestReadAttributeBitmap16MaxValue_18(); break; - case 353: - ChipLogProgress(chipTool, " ***** Test Step 353 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_353(); + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute BITMAP16 Min Value\n"); + err = TestWriteAttributeBitmap16MinValue_19(); break; - case 354: - ChipLogProgress(chipTool, " ***** Test Step 354 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_354(); + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute BITMAP16 Min Value\n"); + err = TestReadAttributeBitmap16MinValue_20(); break; - case 355: - ChipLogProgress(chipTool, " ***** Test Step 355 : Read attribute NULLABLE_CHAR_STRING Default Value\n"); - err = TestReadAttributeNullableCharStringDefaultValue_355(); + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute BITMAP32 Default Value\n"); + err = TestReadAttributeBitmap32DefaultValue_21(); break; - case 356: - ChipLogProgress(chipTool, " ***** Test Step 356 : Write attribute NULLABLE_CHAR_STRING\n"); - err = TestWriteAttributeNullableCharString_356(); + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute BITMAP32 Max Value\n"); + err = TestWriteAttributeBitmap32MaxValue_22(); break; - case 357: - ChipLogProgress(chipTool, " ***** Test Step 357 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_357(); + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute BITMAP32 Max Value\n"); + err = TestReadAttributeBitmap32MaxValue_23(); break; - case 358: - ChipLogProgress(chipTool, " ***** Test Step 358 : Write attribute NULLABLE_CHAR_STRING - Value too long\n"); - err = TestWriteAttributeNullableCharStringValueTooLong_358(); + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Write attribute BITMAP32 Min Value\n"); + err = TestWriteAttributeBitmap32MinValue_24(); break; - case 359: - ChipLogProgress(chipTool, " ***** Test Step 359 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_359(); + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read attribute BITMAP32 Min Value\n"); + err = TestReadAttributeBitmap32MinValue_25(); break; - case 360: - ChipLogProgress(chipTool, " ***** Test Step 360 : Write attribute NULLABLE_CHAR_STRING - Empty\n"); - err = TestWriteAttributeNullableCharStringEmpty_360(); + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); + err = TestReadAttributeBitmap64DefaultValue_26(); break; - case 361: - ChipLogProgress(chipTool, " ***** Test Step 361 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_361(); + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Max Value\n"); + err = TestWriteAttributeBitmap64MaxValue_27(); break; - case 362: - ChipLogProgress(chipTool, " ***** Test Step 362 : Read attribute from nonexistent endpoint.\n"); - err = TestReadAttributeFromNonexistentEndpoint_362(); + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Max Value\n"); + err = TestReadAttributeBitmap64MaxValue_28(); break; - case 363: - ChipLogProgress(chipTool, " ***** Test Step 363 : Read attribute from nonexistent cluster.\n"); - err = TestReadAttributeFromNonexistentCluster_363(); + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Write attribute BITMAP64 Min Value\n"); + err = TestWriteAttributeBitmap64MinValue_29(); break; - case 364: - ChipLogProgress( - chipTool, " ***** Test Step 364 : Send a command that takes an optional parameter but do not set it.\n"); - err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_364(); + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Read attribute BITMAP64 Min Value\n"); + err = TestReadAttributeBitmap64MinValue_30(); break; - case 365: - ChipLogProgress( - chipTool, " ***** Test Step 365 : Send a command that takes an optional parameter but do not set it.\n"); - err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_365(); + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Default Value\n"); + err = TestReadAttributeInt8uDefaultValue_31(); break; - case 366: - ChipLogProgress(chipTool, " ***** Test Step 366 : Report: Subscribe to list attribute\n"); - err = TestReportSubscribeToListAttribute_366(); + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Max Value\n"); + err = TestWriteAttributeInt8uMaxValue_32(); break; - case 367: - ChipLogProgress(chipTool, " ***** Test Step 367 : Subscribe to list attribute\n"); - err = TestSubscribeToListAttribute_367(); + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Max Value\n"); + err = TestReadAttributeInt8uMaxValue_33(); break; - case 368: - ChipLogProgress(chipTool, " ***** Test Step 368 : Write subscribed-to list attribute\n"); - err = TestWriteSubscribedToListAttribute_368(); + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Write attribute INT8U Min Value\n"); + err = TestWriteAttributeInt8uMinValue_34(); break; - case 369: - ChipLogProgress(chipTool, " ***** Test Step 369 : Check for list attribute report\n"); - err = TestCheckForListAttributeReport_369(); + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute INT8U Min Value\n"); + err = TestReadAttributeInt8uMinValue_35(); break; - case 370: - ChipLogProgress(chipTool, " ***** Test Step 370 : Read range-restricted unsigned 8-bit integer\n"); - err = TestReadRangeRestrictedUnsigned8BitInteger_370(); + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Default Value\n"); + err = TestReadAttributeInt16uDefaultValue_36(); break; - case 371: - ChipLogProgress(chipTool, " ***** Test Step 371 : Write min value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371(); + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Max Value\n"); + err = TestWriteAttributeInt16uMaxValue_37(); break; - case 372: - ChipLogProgress( - chipTool, " ***** Test Step 372 : Write just-below-range value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_372(); + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Max Value\n"); + err = TestReadAttributeInt16uMaxValue_38(); break; - case 373: - ChipLogProgress( - chipTool, " ***** Test Step 373 : Write just-above-range value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_373(); + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Write attribute INT16U Min Value\n"); + err = TestWriteAttributeInt16uMinValue_39(); break; - case 374: - ChipLogProgress(chipTool, " ***** Test Step 374 : Write max value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374(); + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute INT16U Min Value\n"); + err = TestReadAttributeInt16uMinValue_40(); break; - case 375: - ChipLogProgress( - chipTool, " ***** Test Step 375 : Verify range-restricted unsigned 8-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375(); + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Default Value\n"); + err = TestReadAttributeInt32uDefaultValue_41(); break; - case 376: - ChipLogProgress( - chipTool, " ***** Test Step 376 : Write min valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376(); + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Max Value\n"); + err = TestWriteAttributeInt32uMaxValue_42(); break; - case 377: - ChipLogProgress( - chipTool, " ***** Test Step 377 : Verify range-restricted unsigned 8-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377(); + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Max Value\n"); + err = TestReadAttributeInt32uMaxValue_43(); break; - case 378: - ChipLogProgress( - chipTool, " ***** Test Step 378 : Write max valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378(); + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute INT32U Min Value\n"); + err = TestWriteAttributeInt32uMinValue_44(); break; - case 379: - ChipLogProgress( - chipTool, " ***** Test Step 379 : Verify range-restricted unsigned 8-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379(); + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute INT32U Min Value\n"); + err = TestReadAttributeInt32uMinValue_45(); break; - case 380: - ChipLogProgress( - chipTool, " ***** Test Step 380 : Write middle valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380(); + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Default Value\n"); + err = TestReadAttributeInt64uDefaultValue_46(); break; - case 381: - ChipLogProgress( - chipTool, " ***** Test Step 381 : Verify range-restricted unsigned 8-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381(); + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Max Value\n"); + err = TestWriteAttributeInt64uMaxValue_47(); break; - case 382: - ChipLogProgress(chipTool, " ***** Test Step 382 : Read range-restricted unsigned 16-bit integer\n"); - err = TestReadRangeRestrictedUnsigned16BitInteger_382(); + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Max Value\n"); + err = TestReadAttributeInt64uMaxValue_48(); break; - case 383: - ChipLogProgress(chipTool, " ***** Test Step 383 : Write min value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383(); + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Write attribute INT64U Min Value\n"); + err = TestWriteAttributeInt64uMinValue_49(); break; - case 384: - ChipLogProgress( - chipTool, " ***** Test Step 384 : Write just-below-range value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_384(); + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute INT64U Min Value\n"); + err = TestReadAttributeInt64uMinValue_50(); break; - case 385: - ChipLogProgress( - chipTool, " ***** Test Step 385 : Write just-above-range value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_385(); + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_51(); break; - case 386: - ChipLogProgress(chipTool, " ***** Test Step 386 : Write max value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386(); + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Max Value\n"); + err = TestWriteAttributeInt8sMaxValue_52(); break; - case 387: - ChipLogProgress( - chipTool, " ***** Test Step 387 : Verify range-restricted unsigned 16-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387(); + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Max Value\n"); + err = TestReadAttributeInt8sMaxValue_53(); break; - case 388: - ChipLogProgress( - chipTool, " ***** Test Step 388 : Write min valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388(); + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute INT8S Min Value\n"); + err = TestWriteAttributeInt8sMinValue_54(); break; - case 389: - ChipLogProgress( - chipTool, " ***** Test Step 389 : Verify range-restricted unsigned 16-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389(); + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Read attribute INT8S Min Value\n"); + err = TestReadAttributeInt8sMinValue_55(); break; - case 390: - ChipLogProgress( - chipTool, " ***** Test Step 390 : Write max valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390(); + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Write attribute INT8S Default Value\n"); + err = TestWriteAttributeInt8sDefaultValue_56(); break; - case 391: - ChipLogProgress( - chipTool, " ***** Test Step 391 : Verify range-restricted unsigned 16-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391(); + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_57(); break; - case 392: - ChipLogProgress( - chipTool, " ***** Test Step 392 : Write middle valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392(); + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_58(); break; - case 393: - ChipLogProgress( - chipTool, " ***** Test Step 393 : Verify range-restricted unsigned 16-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393(); + case 59: + ChipLogProgress(chipTool, " ***** Test Step 59 : Write attribute INT16S Max Value\n"); + err = TestWriteAttributeInt16sMaxValue_59(); break; - case 394: - ChipLogProgress(chipTool, " ***** Test Step 394 : Read range-restricted signed 8-bit integer\n"); - err = TestReadRangeRestrictedSigned8BitInteger_394(); + case 60: + ChipLogProgress(chipTool, " ***** Test Step 60 : Read attribute INT16S Max Value\n"); + err = TestReadAttributeInt16sMaxValue_60(); break; - case 395: - ChipLogProgress(chipTool, " ***** Test Step 395 : Write min value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedSigned8BitInteger_395(); + case 61: + ChipLogProgress(chipTool, " ***** Test Step 61 : Write attribute INT16S Min Value\n"); + err = TestWriteAttributeInt16sMinValue_61(); break; - case 396: - ChipLogProgress( - chipTool, " ***** Test Step 396 : Write just-below-range value to a range-restricted signed 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_396(); + case 62: + ChipLogProgress(chipTool, " ***** Test Step 62 : Read attribute INT16S Min Value\n"); + err = TestReadAttributeInt16sMinValue_62(); break; - case 397: - ChipLogProgress( - chipTool, " ***** Test Step 397 : Write just-above-range value to a range-restricted signed 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_397(); + case 63: + ChipLogProgress(chipTool, " ***** Test Step 63 : Write attribute INT16S Default Value\n"); + err = TestWriteAttributeInt16sDefaultValue_63(); break; - case 398: - ChipLogProgress(chipTool, " ***** Test Step 398 : Write max value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398(); + case 64: + ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_64(); break; - case 399: - ChipLogProgress( - chipTool, " ***** Test Step 399 : Verify range-restricted signed 8-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399(); + case 65: + ChipLogProgress(chipTool, " ***** Test Step 65 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_65(); break; - case 400: - ChipLogProgress(chipTool, " ***** Test Step 400 : Write min valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400(); + case 66: + ChipLogProgress(chipTool, " ***** Test Step 66 : Write attribute INT32S Max Value\n"); + err = TestWriteAttributeInt32sMaxValue_66(); break; - case 401: - ChipLogProgress( - chipTool, " ***** Test Step 401 : Verify range-restricted signed 8-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401(); + case 67: + ChipLogProgress(chipTool, " ***** Test Step 67 : Read attribute INT32S Max Value\n"); + err = TestReadAttributeInt32sMaxValue_67(); break; - case 402: - ChipLogProgress(chipTool, " ***** Test Step 402 : Write max valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402(); + case 68: + ChipLogProgress(chipTool, " ***** Test Step 68 : Write attribute INT32S Min Value\n"); + err = TestWriteAttributeInt32sMinValue_68(); break; - case 403: - ChipLogProgress( - chipTool, " ***** Test Step 403 : Verify range-restricted signed 8-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403(); + case 69: + ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute INT32S Min Value\n"); + err = TestReadAttributeInt32sMinValue_69(); break; - case 404: - ChipLogProgress( - chipTool, " ***** Test Step 404 : Write middle valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404(); + case 70: + ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute INT32S Default Value\n"); + err = TestWriteAttributeInt32sDefaultValue_70(); break; - case 405: - ChipLogProgress( - chipTool, " ***** Test Step 405 : Verify range-restricted signed 8-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405(); + case 71: + ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_71(); break; - case 406: - ChipLogProgress(chipTool, " ***** Test Step 406 : Read range-restricted signed 16-bit integer\n"); - err = TestReadRangeRestrictedSigned16BitInteger_406(); + case 72: + ChipLogProgress(chipTool, " ***** Test Step 72 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_72(); break; - case 407: - ChipLogProgress(chipTool, " ***** Test Step 407 : Write min value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedSigned16BitInteger_407(); + case 73: + ChipLogProgress(chipTool, " ***** Test Step 73 : Write attribute INT64S Max Value\n"); + err = TestWriteAttributeInt64sMaxValue_73(); break; - case 408: - ChipLogProgress( - chipTool, " ***** Test Step 408 : Write just-below-range value to a range-restricted signed 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_408(); + case 74: + ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute INT64S Max Value\n"); + err = TestReadAttributeInt64sMaxValue_74(); break; - case 409: - ChipLogProgress( - chipTool, " ***** Test Step 409 : Write just-above-range value to a range-restricted signed 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_409(); + case 75: + ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute INT64S Min Value\n"); + err = TestWriteAttributeInt64sMinValue_75(); break; - case 410: - ChipLogProgress(chipTool, " ***** Test Step 410 : Write max value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410(); + case 76: + ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute INT64S Min Value\n"); + err = TestReadAttributeInt64sMinValue_76(); break; - case 411: - ChipLogProgress( - chipTool, " ***** Test Step 411 : Verify range-restricted signed 16-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411(); + case 77: + ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute INT64S Default Value\n"); + err = TestWriteAttributeInt64sDefaultValue_77(); break; - case 412: - ChipLogProgress(chipTool, " ***** Test Step 412 : Write min valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412(); + case 78: + ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_78(); break; - case 413: - ChipLogProgress( - chipTool, " ***** Test Step 413 : Verify range-restricted signed 16-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413(); + case 79: + ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute SINGLE Default Value\n"); + err = TestReadAttributeSingleDefaultValue_79(); break; - case 414: - ChipLogProgress(chipTool, " ***** Test Step 414 : Write max valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414(); + case 80: + ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute SINGLE medium Value\n"); + err = TestWriteAttributeSingleMediumValue_80(); break; - case 415: - ChipLogProgress( - chipTool, " ***** Test Step 415 : Verify range-restricted signed 16-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415(); + case 81: + ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute SINGLE medium Value\n"); + err = TestReadAttributeSingleMediumValue_81(); break; - case 416: - ChipLogProgress( - chipTool, " ***** Test Step 416 : Write middle valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416(); + case 82: + ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute SINGLE large Value\n"); + err = TestWriteAttributeSingleLargeValue_82(); break; - case 417: - ChipLogProgress( - chipTool, " ***** Test Step 417 : Verify range-restricted signed 16-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417(); + case 83: + ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute SINGLE large Value\n"); + err = TestReadAttributeSingleLargeValue_83(); break; - case 418: - ChipLogProgress(chipTool, " ***** Test Step 418 : Read nullable range-restricted unsigned 8-bit integer\n"); - err = TestReadNullableRangeRestrictedUnsigned8BitInteger_418(); + case 84: + ChipLogProgress(chipTool, " ***** Test Step 84 : Write attribute SINGLE small Value\n"); + err = TestWriteAttributeSingleSmallValue_84(); break; - case 419: - ChipLogProgress( - chipTool, " ***** Test Step 419 : Write min value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419(); + case 85: + ChipLogProgress(chipTool, " ***** Test Step 85 : Read attribute SINGLE small Value\n"); + err = TestReadAttributeSingleSmallValue_85(); break; - case 420: - ChipLogProgress(chipTool, - " ***** Test Step 420 : Write just-below-range value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_420(); + case 86: + ChipLogProgress(chipTool, " ***** Test Step 86 : Write attribute SINGLE Default Value\n"); + err = TestWriteAttributeSingleDefaultValue_86(); break; - case 421: - ChipLogProgress(chipTool, - " ***** Test Step 421 : Write just-above-range value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_421(); + case 87: + ChipLogProgress(chipTool, " ***** Test Step 87 : Read attribute SINGLE Default Value\n"); + err = TestReadAttributeSingleDefaultValue_87(); break; - case 422: - ChipLogProgress( - chipTool, " ***** Test Step 422 : Write max value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422(); + case 88: + ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute DOUBLE Default Value\n"); + err = TestReadAttributeDoubleDefaultValue_88(); break; - case 423: - ChipLogProgress( - chipTool, " ***** Test Step 423 : Verify nullable range-restricted unsigned 8-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423(); + case 89: + ChipLogProgress(chipTool, " ***** Test Step 89 : Write attribute DOUBLE medium Value\n"); + err = TestWriteAttributeDoubleMediumValue_89(); break; - case 424: - ChipLogProgress( - chipTool, " ***** Test Step 424 : Write min valid value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_424(); + case 90: + ChipLogProgress(chipTool, " ***** Test Step 90 : Read attribute DOUBLE medium Value\n"); + err = TestReadAttributeDoubleMediumValue_90(); break; - case 425: - ChipLogProgress( - chipTool, " ***** Test Step 425 : Verify nullable range-restricted unsigned 8-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_425(); + case 91: + ChipLogProgress(chipTool, " ***** Test Step 91 : Write attribute DOUBLE large Value\n"); + err = TestWriteAttributeDoubleLargeValue_91(); break; - case 426: - ChipLogProgress( - chipTool, " ***** Test Step 426 : Write max valid value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_426(); + case 92: + ChipLogProgress(chipTool, " ***** Test Step 92 : Read attribute DOUBLE large Value\n"); + err = TestReadAttributeDoubleLargeValue_92(); break; - case 427: - ChipLogProgress( - chipTool, " ***** Test Step 427 : Verify nullable range-restricted unsigned 8-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_427(); + case 93: + ChipLogProgress(chipTool, " ***** Test Step 93 : Write attribute DOUBLE small Value\n"); + err = TestWriteAttributeDoubleSmallValue_93(); break; - case 428: - ChipLogProgress(chipTool, - " ***** Test Step 428 : Write middle valid value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_428(); + case 94: + ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute DOUBLE small Value\n"); + err = TestReadAttributeDoubleSmallValue_94(); break; - case 429: - ChipLogProgress( - chipTool, " ***** Test Step 429 : Verify nullable range-restricted unsigned 8-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_429(); + case 95: + ChipLogProgress(chipTool, " ***** Test Step 95 : Write attribute DOUBLE Default Value\n"); + err = TestWriteAttributeDoubleDefaultValue_95(); break; - case 430: - ChipLogProgress( - chipTool, " ***** Test Step 430 : Write null value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430(); + case 96: + ChipLogProgress(chipTool, " ***** Test Step 96 : Read attribute DOUBLE Default Value\n"); + err = TestReadAttributeDoubleDefaultValue_96(); break; - case 431: - ChipLogProgress( - chipTool, " ***** Test Step 431 : Verify nullable range-restricted unsigned 8-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431(); + case 97: + ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute ENUM8 Default Value\n"); + err = TestReadAttributeEnum8DefaultValue_97(); break; - case 432: - ChipLogProgress(chipTool, " ***** Test Step 432 : Read nullable range-restricted unsigned 16-bit integer\n"); - err = TestReadNullableRangeRestrictedUnsigned16BitInteger_432(); + case 98: + ChipLogProgress(chipTool, " ***** Test Step 98 : Write attribute ENUM8 Max Value\n"); + err = TestWriteAttributeEnum8MaxValue_98(); break; - case 433: - ChipLogProgress( - chipTool, " ***** Test Step 433 : Write min value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433(); + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Read attribute ENUM8 Max Value\n"); + err = TestReadAttributeEnum8MaxValue_99(); break; - case 434: - ChipLogProgress(chipTool, - " ***** Test Step 434 : Write just-below-range value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_434(); + case 100: + ChipLogProgress(chipTool, " ***** Test Step 100 : Write attribute ENUM8 Min Value\n"); + err = TestWriteAttributeEnum8MinValue_100(); break; - case 435: - ChipLogProgress(chipTool, - " ***** Test Step 435 : Write just-above-range value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_435(); + case 101: + ChipLogProgress(chipTool, " ***** Test Step 101 : Read attribute ENUM8 Min Value\n"); + err = TestReadAttributeEnum8MinValue_101(); break; - case 436: - ChipLogProgress( - chipTool, " ***** Test Step 436 : Write max value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436(); + case 102: + ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute ENUM16 Default Value\n"); + err = TestReadAttributeEnum16DefaultValue_102(); break; - case 437: - ChipLogProgress(chipTool, - " ***** Test Step 437 : Verify nullable range-restricted unsigned 16-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437(); + case 103: + ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute ENUM16 Max Value\n"); + err = TestWriteAttributeEnum16MaxValue_103(); break; - case 438: - ChipLogProgress( - chipTool, " ***** Test Step 438 : Write min valid value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_438(); + case 104: + ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute ENUM16 Max Value\n"); + err = TestReadAttributeEnum16MaxValue_104(); break; - case 439: - ChipLogProgress(chipTool, - " ***** Test Step 439 : Verify nullable range-restricted unsigned 16-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_439(); + case 105: + ChipLogProgress(chipTool, " ***** Test Step 105 : Write attribute ENUM16 Min Value\n"); + err = TestWriteAttributeEnum16MinValue_105(); break; - case 440: - ChipLogProgress( - chipTool, " ***** Test Step 440 : Write max valid value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_440(); + case 106: + ChipLogProgress(chipTool, " ***** Test Step 106 : Read attribute ENUM16 Min Value\n"); + err = TestReadAttributeEnum16MinValue_106(); break; - case 441: - ChipLogProgress(chipTool, - " ***** Test Step 441 : Verify nullable range-restricted unsigned 16-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_441(); + case 107: + ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute OCTET_STRING Default Value\n"); + err = TestReadAttributeOctetStringDefaultValue_107(); break; - case 442: - ChipLogProgress(chipTool, - " ***** Test Step 442 : Write middle valid value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_442(); + case 108: + ChipLogProgress(chipTool, " ***** Test Step 108 : Write attribute OCTET_STRING with embedded null\n"); + err = TestWriteAttributeOctetStringWithEmbeddedNull_108(); break; - case 443: - ChipLogProgress(chipTool, - " ***** Test Step 443 : Verify nullable range-restricted unsigned 16-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_443(); + case 109: + ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute OCTET_STRING with embedded null\n"); + err = TestReadAttributeOctetStringWithEmbeddedNull_109(); break; - case 444: - ChipLogProgress( - chipTool, " ***** Test Step 444 : Write null value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444(); + case 110: + ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute OCTET_STRING with weird chars\n"); + err = TestWriteAttributeOctetStringWithWeirdChars_110(); break; - case 445: - ChipLogProgress( - chipTool, " ***** Test Step 445 : Verify nullable range-restricted unsigned 16-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445(); + case 111: + ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute OCTET_STRING with weird chars\n"); + err = TestReadAttributeOctetStringWithWeirdChars_111(); break; - case 446: - ChipLogProgress(chipTool, " ***** Test Step 446 : Read nullable range-restricted signed 8-bit integer\n"); - err = TestReadNullableRangeRestrictedSigned8BitInteger_446(); + case 112: + ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_112(); break; - case 447: - ChipLogProgress( - chipTool, " ***** Test Step 447 : Write min value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447(); + case 113: + ChipLogProgress(chipTool, " ***** Test Step 113 : Read attribute OCTET_STRING\n"); + err = TestReadAttributeOctetString_113(); break; - case 448: - ChipLogProgress(chipTool, - " ***** Test Step 448 : Write just-below-range value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_448(); + case 114: + ChipLogProgress(chipTool, " ***** Test Step 114 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_114(); break; - case 449: - ChipLogProgress(chipTool, - " ***** Test Step 449 : Write just-above-range value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_449(); + case 115: + ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute OCTET_STRING\n"); + err = TestReadAttributeOctetString_115(); break; - case 450: - ChipLogProgress( - chipTool, " ***** Test Step 450 : Write max value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450(); + case 116: + ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_116(); break; - case 451: - ChipLogProgress( - chipTool, " ***** Test Step 451 : Verify nullable range-restricted signed 8-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451(); + case 117: + ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute LONG_OCTET_STRING Default Value\n"); + err = TestReadAttributeLongOctetStringDefaultValue_117(); break; - case 452: - ChipLogProgress( - chipTool, " ***** Test Step 452 : Write min valid value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_452(); + case 118: + ChipLogProgress(chipTool, " ***** Test Step 118 : Write attribute LONG_OCTET_STRING\n"); + err = TestWriteAttributeLongOctetString_118(); break; - case 453: - ChipLogProgress( - chipTool, " ***** Test Step 453 : Verify nullable range-restricted signed 8-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_453(); + case 119: + ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute LONG_OCTET_STRING\n"); + err = TestReadAttributeLongOctetString_119(); break; - case 454: - ChipLogProgress( - chipTool, " ***** Test Step 454 : Write max valid value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_454(); + case 120: + ChipLogProgress(chipTool, " ***** Test Step 120 : Write attribute LONG_OCTET_STRING\n"); + err = TestWriteAttributeLongOctetString_120(); break; - case 455: - ChipLogProgress( - chipTool, " ***** Test Step 455 : Verify nullable range-restricted signed 8-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_455(); + case 121: + ChipLogProgress(chipTool, " ***** Test Step 121 : Read attribute CHAR_STRING Default Value\n"); + err = TestReadAttributeCharStringDefaultValue_121(); break; - case 456: - ChipLogProgress( - chipTool, " ***** Test Step 456 : Write middle valid value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_456(); + case 122: + ChipLogProgress(chipTool, " ***** Test Step 122 : Write attribute CHAR_STRING\n"); + err = TestWriteAttributeCharString_122(); break; - case 457: - ChipLogProgress( - chipTool, " ***** Test Step 457 : Verify nullable range-restricted signed 8-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_457(); + case 123: + ChipLogProgress(chipTool, " ***** Test Step 123 : Read attribute CHAR_STRING\n"); + err = TestReadAttributeCharString_123(); break; - case 458: - ChipLogProgress( - chipTool, " ***** Test Step 458 : Write null value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458(); + case 124: + ChipLogProgress(chipTool, " ***** Test Step 124 : Write attribute CHAR_STRING - Value too long\n"); + err = TestWriteAttributeCharStringValueTooLong_124(); break; - case 459: - ChipLogProgress( - chipTool, " ***** Test Step 459 : Verify nullable range-restricted signed 8-bit integer value is at null\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459(); + case 125: + ChipLogProgress(chipTool, " ***** Test Step 125 : Read attribute CHAR_STRING\n"); + err = TestReadAttributeCharString_125(); break; - case 460: - ChipLogProgress(chipTool, " ***** Test Step 460 : Read nullable range-restricted signed 16-bit integer\n"); - err = TestReadNullableRangeRestrictedSigned16BitInteger_460(); + case 126: + ChipLogProgress(chipTool, " ***** Test Step 126 : Write attribute CHAR_STRING - Empty\n"); + err = TestWriteAttributeCharStringEmpty_126(); break; - case 461: - ChipLogProgress( - chipTool, " ***** Test Step 461 : Write min value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461(); + case 127: + ChipLogProgress(chipTool, " ***** Test Step 127 : Read attribute LONG_CHAR_STRING Default Value\n"); + err = TestReadAttributeLongCharStringDefaultValue_127(); break; - case 462: + case 128: + ChipLogProgress(chipTool, " ***** Test Step 128 : Write attribute LONG_CHAR_STRING\n"); + err = TestWriteAttributeLongCharString_128(); + break; + case 129: + ChipLogProgress(chipTool, " ***** Test Step 129 : Read attribute LONG_CHAR_STRING\n"); + err = TestReadAttributeLongCharString_129(); + break; + case 130: + ChipLogProgress(chipTool, " ***** Test Step 130 : Write attribute LONG_CHAR_STRING\n"); + err = TestWriteAttributeLongCharString_130(); + break; + case 131: + ChipLogProgress(chipTool, " ***** Test Step 131 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); + err = TestReadAttributeListLongOctetStringForChunkedRead_131(); + break; + case 132: + ChipLogProgress(chipTool, " ***** Test Step 132 : Write attribute LIST_LONG_OCTET_STRING (for chunked write)\n"); + err = TestWriteAttributeListLongOctetStringForChunkedWrite_132(); + break; + case 133: + ChipLogProgress(chipTool, " ***** Test Step 133 : Read attribute LIST_LONG_OCTET_STRING (for chunked read)\n"); + err = TestReadAttributeListLongOctetStringForChunkedRead_133(); + break; + case 134: + ChipLogProgress(chipTool, " ***** Test Step 134 : Read attribute EPOCH_US Default Value\n"); + err = TestReadAttributeEpochUsDefaultValue_134(); + break; + case 135: + ChipLogProgress(chipTool, " ***** Test Step 135 : Write attribute EPOCH_US Max Value\n"); + err = TestWriteAttributeEpochUsMaxValue_135(); + break; + case 136: + ChipLogProgress(chipTool, " ***** Test Step 136 : Read attribute EPOCH_US Max Value\n"); + err = TestReadAttributeEpochUsMaxValue_136(); + break; + case 137: + ChipLogProgress(chipTool, " ***** Test Step 137 : Write attribute EPOCH_US Min Value\n"); + err = TestWriteAttributeEpochUsMinValue_137(); + break; + case 138: + ChipLogProgress(chipTool, " ***** Test Step 138 : Read attribute EPOCH_US Min Value\n"); + err = TestReadAttributeEpochUsMinValue_138(); + break; + case 139: + ChipLogProgress(chipTool, " ***** Test Step 139 : Read attribute EPOCH_S Default Value\n"); + err = TestReadAttributeEpochSDefaultValue_139(); + break; + case 140: + ChipLogProgress(chipTool, " ***** Test Step 140 : Write attribute EPOCH_S Max Value\n"); + err = TestWriteAttributeEpochSMaxValue_140(); + break; + case 141: + ChipLogProgress(chipTool, " ***** Test Step 141 : Read attribute EPOCH_S Max Value\n"); + err = TestReadAttributeEpochSMaxValue_141(); + break; + case 142: + ChipLogProgress(chipTool, " ***** Test Step 142 : Write attribute EPOCH_S Min Value\n"); + err = TestWriteAttributeEpochSMinValue_142(); + break; + case 143: + ChipLogProgress(chipTool, " ***** Test Step 143 : Read attribute EPOCH_S Min Value\n"); + err = TestReadAttributeEpochSMinValue_143(); + break; + case 144: + ChipLogProgress(chipTool, " ***** Test Step 144 : Read attribute UNSUPPORTED\n"); + err = TestReadAttributeUnsupported_144(); + break; + case 145: + ChipLogProgress(chipTool, " ***** Test Step 145 : Writeattribute UNSUPPORTED\n"); + err = TestWriteattributeUnsupported_145(); + break; + case 146: + ChipLogProgress(chipTool, " ***** Test Step 146 : Send Test Command to unsupported endpoint\n"); + err = TestSendTestCommandToUnsupportedEndpoint_146(); + break; + case 147: + ChipLogProgress(chipTool, " ***** Test Step 147 : Send Test Command to unsupported cluster\n"); + err = TestSendTestCommandToUnsupportedCluster_147(); + break; + case 148: + ChipLogProgress(chipTool, " ***** Test Step 148 : Read attribute vendor_id Default Value\n"); + err = TestReadAttributeVendorIdDefaultValue_148(); + break; + case 149: + ChipLogProgress(chipTool, " ***** Test Step 149 : Write attribute vendor_id\n"); + err = TestWriteAttributeVendorId_149(); + break; + case 150: + ChipLogProgress(chipTool, " ***** Test Step 150 : Read attribute vendor_id\n"); + err = TestReadAttributeVendorId_150(); + break; + case 151: + ChipLogProgress(chipTool, " ***** Test Step 151 : Restore attribute vendor_id\n"); + err = TestRestoreAttributeVendorId_151(); + break; + case 152: + ChipLogProgress(chipTool, " ***** Test Step 152 : Send a command with a vendor_id and enum\n"); + err = TestSendACommandWithAVendorIdAndEnum_152(); + break; + case 153: + ChipLogProgress(chipTool, " ***** Test Step 153 : Send Test Command With Struct Argument and arg1.b is true\n"); + err = TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153(); + break; + case 154: + ChipLogProgress(chipTool, " ***** Test Step 154 : Send Test Command With Struct Argument and arg1.b is false\n"); + err = TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154(); + break; + case 155: + ChipLogProgress( + chipTool, " ***** Test Step 155 : Send Test Command With Nested Struct Argument and arg1.c.b is true\n"); + err = TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_155(); + break; + case 156: + ChipLogProgress(chipTool, " ***** Test Step 156 : Send Test Command With Nested Struct Argument arg1.c.b is false\n"); + err = TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156(); + break; + case 157: ChipLogProgress(chipTool, - " ***** Test Step 462 : Write just-below-range value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_462(); + " ***** Test Step 157 : Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true\n"); + err = TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_157(); break; - case 463: + case 158: ChipLogProgress(chipTool, - " ***** Test Step 463 : Write just-above-range value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_463(); + " ***** Test Step 158 : Send Test Command With Nested Struct List Argument and some fields b of arg1.d are " + "false\n"); + err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_158(); break; - case 464: - ChipLogProgress( - chipTool, " ***** Test Step 464 : Write max value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464(); + case 159: + ChipLogProgress(chipTool, " ***** Test Step 159 : Send Test Command With Struct Argument and see what we get back\n"); + err = TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159(); break; - case 465: - ChipLogProgress( - chipTool, " ***** Test Step 465 : Verify nullable range-restricted signed 16-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465(); + case 160: + ChipLogProgress(chipTool, " ***** Test Step 160 : Send Test Command With List of INT8U and none of them is set to 0\n"); + err = TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_160(); break; - case 466: - ChipLogProgress( - chipTool, " ***** Test Step 466 : Write min valid value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_466(); + case 161: + ChipLogProgress(chipTool, " ***** Test Step 161 : Send Test Command With List of INT8U and one of them is set to 0\n"); + err = TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_161(); break; - case 467: - ChipLogProgress( - chipTool, " ***** Test Step 467 : Verify nullable range-restricted signed 16-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_467(); + case 162: + ChipLogProgress(chipTool, " ***** Test Step 162 : Send Test Command With List of INT8U and get it reversed\n"); + err = TestSendTestCommandWithListOfInt8uAndGetItReversed_162(); break; - case 468: + case 163: ChipLogProgress( - chipTool, " ***** Test Step 468 : Write max valid value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_468(); + chipTool, " ***** Test Step 163 : Send Test Command With empty List of INT8U and get an empty list back\n"); + err = TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_163(); break; - case 469: - ChipLogProgress( - chipTool, " ***** Test Step 469 : Verify nullable range-restricted signed 16-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_469(); + case 164: + ChipLogProgress(chipTool, + " ***** Test Step 164 : Send Test Command With List of Struct Argument and arg1.b of first item is true\n"); + err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_164(); break; - case 470: - ChipLogProgress( - chipTool, " ***** Test Step 470 : Write middle valid value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_470(); + case 165: + ChipLogProgress(chipTool, + " ***** Test Step 165 : Send Test Command With List of Struct Argument and arg1.b of first item is false\n"); + err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_165(); break; - case 471: - ChipLogProgress( - chipTool, " ***** Test Step 471 : Verify nullable range-restricted signed 16-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_471(); + case 166: + ChipLogProgress(chipTool, + " ***** Test Step 166 : Send Test Command With List of Nested Struct List Argument and all fields b of elements of " + "arg1.d are true\n"); + err = TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_166(); break; - case 472: + case 167: + ChipLogProgress(chipTool, + " ***** Test Step 167 : Send Test Command With Nested Struct List Argument and some fields b of elements of arg1.d " + "are false\n"); + err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_167(); + break; + case 168: ChipLogProgress( - chipTool, " ***** Test Step 472 : Write null value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472(); + chipTool, " ***** Test Step 168 : Write attribute LIST With List of INT8U and none of them is set to 0\n"); + err = TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168(); break; - case 473: + case 169: + ChipLogProgress(chipTool, " ***** Test Step 169 : Read attribute LIST With List of INT8U\n"); + err = TestReadAttributeListWithListOfInt8u_169(); + break; + case 170: + ChipLogProgress(chipTool, " ***** Test Step 170 : Write attribute LIST With List of OCTET_STRING\n"); + err = TestWriteAttributeListWithListOfOctetString_170(); + break; + case 171: + ChipLogProgress(chipTool, " ***** Test Step 171 : Read attribute LIST With List of OCTET_STRING\n"); + err = TestReadAttributeListWithListOfOctetString_171(); + break; + case 172: + ChipLogProgress(chipTool, " ***** Test Step 172 : Write attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); + err = TestWriteAttributeListWithListOfListStructOctetString_172(); + break; + case 173: + ChipLogProgress(chipTool, " ***** Test Step 173 : Read attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); + err = TestReadAttributeListWithListOfListStructOctetString_173(); + break; + case 174: + ChipLogProgress(chipTool, " ***** Test Step 174 : Send Test Command with optional arg set.\n"); + err = TestSendTestCommandWithOptionalArgSet_174(); + break; + case 175: + ChipLogProgress(chipTool, " ***** Test Step 175 : Send Test Command without its optional arg.\n"); + err = TestSendTestCommandWithoutItsOptionalArg_175(); + break; + case 176: + ChipLogProgress(chipTool, " ***** Test Step 176 : Read list of structs containing nullables and optionals\n"); + err = TestReadListOfStructsContainingNullablesAndOptionals_176(); + break; + case 177: + ChipLogProgress(chipTool, " ***** Test Step 177 : Write list of structs containing nullables and optionals\n"); + err = TestWriteListOfStructsContainingNullablesAndOptionals_177(); + break; + case 178: ChipLogProgress( - chipTool, " ***** Test Step 473 : Verify nullable range-restricted signed 16-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473(); + chipTool, " ***** Test Step 178 : Read list of structs containing nullables and optionals after writing\n"); + err = TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178(); break; - case 474: - ChipLogProgress(chipTool, " ***** Test Step 474 : Write attribute that returns general status on write\n"); - err = TestWriteAttributeThatReturnsGeneralStatusOnWrite_474(); + case 179: + ChipLogProgress(chipTool, " ***** Test Step 179 : Write attribute NULLABLE_BOOLEAN null\n"); + err = TestWriteAttributeNullableBooleanNull_179(); break; - case 475: - ChipLogProgress(chipTool, " ***** Test Step 475 : Write attribute that returns cluster-specific status on write\n"); - err = TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475(); + case 180: + ChipLogProgress(chipTool, " ***** Test Step 180 : Read attribute NULLABLE_BOOLEAN null\n"); + err = TestReadAttributeNullableBooleanNull_180(); break; - case 476: - ChipLogProgress(chipTool, " ***** Test Step 476 : Read attribute that returns general status on read\n"); - err = TestReadAttributeThatReturnsGeneralStatusOnRead_476(); + case 181: + ChipLogProgress(chipTool, " ***** Test Step 181 : Write attribute NULLABLE_BOOLEAN True\n"); + err = TestWriteAttributeNullableBooleanTrue_181(); break; - case 477: - ChipLogProgress(chipTool, " ***** Test Step 477 : read attribute that returns cluster-specific status on read\n"); - err = TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477(); + case 182: + ChipLogProgress(chipTool, " ***** Test Step 182 : Read attribute NULLABLE_BOOLEAN True\n"); + err = TestReadAttributeNullableBooleanTrue_182(); break; - case 478: - ChipLogProgress(chipTool, " ***** Test Step 478 : read AcceptedCommandList attribute\n"); - err = TestReadAcceptedCommandListAttribute_478(); + case 183: + ChipLogProgress(chipTool, " ***** Test Step 183 : Write attribute NULLABLE_BITMAP8 Max Value\n"); + err = TestWriteAttributeNullableBitmap8MaxValue_183(); break; - case 479: - ChipLogProgress(chipTool, " ***** Test Step 479 : read GeneratedCommandList attribute\n"); - err = TestReadGeneratedCommandListAttribute_479(); + case 184: + ChipLogProgress(chipTool, " ***** Test Step 184 : Read attribute NULLABLE_BITMAP8 Max Value\n"); + err = TestReadAttributeNullableBitmap8MaxValue_184(); break; - case 480: - ChipLogProgress(chipTool, " ***** Test Step 480 : Write struct-typed attribute\n"); - err = TestWriteStructTypedAttribute_480(); + case 185: + ChipLogProgress(chipTool, " ***** Test Step 185 : Write attribute NULLABLE_BITMAP8 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap8InvalidValue_185(); break; - case 481: - ChipLogProgress(chipTool, " ***** Test Step 481 : Read struct-typed attribute\n"); - err = TestReadStructTypedAttribute_481(); + case 186: + ChipLogProgress(chipTool, " ***** Test Step 186 : Read attribute NULLABLE_BITMAP8 unchanged Value\n"); + err = TestReadAttributeNullableBitmap8UnchangedValue_186(); break; - } + case 187: + ChipLogProgress(chipTool, " ***** Test Step 187 : Write attribute NULLABLE_BITMAP8 null Value\n"); + err = TestWriteAttributeNullableBitmap8NullValue_187(); + break; + case 188: + ChipLogProgress(chipTool, " ***** Test Step 188 : Read attribute NULLABLE_BITMAP8 null Value\n"); + err = TestReadAttributeNullableBitmap8NullValue_188(); + break; + case 189: + ChipLogProgress(chipTool, " ***** Test Step 189 : Write attribute NULLABLE_BITMAP16 Max Value\n"); + err = TestWriteAttributeNullableBitmap16MaxValue_189(); + break; + case 190: + ChipLogProgress(chipTool, " ***** Test Step 190 : Read attribute NULLABLE_BITMAP16 Max Value\n"); + err = TestReadAttributeNullableBitmap16MaxValue_190(); + break; + case 191: + ChipLogProgress(chipTool, " ***** Test Step 191 : Write attribute NULLABLE_BITMAP16 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap16InvalidValue_191(); + break; + case 192: + ChipLogProgress(chipTool, " ***** Test Step 192 : Read attribute NULLABLE_BITMAP16 unchanged Value\n"); + err = TestReadAttributeNullableBitmap16UnchangedValue_192(); + break; + case 193: + ChipLogProgress(chipTool, " ***** Test Step 193 : Write attribute NULLABLE_BITMAP16 null Value\n"); + err = TestWriteAttributeNullableBitmap16NullValue_193(); + break; + case 194: + ChipLogProgress(chipTool, " ***** Test Step 194 : Read attribute NULLABLE_BITMAP16 null Value\n"); + err = TestReadAttributeNullableBitmap16NullValue_194(); + break; + case 195: + ChipLogProgress(chipTool, " ***** Test Step 195 : Write attribute NULLABLE_BITMAP32 Max Value\n"); + err = TestWriteAttributeNullableBitmap32MaxValue_195(); + break; + case 196: + ChipLogProgress(chipTool, " ***** Test Step 196 : Read attribute NULLABLE_BITMAP32 Max Value\n"); + err = TestReadAttributeNullableBitmap32MaxValue_196(); + break; + case 197: + ChipLogProgress(chipTool, " ***** Test Step 197 : Write attribute NULLABLE_BITMAP32 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap32InvalidValue_197(); + break; + case 198: + ChipLogProgress(chipTool, " ***** Test Step 198 : Read attribute NULLABLE_BITMAP32 unchanged Value\n"); + err = TestReadAttributeNullableBitmap32UnchangedValue_198(); + break; + case 199: + ChipLogProgress(chipTool, " ***** Test Step 199 : Write attribute NULLABLE_BITMAP32 null Value\n"); + err = TestWriteAttributeNullableBitmap32NullValue_199(); + break; + case 200: + ChipLogProgress(chipTool, " ***** Test Step 200 : Read attribute NULLABLE_BITMAP32 null Value\n"); + err = TestReadAttributeNullableBitmap32NullValue_200(); + break; + case 201: + ChipLogProgress(chipTool, " ***** Test Step 201 : Write attribute NULLABLE_BITMAP64 Max Value\n"); + err = TestWriteAttributeNullableBitmap64MaxValue_201(); + break; + case 202: + ChipLogProgress(chipTool, " ***** Test Step 202 : Read attribute NULLABLE_BITMAP64 Max Value\n"); + err = TestReadAttributeNullableBitmap64MaxValue_202(); + break; + case 203: + ChipLogProgress(chipTool, " ***** Test Step 203 : Write attribute NULLABLE_BITMAP64 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap64InvalidValue_203(); + break; + case 204: + ChipLogProgress(chipTool, " ***** Test Step 204 : Read attribute NULLABLE_BITMAP64 unchanged Value\n"); + err = TestReadAttributeNullableBitmap64UnchangedValue_204(); + break; + case 205: + ChipLogProgress(chipTool, " ***** Test Step 205 : Write attribute NULLABLE_BITMAP64 null Value\n"); + err = TestWriteAttributeNullableBitmap64NullValue_205(); + break; + case 206: + ChipLogProgress(chipTool, " ***** Test Step 206 : Read attribute NULLABLE_BITMAP64 null Value\n"); + err = TestReadAttributeNullableBitmap64NullValue_206(); + break; + case 207: + ChipLogProgress(chipTool, " ***** Test Step 207 : Write attribute NULLABLE_INT8U Min Value\n"); + err = TestWriteAttributeNullableInt8uMinValue_207(); + break; + case 208: + ChipLogProgress(chipTool, " ***** Test Step 208 : Read attribute NULLABLE_INT8U Min Value\n"); + err = TestReadAttributeNullableInt8uMinValue_208(); + break; + case 209: + ChipLogProgress(chipTool, " ***** Test Step 209 : Write attribute NULLABLE_INT8U Max Value\n"); + err = TestWriteAttributeNullableInt8uMaxValue_209(); + break; + case 210: + ChipLogProgress(chipTool, " ***** Test Step 210 : Read attribute NULLABLE_INT8U Max Value\n"); + err = TestReadAttributeNullableInt8uMaxValue_210(); + break; + case 211: + ChipLogProgress(chipTool, " ***** Test Step 211 : Write attribute NULLABLE_INT8U Invalid Value\n"); + err = TestWriteAttributeNullableInt8uInvalidValue_211(); + break; + case 212: + ChipLogProgress(chipTool, " ***** Test Step 212 : Read attribute NULLABLE_INT8U unchanged Value\n"); + err = TestReadAttributeNullableInt8uUnchangedValue_212(); + break; + case 213: + ChipLogProgress(chipTool, " ***** Test Step 213 : Read attribute NULLABLE_INT8U unchanged Value with constraint\n"); + err = TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213(); + break; + case 214: + ChipLogProgress(chipTool, " ***** Test Step 214 : Write attribute NULLABLE_INT8U null Value\n"); + err = TestWriteAttributeNullableInt8uNullValue_214(); + break; + case 215: + ChipLogProgress(chipTool, " ***** Test Step 215 : Read attribute NULLABLE_INT8U null Value\n"); + err = TestReadAttributeNullableInt8uNullValue_215(); + break; + case 216: + ChipLogProgress(chipTool, " ***** Test Step 216 : Read attribute NULLABLE_INT8U null Value & range\n"); + err = TestReadAttributeNullableInt8uNullValueRange_216(); + break; + case 217: + ChipLogProgress(chipTool, " ***** Test Step 217 : Read attribute NULLABLE_INT8U null Value & not\n"); + err = TestReadAttributeNullableInt8uNullValueNot_217(); + break; + case 218: + ChipLogProgress(chipTool, " ***** Test Step 218 : Write attribute NULLABLE_INT8U Value\n"); + err = TestWriteAttributeNullableInt8uValue_218(); + break; + case 219: + ChipLogProgress(chipTool, " ***** Test Step 219 : Read attribute NULLABLE_INT8U Value in range\n"); + err = TestReadAttributeNullableInt8uValueInRange_219(); + break; + case 220: + ChipLogProgress(chipTool, " ***** Test Step 220 : Read attribute NULLABLE_INT8U notValue OK\n"); + err = TestReadAttributeNullableInt8uNotValueOk_220(); + break; + case 221: + ChipLogProgress(chipTool, " ***** Test Step 221 : Write attribute NULLABLE_INT16U Min Value\n"); + err = TestWriteAttributeNullableInt16uMinValue_221(); + break; + case 222: + ChipLogProgress(chipTool, " ***** Test Step 222 : Read attribute NULLABLE_INT16U Min Value\n"); + err = TestReadAttributeNullableInt16uMinValue_222(); + break; + case 223: + ChipLogProgress(chipTool, " ***** Test Step 223 : Write attribute NULLABLE_INT16U Max Value\n"); + err = TestWriteAttributeNullableInt16uMaxValue_223(); + break; + case 224: + ChipLogProgress(chipTool, " ***** Test Step 224 : Read attribute NULLABLE_INT16U Max Value\n"); + err = TestReadAttributeNullableInt16uMaxValue_224(); + break; + case 225: + ChipLogProgress(chipTool, " ***** Test Step 225 : Write attribute NULLABLE_INT16U Invalid Value\n"); + err = TestWriteAttributeNullableInt16uInvalidValue_225(); + break; + case 226: + ChipLogProgress(chipTool, " ***** Test Step 226 : Read attribute NULLABLE_INT16U unchanged Value\n"); + err = TestReadAttributeNullableInt16uUnchangedValue_226(); + break; + case 227: + ChipLogProgress(chipTool, " ***** Test Step 227 : Write attribute NULLABLE_INT16U null Value\n"); + err = TestWriteAttributeNullableInt16uNullValue_227(); + break; + case 228: + ChipLogProgress(chipTool, " ***** Test Step 228 : Read attribute NULLABLE_INT16U null Value\n"); + err = TestReadAttributeNullableInt16uNullValue_228(); + break; + case 229: + ChipLogProgress(chipTool, " ***** Test Step 229 : Read attribute NULLABLE_INT16U null Value & range\n"); + err = TestReadAttributeNullableInt16uNullValueRange_229(); + break; + case 230: + ChipLogProgress(chipTool, " ***** Test Step 230 : Read attribute NULLABLE_INT16U null Value & not\n"); + err = TestReadAttributeNullableInt16uNullValueNot_230(); + break; + case 231: + ChipLogProgress(chipTool, " ***** Test Step 231 : Write attribute NULLABLE_INT16U Value\n"); + err = TestWriteAttributeNullableInt16uValue_231(); + break; + case 232: + ChipLogProgress(chipTool, " ***** Test Step 232 : Read attribute NULLABLE_INT16U Value in range\n"); + err = TestReadAttributeNullableInt16uValueInRange_232(); + break; + case 233: + ChipLogProgress(chipTool, " ***** Test Step 233 : Read attribute NULLABLE_INT16U notValue OK\n"); + err = TestReadAttributeNullableInt16uNotValueOk_233(); + break; + case 234: + ChipLogProgress(chipTool, " ***** Test Step 234 : Write attribute NULLABLE_INT32U Min Value\n"); + err = TestWriteAttributeNullableInt32uMinValue_234(); + break; + case 235: + ChipLogProgress(chipTool, " ***** Test Step 235 : Read attribute NULLABLE_INT32U Min Value\n"); + err = TestReadAttributeNullableInt32uMinValue_235(); + break; + case 236: + ChipLogProgress(chipTool, " ***** Test Step 236 : Write attribute NULLABLE_INT32U Max Value\n"); + err = TestWriteAttributeNullableInt32uMaxValue_236(); + break; + case 237: + ChipLogProgress(chipTool, " ***** Test Step 237 : Read attribute NULLABLE_INT32U Max Value\n"); + err = TestReadAttributeNullableInt32uMaxValue_237(); + break; + case 238: + ChipLogProgress(chipTool, " ***** Test Step 238 : Write attribute NULLABLE_INT32U Invalid Value\n"); + err = TestWriteAttributeNullableInt32uInvalidValue_238(); + break; + case 239: + ChipLogProgress(chipTool, " ***** Test Step 239 : Read attribute NULLABLE_INT32U unchanged Value\n"); + err = TestReadAttributeNullableInt32uUnchangedValue_239(); + break; + case 240: + ChipLogProgress(chipTool, " ***** Test Step 240 : Write attribute NULLABLE_INT32U null Value\n"); + err = TestWriteAttributeNullableInt32uNullValue_240(); + break; + case 241: + ChipLogProgress(chipTool, " ***** Test Step 241 : Read attribute NULLABLE_INT32U null Value\n"); + err = TestReadAttributeNullableInt32uNullValue_241(); + break; + case 242: + ChipLogProgress(chipTool, " ***** Test Step 242 : Read attribute NULLABLE_INT32U null Value & range\n"); + err = TestReadAttributeNullableInt32uNullValueRange_242(); + break; + case 243: + ChipLogProgress(chipTool, " ***** Test Step 243 : Read attribute NULLABLE_INT32U null Value & not\n"); + err = TestReadAttributeNullableInt32uNullValueNot_243(); + break; + case 244: + ChipLogProgress(chipTool, " ***** Test Step 244 : Write attribute NULLABLE_INT32U Value\n"); + err = TestWriteAttributeNullableInt32uValue_244(); + break; + case 245: + ChipLogProgress(chipTool, " ***** Test Step 245 : Read attribute NULLABLE_INT32U Value in range\n"); + err = TestReadAttributeNullableInt32uValueInRange_245(); + break; + case 246: + ChipLogProgress(chipTool, " ***** Test Step 246 : Read attribute NULLABLE_INT32U notValue OK\n"); + err = TestReadAttributeNullableInt32uNotValueOk_246(); + break; + case 247: + ChipLogProgress(chipTool, " ***** Test Step 247 : Write attribute NULLABLE_INT64U Min Value\n"); + err = TestWriteAttributeNullableInt64uMinValue_247(); + break; + case 248: + ChipLogProgress(chipTool, " ***** Test Step 248 : Read attribute NULLABLE_INT64U Min Value\n"); + err = TestReadAttributeNullableInt64uMinValue_248(); + break; + case 249: + ChipLogProgress(chipTool, " ***** Test Step 249 : Write attribute NULLABLE_INT64U Max Value\n"); + err = TestWriteAttributeNullableInt64uMaxValue_249(); + break; + case 250: + ChipLogProgress(chipTool, " ***** Test Step 250 : Read attribute NULLABLE_INT64U Max Value\n"); + err = TestReadAttributeNullableInt64uMaxValue_250(); + break; + case 251: + ChipLogProgress(chipTool, " ***** Test Step 251 : Write attribute NULLABLE_INT64U Invalid Value\n"); + err = TestWriteAttributeNullableInt64uInvalidValue_251(); + break; + case 252: + ChipLogProgress(chipTool, " ***** Test Step 252 : Read attribute NULLABLE_INT64U unchanged Value\n"); + err = TestReadAttributeNullableInt64uUnchangedValue_252(); + break; + case 253: + ChipLogProgress(chipTool, " ***** Test Step 253 : Write attribute NULLABLE_INT64U null Value\n"); + err = TestWriteAttributeNullableInt64uNullValue_253(); + break; + case 254: + ChipLogProgress(chipTool, " ***** Test Step 254 : Read attribute NULLABLE_INT64U null Value\n"); + err = TestReadAttributeNullableInt64uNullValue_254(); + break; + case 255: + ChipLogProgress(chipTool, " ***** Test Step 255 : Read attribute NULLABLE_INT64U null Value & range\n"); + err = TestReadAttributeNullableInt64uNullValueRange_255(); + break; + case 256: + ChipLogProgress(chipTool, " ***** Test Step 256 : Read attribute NULLABLE_INT64U null Value & not\n"); + err = TestReadAttributeNullableInt64uNullValueNot_256(); + break; + case 257: + ChipLogProgress(chipTool, " ***** Test Step 257 : Write attribute NULLABLE_INT64U Value\n"); + err = TestWriteAttributeNullableInt64uValue_257(); + break; + case 258: + ChipLogProgress(chipTool, " ***** Test Step 258 : Read attribute NULLABLE_INT64U Value in range\n"); + err = TestReadAttributeNullableInt64uValueInRange_258(); + break; + case 259: + ChipLogProgress(chipTool, " ***** Test Step 259 : Read attribute NULLABLE_INT64U notValue OK\n"); + err = TestReadAttributeNullableInt64uNotValueOk_259(); + break; + case 260: + ChipLogProgress(chipTool, " ***** Test Step 260 : Write attribute NULLABLE_INT8S Min Value\n"); + err = TestWriteAttributeNullableInt8sMinValue_260(); + break; + case 261: + ChipLogProgress(chipTool, " ***** Test Step 261 : Read attribute NULLABLE_INT8S Min Value\n"); + err = TestReadAttributeNullableInt8sMinValue_261(); + break; + case 262: + ChipLogProgress(chipTool, " ***** Test Step 262 : Write attribute NULLABLE_INT8S Invalid Value\n"); + err = TestWriteAttributeNullableInt8sInvalidValue_262(); + break; + case 263: + ChipLogProgress(chipTool, " ***** Test Step 263 : Read attribute NULLABLE_INT8S unchanged Value\n"); + err = TestReadAttributeNullableInt8sUnchangedValue_263(); + break; + case 264: + ChipLogProgress(chipTool, " ***** Test Step 264 : Write attribute NULLABLE_INT8S null Value\n"); + err = TestWriteAttributeNullableInt8sNullValue_264(); + break; + case 265: + ChipLogProgress(chipTool, " ***** Test Step 265 : Read attribute NULLABLE_INT8S null Value\n"); + err = TestReadAttributeNullableInt8sNullValue_265(); + break; + case 266: + ChipLogProgress(chipTool, " ***** Test Step 266 : Read attribute NULLABLE_INT8S null Value & range\n"); + err = TestReadAttributeNullableInt8sNullValueRange_266(); + break; + case 267: + ChipLogProgress(chipTool, " ***** Test Step 267 : Read attribute NULLABLE_INT8S null Value & not\n"); + err = TestReadAttributeNullableInt8sNullValueNot_267(); + break; + case 268: + ChipLogProgress(chipTool, " ***** Test Step 268 : Write attribute NULLABLE_INT8S Value\n"); + err = TestWriteAttributeNullableInt8sValue_268(); + break; + case 269: + ChipLogProgress(chipTool, " ***** Test Step 269 : Read attribute NULLABLE_INT8S Value in range\n"); + err = TestReadAttributeNullableInt8sValueInRange_269(); + break; + case 270: + ChipLogProgress(chipTool, " ***** Test Step 270 : Read attribute NULLABLE_INT8S notValue OK\n"); + err = TestReadAttributeNullableInt8sNotValueOk_270(); + break; + case 271: + ChipLogProgress(chipTool, " ***** Test Step 271 : Write attribute NULLABLE_INT16S Min Value\n"); + err = TestWriteAttributeNullableInt16sMinValue_271(); + break; + case 272: + ChipLogProgress(chipTool, " ***** Test Step 272 : Read attribute NULLABLE_INT16S Min Value\n"); + err = TestReadAttributeNullableInt16sMinValue_272(); + break; + case 273: + ChipLogProgress(chipTool, " ***** Test Step 273 : Write attribute NULLABLE_INT16S Invalid Value\n"); + err = TestWriteAttributeNullableInt16sInvalidValue_273(); + break; + case 274: + ChipLogProgress(chipTool, " ***** Test Step 274 : Read attribute NULLABLE_INT16S unchanged Value\n"); + err = TestReadAttributeNullableInt16sUnchangedValue_274(); + break; + case 275: + ChipLogProgress(chipTool, " ***** Test Step 275 : Write attribute NULLABLE_INT16S null Value\n"); + err = TestWriteAttributeNullableInt16sNullValue_275(); + break; + case 276: + ChipLogProgress(chipTool, " ***** Test Step 276 : Read attribute NULLABLE_INT16S null Value\n"); + err = TestReadAttributeNullableInt16sNullValue_276(); + break; + case 277: + ChipLogProgress(chipTool, " ***** Test Step 277 : Read attribute NULLABLE_INT16S null Value & range\n"); + err = TestReadAttributeNullableInt16sNullValueRange_277(); + break; + case 278: + ChipLogProgress(chipTool, " ***** Test Step 278 : Read attribute NULLABLE_INT16S null Value & not\n"); + err = TestReadAttributeNullableInt16sNullValueNot_278(); + break; + case 279: + ChipLogProgress(chipTool, " ***** Test Step 279 : Write attribute NULLABLE_INT16S Value\n"); + err = TestWriteAttributeNullableInt16sValue_279(); + break; + case 280: + ChipLogProgress(chipTool, " ***** Test Step 280 : Read attribute NULLABLE_INT16S Value in range\n"); + err = TestReadAttributeNullableInt16sValueInRange_280(); + break; + case 281: + ChipLogProgress(chipTool, " ***** Test Step 281 : Read attribute NULLABLE_INT16S notValue OK\n"); + err = TestReadAttributeNullableInt16sNotValueOk_281(); + break; + case 282: + ChipLogProgress(chipTool, " ***** Test Step 282 : Write attribute NULLABLE_INT32S Min Value\n"); + err = TestWriteAttributeNullableInt32sMinValue_282(); + break; + case 283: + ChipLogProgress(chipTool, " ***** Test Step 283 : Read attribute NULLABLE_INT32S Min Value\n"); + err = TestReadAttributeNullableInt32sMinValue_283(); + break; + case 284: + ChipLogProgress(chipTool, " ***** Test Step 284 : Write attribute NULLABLE_INT32S Invalid Value\n"); + err = TestWriteAttributeNullableInt32sInvalidValue_284(); + break; + case 285: + ChipLogProgress(chipTool, " ***** Test Step 285 : Read attribute NULLABLE_INT32S unchanged Value\n"); + err = TestReadAttributeNullableInt32sUnchangedValue_285(); + break; + case 286: + ChipLogProgress(chipTool, " ***** Test Step 286 : Write attribute NULLABLE_INT32S null Value\n"); + err = TestWriteAttributeNullableInt32sNullValue_286(); + break; + case 287: + ChipLogProgress(chipTool, " ***** Test Step 287 : Read attribute NULLABLE_INT32S null Value\n"); + err = TestReadAttributeNullableInt32sNullValue_287(); + break; + case 288: + ChipLogProgress(chipTool, " ***** Test Step 288 : Read attribute NULLABLE_INT32S null Value & range\n"); + err = TestReadAttributeNullableInt32sNullValueRange_288(); + break; + case 289: + ChipLogProgress(chipTool, " ***** Test Step 289 : Read attribute NULLABLE_INT32S null Value & not\n"); + err = TestReadAttributeNullableInt32sNullValueNot_289(); + break; + case 290: + ChipLogProgress(chipTool, " ***** Test Step 290 : Write attribute NULLABLE_INT32S Value\n"); + err = TestWriteAttributeNullableInt32sValue_290(); + break; + case 291: + ChipLogProgress(chipTool, " ***** Test Step 291 : Read attribute NULLABLE_INT32S Value in range\n"); + err = TestReadAttributeNullableInt32sValueInRange_291(); + break; + case 292: + ChipLogProgress(chipTool, " ***** Test Step 292 : Read attribute NULLABLE_INT32S notValue OK\n"); + err = TestReadAttributeNullableInt32sNotValueOk_292(); + break; + case 293: + ChipLogProgress(chipTool, " ***** Test Step 293 : Write attribute NULLABLE_INT64S Min Value\n"); + err = TestWriteAttributeNullableInt64sMinValue_293(); + break; + case 294: + ChipLogProgress(chipTool, " ***** Test Step 294 : Read attribute NULLABLE_INT64S Min Value\n"); + err = TestReadAttributeNullableInt64sMinValue_294(); + break; + case 295: + ChipLogProgress(chipTool, " ***** Test Step 295 : Write attribute NULLABLE_INT64S Invalid Value\n"); + err = TestWriteAttributeNullableInt64sInvalidValue_295(); + break; + case 296: + ChipLogProgress(chipTool, " ***** Test Step 296 : Read attribute NULLABLE_INT64S unchanged Value\n"); + err = TestReadAttributeNullableInt64sUnchangedValue_296(); + break; + case 297: + ChipLogProgress(chipTool, " ***** Test Step 297 : Write attribute NULLABLE_INT64S null Value\n"); + err = TestWriteAttributeNullableInt64sNullValue_297(); + break; + case 298: + ChipLogProgress(chipTool, " ***** Test Step 298 : Read attribute NULLABLE_INT64S null Value\n"); + err = TestReadAttributeNullableInt64sNullValue_298(); + break; + case 299: + ChipLogProgress(chipTool, " ***** Test Step 299 : Read attribute NULLABLE_INT64S null Value & range\n"); + err = TestReadAttributeNullableInt64sNullValueRange_299(); + break; + case 300: + ChipLogProgress(chipTool, " ***** Test Step 300 : Read attribute NULLABLE_INT64S null Value & not\n"); + err = TestReadAttributeNullableInt64sNullValueNot_300(); + break; + case 301: + ChipLogProgress(chipTool, " ***** Test Step 301 : Write attribute NULLABLE_INT64S Value\n"); + err = TestWriteAttributeNullableInt64sValue_301(); + break; + case 302: + ChipLogProgress(chipTool, " ***** Test Step 302 : Read attribute NULLABLE_INT64S Value in range\n"); + err = TestReadAttributeNullableInt64sValueInRange_302(); + break; + case 303: + ChipLogProgress(chipTool, " ***** Test Step 303 : Read attribute NULLABLE_INT64S notValue OK\n"); + err = TestReadAttributeNullableInt64sNotValueOk_303(); + break; + case 304: + ChipLogProgress(chipTool, " ***** Test Step 304 : Write attribute NULLABLE_SINGLE medium Value\n"); + err = TestWriteAttributeNullableSingleMediumValue_304(); + break; + case 305: + ChipLogProgress(chipTool, " ***** Test Step 305 : Read attribute NULLABLE_SINGLE medium Value\n"); + err = TestReadAttributeNullableSingleMediumValue_305(); + break; + case 306: + ChipLogProgress(chipTool, " ***** Test Step 306 : Write attribute NULLABLE_SINGLE largest Value\n"); + err = TestWriteAttributeNullableSingleLargestValue_306(); + break; + case 307: + ChipLogProgress(chipTool, " ***** Test Step 307 : Read attribute NULLABLE_SINGLE largest Value\n"); + err = TestReadAttributeNullableSingleLargestValue_307(); + break; + case 308: + ChipLogProgress(chipTool, " ***** Test Step 308 : Write attribute NULLABLE_SINGLE smallest Value\n"); + err = TestWriteAttributeNullableSingleSmallestValue_308(); + break; + case 309: + ChipLogProgress(chipTool, " ***** Test Step 309 : Read attribute NULLABLE_SINGLE smallest Value\n"); + err = TestReadAttributeNullableSingleSmallestValue_309(); + break; + case 310: + ChipLogProgress(chipTool, " ***** Test Step 310 : Write attribute NULLABLE_SINGLE null Value\n"); + err = TestWriteAttributeNullableSingleNullValue_310(); + break; + case 311: + ChipLogProgress(chipTool, " ***** Test Step 311 : Read attribute NULLABLE_SINGLE null Value\n"); + err = TestReadAttributeNullableSingleNullValue_311(); + break; + case 312: + ChipLogProgress(chipTool, " ***** Test Step 312 : Write attribute NULLABLE_SINGLE 0 Value\n"); + err = TestWriteAttributeNullableSingle0Value_312(); + break; + case 313: + ChipLogProgress(chipTool, " ***** Test Step 313 : Read attribute NULLABLE_SINGLE 0 Value\n"); + err = TestReadAttributeNullableSingle0Value_313(); + break; + case 314: + ChipLogProgress(chipTool, " ***** Test Step 314 : Write attribute NULLABLE_DOUBLE medium Value\n"); + err = TestWriteAttributeNullableDoubleMediumValue_314(); + break; + case 315: + ChipLogProgress(chipTool, " ***** Test Step 315 : Read attribute NULLABLE_DOUBLE medium Value\n"); + err = TestReadAttributeNullableDoubleMediumValue_315(); + break; + case 316: + ChipLogProgress(chipTool, " ***** Test Step 316 : Write attribute NULLABLE_DOUBLE largest Value\n"); + err = TestWriteAttributeNullableDoubleLargestValue_316(); + break; + case 317: + ChipLogProgress(chipTool, " ***** Test Step 317 : Read attribute NULLABLE_DOUBLE largest Value\n"); + err = TestReadAttributeNullableDoubleLargestValue_317(); + break; + case 318: + ChipLogProgress(chipTool, " ***** Test Step 318 : Write attribute NULLABLE_DOUBLE smallest Value\n"); + err = TestWriteAttributeNullableDoubleSmallestValue_318(); + break; + case 319: + ChipLogProgress(chipTool, " ***** Test Step 319 : Read attribute NULLABLE_DOUBLE smallest Value\n"); + err = TestReadAttributeNullableDoubleSmallestValue_319(); + break; + case 320: + ChipLogProgress(chipTool, " ***** Test Step 320 : Write attribute NULLABLE_DOUBLE null Value\n"); + err = TestWriteAttributeNullableDoubleNullValue_320(); + break; + case 321: + ChipLogProgress(chipTool, " ***** Test Step 321 : Read attribute NULLABLE_DOUBLE null Value\n"); + err = TestReadAttributeNullableDoubleNullValue_321(); + break; + case 322: + ChipLogProgress(chipTool, " ***** Test Step 322 : Write attribute NULLABLE_DOUBLE 0 Value\n"); + err = TestWriteAttributeNullableDouble0Value_322(); + break; + case 323: + ChipLogProgress(chipTool, " ***** Test Step 323 : Read attribute NULLABLE_DOUBLE 0 Value\n"); + err = TestReadAttributeNullableDouble0Value_323(); + break; + case 324: + ChipLogProgress(chipTool, " ***** Test Step 324 : Write attribute NULLABLE_ENUM8 Min Value\n"); + err = TestWriteAttributeNullableEnum8MinValue_324(); + break; + case 325: + ChipLogProgress(chipTool, " ***** Test Step 325 : Read attribute NULLABLE_ENUM8 Min Value\n"); + err = TestReadAttributeNullableEnum8MinValue_325(); + break; + case 326: + ChipLogProgress(chipTool, " ***** Test Step 326 : Write attribute NULLABLE_ENUM8 Max Value\n"); + err = TestWriteAttributeNullableEnum8MaxValue_326(); + break; + case 327: + ChipLogProgress(chipTool, " ***** Test Step 327 : Read attribute NULLABLE_ENUM8 Max Value\n"); + err = TestReadAttributeNullableEnum8MaxValue_327(); + break; + case 328: + ChipLogProgress(chipTool, " ***** Test Step 328 : Write attribute NULLABLE_ENUM8 Invalid Value\n"); + err = TestWriteAttributeNullableEnum8InvalidValue_328(); + break; + case 329: + ChipLogProgress(chipTool, " ***** Test Step 329 : Read attribute NULLABLE_ENUM8 unchanged Value\n"); + err = TestReadAttributeNullableEnum8UnchangedValue_329(); + break; + case 330: + ChipLogProgress(chipTool, " ***** Test Step 330 : Write attribute NULLABLE_ENUM8 null Value\n"); + err = TestWriteAttributeNullableEnum8NullValue_330(); + break; + case 331: + ChipLogProgress(chipTool, " ***** Test Step 331 : Read attribute NULLABLE_ENUM8 null Value\n"); + err = TestReadAttributeNullableEnum8NullValue_331(); + break; + case 332: + ChipLogProgress(chipTool, " ***** Test Step 332 : Write attribute NULLABLE_ENUM16 Min Value\n"); + err = TestWriteAttributeNullableEnum16MinValue_332(); + break; + case 333: + ChipLogProgress(chipTool, " ***** Test Step 333 : Read attribute NULLABLE_ENUM16 Min Value\n"); + err = TestReadAttributeNullableEnum16MinValue_333(); + break; + case 334: + ChipLogProgress(chipTool, " ***** Test Step 334 : Write attribute NULLABLE_ENUM16 Max Value\n"); + err = TestWriteAttributeNullableEnum16MaxValue_334(); + break; + case 335: + ChipLogProgress(chipTool, " ***** Test Step 335 : Read attribute NULLABLE_ENUM16 Max Value\n"); + err = TestReadAttributeNullableEnum16MaxValue_335(); + break; + case 336: + ChipLogProgress(chipTool, " ***** Test Step 336 : Write attribute NULLABLE_ENUM16 Invalid Value\n"); + err = TestWriteAttributeNullableEnum16InvalidValue_336(); + break; + case 337: + ChipLogProgress(chipTool, " ***** Test Step 337 : Read attribute NULLABLE_ENUM16 unchanged Value\n"); + err = TestReadAttributeNullableEnum16UnchangedValue_337(); + break; + case 338: + ChipLogProgress(chipTool, " ***** Test Step 338 : Write attribute NULLABLE_ENUM16 null Value\n"); + err = TestWriteAttributeNullableEnum16NullValue_338(); + break; + case 339: + ChipLogProgress(chipTool, " ***** Test Step 339 : Read attribute NULLABLE_ENUM16 null Value\n"); + err = TestReadAttributeNullableEnum16NullValue_339(); + break; + case 340: + ChipLogProgress(chipTool, " ***** Test Step 340 : Write attribute NULLABLE_SIMPLE_ENUM Min Value\n"); + err = TestWriteAttributeNullableSimpleEnumMinValue_340(); + break; + case 341: + ChipLogProgress(chipTool, " ***** Test Step 341 : Read attribute NULLABLE_SIMPLE_ENUM Min Value\n"); + err = TestReadAttributeNullableSimpleEnumMinValue_341(); + break; + case 342: + ChipLogProgress(chipTool, " ***** Test Step 342 : Write attribute NULLABLE_SIMPLE_ENUM Max Value\n"); + err = TestWriteAttributeNullableSimpleEnumMaxValue_342(); + break; + case 343: + ChipLogProgress(chipTool, " ***** Test Step 343 : Read attribute NULLABLE_SIMPLE_ENUM Max Value\n"); + err = TestReadAttributeNullableSimpleEnumMaxValue_343(); + break; + case 344: + ChipLogProgress(chipTool, " ***** Test Step 344 : Write attribute NULLABLE_SIMPLE_ENUM Invalid Value\n"); + err = TestWriteAttributeNullableSimpleEnumInvalidValue_344(); + break; + case 345: + ChipLogProgress(chipTool, " ***** Test Step 345 : Read attribute NULLABLE_SIMPLE_ENUM unchanged Value\n"); + err = TestReadAttributeNullableSimpleEnumUnchangedValue_345(); + break; + case 346: + ChipLogProgress(chipTool, " ***** Test Step 346 : Write attribute NULLABLE_SIMPLE_ENUM null Value\n"); + err = TestWriteAttributeNullableSimpleEnumNullValue_346(); + break; + case 347: + ChipLogProgress(chipTool, " ***** Test Step 347 : Read attribute NULLABLE_SIMPLE_ENUM null Value\n"); + err = TestReadAttributeNullableSimpleEnumNullValue_347(); + break; + case 348: + ChipLogProgress(chipTool, " ***** Test Step 348 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); + err = TestReadAttributeNullableOctetStringDefaultValue_348(); + break; + case 349: + ChipLogProgress(chipTool, " ***** Test Step 349 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_349(); + break; + case 350: + ChipLogProgress(chipTool, " ***** Test Step 350 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_350(); + break; + case 351: + ChipLogProgress(chipTool, " ***** Test Step 351 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_351(); + break; + case 352: + ChipLogProgress(chipTool, " ***** Test Step 352 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_352(); + break; + case 353: + ChipLogProgress(chipTool, " ***** Test Step 353 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_353(); + break; + case 354: + ChipLogProgress(chipTool, " ***** Test Step 354 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_354(); + break; + case 355: + ChipLogProgress(chipTool, " ***** Test Step 355 : Read attribute NULLABLE_CHAR_STRING Default Value\n"); + err = TestReadAttributeNullableCharStringDefaultValue_355(); + break; + case 356: + ChipLogProgress(chipTool, " ***** Test Step 356 : Write attribute NULLABLE_CHAR_STRING\n"); + err = TestWriteAttributeNullableCharString_356(); + break; + case 357: + ChipLogProgress(chipTool, " ***** Test Step 357 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_357(); + break; + case 358: + ChipLogProgress(chipTool, " ***** Test Step 358 : Write attribute NULLABLE_CHAR_STRING - Value too long\n"); + err = TestWriteAttributeNullableCharStringValueTooLong_358(); + break; + case 359: + ChipLogProgress(chipTool, " ***** Test Step 359 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_359(); + break; + case 360: + ChipLogProgress(chipTool, " ***** Test Step 360 : Write attribute NULLABLE_CHAR_STRING - Empty\n"); + err = TestWriteAttributeNullableCharStringEmpty_360(); + break; + case 361: + ChipLogProgress(chipTool, " ***** Test Step 361 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_361(); + break; + case 362: + ChipLogProgress(chipTool, " ***** Test Step 362 : Read attribute from nonexistent endpoint.\n"); + err = TestReadAttributeFromNonexistentEndpoint_362(); + break; + case 363: + ChipLogProgress(chipTool, " ***** Test Step 363 : Read attribute from nonexistent cluster.\n"); + err = TestReadAttributeFromNonexistentCluster_363(); + break; + case 364: + ChipLogProgress( + chipTool, " ***** Test Step 364 : Send a command that takes an optional parameter but do not set it.\n"); + err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_364(); + break; + case 365: + ChipLogProgress( + chipTool, " ***** Test Step 365 : Send a command that takes an optional parameter but do not set it.\n"); + err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_365(); + break; + case 366: + ChipLogProgress(chipTool, " ***** Test Step 366 : Report: Subscribe to list attribute\n"); + err = TestReportSubscribeToListAttribute_366(); + break; + case 367: + ChipLogProgress(chipTool, " ***** Test Step 367 : Subscribe to list attribute\n"); + err = TestSubscribeToListAttribute_367(); + break; + case 368: + ChipLogProgress(chipTool, " ***** Test Step 368 : Write subscribed-to list attribute\n"); + err = TestWriteSubscribedToListAttribute_368(); + break; + case 369: + ChipLogProgress(chipTool, " ***** Test Step 369 : Check for list attribute report\n"); + err = TestCheckForListAttributeReport_369(); + break; + case 370: + ChipLogProgress(chipTool, " ***** Test Step 370 : Read range-restricted unsigned 8-bit integer\n"); + err = TestReadRangeRestrictedUnsigned8BitInteger_370(); + break; + case 371: + ChipLogProgress(chipTool, " ***** Test Step 371 : Write min value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371(); + break; + case 372: + ChipLogProgress( + chipTool, " ***** Test Step 372 : Write just-below-range value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_372(); + break; + case 373: + ChipLogProgress( + chipTool, " ***** Test Step 373 : Write just-above-range value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_373(); + break; + case 374: + ChipLogProgress(chipTool, " ***** Test Step 374 : Write max value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374(); + break; + case 375: + ChipLogProgress( + chipTool, " ***** Test Step 375 : Verify range-restricted unsigned 8-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375(); + break; + case 376: + ChipLogProgress( + chipTool, " ***** Test Step 376 : Write min valid value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376(); + break; + case 377: + ChipLogProgress( + chipTool, " ***** Test Step 377 : Verify range-restricted unsigned 8-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377(); + break; + case 378: + ChipLogProgress( + chipTool, " ***** Test Step 378 : Write max valid value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378(); + break; + case 379: + ChipLogProgress( + chipTool, " ***** Test Step 379 : Verify range-restricted unsigned 8-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379(); + break; + case 380: + ChipLogProgress( + chipTool, " ***** Test Step 380 : Write middle valid value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380(); + break; + case 381: + ChipLogProgress( + chipTool, " ***** Test Step 381 : Verify range-restricted unsigned 8-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381(); + break; + case 382: + ChipLogProgress(chipTool, " ***** Test Step 382 : Read range-restricted unsigned 16-bit integer\n"); + err = TestReadRangeRestrictedUnsigned16BitInteger_382(); + break; + case 383: + ChipLogProgress(chipTool, " ***** Test Step 383 : Write min value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383(); + break; + case 384: + ChipLogProgress( + chipTool, " ***** Test Step 384 : Write just-below-range value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_384(); + break; + case 385: + ChipLogProgress( + chipTool, " ***** Test Step 385 : Write just-above-range value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_385(); + break; + case 386: + ChipLogProgress(chipTool, " ***** Test Step 386 : Write max value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386(); + break; + case 387: + ChipLogProgress( + chipTool, " ***** Test Step 387 : Verify range-restricted unsigned 16-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387(); + break; + case 388: + ChipLogProgress( + chipTool, " ***** Test Step 388 : Write min valid value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388(); + break; + case 389: + ChipLogProgress( + chipTool, " ***** Test Step 389 : Verify range-restricted unsigned 16-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389(); + break; + case 390: + ChipLogProgress( + chipTool, " ***** Test Step 390 : Write max valid value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390(); + break; + case 391: + ChipLogProgress( + chipTool, " ***** Test Step 391 : Verify range-restricted unsigned 16-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391(); + break; + case 392: + ChipLogProgress( + chipTool, " ***** Test Step 392 : Write middle valid value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392(); + break; + case 393: + ChipLogProgress( + chipTool, " ***** Test Step 393 : Verify range-restricted unsigned 16-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393(); + break; + case 394: + ChipLogProgress(chipTool, " ***** Test Step 394 : Read range-restricted signed 8-bit integer\n"); + err = TestReadRangeRestrictedSigned8BitInteger_394(); + break; + case 395: + ChipLogProgress(chipTool, " ***** Test Step 395 : Write min value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedSigned8BitInteger_395(); + break; + case 396: + ChipLogProgress( + chipTool, " ***** Test Step 396 : Write just-below-range value to a range-restricted signed 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_396(); + break; + case 397: + ChipLogProgress( + chipTool, " ***** Test Step 397 : Write just-above-range value to a range-restricted signed 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_397(); + break; + case 398: + ChipLogProgress(chipTool, " ***** Test Step 398 : Write max value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398(); + break; + case 399: + ChipLogProgress( + chipTool, " ***** Test Step 399 : Verify range-restricted signed 8-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399(); + break; + case 400: + ChipLogProgress(chipTool, " ***** Test Step 400 : Write min valid value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400(); + break; + case 401: + ChipLogProgress( + chipTool, " ***** Test Step 401 : Verify range-restricted signed 8-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401(); + break; + case 402: + ChipLogProgress(chipTool, " ***** Test Step 402 : Write max valid value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402(); + break; + case 403: + ChipLogProgress( + chipTool, " ***** Test Step 403 : Verify range-restricted signed 8-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403(); + break; + case 404: + ChipLogProgress( + chipTool, " ***** Test Step 404 : Write middle valid value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404(); + break; + case 405: + ChipLogProgress( + chipTool, " ***** Test Step 405 : Verify range-restricted signed 8-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405(); + break; + case 406: + ChipLogProgress(chipTool, " ***** Test Step 406 : Read range-restricted signed 16-bit integer\n"); + err = TestReadRangeRestrictedSigned16BitInteger_406(); + break; + case 407: + ChipLogProgress(chipTool, " ***** Test Step 407 : Write min value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedSigned16BitInteger_407(); + break; + case 408: + ChipLogProgress( + chipTool, " ***** Test Step 408 : Write just-below-range value to a range-restricted signed 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_408(); + break; + case 409: + ChipLogProgress( + chipTool, " ***** Test Step 409 : Write just-above-range value to a range-restricted signed 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_409(); + break; + case 410: + ChipLogProgress(chipTool, " ***** Test Step 410 : Write max value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410(); + break; + case 411: + ChipLogProgress( + chipTool, " ***** Test Step 411 : Verify range-restricted signed 16-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411(); + break; + case 412: + ChipLogProgress(chipTool, " ***** Test Step 412 : Write min valid value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412(); + break; + case 413: + ChipLogProgress( + chipTool, " ***** Test Step 413 : Verify range-restricted signed 16-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413(); + break; + case 414: + ChipLogProgress(chipTool, " ***** Test Step 414 : Write max valid value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414(); + break; + case 415: + ChipLogProgress( + chipTool, " ***** Test Step 415 : Verify range-restricted signed 16-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415(); + break; + case 416: + ChipLogProgress( + chipTool, " ***** Test Step 416 : Write middle valid value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416(); + break; + case 417: + ChipLogProgress( + chipTool, " ***** Test Step 417 : Verify range-restricted signed 16-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417(); + break; + case 418: + ChipLogProgress(chipTool, " ***** Test Step 418 : Read nullable range-restricted unsigned 8-bit integer\n"); + err = TestReadNullableRangeRestrictedUnsigned8BitInteger_418(); + break; + case 419: + ChipLogProgress( + chipTool, " ***** Test Step 419 : Write min value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419(); + break; + case 420: + ChipLogProgress(chipTool, + " ***** Test Step 420 : Write just-below-range value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_420(); + break; + case 421: + ChipLogProgress(chipTool, + " ***** Test Step 421 : Write just-above-range value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_421(); + break; + case 422: + ChipLogProgress( + chipTool, " ***** Test Step 422 : Write max value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422(); + break; + case 423: + ChipLogProgress( + chipTool, " ***** Test Step 423 : Verify nullable range-restricted unsigned 8-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423(); + break; + case 424: + ChipLogProgress( + chipTool, " ***** Test Step 424 : Write min valid value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_424(); + break; + case 425: + ChipLogProgress( + chipTool, " ***** Test Step 425 : Verify nullable range-restricted unsigned 8-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_425(); + break; + case 426: + ChipLogProgress( + chipTool, " ***** Test Step 426 : Write max valid value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_426(); + break; + case 427: + ChipLogProgress( + chipTool, " ***** Test Step 427 : Verify nullable range-restricted unsigned 8-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_427(); + break; + case 428: + ChipLogProgress(chipTool, + " ***** Test Step 428 : Write middle valid value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_428(); + break; + case 429: + ChipLogProgress( + chipTool, " ***** Test Step 429 : Verify nullable range-restricted unsigned 8-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_429(); + break; + case 430: + ChipLogProgress( + chipTool, " ***** Test Step 430 : Write null value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430(); + break; + case 431: + ChipLogProgress( + chipTool, " ***** Test Step 431 : Verify nullable range-restricted unsigned 8-bit integer value is null\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431(); + break; + case 432: + ChipLogProgress(chipTool, " ***** Test Step 432 : Read nullable range-restricted unsigned 16-bit integer\n"); + err = TestReadNullableRangeRestrictedUnsigned16BitInteger_432(); + break; + case 433: + ChipLogProgress( + chipTool, " ***** Test Step 433 : Write min value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433(); + break; + case 434: + ChipLogProgress(chipTool, + " ***** Test Step 434 : Write just-below-range value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_434(); + break; + case 435: + ChipLogProgress(chipTool, + " ***** Test Step 435 : Write just-above-range value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_435(); + break; + case 436: + ChipLogProgress( + chipTool, " ***** Test Step 436 : Write max value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436(); + break; + case 437: + ChipLogProgress(chipTool, + " ***** Test Step 437 : Verify nullable range-restricted unsigned 16-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437(); + break; + case 438: + ChipLogProgress( + chipTool, " ***** Test Step 438 : Write min valid value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_438(); + break; + case 439: + ChipLogProgress(chipTool, + " ***** Test Step 439 : Verify nullable range-restricted unsigned 16-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_439(); + break; + case 440: + ChipLogProgress( + chipTool, " ***** Test Step 440 : Write max valid value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_440(); + break; + case 441: + ChipLogProgress(chipTool, + " ***** Test Step 441 : Verify nullable range-restricted unsigned 16-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_441(); + break; + case 442: + ChipLogProgress(chipTool, + " ***** Test Step 442 : Write middle valid value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_442(); + break; + case 443: + ChipLogProgress(chipTool, + " ***** Test Step 443 : Verify nullable range-restricted unsigned 16-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_443(); + break; + case 444: + ChipLogProgress( + chipTool, " ***** Test Step 444 : Write null value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444(); + break; + case 445: + ChipLogProgress( + chipTool, " ***** Test Step 445 : Verify nullable range-restricted unsigned 16-bit integer value is null\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445(); + break; + case 446: + ChipLogProgress(chipTool, " ***** Test Step 446 : Read nullable range-restricted signed 8-bit integer\n"); + err = TestReadNullableRangeRestrictedSigned8BitInteger_446(); + break; + case 447: + ChipLogProgress( + chipTool, " ***** Test Step 447 : Write min value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447(); + break; + case 448: + ChipLogProgress(chipTool, + " ***** Test Step 448 : Write just-below-range value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_448(); + break; + case 449: + ChipLogProgress(chipTool, + " ***** Test Step 449 : Write just-above-range value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_449(); + break; + case 450: + ChipLogProgress( + chipTool, " ***** Test Step 450 : Write max value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450(); + break; + case 451: + ChipLogProgress( + chipTool, " ***** Test Step 451 : Verify nullable range-restricted signed 8-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451(); + break; + case 452: + ChipLogProgress( + chipTool, " ***** Test Step 452 : Write min valid value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_452(); + break; + case 453: + ChipLogProgress( + chipTool, " ***** Test Step 453 : Verify nullable range-restricted signed 8-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_453(); + break; + case 454: + ChipLogProgress( + chipTool, " ***** Test Step 454 : Write max valid value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_454(); + break; + case 455: + ChipLogProgress( + chipTool, " ***** Test Step 455 : Verify nullable range-restricted signed 8-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_455(); + break; + case 456: + ChipLogProgress( + chipTool, " ***** Test Step 456 : Write middle valid value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_456(); + break; + case 457: + ChipLogProgress( + chipTool, " ***** Test Step 457 : Verify nullable range-restricted signed 8-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_457(); + break; + case 458: + ChipLogProgress( + chipTool, " ***** Test Step 458 : Write null value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458(); + break; + case 459: + ChipLogProgress( + chipTool, " ***** Test Step 459 : Verify nullable range-restricted signed 8-bit integer value is at null\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459(); + break; + case 460: + ChipLogProgress(chipTool, " ***** Test Step 460 : Read nullable range-restricted signed 16-bit integer\n"); + err = TestReadNullableRangeRestrictedSigned16BitInteger_460(); + break; + case 461: + ChipLogProgress( + chipTool, " ***** Test Step 461 : Write min value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461(); + break; + case 462: + ChipLogProgress(chipTool, + " ***** Test Step 462 : Write just-below-range value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_462(); + break; + case 463: + ChipLogProgress(chipTool, + " ***** Test Step 463 : Write just-above-range value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_463(); + break; + case 464: + ChipLogProgress( + chipTool, " ***** Test Step 464 : Write max value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464(); + break; + case 465: + ChipLogProgress( + chipTool, " ***** Test Step 465 : Verify nullable range-restricted signed 16-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465(); + break; + case 466: + ChipLogProgress( + chipTool, " ***** Test Step 466 : Write min valid value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_466(); + break; + case 467: + ChipLogProgress( + chipTool, " ***** Test Step 467 : Verify nullable range-restricted signed 16-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_467(); + break; + case 468: + ChipLogProgress( + chipTool, " ***** Test Step 468 : Write max valid value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_468(); + break; + case 469: + ChipLogProgress( + chipTool, " ***** Test Step 469 : Verify nullable range-restricted signed 16-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_469(); + break; + case 470: + ChipLogProgress( + chipTool, " ***** Test Step 470 : Write middle valid value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_470(); + break; + case 471: + ChipLogProgress( + chipTool, " ***** Test Step 471 : Verify nullable range-restricted signed 16-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_471(); + break; + case 472: + ChipLogProgress( + chipTool, " ***** Test Step 472 : Write null value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472(); + break; + case 473: + ChipLogProgress( + chipTool, " ***** Test Step 473 : Verify nullable range-restricted signed 16-bit integer value is null\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473(); + break; + case 474: + ChipLogProgress(chipTool, " ***** Test Step 474 : Write attribute that returns general status on write\n"); + err = TestWriteAttributeThatReturnsGeneralStatusOnWrite_474(); + break; + case 475: + ChipLogProgress(chipTool, " ***** Test Step 475 : Write attribute that returns cluster-specific status on write\n"); + err = TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475(); + break; + case 476: + ChipLogProgress(chipTool, " ***** Test Step 476 : Read attribute that returns general status on read\n"); + err = TestReadAttributeThatReturnsGeneralStatusOnRead_476(); + break; + case 477: + ChipLogProgress(chipTool, " ***** Test Step 477 : read attribute that returns cluster-specific status on read\n"); + err = TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477(); + break; + case 478: + ChipLogProgress(chipTool, " ***** Test Step 478 : read AcceptedCommandList attribute\n"); + err = TestReadAcceptedCommandListAttribute_478(); + break; + case 479: + ChipLogProgress(chipTool, " ***** Test Step 479 : read GeneratedCommandList attribute\n"); + err = TestReadGeneratedCommandListAttribute_479(); + break; + case 480: + ChipLogProgress(chipTool, " ***** Test Step 480 : Write struct-typed attribute\n"); + err = TestWriteStructTypedAttribute_480(); + break; + case 481: + ChipLogProgress(chipTool, " ***** Test Step 481 : Read struct-typed attribute\n"); + err = TestReadStructTypedAttribute_481(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 482; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestCommand_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster testWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Test Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestNotHandledCommand_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster testNotHandledWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Test Not Handled Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestSpecificCommand_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster testSpecificWithCompletionHandler:^( + CHIPTestClusterClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Specific Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.returnValue; + VerifyOrReturn(CheckValue("returnValue", actualValue, 7)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestAddArgumentsCommand_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:3]; + params.arg2 = [NSNumber numberWithUnsignedChar:17]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Add Arguments Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.returnValue; + VerifyOrReturn(CheckValue("returnValue", actualValue, 20)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendFailingTestAddArgumentsCommand_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:250]; + params.arg2 = [NSNumber numberWithUnsignedChar:6]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send failing Test Add Arguments Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBooleanDefaultValue_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBooleanTrue_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id booleanArgument; + booleanArgument = [NSNumber numberWithBool:1]; + [cluster writeAttributeBooleanWithValue:booleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BOOLEAN True Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBooleanTrue_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN True Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBooleanFalse_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id booleanArgument; + booleanArgument = [NSNumber numberWithBool:0]; + [cluster writeAttributeBooleanWithValue:booleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BOOLEAN False Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBooleanFalse_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN False Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap8MaxValue_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap8Argument; + bitmap8Argument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP8 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap8MaxValue_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, 255)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap8MinValue_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap8Argument; + bitmap8Argument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP8 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap8MinValue_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_16() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap16MaxValue_17() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap16Argument; + bitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP16 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap16MaxValue_18() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap16MinValue_19() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap16Argument; + bitmap16Argument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP16 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap16MinValue_20() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap32MaxValue_22() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap32Argument; + bitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32MaxValue_23() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 4294967295UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap32MinValue_24() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap32Argument; + bitmap32Argument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32MinValue_25() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap64MaxValue_27() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap64Argument; + bitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP64 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap64MaxValue_28() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap64", actualValue, 18446744073709551615ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap64MinValue_29() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap64Argument; + bitmap64Argument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP64 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap64MinValue_30() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8uDefaultValue_31() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8uMaxValue_32() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8uArgument; + int8uArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeInt8uWithValue:int8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8uMaxValue_33() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, 255)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8uMinValue_34() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8uArgument; + int8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeInt8uWithValue:int8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8uMinValue_35() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16uDefaultValue_36() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16uMaxValue_37() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int16uArgument; + int16uArgument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeInt16uWithValue:int16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16uMaxValue_38() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16u", actualValue, 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16uMinValue_39() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int16uArgument; + int16uArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeInt16uWithValue:int16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16uMinValue_40() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt32uDefaultValue_41() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt32uMaxValue_42() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt32uMaxValue_43() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int32u", actualValue, 4294967295UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt32uMinValue_44() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt32uMinValue_45() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt64uDefaultValue_46() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt64uMaxValue_47() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int64uArgument; + int64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeInt64uWithValue:int64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt64uMaxValue_48() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int64u", actualValue, 18446744073709551615ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt64uMinValue_49() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int64uArgument; + int64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeInt64uWithValue:int64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt64uMinValue_50() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8sDefaultValue_51() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8s", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8sMaxValue_52() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8sArgument; + int8sArgument = [NSNumber numberWithChar:127]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8sMaxValue_53() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8s", actualValue, 127)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8sMinValue_54() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8sArgument; + int8sArgument = [NSNumber numberWithChar:-128]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8sMinValue_55() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8s", actualValue, -128)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt8sDefaultValue_56() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8sArgument; + int8sArgument = [NSNumber numberWithChar:0]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt8sDefaultValue_57() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8s", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16s", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16sMaxValue_59() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int16sArgument; + int16sArgument = [NSNumber numberWithShort:32767]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Max Value Error: %@", err); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestReadAttributeInt16sMaxValue_60() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 482; + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Max Value Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16s", actualValue, 32767)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeInt16sMinValue_61() { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int16sArgument; + int16sArgument = [NSNumber numberWithShort:-32768]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommand_1() + CHIP_ERROR TestReadAttributeInt16sMinValue_62() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Command Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("int16s", actualValue, -32768)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestNotHandledCommand_2() + CHIP_ERROR TestWriteAttributeInt16sDefaultValue_63() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testNotHandledWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Not Handled Command Error: %@", err); + id int16sArgument; + int16sArgument = [NSNumber numberWithShort:0]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestSpecificCommand_3() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_64() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testSpecificWithCompletionHandler:^( - CHIPTestClusterClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Specific Command Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { - id actualValue = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, 7)); + id actualValue = value; + VerifyOrReturn(CheckValue("int16s", actualValue, 0)); } NextTest(); @@ -49714,68 +57399,62 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestAddArgumentsCommand_4() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_65() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [NSNumber numberWithUnsignedChar:17]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, 20)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendFailingTestAddArgumentsCommand_5() + CHIP_ERROR TestWriteAttributeInt32sMaxValue_66() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:250]; - params.arg2 = [NSNumber numberWithUnsignedChar:6]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send failing Test Add Arguments Command Error: %@", err); + id int32sArgument; + int32sArgument = [NSNumber numberWithInt:2147483647L]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanDefaultValue_6() + CHIP_ERROR TestReadAttributeInt32sMaxValue_67() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + VerifyOrReturn(CheckValue("int32s", actualValue, 2147483647L)); } NextTest(); @@ -49784,40 +57463,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanTrue_7() + CHIP_ERROR TestWriteAttributeInt32sMinValue_68() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id booleanArgument; - booleanArgument = [NSNumber numberWithBool:1]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN True Error: %@", err); + id int32sArgument; + int32sArgument = [NSNumber numberWithInt:-2147483648L]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanTrue_8() + CHIP_ERROR TestReadAttributeInt32sMinValue_69() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN True Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, 1)); + VerifyOrReturn(CheckValue("int32s", actualValue, -2147483648L)); } NextTest(); @@ -49826,40 +57505,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanFalse_9() + CHIP_ERROR TestWriteAttributeInt32sDefaultValue_70() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id booleanArgument; - booleanArgument = [NSNumber numberWithBool:0]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN False Error: %@", err); + id int32sArgument; + int32sArgument = [NSNumber numberWithInt:0L]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanFalse_10() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_71() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN False Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); } NextTest(); @@ -49868,20 +57547,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_11() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_72() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); } NextTest(); @@ -49890,40 +57569,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8MaxValue_12() + CHIP_ERROR TestWriteAttributeInt64sMaxValue_73() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap8Argument; - bitmap8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Max Value Error: %@", err); + id int64sArgument; + int64sArgument = [NSNumber numberWithLongLong:9223372036854775807LL]; + [cluster writeAttributeInt64sWithValue:int64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64S Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8MaxValue_13() + CHIP_ERROR TestReadAttributeInt64sMaxValue_74() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Max Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, 255)); + VerifyOrReturn(CheckValue("int64s", actualValue, 9223372036854775807LL)); } NextTest(); @@ -49932,40 +57611,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8MinValue_14() + CHIP_ERROR TestWriteAttributeInt64sMinValue_75() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap8Argument; - bitmap8Argument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Min Value Error: %@", err); + id int64sArgument; + int64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; + [cluster writeAttributeInt64sWithValue:int64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8MinValue_15() + CHIP_ERROR TestReadAttributeInt64sMinValue_76() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Min Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + VerifyOrReturn(CheckValue("int64s", actualValue, -9223372036854775807LL)); } NextTest(); @@ -49974,62 +57653,62 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_16() + CHIP_ERROR TestWriteAttributeInt64sDefaultValue_77() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id int64sArgument; + int64sArgument = [NSNumber numberWithLongLong:0LL]; + [cluster writeAttributeInt64sWithValue:int64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64S Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16MaxValue_17() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_78() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap16Argument; - bitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Max Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16MaxValue_18() + CHIP_ERROR TestReadAttributeSingleDefaultValue_79() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Max Value Error: %@", err); + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, 65535U)); + VerifyOrReturn(CheckValue("float_single", actualValue, 0.0f)); } NextTest(); @@ -50038,40 +57717,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16MinValue_19() + CHIP_ERROR TestWriteAttributeSingleMediumValue_80() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap16Argument; - bitmap16Argument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Min Value Error: %@", err); + id floatSingleArgument; + floatSingleArgument = [NSNumber numberWithFloat:0.1f]; + [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute SINGLE medium Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16MinValue_20() + CHIP_ERROR TestReadAttributeSingleMediumValue_81() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Min Value Error: %@", err); + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE medium Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + VerifyOrReturn(CheckValue("float_single", actualValue, 0.1f)); } NextTest(); @@ -50080,20 +57759,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_21() + CHIP_ERROR TestWriteAttributeSingleLargeValue_82() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); + id floatSingleArgument; + floatSingleArgument = [NSNumber numberWithFloat:17000000000.0f]; + [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute SINGLE large Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeSingleLargeValue_83() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE large Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + VerifyOrReturn(CheckValue("float_single", actualValue, 17000000000.0f)); } NextTest(); @@ -50102,40 +57801,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32MaxValue_22() + CHIP_ERROR TestWriteAttributeSingleSmallValue_84() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap32Argument; - bitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Max Value Error: %@", err); + id floatSingleArgument; + floatSingleArgument = [NSNumber numberWithFloat:1.7e-10f]; + [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute SINGLE small Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32MaxValue_23() + CHIP_ERROR TestReadAttributeSingleSmallValue_85() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Max Value Error: %@", err); + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE small Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, 4294967295UL)); + VerifyOrReturn(CheckValue("float_single", actualValue, 1.7e-10f)); } NextTest(); @@ -50144,40 +57843,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32MinValue_24() + CHIP_ERROR TestWriteAttributeSingleDefaultValue_86() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap32Argument; - bitmap32Argument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Min Value Error: %@", err); + id floatSingleArgument; + floatSingleArgument = [NSNumber numberWithFloat:0.0f]; + [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute SINGLE Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32MinValue_25() + CHIP_ERROR TestReadAttributeSingleDefaultValue_87() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Min Value Error: %@", err); + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute SINGLE Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + VerifyOrReturn(CheckValue("float_single", actualValue, 0.0f)); } NextTest(); @@ -50186,20 +57885,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() + CHIP_ERROR TestReadAttributeDoubleDefaultValue_88() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + VerifyOrReturn(CheckValue("float_double", actualValue, 0)); } NextTest(); @@ -50208,40 +57907,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64MaxValue_27() + CHIP_ERROR TestWriteAttributeDoubleMediumValue_89() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap64Argument; - bitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Max Value Error: %@", err); + id floatDoubleArgument; + floatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; + [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute DOUBLE medium Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap64MaxValue_28() + CHIP_ERROR TestReadAttributeDoubleMediumValue_90() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Max Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE medium Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, 18446744073709551615ULL)); + VerifyOrReturn(CheckValue("float_double", actualValue, 0.1234567890123)); } NextTest(); @@ -50250,62 +57949,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64MinValue_29() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id bitmap64Argument; - bitmap64Argument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeBitmap64MinValue_30() + CHIP_ERROR TestWriteAttributeDoubleLargeValue_91() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id floatDoubleArgument; + floatDoubleArgument = [NSNumber numberWithDouble:1.7e+200]; + [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute DOUBLE large Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uDefaultValue_31() + CHIP_ERROR TestReadAttributeDoubleLargeValue_92() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE large Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + VerifyOrReturn(CheckValue("float_double", actualValue, 1.7e+200)); } NextTest(); @@ -50314,40 +57991,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uMaxValue_32() + CHIP_ERROR TestWriteAttributeDoubleSmallValue_93() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8uArgument; - int8uArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Max Value Error: %@", err); + id floatDoubleArgument; + floatDoubleArgument = [NSNumber numberWithDouble:1.7e-200]; + [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute DOUBLE small Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uMaxValue_33() + CHIP_ERROR TestReadAttributeDoubleSmallValue_94() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Max Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE small Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, 255)); + VerifyOrReturn(CheckValue("float_double", actualValue, 1.7e-200)); } NextTest(); @@ -50356,40 +58033,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uMinValue_34() + CHIP_ERROR TestWriteAttributeDoubleDefaultValue_95() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8uArgument; - int8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Min Value Error: %@", err); + id floatDoubleArgument; + floatDoubleArgument = [NSNumber numberWithDouble:0]; + [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute DOUBLE Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uMinValue_35() + CHIP_ERROR TestReadAttributeDoubleDefaultValue_96() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Min Value Error: %@", err); + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + VerifyOrReturn(CheckValue("float_double", actualValue, 0)); } NextTest(); @@ -50398,20 +58075,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uDefaultValue_36() + CHIP_ERROR TestReadAttributeEnum8DefaultValue_97() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + VerifyOrReturn(CheckValue("enum8", actualValue, 0)); } NextTest(); @@ -50420,40 +58097,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uMaxValue_37() + CHIP_ERROR TestWriteAttributeEnum8MaxValue_98() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16uArgument; - int16uArgument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeInt16uWithValue:int16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Max Value Error: %@", err); + id enum8Argument; + enum8Argument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeEnum8WithValue:enum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute ENUM8 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uMaxValue_38() + CHIP_ERROR TestReadAttributeEnum8MaxValue_99() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Max Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, 65535U)); + VerifyOrReturn(CheckValue("enum8", actualValue, 255)); } NextTest(); @@ -50462,40 +58139,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uMinValue_39() + CHIP_ERROR TestWriteAttributeEnum8MinValue_100() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16uArgument; - int16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeInt16uWithValue:int16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Min Value Error: %@", err); + id enum8Argument; + enum8Argument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeEnum8WithValue:enum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute ENUM8 Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uMinValue_40() + CHIP_ERROR TestReadAttributeEnum8MinValue_101() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Min Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + VerifyOrReturn(CheckValue("enum8", actualValue, 0)); } NextTest(); @@ -50504,20 +58181,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uDefaultValue_41() + CHIP_ERROR TestReadAttributeEnum16DefaultValue_102() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); } NextTest(); @@ -50526,17 +58203,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uMaxValue_42() + CHIP_ERROR TestWriteAttributeEnum16MaxValue_103() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument + id enum16Argument; + enum16Argument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeEnum16WithValue:enum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Max Value Error: %@", err); + NSLog(@"Write attribute ENUM16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -50546,20 +58223,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uMaxValue_43() + CHIP_ERROR TestReadAttributeEnum16MaxValue_104() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Max Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, 4294967295UL)); + VerifyOrReturn(CheckValue("enum16", actualValue, 65535U)); } NextTest(); @@ -50568,17 +58245,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uMinValue_44() + CHIP_ERROR TestWriteAttributeEnum16MinValue_105() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument + id enum16Argument; + enum16Argument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeEnum16WithValue:enum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Min Value Error: %@", err); + NSLog(@"Write attribute ENUM16 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -50588,20 +58265,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uMinValue_45() + CHIP_ERROR TestReadAttributeEnum16MinValue_106() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Min Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); } NextTest(); @@ -50610,20 +58287,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uDefaultValue_46() + CHIP_ERROR TestReadAttributeOctetStringDefaultValue_107() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } NextTest(); @@ -50632,40 +58309,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uMaxValue_47() + CHIP_ERROR TestWriteAttributeOctetStringWithEmbeddedNull_108() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64uArgument; - int64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeInt64uWithValue:int64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Max Value Error: %@", err); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING with embedded null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uMaxValue_48() + CHIP_ERROR TestReadAttributeOctetStringWithEmbeddedNull_109() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Max Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING with embedded null Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, 18446744073709551615ULL)); + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9])); } NextTest(); @@ -50674,62 +58352,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uMinValue_49() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id int64uArgument; - int64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeInt64uWithValue:int64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeInt64uMinValue_50() + CHIP_ERROR TestWriteAttributeOctetStringWithWeirdChars_110() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING with weird chars Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sDefaultValue_51() + CHIP_ERROR TestReadAttributeOctetStringWithWeirdChars_111() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING with weird chars Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, 0)); + VerifyOrReturn(CheckValueAsString( + "octet_string", actualValue, [[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5])); } NextTest(); @@ -50738,40 +58395,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sMaxValue_52() + CHIP_ERROR TestWriteAttributeOctetString_112() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:127]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Max Value Error: %@", err); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sMaxValue_53() + CHIP_ERROR TestReadAttributeOctetString_113() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Max Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, 127)); + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); } NextTest(); @@ -50780,40 +58438,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sMinValue_54() + CHIP_ERROR TestWriteAttributeOctetString_114() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"TestValueLongerThan10" length:21]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sMinValue_55() + CHIP_ERROR TestReadAttributeOctetString_115() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Min Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, -128)); + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); } NextTest(); @@ -50822,62 +58480,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sDefaultValue_56() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:0]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeInt8sDefaultValue_57() + CHIP_ERROR TestWriteAttributeOctetString_116() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() + CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_117() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LONG_OCTET_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, 0)); + VerifyOrReturn(CheckValueAsString("long_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } NextTest(); @@ -50886,40 +58522,50 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sMaxValue_59() + CHIP_ERROR TestWriteAttributeLongOctetString_118() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:32767]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Max Value Error: %@", err); + id longOctetStringArgument; + longOctetStringArgument = [[NSData alloc] + initWithBytes:"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + length:300]; + [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sMaxValue_60() + CHIP_ERROR TestReadAttributeLongOctetString_119() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Max Value Error: %@", err); + [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LONG_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, 32767)); + VerifyOrReturn(CheckValueAsString("long_octet_string", actualValue, + [[NSData alloc] + initWithBytes: + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + length:300])); } NextTest(); @@ -50928,40 +58574,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sMinValue_61() + CHIP_ERROR TestWriteAttributeLongOctetString_120() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:-32768]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Min Value Error: %@", err); + id longOctetStringArgument; + longOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; + [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sMinValue_62() + CHIP_ERROR TestReadAttributeCharStringDefaultValue_121() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Min Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, -32768)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"")); } NextTest(); @@ -50970,40 +58616,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sDefaultValue_63() + CHIP_ERROR TestWriteAttributeCharString_122() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:0]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Default Value Error: %@", err); + id charStringArgument; + charStringArgument = @"☉T☉"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_64() + CHIP_ERROR TestReadAttributeCharString_123() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, 0)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"☉T☉")); } NextTest(); @@ -51012,20 +58658,39 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sDefaultValue_65() + CHIP_ERROR TestWriteAttributeCharStringValueTooLong_124() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + id charStringArgument; + charStringArgument = @"☉TestValueLongerThan10☉"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING - Value too long Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCharString_125() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"☉T☉")); } NextTest(); @@ -51034,40 +58699,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sMaxValue_66() + CHIP_ERROR TestWriteAttributeCharStringEmpty_126() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:2147483647L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Max Value Error: %@", err); + id charStringArgument; + charStringArgument = @""; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING - Empty Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sMaxValue_67() + CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_127() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Max Value Error: %@", err); + [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LONG_CHAR_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, 2147483647L)); + VerifyOrReturn(CheckValueAsString("long_char_string", actualValue, @"")); } NextTest(); @@ -51076,40 +58741,46 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sMinValue_68() + CHIP_ERROR TestWriteAttributeLongCharString_128() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:-2147483648L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Min Value Error: %@", err); + id longCharStringArgument; + longCharStringArgument + = @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"; + [cluster writeAttributeLongCharStringWithValue:longCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sMinValue_69() + CHIP_ERROR TestReadAttributeLongCharString_129() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Min Value Error: %@", err); + [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LONG_CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, -2147483648L)); + VerifyOrReturn(CheckValueAsString("long_char_string", actualValue, + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉")); } NextTest(); @@ -51118,40 +58789,76 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sDefaultValue_70() + CHIP_ERROR TestWriteAttributeLongCharString_130() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:0L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Default Value Error: %@", err); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturn(CheckValue("status", err, 0)); + id longCharStringArgument; + longCharStringArgument = @""; + [cluster writeAttributeLongCharStringWithValue:longCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sDefaultValue_71() + CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_131() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); + VerifyOrReturn(CheckValue("list_long_octet_string", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValueAsString("", actualValue[0], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[1], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[2], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[3], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); } NextTest(); @@ -51160,62 +58867,150 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64sDefaultValue_72() + CHIP_ERROR TestWriteAttributeListLongOctetStringForChunkedWrite_132() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id listLongOctetStringArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + temp_0[1] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + temp_0[2] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + temp_0[3] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + temp_0[4] = [[NSData alloc] + initWithBytes: + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512]; + listLongOctetStringArgument = temp_0; + } + [cluster writeAttributeListLongOctetStringWithValue:listLongOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LIST_LONG_OCTET_STRING (for chunked write) Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64sMaxValue_73() + CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_133() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:9223372036854775807LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Max Value Error: %@", err); + [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("list_long_octet_string", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValueAsString("", actualValue[0], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[1], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[2], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[3], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + VerifyOrReturn(CheckValueAsString("", actualValue[4], + [[NSData alloc] + initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" + "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef" + length:512])); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64sMaxValue_74() + CHIP_ERROR TestReadAttributeEpochUsDefaultValue_134() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Max Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, 9223372036854775807LL)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); } NextTest(); @@ -51224,40 +59019,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64sMinValue_75() + CHIP_ERROR TestWriteAttributeEpochUsMaxValue_135() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Min Value Error: %@", err); + id epochUsArgument; + epochUsArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_US Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64sMinValue_76() + CHIP_ERROR TestReadAttributeEpochUsMaxValue_136() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Min Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, -9223372036854775807LL)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, 18446744073709551615ULL)); } NextTest(); @@ -51266,40 +59061,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64sDefaultValue_77() + CHIP_ERROR TestWriteAttributeEpochUsMinValue_137() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:0LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Default Value Error: %@", err); + id epochUsArgument; + epochUsArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_US Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64sDefaultValue_78() + CHIP_ERROR TestReadAttributeEpochUsMinValue_138() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); } NextTest(); @@ -51308,20 +59103,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSingleDefaultValue_79() + CHIP_ERROR TestReadAttributeEpochSDefaultValue_139() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE Default Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 0.0f)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); } NextTest(); @@ -51330,40 +59125,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeSingleMediumValue_80() + CHIP_ERROR TestWriteAttributeEpochSMaxValue_140() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:0.1f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE medium Value Error: %@", err); + id epochSArgument; + epochSArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeEpochSWithValue:epochSArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_S Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSingleMediumValue_81() + CHIP_ERROR TestReadAttributeEpochSMaxValue_141() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE medium Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 0.1f)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, 4294967295UL)); } NextTest(); @@ -51372,40 +59167,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeSingleLargeValue_82() + CHIP_ERROR TestWriteAttributeEpochSMinValue_142() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:17000000000.0f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE large Value Error: %@", err); + id epochSArgument; + epochSArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeEpochSWithValue:epochSArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSingleLargeValue_83() + CHIP_ERROR TestReadAttributeEpochSMinValue_143() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE large Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 17000000000.0f)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); } NextTest(); @@ -51414,40 +59209,25 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeSingleSmallValue_84() + CHIP_ERROR TestReadAttributeUnsupported_144() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:1.7e-10f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE small Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeSingleSmallValue_85() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeUnsupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute UNSUPPORTED Error: %@", err); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE small Value Error: %@", err); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 1.7e-10f)); + VerifyOrReturn(CheckValue("unsupported", actualValue, 0)); } NextTest(); @@ -51456,17 +59236,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeSingleDefaultValue_86() + CHIP_ERROR TestWriteattributeUnsupported_145() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:0.0f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument + id unsupportedArgument; + unsupportedArgument = [NSNumber numberWithBool:0]; + [cluster writeAttributeUnsupportedWithValue:unsupportedArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE Default Value Error: %@", err); + NSLog(@"Writeattribute UNSUPPORTED Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err, 0)); @@ -51476,42 +59261,52 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeSingleDefaultValue_87() + CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_146() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE Default Value Error: %@", err); + [cluster testWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Test Command to unsupported endpoint Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("float_single", actualValue, 0.0f)); - } + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendTestCommandToUnsupportedCluster_147() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster testWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Test Command to unsupported cluster Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleDefaultValue_88() + CHIP_ERROR TestReadAttributeVendorIdDefaultValue_148() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 0)); + VerifyOrReturn(CheckValue("vendor_id", actualValue, 0U)); } NextTest(); @@ -51520,40 +59315,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeDoubleMediumValue_89() + CHIP_ERROR TestWriteAttributeVendorId_149() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE medium Value Error: %@", err); + id vendorIdArgument; + vendorIdArgument = [NSNumber numberWithUnsignedShort:17U]; + [cluster writeAttributeVendorIdWithValue:vendorIdArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute vendor_id Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleMediumValue_90() + CHIP_ERROR TestReadAttributeVendorId_150() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE medium Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 0.1234567890123)); + VerifyOrReturn(CheckValue("vendor_id", actualValue, 17U)); } NextTest(); @@ -51562,487 +59357,948 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeDoubleLargeValue_91() + CHIP_ERROR TestRestoreAttributeVendorId_151() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:1.7e+200]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE large Value Error: %@", err); + id vendorIdArgument; + vendorIdArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeVendorIdWithValue:vendorIdArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Restore attribute vendor_id Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleLargeValue_92() + CHIP_ERROR TestSendACommandWithAVendorIdAndEnum_152() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE large Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 1.7e+200)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + __auto_type * params = [[CHIPTestClusterClusterTestEnumsRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedShort:20003U]; + params.arg2 = [NSNumber numberWithUnsignedChar:101]; + [cluster testEnumsRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send a command with a vendor_id and enum Error: %@", err); - CHIP_ERROR TestWriteAttributeDoubleSmallValue_93() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:1.7e-200]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE small Value Error: %@", err); + { + id actualValue = values.arg1; + VerifyOrReturn(CheckValue("arg1", actualValue, 20003U)); + } - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.arg2; + VerifyOrReturn(CheckValue("arg2", actualValue, 101)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleSmallValue_94() + CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE small Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster testStructArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Struct Argument and arg1.b is true Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 1.7e-200)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeDoubleDefaultValue_95() + CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:0]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster testStructArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Struct Argument and arg1.b is false Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDoubleDefaultValue_96() + CHIP_ERROR TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_155() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = + [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster + testNestedStructArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct Argument and arg1.c.b is true Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("float_double", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum8DefaultValue_97() + CHIP_ERROR TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = + [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = + [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster + testNestedStructArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct Argument arg1.c.b is false Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8MaxValue_98() + CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_157() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum8Argument; - enum8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Max Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = + [NSNumber numberWithDouble:0]; - NextTest(); - }]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - return CHIP_NO_ERROR; - } + temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - CHIP_ERROR TestReadAttributeEnum8MaxValue_99() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; + temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; + temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; + temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; + temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [NSNumber numberWithUnsignedChar:0]; + temp_1[1] = [NSNumber numberWithUnsignedChar:255]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; + } - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Max Value Error: %@", err); + [cluster testNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct List Argument and all fields b of " + @"arg1.d are true Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, 255)); - } + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8MinValue_100() + CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_158() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum8Argument; - enum8Argument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = + [NSNumber numberWithDouble:0]; - NextTest(); - }]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - return CHIP_NO_ERROR; - } + temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - CHIP_ERROR TestReadAttributeEnum8MinValue_101() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; + temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; + temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; + temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; + temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; + } + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [NSNumber numberWithUnsignedChar:0]; + temp_1[1] = [NSNumber numberWithUnsignedChar:255]; + ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; + } - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Min Value Error: %@", err); + [cluster testNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct List Argument and some fields b of " + @"arg1.d are false Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, 0)); - } + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum16DefaultValue_102() + CHIP_ERROR TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterSimpleStructEchoRequestParams alloc] init]; + params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:17]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.1f]; + ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0.1]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster + simpleStructEchoRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterSimpleStructResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With Struct Argument and see what we get back Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.arg1; + VerifyOrReturn(CheckValue("a", ((CHIPTestClusterClusterSimpleStruct *) actualValue).a, 17)); + VerifyOrReturn(CheckValue("b", ((CHIPTestClusterClusterSimpleStruct *) actualValue).b, false)); + VerifyOrReturn(CheckValue("c", ((CHIPTestClusterClusterSimpleStruct *) actualValue).c, 2)); + VerifyOrReturn(CheckValueAsString("d", ((CHIPTestClusterClusterSimpleStruct *) actualValue).d, + [[NSData alloc] initWithBytes:"octet_string" length:12])); + VerifyOrReturn(CheckValueAsString( + "e", ((CHIPTestClusterClusterSimpleStruct *) actualValue).e, @"char_string")); + VerifyOrReturn(CheckValue("f", ((CHIPTestClusterClusterSimpleStruct *) actualValue).f, 1)); + VerifyOrReturn(CheckValue("g", ((CHIPTestClusterClusterSimpleStruct *) actualValue).g, 0.1f)); + VerifyOrReturn(CheckValue("h", ((CHIPTestClusterClusterSimpleStruct *) actualValue).h, 0.1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16MaxValue_103() + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_160() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum16Argument; - enum16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Max Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:1]; + temp_0[1] = [NSNumber numberWithUnsignedChar:2]; + temp_0[2] = [NSNumber numberWithUnsignedChar:3]; + temp_0[3] = [NSNumber numberWithUnsignedChar:4]; + temp_0[4] = [NSNumber numberWithUnsignedChar:5]; + temp_0[5] = [NSNumber numberWithUnsignedChar:6]; + temp_0[6] = [NSNumber numberWithUnsignedChar:7]; + temp_0[7] = [NSNumber numberWithUnsignedChar:8]; + temp_0[8] = [NSNumber numberWithUnsignedChar:9]; + params.arg1 = temp_0; + } + [cluster + testListInt8UArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With List of INT8U and none of them is set to 0 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum16MaxValue_104() + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_161() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Max Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:1]; + temp_0[1] = [NSNumber numberWithUnsignedChar:2]; + temp_0[2] = [NSNumber numberWithUnsignedChar:3]; + temp_0[3] = [NSNumber numberWithUnsignedChar:4]; + temp_0[4] = [NSNumber numberWithUnsignedChar:5]; + temp_0[5] = [NSNumber numberWithUnsignedChar:6]; + temp_0[6] = [NSNumber numberWithUnsignedChar:7]; + temp_0[7] = [NSNumber numberWithUnsignedChar:8]; + temp_0[8] = [NSNumber numberWithUnsignedChar:9]; + temp_0[9] = [NSNumber numberWithUnsignedChar:0]; + params.arg1 = temp_0; + } + [cluster testListInt8UArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Command With List of INT8U and one of them is set to 0 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, 65535U)); - } + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16MinValue_105() + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_162() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum16Argument; - enum16Argument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Min Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:1]; + temp_0[1] = [NSNumber numberWithUnsignedChar:2]; + temp_0[2] = [NSNumber numberWithUnsignedChar:3]; + temp_0[3] = [NSNumber numberWithUnsignedChar:4]; + temp_0[4] = [NSNumber numberWithUnsignedChar:5]; + temp_0[5] = [NSNumber numberWithUnsignedChar:6]; + temp_0[6] = [NSNumber numberWithUnsignedChar:7]; + temp_0[7] = [NSNumber numberWithUnsignedChar:8]; + temp_0[8] = [NSNumber numberWithUnsignedChar:9]; + params.arg1 = temp_0; + } + [cluster + testListInt8UReverseRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With List of INT8U and get it reversed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.arg1; + VerifyOrReturn(CheckValue("arg1", [actualValue count], static_cast(9))); + VerifyOrReturn(CheckValue("", actualValue[0], 9)); + VerifyOrReturn(CheckValue("", actualValue[1], 8)); + VerifyOrReturn(CheckValue("", actualValue[2], 7)); + VerifyOrReturn(CheckValue("", actualValue[3], 6)); + VerifyOrReturn(CheckValue("", actualValue[4], 5)); + VerifyOrReturn(CheckValue("", actualValue[5], 4)); + VerifyOrReturn(CheckValue("", actualValue[6], 3)); + VerifyOrReturn(CheckValue("", actualValue[7], 2)); + VerifyOrReturn(CheckValue("", actualValue[8], 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum16MinValue_106() + CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_163() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Min Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + params.arg1 = temp_0; + } + [cluster + testListInt8UReverseRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With empty List of INT8U and get an empty list back Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); - } + { + id actualValue = values.arg1; + VerifyOrReturn(CheckValue("arg1", [actualValue count], static_cast(0))); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringDefaultValue_107() + CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_164() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING Default Value Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"first_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"second_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); - } + params.arg1 = temp_0; + } + [cluster testListStructArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With List of Struct Argument and arg1.b of first item is true " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringWithEmbeddedNull_108() + CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_165() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING with embedded null Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"second_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"first_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - NextTest(); - }]; + params.arg1 = temp_0; + } + [cluster testListStructArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With List of Struct Argument and arg1.b of first item is " + @"false Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringWithEmbeddedNull_109() + CHIP_ERROR TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_166() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING with embedded null Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = + [NSNumber numberWithDouble:0]; { - id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9])); - } + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" + length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; - NextTest(); - }]; + temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" + length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; - return CHIP_NO_ERROR; - } + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; + temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; + temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; + temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; + temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [NSNumber numberWithUnsignedChar:0]; + temp_2[1] = [NSNumber numberWithUnsignedChar:255]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; + } - CHIP_ERROR TestWriteAttributeOctetStringWithWeirdChars_110() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + params.arg1 = temp_0; + } + [cluster testListNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With List of Nested Struct List Argument and all " + @"fields b of elements of arg1.d are true Error: %@", + err); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING with weird chars Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, true)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringWithWeirdChars_111() + CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_167() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING with weird chars Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = + [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = + [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = + [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = + [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = + [NSNumber numberWithDouble:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" + length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; + + temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" + length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; + ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; + } { - id actualValue = value; - VerifyOrReturn(CheckValueAsString( - "octet_string", actualValue, [[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5])); + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; + temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; + temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; + temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; + temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; + } + { + NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; + temp_2[0] = [NSNumber numberWithUnsignedChar:0]; + temp_2[1] = [NSNumber numberWithUnsignedChar:255]; + ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; } - NextTest(); - }]; + params.arg1 = temp_0; + } + [cluster testListNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command With Nested Struct List Argument and some fields b " + @"of elements of arg1.d are false Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetString_112() + CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); + id listInt8uArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:1]; + temp_0[1] = [NSNumber numberWithUnsignedChar:2]; + temp_0[2] = [NSNumber numberWithUnsignedChar:3]; + temp_0[3] = [NSNumber numberWithUnsignedChar:4]; + listInt8uArgument = temp_0; + } + [cluster writeAttributeListInt8uWithValue:listInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LIST With List of INT8U and none of them is set to 0 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetString_113() + CHIP_ERROR TestReadAttributeListWithListOfInt8u_169() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING Error: %@", err); + [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST With List of INT8U Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); + VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 1)); + VerifyOrReturn(CheckValue("", actualValue[1], 2)); + VerifyOrReturn(CheckValue("", actualValue[2], 3)); + VerifyOrReturn(CheckValue("", actualValue[3], 4)); } NextTest(); @@ -52051,40 +60307,51 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetString_114() + CHIP_ERROR TestWriteAttributeListWithListOfOctetString_170() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"TestValueLongerThan10" length:21]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); + id listOctetStringArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[NSData alloc] initWithBytes:"Test0" length:5]; + temp_0[1] = [[NSData alloc] initWithBytes:"Test1" length:5]; + temp_0[2] = [[NSData alloc] initWithBytes:"Test2" length:5]; + temp_0[3] = [[NSData alloc] initWithBytes:"Test3" length:5]; + listOctetStringArgument = temp_0; + } + [cluster writeAttributeListOctetStringWithValue:listOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LIST With List of OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetString_115() + CHIP_ERROR TestReadAttributeListWithListOfOctetString_171() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING Error: %@", err); + [cluster readAttributeListOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST With List of OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); + VerifyOrReturn(CheckValue("list_octet_string", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValueAsString("", actualValue[0], [[NSData alloc] initWithBytes:"Test0" length:5])); + VerifyOrReturn(CheckValueAsString("", actualValue[1], [[NSData alloc] initWithBytes:"Test1" length:5])); + VerifyOrReturn(CheckValueAsString("", actualValue[2], [[NSData alloc] initWithBytes:"Test2" length:5])); + VerifyOrReturn(CheckValueAsString("", actualValue[3], [[NSData alloc] initWithBytes:"Test3" length:5])); } NextTest(); @@ -52093,40 +60360,83 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetString_116() + CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_172() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); + id listStructOctetStringArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedLongLong:0ULL]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).operationalCert = [[NSData alloc] initWithBytes:"Test0" + length:5]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedLongLong:1ULL]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).operationalCert = [[NSData alloc] initWithBytes:"Test1" + length:5]; - NextTest(); - }]; + temp_0[2] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedLongLong:2ULL]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).operationalCert = [[NSData alloc] initWithBytes:"Test2" + length:5]; + + temp_0[3] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).fabricIndex = [NSNumber numberWithUnsignedLongLong:3ULL]; + ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).operationalCert = [[NSData alloc] initWithBytes:"Test3" + length:5]; + + listStructOctetStringArgument = temp_0; + } + [cluster writeAttributeListStructOctetStringWithValue:listStructOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_117() + CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_173() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_OCTET_STRING Default Value Error: %@", err); + [cluster readAttributeListStructOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("long_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); + VerifyOrReturn(CheckValue("list_struct_octet_string", [actualValue count], static_cast(4))); + VerifyOrReturn( + CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).fabricIndex, 0ULL)); + VerifyOrReturn(CheckValueAsString("operationalCert", + ((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).operationalCert, + [[NSData alloc] initWithBytes:"Test0" length:5])); + VerifyOrReturn( + CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).fabricIndex, 1ULL)); + VerifyOrReturn(CheckValueAsString("operationalCert", + ((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).operationalCert, + [[NSData alloc] initWithBytes:"Test1" length:5])); + VerifyOrReturn( + CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).fabricIndex, 2ULL)); + VerifyOrReturn(CheckValueAsString("operationalCert", + ((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).operationalCert, + [[NSData alloc] initWithBytes:"Test2" length:5])); + VerifyOrReturn( + CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).fabricIndex, 3ULL)); + VerifyOrReturn(CheckValueAsString("operationalCert", + ((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).operationalCert, + [[NSData alloc] initWithBytes:"Test3" length:5])); } NextTest(); @@ -52135,92 +60445,98 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeLongOctetString_118() + CHIP_ERROR TestSendTestCommandWithOptionalArgSet_174() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id longOctetStringArgument; - longOctetStringArgument = [[NSData alloc] - initWithBytes:"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - length:300]; - [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; + __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:5]; + [cluster + testNullableOptionalRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command with optional arg set. Error: %@", err); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR TestReadAttributeLongOctetString_119() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.wasPresent; + VerifyOrReturn(CheckValue("wasPresent", actualValue, true)); + } - [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_OCTET_STRING Error: %@", err); + { + id actualValue = values.wasNull; + VerifyOrReturn(CheckValue("wasNull", actualValue, false)); + } - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.value; + VerifyOrReturn(CheckValue("value", actualValue, 5)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("long_octet_string", actualValue, - [[NSData alloc] - initWithBytes: - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - length:300])); - } + { + id actualValue = values.originalValue; + VerifyOrReturn(CheckValueNonNull("originalValue", actualValue)); + VerifyOrReturn(CheckValue("originalValue", actualValue, 5)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeLongOctetString_120() + CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_175() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id longOctetStringArgument; - longOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); + __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; + [cluster + testNullableOptionalRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Send Test Command without its optional arg. Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.wasPresent; + VerifyOrReturn(CheckValue("wasPresent", actualValue, false)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringDefaultValue_121() + CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionals_176() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Default Value Error: %@", err); + [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( + NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read list of structs containing nullables and optionals Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"")); + VerifyOrReturn(CheckValue("list_nullables_and_optionals_struct", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueNull( + "NullableInt", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt)); + VerifyOrReturn(CheckValueNull( + "NullableString", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString)); + VerifyOrReturn(CheckValueNull( + "NullableStruct", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct)); + VerifyOrReturn(CheckValueNull( + "NullableList", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList)); } NextTest(); @@ -52229,40 +60545,72 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharString_122() + CHIP_ERROR TestWriteListOfStructsContainingNullablesAndOptionals_177() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"☉T☉"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Error: %@", err); + id listNullablesAndOptionalsStructArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPTestClusterClusterNullablesAndOptionalsStruct alloc] init]; + ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableInt = nil; + ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableString = nil; + ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableStruct = nil; + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [NSNumber numberWithUnsignedChar:1]; + temp_3[1] = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableList = temp_3; + } - VerifyOrReturn(CheckValue("status", err, 0)); + listNullablesAndOptionalsStructArgument = temp_0; + } + [cluster + writeAttributeListNullablesAndOptionalsStructWithValue:listNullablesAndOptionalsStructArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write list of structs containing nullables and optionals Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharString_123() + CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Error: %@", err); + [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( + NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read list of structs containing nullables and optionals after writing Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"☉T☉")); + VerifyOrReturn(CheckValue("list_nullables_and_optionals_struct", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueNull( + "NullableInt", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt)); + VerifyOrReturn(CheckValueNull( + "NullableString", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString)); + VerifyOrReturn(CheckValueNull( + "NullableStruct", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct)); + VerifyOrReturn(CheckValueNonNull( + "NullableList", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList)); + VerifyOrReturn(CheckValue("NullableList", + [((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList count], + static_cast(2))); + VerifyOrReturn( + CheckValue("", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[0], 1)); + VerifyOrReturn( + CheckValue("", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[1], 2)); } NextTest(); @@ -52271,39 +60619,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueTooLong_124() + CHIP_ERROR TestWriteAttributeNullableBooleanNull_179() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"☉TestValueLongerThan10☉"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING - Value too long Error: %@", err); + id nullableBooleanArgument; + nullableBooleanArgument = nil; + [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BOOLEAN null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharString_125() + CHIP_ERROR TestReadAttributeNullableBooleanNull_180() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Error: %@", err); + [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BOOLEAN null Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"☉T☉")); + VerifyOrReturn(CheckValueNull("nullable_boolean", actualValue)); } NextTest(); @@ -52312,40 +60661,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringEmpty_126() + CHIP_ERROR TestWriteAttributeNullableBooleanTrue_181() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @""; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING - Empty Error: %@", err); + id nullableBooleanArgument; + nullableBooleanArgument = [NSNumber numberWithBool:true]; + [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BOOLEAN True Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_127() + CHIP_ERROR TestReadAttributeNullableBooleanTrue_182() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_CHAR_STRING Default Value Error: %@", err); + [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BOOLEAN True Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("long_char_string", actualValue, @"")); + VerifyOrReturn(CheckValueNonNull("nullable_boolean", actualValue)); + VerifyOrReturn(CheckValue("nullable_boolean", actualValue, true)); } NextTest(); @@ -52354,46 +60704,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeLongCharString_128() + CHIP_ERROR TestWriteAttributeNullableBitmap8MaxValue_183() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id longCharStringArgument; - longCharStringArgument - = @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"; - [cluster writeAttributeLongCharStringWithValue:longCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); + id nullableBitmap8Argument; + nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP8 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeLongCharString_129() + CHIP_ERROR TestReadAttributeNullableBitmap8MaxValue_184() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_CHAR_STRING Error: %@", err); + [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP8 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("long_char_string", actualValue, - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉")); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap8", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap8", actualValue, 254)); } NextTest(); @@ -52402,76 +60747,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeLongCharString_130() + CHIP_ERROR TestWriteAttributeNullableBitmap8InvalidValue_185() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id longCharStringArgument; - longCharStringArgument = @""; - [cluster writeAttributeLongCharStringWithValue:longCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableBitmap8Argument; + nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP8 Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_131() + CHIP_ERROR TestReadAttributeNullableBitmap8UnchangedValue_186() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); + [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP8 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("list_long_octet_string", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValueAsString("", actualValue[0], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[1], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[2], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[3], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap8", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap8", actualValue, 254)); } NextTest(); @@ -52480,150 +60789,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeListLongOctetStringForChunkedWrite_132() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id listLongOctetStringArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[1] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[2] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[3] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[4] = [[NSData alloc] - initWithBytes: - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - listLongOctetStringArgument = temp_0; - } - [cluster writeAttributeListLongOctetStringWithValue:listLongOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST_LONG_OCTET_STRING (for chunked write) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeListLongOctetStringForChunkedRead_133() + CHIP_ERROR TestWriteAttributeNullableBitmap8NullValue_187() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableBitmap8Argument; + nullableBitmap8Argument = nil; + [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP8 null Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_long_octet_string", [actualValue count], static_cast(5))); - VerifyOrReturn(CheckValueAsString("", actualValue[0], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[1], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[2], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[3], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - VerifyOrReturn(CheckValueAsString("", actualValue[4], - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512])); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_134() + CHIP_ERROR TestReadAttributeNullableBitmap8NullValue_188() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); + [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP8 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); + VerifyOrReturn(CheckValueNull("nullable_bitmap8", actualValue)); } NextTest(); @@ -52632,40 +60831,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochUsMaxValue_135() + CHIP_ERROR TestWriteAttributeNullableBitmap16MaxValue_189() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochUsArgument; - epochUsArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Max Value Error: %@", err); + id nullableBitmap16Argument; + nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP16 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochUsMaxValue_136() + CHIP_ERROR TestReadAttributeNullableBitmap16MaxValue_190() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Max Value Error: %@", err); + [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, 18446744073709551615ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap16", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap16", actualValue, 65534U)); } NextTest(); @@ -52674,40 +60874,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochUsMinValue_137() + CHIP_ERROR TestWriteAttributeNullableBitmap16InvalidValue_191() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochUsArgument; - epochUsArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableBitmap16Argument; + nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP16 Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochUsMinValue_138() + CHIP_ERROR TestReadAttributeNullableBitmap16UnchangedValue_192() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Min Value Error: %@", err); + [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP16 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap16", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap16", actualValue, 65534U)); } NextTest(); @@ -52716,20 +60916,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochSDefaultValue_139() + CHIP_ERROR TestWriteAttributeNullableBitmap16NullValue_193() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); + id nullableBitmap16Argument; + nullableBitmap16Argument = nil; + [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP16 null Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableBitmap16NullValue_194() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP16 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); + VerifyOrReturn(CheckValueNull("nullable_bitmap16", actualValue)); } NextTest(); @@ -52738,40 +60958,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochSMaxValue_140() + CHIP_ERROR TestWriteAttributeNullableBitmap32MaxValue_195() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Max Value Error: %@", err); + id nullableBitmap32Argument; + nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967294UL]; + [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP32 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochSMaxValue_141() + CHIP_ERROR TestReadAttributeNullableBitmap32MaxValue_196() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Max Value Error: %@", err); + [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP32 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, 4294967295UL)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap32", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap32", actualValue, 4294967294UL)); } NextTest(); @@ -52780,40 +61001,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochSMinValue_142() + CHIP_ERROR TestWriteAttributeNullableBitmap32InvalidValue_197() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableBitmap32Argument; + nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP32 Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochSMinValue_143() + CHIP_ERROR TestReadAttributeNullableBitmap32UnchangedValue_198() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Min Value Error: %@", err); + [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP32 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap32", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap32", actualValue, 4294967294UL)); } NextTest(); @@ -52822,25 +61043,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeUnsupported_144() + CHIP_ERROR TestWriteAttributeNullableBitmap32NullValue_199() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeUnsupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute UNSUPPORTED Error: %@", err); + id nullableBitmap32Argument; + nullableBitmap32Argument = nil; + [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP32 null Value Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableBitmap32NullValue_200() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP32 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("unsupported", actualValue, 0)); + VerifyOrReturn(CheckValueNull("nullable_bitmap32", actualValue)); } NextTest(); @@ -52849,77 +61085,83 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteattributeUnsupported_145() + CHIP_ERROR TestWriteAttributeNullableBitmap64MaxValue_201() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id unsupportedArgument; - unsupportedArgument = [NSNumber numberWithBool:0]; - [cluster writeAttributeUnsupportedWithValue:unsupportedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writeattribute UNSUPPORTED Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + id nullableBitmap64Argument; + nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; + [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP64 Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_146() + CHIP_ERROR TestReadAttributeNullableBitmap64MaxValue_202() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Command to unsupported endpoint Error: %@", err); + [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP64 Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_bitmap64", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap64", actualValue, 18446744073709551614ULL)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandToUnsupportedCluster_147() + CHIP_ERROR TestWriteAttributeNullableBitmap64InvalidValue_203() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster testWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Command to unsupported cluster Error: %@", err); + id nullableBitmap64Argument; + nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP64 Invalid Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_148() + CHIP_ERROR TestReadAttributeNullableBitmap64UnchangedValue_204() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); + [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP64 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("vendor_id", actualValue, 0U)); + VerifyOrReturn(CheckValueNonNull("nullable_bitmap64", actualValue)); + VerifyOrReturn(CheckValue("nullable_bitmap64", actualValue, 18446744073709551614ULL)); } NextTest(); @@ -52928,40 +61170,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeVendorId_149() + CHIP_ERROR TestWriteAttributeNullableBitmap64NullValue_205() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id vendorIdArgument; - vendorIdArgument = [NSNumber numberWithUnsignedShort:17U]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Error: %@", err); + id nullableBitmap64Argument; + nullableBitmap64Argument = nil; + [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_BITMAP64 null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeVendorId_150() + CHIP_ERROR TestReadAttributeNullableBitmap64NullValue_206() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Error: %@", err); + [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_BITMAP64 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("vendor_id", actualValue, 17U)); + VerifyOrReturn(CheckValueNull("nullable_bitmap64", actualValue)); } NextTest(); @@ -52970,948 +61212,425 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRestoreAttributeVendorId_151() + CHIP_ERROR TestWriteAttributeNullableInt8uMinValue_207() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id vendorIdArgument; - vendorIdArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Restore attribute vendor_id Error: %@", err); + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendACommandWithAVendorIdAndEnum_152() + CHIP_ERROR TestReadAttributeNullableInt8uMinValue_208() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestEnumsRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedShort:20003U]; - params.arg2 = [NSNumber numberWithUnsignedChar:101]; - [cluster testEnumsRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send a command with a vendor_id and enum Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U Min Value Error: %@", err); - { - id actualValue = values.arg1; - VerifyOrReturn(CheckValue("arg1", actualValue, 20003U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.arg2; - VerifyOrReturn(CheckValue("arg2", actualValue, 101)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 0)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_153() + CHIP_ERROR TestWriteAttributeNullableInt8uMaxValue_209() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - - [cluster testStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Struct Argument and arg1.b is true Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Max Value Error: %@", err); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_154() + CHIP_ERROR TestReadAttributeNullableInt8uMaxValue_210() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - - [cluster testStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Struct Argument and arg1.b is false Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_155() + CHIP_ERROR TestWriteAttributeNullableInt8uInvalidValue_211() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - [cluster - testNestedStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct Argument and arg1.c.b is true Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Invalid Value Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_156() + CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValue_212() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = - [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - [cluster - testNestedStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct Argument arg1.c.b is false Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U unchanged Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_157() + CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - - temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedChar:0]; - temp_1[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; - } - - [cluster testNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct List Argument and all fields b of " - @"arg1.d are true Error: %@", - err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U unchanged Value with constraint Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_158() + CHIP_ERROR TestWriteAttributeNullableInt8uNullValue_214() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - - temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedChar:0]; - temp_1[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; - } - - [cluster testNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct List Argument and some fields b of " - @"arg1.d are false Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt8uArgument; + nullableInt8uArgument = nil; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U null Value Error: %@", err); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_159() + CHIP_ERROR TestReadAttributeNullableInt8uNullValue_215() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterSimpleStructEchoRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:17]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.1f]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0.1]; - - [cluster - simpleStructEchoRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterSimpleStructResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Struct Argument and see what we get back Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.arg1; - VerifyOrReturn(CheckValue("a", ((CHIPTestClusterClusterSimpleStruct *) actualValue).a, 17)); - VerifyOrReturn(CheckValue("b", ((CHIPTestClusterClusterSimpleStruct *) actualValue).b, false)); - VerifyOrReturn(CheckValue("c", ((CHIPTestClusterClusterSimpleStruct *) actualValue).c, 2)); - VerifyOrReturn(CheckValueAsString("d", ((CHIPTestClusterClusterSimpleStruct *) actualValue).d, - [[NSData alloc] initWithBytes:"octet_string" length:12])); - VerifyOrReturn(CheckValueAsString( - "e", ((CHIPTestClusterClusterSimpleStruct *) actualValue).e, @"char_string")); - VerifyOrReturn(CheckValue("f", ((CHIPTestClusterClusterSimpleStruct *) actualValue).f, 1)); - VerifyOrReturn(CheckValue("g", ((CHIPTestClusterClusterSimpleStruct *) actualValue).g, 0.1f)); - VerifyOrReturn(CheckValue("h", ((CHIPTestClusterClusterSimpleStruct *) actualValue).h, 0.1)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_int8u", actualValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_160() + CHIP_ERROR TestReadAttributeNullableInt8uNullValueRange_216() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - temp_0[4] = [NSNumber numberWithUnsignedChar:5]; - temp_0[5] = [NSNumber numberWithUnsignedChar:6]; - temp_0[6] = [NSNumber numberWithUnsignedChar:7]; - temp_0[7] = [NSNumber numberWithUnsignedChar:8]; - temp_0[8] = [NSNumber numberWithUnsignedChar:9]; - params.arg1 = temp_0; - } - [cluster - testListInt8UArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With List of INT8U and none of them is set to 0 Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", [value unsignedCharValue], 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_161() + CHIP_ERROR TestReadAttributeNullableInt8uNullValueNot_217() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - temp_0[4] = [NSNumber numberWithUnsignedChar:5]; - temp_0[5] = [NSNumber numberWithUnsignedChar:6]; - temp_0[6] = [NSNumber numberWithUnsignedChar:7]; - temp_0[7] = [NSNumber numberWithUnsignedChar:8]; - temp_0[8] = [NSNumber numberWithUnsignedChar:9]; - temp_0[9] = [NSNumber numberWithUnsignedChar:0]; - params.arg1 = temp_0; - } - [cluster testListInt8UArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With List of INT8U and one of them is set to 0 Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U null Value & not Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", value, 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_162() + CHIP_ERROR TestWriteAttributeNullableInt8uValue_218() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - temp_0[4] = [NSNumber numberWithUnsignedChar:5]; - temp_0[5] = [NSNumber numberWithUnsignedChar:6]; - temp_0[6] = [NSNumber numberWithUnsignedChar:7]; - temp_0[7] = [NSNumber numberWithUnsignedChar:8]; - temp_0[8] = [NSNumber numberWithUnsignedChar:9]; - params.arg1 = temp_0; - } - [cluster - testListInt8UReverseRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of INT8U and get it reversed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:128]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Value Error: %@", err); - { - id actualValue = values.arg1; - VerifyOrReturn(CheckValue("arg1", [actualValue count], static_cast(9))); - VerifyOrReturn(CheckValue("", actualValue[0], 9)); - VerifyOrReturn(CheckValue("", actualValue[1], 8)); - VerifyOrReturn(CheckValue("", actualValue[2], 7)); - VerifyOrReturn(CheckValue("", actualValue[3], 6)); - VerifyOrReturn(CheckValue("", actualValue[4], 5)); - VerifyOrReturn(CheckValue("", actualValue[5], 4)); - VerifyOrReturn(CheckValue("", actualValue[6], 3)); - VerifyOrReturn(CheckValue("", actualValue[7], 2)); - VerifyOrReturn(CheckValue("", actualValue[8], 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_163() + CHIP_ERROR TestReadAttributeNullableInt8uValueInRange_219() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - params.arg1 = temp_0; - } - [cluster - testListInt8UReverseRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With empty List of INT8U and get an empty list back Error: %@", err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U Value in range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.arg1; - VerifyOrReturn(CheckValue("arg1", [actualValue count], static_cast(0))); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", [value unsignedCharValue], 254)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_164() + CHIP_ERROR TestReadAttributeNullableInt8uNotValueOk_220() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"first_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - - temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"second_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - - params.arg1 = temp_0; - } - [cluster testListStructArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of Struct Argument and arg1.b of first item is true " - @"Error: %@", - err); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U notValue OK Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", value, 129)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_165() + CHIP_ERROR TestWriteAttributeNullableInt16uMinValue_221() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"second_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - - temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"first_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - - params.arg1 = temp_0; - } - [cluster testListStructArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of Struct Argument and arg1.b of first item is " - @"false Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Min Value Error: %@", err); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_166() + CHIP_ERROR TestReadAttributeNullableInt16uMinValue_222() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" - length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U Min Value Error: %@", err); - temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" - length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; + VerifyOrReturn(CheckValue("status", err, 0)); - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; - } { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedChar:0]; - temp_2[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 0U)); } - params.arg1 = temp_0; - } - [cluster testListNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of Nested Struct List Argument and all " - @"fields b of elements of arg1.d are true Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, true)); - } - - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_167() + CHIP_ERROR TestWriteAttributeNullableInt16uMaxValue_223() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" - length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; - - temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" - length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedChar:0]; - temp_2[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; - } - - params.arg1 = temp_0; - } - [cluster testListNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct List Argument and some fields b " - @"of elements of arg1.d are false Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Max Value Error: %@", err); - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, false)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_168() + CHIP_ERROR TestReadAttributeNullableInt16uMaxValue_224() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listInt8uArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - listInt8uArgument = temp_0; - } - [cluster writeAttributeListInt8uWithValue:listInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST With List of INT8U and none of them is set to 0 Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U Max Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 65534U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValue("status", err, 0)); + CHIP_ERROR TestWriteAttributeNullableInt16uInvalidValue_225() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - NextTest(); - }]; + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Invalid Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeListWithListOfInt8u_169() + CHIP_ERROR TestReadAttributeNullableInt16uUnchangedValue_226() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST With List of INT8U Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValue("", actualValue[0], 1)); - VerifyOrReturn(CheckValue("", actualValue[1], 2)); - VerifyOrReturn(CheckValue("", actualValue[2], 3)); - VerifyOrReturn(CheckValue("", actualValue[3], 4)); + VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 65534U)); } NextTest(); @@ -53920,51 +61639,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeListWithListOfOctetString_170() + CHIP_ERROR TestWriteAttributeNullableInt16uNullValue_227() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listOctetStringArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[NSData alloc] initWithBytes:"Test0" length:5]; - temp_0[1] = [[NSData alloc] initWithBytes:"Test1" length:5]; - temp_0[2] = [[NSData alloc] initWithBytes:"Test2" length:5]; - temp_0[3] = [[NSData alloc] initWithBytes:"Test3" length:5]; - listOctetStringArgument = temp_0; - } - [cluster writeAttributeListOctetStringWithValue:listOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST With List of OCTET_STRING Error: %@", err); + id nullableInt16uArgument; + nullableInt16uArgument = nil; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeListWithListOfOctetString_171() + CHIP_ERROR TestReadAttributeNullableInt16uNullValue_228() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST With List of OCTET_STRING Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("list_octet_string", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValueAsString("", actualValue[0], [[NSData alloc] initWithBytes:"Test0" length:5])); - VerifyOrReturn(CheckValueAsString("", actualValue[1], [[NSData alloc] initWithBytes:"Test1" length:5])); - VerifyOrReturn(CheckValueAsString("", actualValue[2], [[NSData alloc] initWithBytes:"Test2" length:5])); - VerifyOrReturn(CheckValueAsString("", actualValue[3], [[NSData alloc] initWithBytes:"Test3" length:5])); + VerifyOrReturn(CheckValueNull("nullable_int16u", actualValue)); } NextTest(); @@ -53973,83 +61681,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_172() + CHIP_ERROR TestReadAttributeNullableInt16uNullValueRange_229() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listStructOctetStringArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedLongLong:0ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).operationalCert = [[NSData alloc] initWithBytes:"Test0" - length:5]; - - temp_0[1] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedLongLong:1ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).operationalCert = [[NSData alloc] initWithBytes:"Test1" - length:5]; - - temp_0[2] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedLongLong:2ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).operationalCert = [[NSData alloc] initWithBytes:"Test2" - length:5]; - - temp_0[3] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).fabricIndex = [NSNumber numberWithUnsignedLongLong:3ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).operationalCert = [[NSData alloc] initWithBytes:"Test3" - length:5]; + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U null Value & range Error: %@", err); - listStructOctetStringArgument = temp_0; - } - [cluster writeAttributeListStructOctetStringWithValue:listStructOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", [value unsignedShortValue], 65534U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_173() + CHIP_ERROR TestReadAttributeNullableInt16uNullValueNot_230() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListStructOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_struct_octet_string", [actualValue count], static_cast(4))); - VerifyOrReturn( - CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).fabricIndex, 0ULL)); - VerifyOrReturn(CheckValueAsString("operationalCert", - ((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).operationalCert, - [[NSData alloc] initWithBytes:"Test0" length:5])); - VerifyOrReturn( - CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).fabricIndex, 1ULL)); - VerifyOrReturn(CheckValueAsString("operationalCert", - ((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).operationalCert, - [[NSData alloc] initWithBytes:"Test1" length:5])); - VerifyOrReturn( - CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).fabricIndex, 2ULL)); - VerifyOrReturn(CheckValueAsString("operationalCert", - ((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).operationalCert, - [[NSData alloc] initWithBytes:"Test2" length:5])); - VerifyOrReturn( - CheckValue("fabricIndex", ((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).fabricIndex, 3ULL)); - VerifyOrReturn(CheckValueAsString("operationalCert", - ((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).operationalCert, - [[NSData alloc] initWithBytes:"Test3" length:5])); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", value, 65534U)); } NextTest(); @@ -54058,98 +61726,63 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithOptionalArgSet_174() + CHIP_ERROR TestWriteAttributeNullableInt16uValue_231() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:5]; - [cluster - testNullableOptionalRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command with optional arg set. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.wasPresent; - VerifyOrReturn(CheckValue("wasPresent", actualValue, true)); - } - - { - id actualValue = values.wasNull; - VerifyOrReturn(CheckValue("wasNull", actualValue, false)); - } - - { - id actualValue = values.value; - VerifyOrReturn(CheckValue("value", actualValue, 5)); - } + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:32000U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Value Error: %@", err); - { - id actualValue = values.originalValue; - VerifyOrReturn(CheckValueNonNull("originalValue", actualValue)); - VerifyOrReturn(CheckValue("originalValue", actualValue, 5)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_175() + CHIP_ERROR TestReadAttributeNullableInt16uValueInRange_232() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; - [cluster - testNullableOptionalRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command without its optional arg. Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U Value in range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.wasPresent; - VerifyOrReturn(CheckValue("wasPresent", actualValue, false)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", [value unsignedShortValue], 65534U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionals_176() + CHIP_ERROR TestReadAttributeNullableInt16uNotValueOk_233() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( - NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read list of structs containing nullables and optionals Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_nullables_and_optionals_struct", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValueNull( - "NullableInt", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt)); - VerifyOrReturn(CheckValueNull( - "NullableString", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString)); - VerifyOrReturn(CheckValueNull( - "NullableStruct", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct)); - VerifyOrReturn(CheckValueNull( - "NullableList", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", value, 32001U)); } NextTest(); @@ -54158,72 +61791,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteListOfStructsContainingNullablesAndOptionals_177() + CHIP_ERROR TestWriteAttributeNullableInt32uMinValue_234() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listNullablesAndOptionalsStructArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterNullablesAndOptionalsStruct alloc] init]; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableInt = nil; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableString = nil; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableStruct = nil; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [NSNumber numberWithUnsignedChar:1]; - temp_3[1] = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableList = temp_3; - } - - listNullablesAndOptionalsStructArgument = temp_0; - } - [cluster - writeAttributeListNullablesAndOptionalsStructWithValue:listNullablesAndOptionalsStructArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write list of structs containing nullables and optionals Error: %@", - err); + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadListOfStructsContainingNullablesAndOptionalsAfterWriting_178() + CHIP_ERROR TestReadAttributeNullableInt32uMinValue_235() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( - NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read list of structs containing nullables and optionals after writing Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("list_nullables_and_optionals_struct", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValueNull( - "NullableInt", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt)); - VerifyOrReturn(CheckValueNull( - "NullableString", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString)); - VerifyOrReturn(CheckValueNull( - "NullableStruct", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct)); - VerifyOrReturn(CheckValueNonNull( - "NullableList", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList)); - VerifyOrReturn(CheckValue("NullableList", - [((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList count], - static_cast(2))); - VerifyOrReturn( - CheckValue("", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[0], 1)); - VerifyOrReturn( - CheckValue("", ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[1], 2)); + VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 0UL)); } NextTest(); @@ -54232,40 +61834,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBooleanNull_179() + CHIP_ERROR TestWriteAttributeNullableInt32uMaxValue_236() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBooleanArgument; - nullableBooleanArgument = nil; - [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BOOLEAN null Error: %@", err); + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967294UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBooleanNull_180() + CHIP_ERROR TestReadAttributeNullableInt32uMaxValue_237() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BOOLEAN null Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_boolean", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 4294967294UL)); } NextTest(); @@ -54274,41 +61877,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBooleanTrue_181() + CHIP_ERROR TestWriteAttributeNullableInt32uInvalidValue_238() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBooleanArgument; - nullableBooleanArgument = [NSNumber numberWithBool:true]; - [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BOOLEAN True Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBooleanTrue_182() + CHIP_ERROR TestReadAttributeNullableInt32uUnchangedValue_239() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BOOLEAN True Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_boolean", actualValue)); - VerifyOrReturn(CheckValue("nullable_boolean", actualValue, true)); + VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 4294967294UL)); } NextTest(); @@ -54317,41 +61919,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap8MaxValue_183() + CHIP_ERROR TestWriteAttributeNullableInt32uNullValue_240() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap8Argument; - nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP8 Max Value Error: %@", err); + id nullableInt32uArgument; + nullableInt32uArgument = nil; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap8MaxValue_184() + CHIP_ERROR TestReadAttributeNullableInt32uNullValue_241() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP8 Max Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap8", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap8", actualValue, 254)); + VerifyOrReturn(CheckValueNull("nullable_int32u", actualValue)); } NextTest(); @@ -54360,40 +61961,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap8InvalidValue_185() + CHIP_ERROR TestReadAttributeNullableInt32uNullValueRange_242() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap8Argument; - nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP8 Invalid Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", [value unsignedIntValue], 0UL)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", [value unsignedIntValue], 4294967294UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap8UnchangedValue_186() + CHIP_ERROR TestReadAttributeNullableInt32uNullValueNot_243() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP8 unchanged Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap8", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap8", actualValue, 254)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", value, 4294967294UL)); } NextTest(); @@ -54402,40 +62006,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap8NullValue_187() + CHIP_ERROR TestWriteAttributeNullableInt32uValue_244() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap8Argument; - nullableBitmap8Argument = nil; - [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP8 null Value Error: %@", err); + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:2147483647UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap8NullValue_188() + CHIP_ERROR TestReadAttributeNullableInt32uValueInRange_245() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP8 null Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_bitmap8", actualValue)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", [value unsignedIntValue], 0UL)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", [value unsignedIntValue], 4294967294UL)); } NextTest(); @@ -54444,41 +62050,62 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap16MaxValue_189() + CHIP_ERROR TestReadAttributeNullableInt32uNotValueOk_246() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap16Argument; - nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP16 Max Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U notValue OK Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", value, 2147483648UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap16MaxValue_190() + CHIP_ERROR TestWriteAttributeNullableInt64uMinValue_247() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP16 Max Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableInt64uMinValue_248() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap16", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap16", actualValue, 65534U)); + VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 0ULL)); } NextTest(); @@ -54487,40 +62114,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap16InvalidValue_191() + CHIP_ERROR TestWriteAttributeNullableInt64uMaxValue_249() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap16Argument; - nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP16 Invalid Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap16UnchangedValue_192() + CHIP_ERROR TestReadAttributeNullableInt64uMaxValue_250() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP16 unchanged Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap16", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap16", actualValue, 65534U)); + VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 18446744073709551614ULL)); } NextTest(); @@ -54529,40 +62157,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap16NullValue_193() + CHIP_ERROR TestWriteAttributeNullableInt64uInvalidValue_251() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap16Argument; - nullableBitmap16Argument = nil; - [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP16 null Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap16NullValue_194() + CHIP_ERROR TestReadAttributeNullableInt64uUnchangedValue_252() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP16 null Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_bitmap16", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 18446744073709551614ULL)); } NextTest(); @@ -54571,41 +62199,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap32MaxValue_195() + CHIP_ERROR TestWriteAttributeNullableInt64uNullValue_253() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap32Argument; - nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967294UL]; - [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP32 Max Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = nil; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap32MaxValue_196() + CHIP_ERROR TestReadAttributeNullableInt64uNullValue_254() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP32 Max Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap32", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap32", actualValue, 4294967294UL)); + VerifyOrReturn(CheckValueNull("nullable_int64u", actualValue)); } NextTest(); @@ -54614,40 +62241,44 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap32InvalidValue_197() + CHIP_ERROR TestReadAttributeNullableInt64uNullValueRange_255() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap32Argument; - nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP32 Invalid Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", [value unsignedLongLongValue], 0ULL)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("nullableInt64u", [value unsignedLongLongValue], 18446744073709551614ULL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap32UnchangedValue_198() + CHIP_ERROR TestReadAttributeNullableInt64uNullValueNot_256() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP32 unchanged Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap32", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap32", actualValue, 4294967294UL)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", value, 18446744073709551614ULL)); } NextTest(); @@ -54656,40 +62287,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap32NullValue_199() + CHIP_ERROR TestWriteAttributeNullableInt64uValue_257() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap32Argument; - nullableBitmap32Argument = nil; - [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP32 null Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18000000000000000000ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap32NullValue_200() + CHIP_ERROR TestReadAttributeNullableInt64uValueInRange_258() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP32 null Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_bitmap32", actualValue)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", [value unsignedLongLongValue], 0ULL)); + } + if (value != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("nullableInt64u", [value unsignedLongLongValue], 18446744073709551614ULL)); } NextTest(); @@ -54698,41 +62332,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap64MaxValue_201() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableBitmap64Argument; - nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP64 Max Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeNullableBitmap64MaxValue_202() + CHIP_ERROR TestReadAttributeNullableInt64uNotValueOk_259() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP64 Max Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap64", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap64", actualValue, 18446744073709551614ULL)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", value, 18000000000000000001ULL)); } NextTest(); @@ -54741,40 +62353,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap64InvalidValue_203() + CHIP_ERROR TestWriteAttributeNullableInt8sMinValue_260() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap64Argument; - nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP64 Invalid Value Error: %@", err); + id nullableInt8sArgument; + nullableInt8sArgument = [NSNumber numberWithChar:-127]; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap64UnchangedValue_204() + CHIP_ERROR TestReadAttributeNullableInt8sMinValue_261() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP64 unchanged Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_bitmap64", actualValue)); - VerifyOrReturn(CheckValue("nullable_bitmap64", actualValue, 18446744073709551614ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8s", actualValue, -127)); } NextTest(); @@ -54783,40 +62396,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap64NullValue_205() + CHIP_ERROR TestWriteAttributeNullableInt8sInvalidValue_262() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableBitmap64Argument; - nullableBitmap64Argument = nil; - [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP64 null Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt8sArgument; + nullableInt8sArgument = [NSNumber numberWithChar:-128]; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8S Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableBitmap64NullValue_206() + CHIP_ERROR TestReadAttributeNullableInt8sUnchangedValue_263() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP64 null Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_bitmap64", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int8s", actualValue, -127)); } NextTest(); @@ -54825,17 +62438,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uMinValue_207() + CHIP_ERROR TestWriteAttributeNullableInt8sNullValue_264() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + id nullableInt8sArgument; + nullableInt8sArgument = nil; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Min Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT8S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -54845,21 +62458,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uMinValue_208() + CHIP_ERROR TestReadAttributeNullableInt8sNullValue_265() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U Min Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 0)); + VerifyOrReturn(CheckValueNull("nullable_int8s", actualValue)); } NextTest(); @@ -54868,41 +62480,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uMaxValue_209() + CHIP_ERROR TestReadAttributeNullableInt8sNullValueRange_266() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Max Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", [value charValue], -127)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", [value charValue], 127)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uMaxValue_210() + CHIP_ERROR TestReadAttributeNullableInt8sNullValueNot_267() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U Max Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 254)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", value, -127)); } NextTest(); @@ -54911,40 +62525,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uInvalidValue_211() + CHIP_ERROR TestWriteAttributeNullableInt8sValue_268() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + id nullableInt8sArgument; + nullableInt8sArgument = [NSNumber numberWithChar:-127]; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT8S Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValue_212() + CHIP_ERROR TestReadAttributeNullableInt8sValueInRange_269() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U unchanged Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8u", actualValue, 254)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", [value charValue], -127)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", [value charValue], 127)); } NextTest(); @@ -54953,18 +62569,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValueWithConstraint_213() + CHIP_ERROR TestReadAttributeNullableInt8sNotValueOk_270() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U unchanged Value with constraint Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", value, -126)); + } NextTest(); }]; @@ -54972,40 +62590,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uNullValue_214() + CHIP_ERROR TestWriteAttributeNullableInt16sMinValue_271() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = nil; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U null Value Error: %@", err); + id nullableInt16sArgument; + nullableInt16sArgument = [NSNumber numberWithShort:-32767]; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S Min Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uNullValue_215() + CHIP_ERROR TestReadAttributeNullableInt16sMinValue_272() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U null Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int8u", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16s", actualValue, -32767)); } NextTest(); @@ -55014,22 +62633,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uNullValueRange_216() + CHIP_ERROR TestWriteAttributeNullableInt16sInvalidValue_273() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U null Value & range Error: %@", err); + id nullableInt16sArgument; + nullableInt16sArgument = [NSNumber numberWithShort:-32768]; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S Invalid Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableInt16sUnchangedValue_274() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", [value unsignedCharValue], 254)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int16s", actualValue, -32767)); } NextTest(); @@ -55038,63 +62675,64 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uNullValueNot_217() + CHIP_ERROR TestWriteAttributeNullableInt16sNullValue_275() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U null Value & not Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableInt16sArgument; + nullableInt16sArgument = nil; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S null Value Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", value, 254)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uValue_218() + CHIP_ERROR TestReadAttributeNullableInt16sNullValue_276() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:128]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_int16s", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uValueInRange_219() + CHIP_ERROR TestReadAttributeNullableInt16sNullValueRange_277() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U Value in range Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S null Value & range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", [value unsignedCharValue], 0)); + VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", [value shortValue], -32767)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", [value unsignedCharValue], 254)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", [value shortValue], 32767)); } NextTest(); @@ -55103,19 +62741,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uNotValueOk_220() + CHIP_ERROR TestReadAttributeNullableInt16sNullValueNot_278() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U notValue OK Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", value, 129)); + VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", value, -32767)); } NextTest(); @@ -55124,17 +62762,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uMinValue_221() + CHIP_ERROR TestWriteAttributeNullableInt16sValue_279() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + id nullableInt16sArgument; + nullableInt16sArgument = [NSNumber numberWithShort:-32767]; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Min Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT16S Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55144,21 +62782,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uMinValue_222() + CHIP_ERROR TestReadAttributeNullableInt16sValueInRange_280() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U Min Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 0U)); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", [value shortValue], -32767)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", [value shortValue], 32767)); } NextTest(); @@ -55167,17 +62806,38 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uMaxValue_223() + CHIP_ERROR TestReadAttributeNullableInt16sNotValueOk_281() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S notValue OK Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", value, -32766)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeNullableInt32sMinValue_282() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nullableInt32sArgument; + nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Max Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55187,21 +62847,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uMaxValue_224() + CHIP_ERROR TestReadAttributeNullableInt32sMinValue_283() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U Max Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 65534U)); + VerifyOrReturn(CheckValueNonNull("nullable_int32s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32s", actualValue, -2147483647L)); } NextTest(); @@ -55210,17 +62870,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uInvalidValue_225() + CHIP_ERROR TestWriteAttributeNullableInt32sInvalidValue_284() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + id nullableInt32sArgument; + nullableInt32sArgument = [NSNumber numberWithInt:-2147483648L]; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32S Invalid Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -55229,21 +62889,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uUnchangedValue_226() + CHIP_ERROR TestReadAttributeNullableInt32sUnchangedValue_285() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U unchanged Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16u", actualValue, 65534U)); + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_int32s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int32s", actualValue, -2147483647L)); } NextTest(); @@ -55252,17 +62912,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uNullValue_227() + CHIP_ERROR TestWriteAttributeNullableInt32sNullValue_286() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = nil; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + id nullableInt32sArgument; + nullableInt32sArgument = nil; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U null Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55272,20 +62932,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uNullValue_228() + CHIP_ERROR TestReadAttributeNullableInt32sNullValue_287() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U null Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int16u", actualValue)); + VerifyOrReturn(CheckValueNull("nullable_int32s", actualValue)); } NextTest(); @@ -55294,22 +62954,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uNullValueRange_229() + CHIP_ERROR TestReadAttributeNullableInt32sNullValueRange_288() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U null Value & range Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S null Value & range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", [value intValue], -2147483647L)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", [value unsignedShortValue], 65534U)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", [value intValue], 2147483647L)); } NextTest(); @@ -55318,19 +62978,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uNullValueNot_230() + CHIP_ERROR TestReadAttributeNullableInt32sNullValueNot_289() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U null Value & not Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", value, 65534U)); + VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", value, -2147483647L)); } NextTest(); @@ -55339,17 +62999,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16uValue_231() + CHIP_ERROR TestWriteAttributeNullableInt32sValue_290() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:32000U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + id nullableInt32sArgument; + nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32S Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55359,22 +63019,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uValueInRange_232() + CHIP_ERROR TestReadAttributeNullableInt32sValueInRange_291() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U Value in range Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", [value intValue], -2147483647L)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", [value unsignedShortValue], 65534U)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", [value intValue], 2147483647L)); } NextTest(); @@ -55383,19 +63043,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16uNotValueOk_233() + CHIP_ERROR TestReadAttributeNullableInt32sNotValueOk_292() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U notValue OK Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", value, 32001U)); + VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", value, -2147483646L)); } NextTest(); @@ -55404,17 +63064,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uMinValue_234() + CHIP_ERROR TestWriteAttributeNullableInt64sMinValue_293() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + id nullableInt64sArgument; + nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Min Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT64S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -55424,21 +63084,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uMinValue_235() + CHIP_ERROR TestReadAttributeNullableInt64sMinValue_294() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Min Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 0UL)); + VerifyOrReturn(CheckValueNonNull("nullable_int64s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64s", actualValue, -9223372036854775807LL)); } NextTest(); @@ -55447,41 +63107,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uMaxValue_236() + CHIP_ERROR TestWriteAttributeNullableInt64sInvalidValue_295() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967294UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + id nullableInt64sArgument; + nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL - 1]; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Max Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + NSLog(@"Write attribute NULLABLE_INT64S Invalid Value Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uMaxValue_237() + CHIP_ERROR TestReadAttributeNullableInt64sUnchangedValue_296() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Max Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 4294967294UL)); + VerifyOrReturn(CheckValueNonNull("nullable_int64s", actualValue)); + VerifyOrReturn(CheckValue("nullable_int64s", actualValue, -9223372036854775807LL)); } NextTest(); @@ -55490,40 +63149,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uInvalidValue_238() + CHIP_ERROR TestWriteAttributeNullableInt64sNullValue_297() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + id nullableInt64sArgument; + nullableInt64sArgument = nil; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT64S null Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uUnchangedValue_239() + CHIP_ERROR TestReadAttributeNullableInt64sNullValue_298() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U unchanged Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32u", actualValue, 4294967294UL)); + VerifyOrReturn(CheckValueNull("nullable_int64s", actualValue)); } NextTest(); @@ -55532,40 +63191,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uNullValue_240() + CHIP_ERROR TestReadAttributeNullableInt64sNullValueRange_299() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = nil; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U null Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S null Value & range Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", [value longLongValue], -9223372036854775807LL)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", [value longLongValue], 9223372036854775807LL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uNullValue_241() + CHIP_ERROR TestReadAttributeNullableInt64sNullValueNot_300() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S null Value & not Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int32u", actualValue)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", value, -9223372036854775807LL)); } NextTest(); @@ -55574,22 +63236,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uNullValueRange_242() + CHIP_ERROR TestWriteAttributeNullableInt64sValue_301() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value & range Error: %@", err); + id nullableInt64sArgument; + nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64S Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableInt64sValueInRange_302() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S Value in range Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", [value longLongValue], -9223372036854775807LL)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", [value unsignedIntValue], 4294967294UL)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", [value longLongValue], 9223372036854775807LL)); } NextTest(); @@ -55598,19 +63280,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uNullValueNot_243() + CHIP_ERROR TestReadAttributeNullableInt64sNotValueOk_303() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value & not Error: %@", err); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S notValue OK Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", value, 4294967294UL)); + VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", value, -9223372036854775806LL)); } NextTest(); @@ -55619,42 +63301,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32uValue_244() + CHIP_ERROR TestWriteAttributeNullableSingleMediumValue_304() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:2147483647UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Value Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:0.1f]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE medium Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uValueInRange_245() + CHIP_ERROR TestReadAttributeNullableSingleMediumValue_305() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Value in range Error: %@", err); + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE medium Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", [value unsignedIntValue], 0UL)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", [value unsignedIntValue], 4294967294UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_single", actualValue, 0.1f)); } NextTest(); @@ -55663,19 +63344,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32uNotValueOk_246() + CHIP_ERROR TestWriteAttributeNullableSingleLargestValue_306() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U notValue OK Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:INFINITY]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE largest Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableSingleLargestValue_307() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE largest Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", value, 2147483648UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_single", actualValue, INFINITY)); } NextTest(); @@ -55684,41 +63387,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uMinValue_247() + CHIP_ERROR TestWriteAttributeNullableSingleSmallestValue_308() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Min Value Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:-INFINITY]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE smallest Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uMinValue_248() + CHIP_ERROR TestReadAttributeNullableSingleSmallestValue_309() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Min Value Error: %@", err); + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE smallest Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 0ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_single", actualValue, -INFINITY)); } NextTest(); @@ -55727,41 +63430,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uMaxValue_249() + CHIP_ERROR TestWriteAttributeNullableSingleNullValue_310() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Max Value Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = nil; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uMaxValue_250() + CHIP_ERROR TestReadAttributeNullableSingleNullValue_311() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Max Value Error: %@", err); + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 18446744073709551614ULL)); + VerifyOrReturn(CheckValueNull("nullable_float_single", actualValue)); } NextTest(); @@ -55770,40 +63472,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uInvalidValue_251() + CHIP_ERROR TestWriteAttributeNullableSingle0Value_312() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Invalid Value Error: %@", err); + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:0.0f]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE 0 Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uUnchangedValue_252() + CHIP_ERROR TestReadAttributeNullableSingle0Value_313() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U unchanged Value Error: %@", err); + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE 0 Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64u", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64u", actualValue, 18446744073709551614ULL)); + VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_single", actualValue, 0.0f)); } NextTest(); @@ -55812,40 +63515,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uNullValue_253() + CHIP_ERROR TestWriteAttributeNullableDoubleMediumValue_314() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = nil; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U null Value Error: %@", err); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE medium Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uNullValue_254() + CHIP_ERROR TestReadAttributeNullableDoubleMediumValue_315() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value Error: %@", err); + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE medium Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int64u", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_double", actualValue, 0.1234567890123)); } NextTest(); @@ -55854,44 +63558,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uNullValueRange_255() + CHIP_ERROR TestWriteAttributeNullableDoubleLargestValue_316() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:INFINITY]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE largest Value Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", [value unsignedLongLongValue], 0ULL)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("nullableInt64u", [value unsignedLongLongValue], 18446744073709551614ULL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uNullValueNot_256() + CHIP_ERROR TestReadAttributeNullableDoubleLargestValue_317() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value & not Error: %@", err); + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE largest Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", value, 18446744073709551614ULL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_double", actualValue, INFINITY)); } NextTest(); @@ -55900,43 +63601,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64uValue_257() + CHIP_ERROR TestWriteAttributeNullableDoubleSmallestValue_318() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18000000000000000000ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Value Error: %@", err); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:-INFINITY]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE smallest Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uValueInRange_258() + CHIP_ERROR TestReadAttributeNullableDoubleSmallestValue_319() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Value in range Error: %@", err); + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE smallest Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", [value unsignedLongLongValue], 0ULL)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("nullableInt64u", [value unsignedLongLongValue], 18446744073709551614ULL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_double", actualValue, -INFINITY)); } NextTest(); @@ -55945,19 +63644,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64uNotValueOk_259() + CHIP_ERROR TestWriteAttributeNullableDoubleNullValue_320() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U notValue OK Error: %@", err); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = nil; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE null Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableDoubleNullValue_321() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", value, 18000000000000000001ULL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_float_double", actualValue)); } NextTest(); @@ -55966,41 +63686,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8sMinValue_260() + CHIP_ERROR TestWriteAttributeNullableDouble0Value_322() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Min Value Error: %@", err); + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:0]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE 0 Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sMinValue_261() + CHIP_ERROR TestReadAttributeNullableDouble0Value_323() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S Min Value Error: %@", err); + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE 0 Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8s", actualValue, -127)); + VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("nullable_float_double", actualValue, 0)); } NextTest(); @@ -56009,40 +63729,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8sInvalidValue_262() + CHIP_ERROR TestWriteAttributeNullableEnum8MinValue_324() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + id nullableEnum8Argument; + nullableEnum8Argument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM8 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sUnchangedValue_263() + CHIP_ERROR TestReadAttributeNullableEnum8MinValue_325() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S unchanged Value Error: %@", err); + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int8s", actualValue, -127)); + VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 0)); } NextTest(); @@ -56051,17 +63772,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8sNullValue_264() + CHIP_ERROR TestWriteAttributeNullableEnum8MaxValue_326() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8sArgument; - nullableInt8sArgument = nil; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + id nullableEnum8Argument; + nullableEnum8Argument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S null Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM8 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -56071,20 +63792,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sNullValue_265() + CHIP_ERROR TestReadAttributeNullableEnum8MaxValue_327() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value Error: %@", err); + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int8s", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 254)); } NextTest(); @@ -56093,43 +63815,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sNullValueRange_266() + CHIP_ERROR TestWriteAttributeNullableEnum8InvalidValue_328() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", [value charValue], -127)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", [value charValue], 127)); - } + id nullableEnum8Argument; + nullableEnum8Argument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM8 Invalid Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sNullValueNot_267() + CHIP_ERROR TestReadAttributeNullableEnum8UnchangedValue_329() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value & not Error: %@", err); + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", value, -127)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 254)); } NextTest(); @@ -56138,17 +63857,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8sValue_268() + CHIP_ERROR TestWriteAttributeNullableEnum8NullValue_330() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + id nullableEnum8Argument; + nullableEnum8Argument = nil; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM8 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -56158,22 +63877,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sValueInRange_269() + CHIP_ERROR TestReadAttributeNullableEnum8NullValue_331() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S Value in range Error: %@", err); + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", [value charValue], -127)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", [value charValue], 127)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_enum8", actualValue)); } NextTest(); @@ -56182,19 +63899,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8sNotValueOk_270() + CHIP_ERROR TestWriteAttributeNullableEnum16MinValue_332() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S notValue OK Error: %@", err); + id nullableEnum16Argument; + nullableEnum16Argument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM16 Min Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableEnum16MinValue_333() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", value, -126)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 0U)); } NextTest(); @@ -56203,17 +63942,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16sMinValue_271() + CHIP_ERROR TestWriteAttributeNullableEnum16MaxValue_334() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + id nullableEnum16Argument; + nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Min Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -56223,21 +63962,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sMinValue_272() + CHIP_ERROR TestReadAttributeNullableEnum16MaxValue_335() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S Min Value Error: %@", err); + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16s", actualValue, -32767)); + VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 65534U)); } NextTest(); @@ -56246,17 +63985,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16sInvalidValue_273() + CHIP_ERROR TestWriteAttributeNullableEnum16InvalidValue_336() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32768]; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + id nullableEnum16Argument; + nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM16 Invalid Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -56265,21 +64004,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sUnchangedValue_274() + CHIP_ERROR TestReadAttributeNullableEnum16UnchangedValue_337() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S unchanged Value Error: %@", err); + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int16s", actualValue, -32767)); + VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 65534U)); } NextTest(); @@ -56288,17 +64027,17 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16sNullValue_275() + CHIP_ERROR TestWriteAttributeNullableEnum16NullValue_338() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16sArgument; - nullableInt16sArgument = nil; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + id nullableEnum16Argument; + nullableEnum16Argument = nil; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S null Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_ENUM16 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -56308,20 +64047,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sNullValue_276() + CHIP_ERROR TestReadAttributeNullableEnum16NullValue_339() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value Error: %@", err); + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int16s", actualValue)); + VerifyOrReturn(CheckValueNull("nullable_enum16", actualValue)); } NextTest(); @@ -56330,43 +64069,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sNullValueRange_277() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumMinValue_340() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableEnumAttrArgument; + nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", [value shortValue], -32767)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", [value shortValue], 32767)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sNullValueNot_278() + CHIP_ERROR TestReadAttributeNullableSimpleEnumMinValue_341() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value & not Error: %@", err); + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", value, -32767)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 0)); } NextTest(); @@ -56375,42 +64112,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt16sValue_279() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumMaxValue_342() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Value Error: %@", err); + id nullableEnumAttrArgument; + nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sValueInRange_280() + CHIP_ERROR TestReadAttributeNullableSimpleEnumMaxValue_343() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S Value in range Error: %@", err); + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", [value shortValue], -32767)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", [value shortValue], 32767)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 254)); } NextTest(); @@ -56419,19 +64155,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt16sNotValueOk_281() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumInvalidValue_344() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S notValue OK Error: %@", err); + id nullableEnumAttrArgument; + nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Invalid Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableSimpleEnumUnchangedValue_345() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM unchanged Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", value, -32766)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); + VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 254)); } NextTest(); @@ -56440,41 +64197,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32sMinValue_282() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumNullValue_346() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Min Value Error: %@", err); + id nullableEnumAttrArgument; + nullableEnumAttrArgument = nil; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sMinValue_283() + CHIP_ERROR TestReadAttributeNullableSimpleEnumNullValue_347() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S Min Value Error: %@", err); + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32s", actualValue, -2147483647L)); + VerifyOrReturn(CheckValueNull("nullable_enum_attr", actualValue)); } NextTest(); @@ -56483,40 +64239,22 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32sInvalidValue_284() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483648L]; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Invalid Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeNullableInt32sUnchangedValue_285() + CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_348() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S unchanged Value Error: %@", err); + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int32s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int32s", actualValue, -2147483647L)); + VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); + VerifyOrReturn( + CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } NextTest(); @@ -56525,40 +64263,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32sNullValue_286() + CHIP_ERROR TestWriteAttributeNullableOctetString_349() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32sArgument; - nullableInt32sArgument = nil; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S null Value Error: %@", err); + id nullableOctetStringArgument; + nullableOctetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; + [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sNullValue_287() + CHIP_ERROR TestReadAttributeNullableOctetString_350() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value Error: %@", err); + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int32s", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); + VerifyOrReturn( + CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); } NextTest(); @@ -56567,43 +64307,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sNullValueRange_288() + CHIP_ERROR TestWriteAttributeNullableOctetString_351() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableOctetStringArgument; + nullableOctetStringArgument = nil; + [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", [value intValue], -2147483647L)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", [value intValue], 2147483647L)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sNullValueNot_289() + CHIP_ERROR TestReadAttributeNullableOctetString_352() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value & not Error: %@", err); + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", value, -2147483647L)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_octet_string", actualValue)); } NextTest(); @@ -56612,42 +64349,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt32sValue_290() + CHIP_ERROR TestWriteAttributeNullableOctetString_353() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Value Error: %@", err); + id nullableOctetStringArgument; + nullableOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; + [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sValueInRange_291() + CHIP_ERROR TestReadAttributeNullableOctetString_354() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S Value in range Error: %@", err); + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", [value intValue], -2147483647L)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", [value intValue], 2147483647L)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); + VerifyOrReturn( + CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } NextTest(); @@ -56656,19 +64393,21 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt32sNotValueOk_292() + CHIP_ERROR TestReadAttributeNullableCharStringDefaultValue_355() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S notValue OK Error: %@", err); + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", value, -2147483646L)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); + VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"")); } NextTest(); @@ -56677,41 +64416,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64sMinValue_293() + CHIP_ERROR TestWriteAttributeNullableCharString_356() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Min Value Error: %@", err); + id nullableCharStringArgument; + nullableCharStringArgument = @"☉T☉"; + [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_CHAR_STRING Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sMinValue_294() + CHIP_ERROR TestReadAttributeNullableCharString_357() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S Min Value Error: %@", err); + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64s", actualValue, -9223372036854775807LL)); + VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); + VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"☉T☉")); } NextTest(); @@ -56720,40 +64459,40 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64sInvalidValue_295() + CHIP_ERROR TestWriteAttributeNullableCharStringValueTooLong_358() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL - 1]; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Invalid Value Error: %@", err); + id nullableCharStringArgument; + nullableCharStringArgument = nil; + [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_CHAR_STRING - Value too long Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sUnchangedValue_296() + CHIP_ERROR TestReadAttributeNullableCharString_359() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S unchanged Value Error: %@", err); + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_int64s", actualValue)); - VerifyOrReturn(CheckValue("nullable_int64s", actualValue, -9223372036854775807LL)); + VerifyOrReturn(CheckValueNull("nullable_char_string", actualValue)); } NextTest(); @@ -56762,40 +64501,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64sNullValue_297() + CHIP_ERROR TestWriteAttributeNullableCharStringEmpty_360() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64sArgument; - nullableInt64sArgument = nil; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S null Value Error: %@", err); + id nullableCharStringArgument; + nullableCharStringArgument = @""; + [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_CHAR_STRING - Empty Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sNullValue_298() + CHIP_ERROR TestReadAttributeNullableCharString_361() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value Error: %@", err); + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_int64s", actualValue)); + VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); + VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"")); } NextTest(); @@ -56804,194 +64544,207 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sNullValueRange_299() + CHIP_ERROR TestReadAttributeFromNonexistentEndpoint_362() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value & range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", [value longLongValue], -9223372036854775807LL)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", [value longLongValue], 9223372036854775807LL)); - } + [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute from nonexistent endpoint. Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sNullValueNot_300() + CHIP_ERROR TestReadAttributeFromNonexistentCluster_363() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value & not Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", value, -9223372036854775807LL)); - } + [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute from nonexistent cluster. Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt64sValue_301() + CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_364() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; + [cluster + testSimpleOptionalArgumentRequestWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Send a command that takes an optional parameter but do not set it. Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_VALUE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt64sValueInRange_302() + CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_365() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S Value in range Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithBool:1]; + [cluster + testSimpleOptionalArgumentRequestWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Send a command that takes an optional parameter but do not set it. Error: %@", err); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", [value longLongValue], -9223372036854775807LL)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", [value longLongValue], 9223372036854775807LL)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + bool testSendClusterTestCluster_000366_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_TestCluster_list_int8u_Reported = nil; - CHIP_ERROR TestReadAttributeNullableInt64sNotValueOk_303() + CHIP_ERROR TestReportSubscribeToListAttribute_366() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S notValue OK Error: %@", err); + test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: Subscribe to list attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", value, -9223372036854775806LL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 1)); + VerifyOrReturn(CheckValue("", actualValue[1], 2)); + VerifyOrReturn(CheckValue("", actualValue[2], 3)); + VerifyOrReturn(CheckValue("", actualValue[3], 4)); } - NextTest(); - }]; + testSendClusterTestCluster_000366_WaitForReport_Fulfilled = true; + }; + NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingleMediumValue_304() + CHIP_ERROR TestSubscribeToListAttribute_367() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:0.1f]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE medium Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + uint16_t minIntervalArgument = 2U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeListInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn( + testSendClusterTestCluster_000366_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + NextTest(); + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Subscribe to list attribute Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_TestCluster_list_int8u_Reported != nil) { + ResponseHandler callback = test_TestCluster_list_int8u_Reported; + test_TestCluster_list_int8u_Reported = nil; + callback(value, err); + } + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingleMediumValue_305() + CHIP_ERROR TestWriteSubscribedToListAttribute_368() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE medium Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id listInt8uArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:5]; + temp_0[1] = [NSNumber numberWithUnsignedChar:6]; + temp_0[2] = [NSNumber numberWithUnsignedChar:7]; + temp_0[3] = [NSNumber numberWithUnsignedChar:8]; + listInt8uArgument = temp_0; + } + [cluster writeAttributeListInt8uWithValue:listInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write subscribed-to list attribute Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_single", actualValue, 0.1f)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingleLargestValue_306() + CHIP_ERROR TestCheckForListAttributeReport_369() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:INFINITY]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE largest Value Error: %@", err); + test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check for list attribute report Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("", actualValue[0], 5)); + VerifyOrReturn(CheckValue("", actualValue[1], 6)); + VerifyOrReturn(CheckValue("", actualValue[2], 7)); + VerifyOrReturn(CheckValue("", actualValue[3], 8)); + } + + NextTest(); + }; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingleLargestValue_307() + CHIP_ERROR TestReadRangeRestrictedUnsigned8BitInteger_370() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE largest Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted unsigned 8-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_single", actualValue, INFINITY)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 70)); } NextTest(); @@ -57000,83 +64753,102 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingleSmallestValue_308() + CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:-INFINITY]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE smallest Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted unsigned 8-bit integer Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingleSmallestValue_309() + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_372() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE smallest Value Error: %@", err); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; + [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a range-restricted unsigned 8-bit integer " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_single", actualValue, -INFINITY)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_373() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; + [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a range-restricted unsigned 8-bit integer " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingleNullValue_310() + CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = nil; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE null Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted unsigned 8-bit integer Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingleNullValue_311() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE null Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value has not changed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_float_single", actualValue)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 70)); } NextTest(); @@ -57085,41 +64857,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSingle0Value_312() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:0.0f]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE 0 Value Error: %@", err); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write min valid value to a range-restricted unsigned 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSingle0Value_313() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE 0 Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_single", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_single", actualValue, 0.0f)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 20)); } NextTest(); @@ -57128,41 +64901,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDoubleMediumValue_314() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE medium Value Error: %@", err); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write max valid value to a range-restricted unsigned 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDoubleMediumValue_315() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE medium Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_double", actualValue, 0.1234567890123)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 100)); } NextTest(); @@ -57171,41 +64945,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDoubleLargestValue_316() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:INFINITY]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE largest Value Error: %@", err); + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted unsigned 8-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDoubleLargestValue_317() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE largest Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_double", actualValue, INFINITY)); + VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 50)); } NextTest(); @@ -57214,83 +64989,124 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDoubleSmallestValue_318() + CHIP_ERROR TestReadRangeRestrictedUnsigned16BitInteger_382() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:-INFINITY]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE smallest Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted unsigned 16-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 200U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDoubleSmallestValue_319() + CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE smallest Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted unsigned 16-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_double", actualValue, -INFINITY)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_384() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; + [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a range-restricted unsigned 16-bit integer " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDoubleNullValue_320() + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_385() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = nil; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE null Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; + [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a range-restricted unsigned 16-bit integer " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted unsigned 16-bit integer Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDoubleNullValue_321() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE null Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value has not changed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_float_double", actualValue)); + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 200U)); } NextTest(); @@ -57299,41 +65115,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableDouble0Value_322() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:0]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE 0 Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a range-restricted unsigned 16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableDouble0Value_323() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE 0 Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_float_double", actualValue)); - VerifyOrReturn(CheckValue("nullable_float_double", actualValue, 0)); + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 100U)); } NextTest(); @@ -57342,41 +65159,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum8MinValue_324() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Min Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a range-restricted unsigned 16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum8MinValue_325() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 Min Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 0)); + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 1000U)); } NextTest(); @@ -57385,41 +65203,43 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum8MaxValue_326() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Max Value Error: %@", err); + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write middle valid value to a range-restricted unsigned 16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum8MaxValue_327() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 Max Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 254)); + VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 500U)); } NextTest(); @@ -57428,40 +65248,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum8InvalidValue_328() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Invalid Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeNullableEnum8UnchangedValue_329() + CHIP_ERROR TestReadRangeRestrictedSigned8BitInteger_394() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 unchanged Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted signed 8-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum8", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum8", actualValue, 254)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -20)); } NextTest(); @@ -57470,83 +65270,102 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum8NullValue_330() + CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned8BitInteger_395() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum8Argument; - nullableEnum8Argument = nil; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 null Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-128]; + [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted signed 8-bit integer Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum8NullValue_331() + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_396() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 null Value Error: %@", err); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write just-below-range value to a range-restricted signed 8-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_enum8", actualValue)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_397() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write just-above-range value to a range-restricted signed 8-bit integer Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum16MinValue_332() + CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; + [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted signed 8-bit integer Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum16MinValue_333() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 Min Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value has not changed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 0U)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -20)); } NextTest(); @@ -57555,41 +65374,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum16MaxValue_334() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Max Value Error: %@", err); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a range-restricted signed 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum16MaxValue_335() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 Max Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value is at min valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 65534U)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -40)); } NextTest(); @@ -57598,40 +65417,41 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum16InvalidValue_336() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Invalid Value Error: %@", err); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a range-restricted signed 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum16UnchangedValue_337() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 unchanged Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value is at max valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum16", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum16", actualValue, 65534U)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, 50)); } NextTest(); @@ -57640,40 +65460,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableEnum16NullValue_338() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnum16Argument; - nullableEnum16Argument = nil; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 null Value Error: %@", err); + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted signed 8-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableEnum16NullValue_339() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 null Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value is at mid valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_enum16", actualValue)); + VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, 6)); } NextTest(); @@ -57682,41 +65504,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSimpleEnumMinValue_340() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableEnumAttrArgument; - nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeNullableSimpleEnumMinValue_341() + CHIP_ERROR TestReadRangeRestrictedSigned16BitInteger_406() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted signed 16-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 0)); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -100)); } NextTest(); @@ -57725,60 +65526,80 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSimpleEnumMaxValue_342() + CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned16BitInteger_407() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnumAttrArgument; - nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32768]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + NSLog(@"Write min value to a range-restricted signed 16-bit integer Error: %@", err); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSimpleEnumMaxValue_343() + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_408() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; + [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a range-restricted signed 16-bit integer " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 254)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_409() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; + [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a range-restricted signed 16-bit integer " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSimpleEnumInvalidValue_344() + CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnumAttrArgument; - nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Invalid Value Error: %@", err); + NSLog(@"Write max value to a range-restricted signed 16-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -57787,21 +65608,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSimpleEnumUnchangedValue_345() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM unchanged Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value has not changed Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_enum_attr", actualValue)); - VerifyOrReturn(CheckValue("nullable_enum_attr", actualValue, 254)); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -100)); } NextTest(); @@ -57810,17 +65630,19 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableSimpleEnumNullValue_346() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableEnumAttrArgument; - nullableEnumAttrArgument = nil; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); + NSLog( + @"Write min valid value to a range-restricted signed 16-bit integer Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -57830,20 +65652,20 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableSimpleEnumNullValue_347() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value is at min valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_enum_attr", actualValue)); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -150)); } NextTest(); @@ -57852,22 +65674,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_348() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Default Value Error: %@", err); + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write max valid value to a range-restricted signed 16-bit integer Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value is at max valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); - VerifyOrReturn( - CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, 200)); } NextTest(); @@ -57876,42 +65718,42 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_349() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableOctetStringArgument; - nullableOctetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted signed 16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_350() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value is at mid valid Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); - VerifyOrReturn( - CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"TestValue" length:9])); + VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, 7)); } NextTest(); @@ -57920,1321 +65762,1377 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_351() + CHIP_ERROR TestReadNullableRangeRestrictedUnsigned8BitInteger_418() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableOctetStringArgument; - nullableOctetStringArgument = nil; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted unsigned 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 70)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_352() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_octet_string", actualValue)); - } + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_420() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted " + @"unsigned 8-bit integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_353() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_421() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableOctetStringArgument; - nullableOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted " + @"unsigned 8-bit integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_354() + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_octet_string", actualValue)); - VerifyOrReturn( - CheckValueAsString("nullable_octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); - } + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableCharStringDefaultValue_355() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Default Value Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value has not changed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); - VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"")); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 70)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableCharString_356() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_424() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableCharStringArgument; - nullableCharStringArgument = @"☉T☉"; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableCharString_357() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_425() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); - VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"☉T☉")); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 20)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableCharStringValueTooLong_358() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_426() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableCharStringArgument; - nullableCharStringArgument = nil; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING - Value too long Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableCharString_359() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_427() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_char_string", actualValue)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 100)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableCharStringEmpty_360() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_428() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableCharStringArgument; - nullableCharStringArgument = @""; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING - Empty Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted unsigned " + @"8-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableCharString_361() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_429() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_char_string", actualValue)); - VerifyOrReturn(CheckValueAsString("nullable_char_string", actualValue, @"")); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 50)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeFromNonexistentEndpoint_362() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute from nonexistent endpoint. Error: %@", err); + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeFromNonexistentCluster_363() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute from nonexistent cluster. Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_range_restricted_int8u", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_364() + CHIP_ERROR TestReadNullableRangeRestrictedUnsigned16BitInteger_432() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; [cluster - testSimpleOptionalArgumentRequestWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Send a command that takes an optional parameter but do not set it. Error: %@", err); + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted unsigned 16-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_VALUE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 200U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_365() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithBool:1]; + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; [cluster - testSimpleOptionalArgumentRequestWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Send a command that takes an optional parameter but do not set it. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted unsigned 16-bit integer " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - bool testSendClusterTestCluster_000366_WaitForReport_Fulfilled = false; - ResponseHandler _Nullable test_TestCluster_list_int8u_Reported = nil; - CHIP_ERROR TestReportSubscribeToListAttribute_366() + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_434() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Report: Subscribe to list attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValue("", actualValue[0], 1)); - VerifyOrReturn(CheckValue("", actualValue[1], 2)); - VerifyOrReturn(CheckValue("", actualValue[2], 3)); - VerifyOrReturn(CheckValue("", actualValue[3], 4)); - } + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; + [cluster + writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - testSendClusterTestCluster_000366_WaitForReport_Fulfilled = true; - }; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; - NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR TestSubscribeToListAttribute_367() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_435() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - uint16_t minIntervalArgument = 2U; - uint16_t maxIntervalArgument = 5U; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - [cluster subscribeAttributeListInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] - maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] - params:params - subscriptionEstablished:^{ - VerifyOrReturn( - testSendClusterTestCluster_000366_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); - NextTest(); - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Subscribe to list attribute Error: %@", err); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; + [cluster + writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, 0)); - if (test_TestCluster_list_int8u_Reported != nil) { - ResponseHandler callback = test_TestCluster_list_int8u_Reported; - test_TestCluster_list_int8u_Reported = nil; - callback(value, err); - } - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteSubscribedToListAttribute_368() + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id listInt8uArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:5]; - temp_0[1] = [NSNumber numberWithUnsignedChar:6]; - temp_0[2] = [NSNumber numberWithUnsignedChar:7]; - temp_0[3] = [NSNumber numberWithUnsignedChar:8]; - listInt8uArgument = temp_0; - } - [cluster writeAttributeListInt8uWithValue:listInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write subscribed-to list attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster + writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted unsigned 16-bit integer " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckForListAttributeReport_369() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check for list attribute report Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value has not changed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("list_int8u", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValue("", actualValue[0], 5)); - VerifyOrReturn(CheckValue("", actualValue[1], 6)); - VerifyOrReturn(CheckValue("", actualValue[2], 7)); - VerifyOrReturn(CheckValue("", actualValue[3], 8)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 200U)); + } - NextTest(); - }; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRangeRestrictedUnsigned8BitInteger_370() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_438() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted unsigned 8-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 70)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_371() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_439() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted unsigned 8-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_372() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; - [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a range-restricted unsigned 8-bit integer " - @"Error: %@", - err); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 100U)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_373() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_440() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; - [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a range-restricted unsigned 8-bit integer " - @"Error: %@", - err); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_374() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_441() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:255]; [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted unsigned 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 1000U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_375() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_442() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 70)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_376() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_443() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write min valid value to a range-restricted unsigned 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 500U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_377() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted unsigned 16-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 20)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_378() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write max valid value to a range-restricted unsigned 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_range_restricted_int16u", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_379() + CHIP_ERROR TestReadNullableRangeRestrictedSigned8BitInteger_446() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted signed 8-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 100)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -20)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_380() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; - [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted unsigned 8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-127]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted signed 8-bit integer " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_381() + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_448() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8u", actualValue, 50)); - } + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted signed " + @"8-bit integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRangeRestrictedUnsigned16BitInteger_382() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_449() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted unsigned 16-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 200U)); - } + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted signed " + @"8-bit integer Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_383() + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted unsigned 16-bit integer Error: %@", err); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted signed 8-bit integer " + @"Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_384() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; - [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a range-restricted unsigned 16-bit integer " - @"Error: %@", - err); + [cluster + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value has not changed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -20)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_385() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_452() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; - [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a range-restricted unsigned 16-bit integer " - @"Error: %@", - err); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted signed 8-bit " + @"integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_386() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_453() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted unsigned 16-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at min valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -40)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_387() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_454() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted signed 8-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 200U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_388() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_455() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a range-restricted unsigned 16-bit integer Error: %@", - err); + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at max valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, 50)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_389() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_456() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted signed " + @"8-bit integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 100U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_390() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_457() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a range-restricted unsigned 16-bit integer Error: %@", - err); + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at mid valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, 6)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_391() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted signed 8-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 1000U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_392() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write middle valid value to a range-restricted unsigned 16-bit integer Error: %@", - err); + readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_range_restricted_int8s", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_393() + CHIP_ERROR TestReadNullableRangeRestrictedSigned16BitInteger_460() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted signed 16-bit integer Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16u", actualValue, 500U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -100)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRangeRestrictedSigned8BitInteger_394() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted signed 8-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -20)); - } + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32767]; + [cluster + writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted signed 16-bit integer " + @"Error: %@", + err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned8BitInteger_395() + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_462() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted signed 8-bit integer Error: %@", err); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; + [cluster + writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted signed " + @"16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_396() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_463() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write just-below-range value to a range-restricted signed 8-bit integer Error: %@", - err); + writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted signed " + @"16-bit integer Error: %@", + err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_397() + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write just-above-range value to a range-restricted signed 8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted signed 16-bit integer " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned8BitInteger_398() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; - [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted signed 8-bit integer Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value has not changed Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -100)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_399() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_466() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted signed 16-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -20)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_400() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_467() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a range-restricted signed 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at min valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -150)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_401() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_468() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted signed 16-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, -40)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_402() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_469() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a range-restricted signed 8-bit integer Error: %@", err); + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at max valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, 200)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_403() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_470() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted signed " + @"16-bit integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, 50)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_404() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_471() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted signed 8-bit integer Error: %@", - err); + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at mid valid Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); + VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, 7)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_405() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted signed 16-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int8s", actualValue, 6)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadRangeRestrictedSigned16BitInteger_406() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted signed 16-bit integer Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -100)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_range_restricted_int16s", actualValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned16BitInteger_407() + CHIP_ERROR TestWriteAttributeThatReturnsGeneralStatusOnWrite_474() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32768]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted signed 16-bit integer Error: %@", err); + id generalErrorBooleanArgument; + generalErrorBooleanArgument = [NSNumber numberWithBool:false]; + [cluster writeAttributeGeneralErrorBooleanWithValue:generalErrorBooleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute that returns general status on write Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_408() + CHIP_ERROR TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; - [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a range-restricted signed 16-bit integer " - @"Error: %@", - err); + id clusterErrorBooleanArgument; + clusterErrorBooleanArgument = [NSNumber numberWithBool:false]; + [cluster + writeAttributeClusterErrorBooleanWithValue:clusterErrorBooleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute that returns cluster-specific status on write Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_409() + CHIP_ERROR TestReadAttributeThatReturnsGeneralStatusOnRead_476() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; - [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a range-restricted signed 16-bit integer " - @"Error: %@", - err); + [cluster readAttributeGeneralErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute that returns general status on read Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned16BitInteger_410() + CHIP_ERROR TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted signed 16-bit integer Error: %@", err); + [cluster readAttributeClusterErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read attribute that returns cluster-specific status on read Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_411() + CHIP_ERROR TestReadAcceptedCommandListAttribute_478() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value has not changed Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"read AcceptedCommandList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -100)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(18))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 7UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 8UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 9UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 17UL)); + VerifyOrReturn(CheckValue("", actualValue[14], 18UL)); + VerifyOrReturn(CheckValue("", actualValue[15], 19UL)); + VerifyOrReturn(CheckValue("", actualValue[16], 20UL)); + VerifyOrReturn(CheckValue("", actualValue[17], 21UL)); } NextTest(); @@ -59243,42 +67141,28 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_412() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write min valid value to a range-restricted signed 16-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_413() + CHIP_ERROR TestReadGeneratedCommandListAttribute_479() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value is at min valid Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"read GeneratedCommandList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, -150)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(8))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 9UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 11UL)); } NextTest(); @@ -59287,42 +67171,58 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_414() + CHIP_ERROR TestWriteStructTypedAttribute_480() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write max valid value to a range-restricted signed 16-bit integer Error: %@", err); + id structAttrArgument; + structAttrArgument = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).a = [NSNumber numberWithUnsignedChar:5]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).d = [[NSData alloc] initWithBytes:"abc" length:3]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).e = @""; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).f = [NSNumber numberWithUnsignedChar:17]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).g = [NSNumber numberWithFloat:1.5f]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).h = [NSNumber numberWithDouble:3.14159265358979]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster writeAttributeStructAttrWithValue:structAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write struct-typed attribute Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_415() + CHIP_ERROR TestReadStructTypedAttribute_481() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value is at max valid Error: %@", err); + [cluster readAttributeStructAttrWithCompletionHandler:^( + CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read struct-typed attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, 200)); + VerifyOrReturn(CheckValue("a", ((CHIPTestClusterClusterSimpleStruct *) actualValue).a, 5)); + VerifyOrReturn(CheckValue("b", ((CHIPTestClusterClusterSimpleStruct *) actualValue).b, true)); + VerifyOrReturn(CheckValue("c", ((CHIPTestClusterClusterSimpleStruct *) actualValue).c, 2)); + VerifyOrReturn(CheckValueAsString( + "d", ((CHIPTestClusterClusterSimpleStruct *) actualValue).d, [[NSData alloc] initWithBytes:"abc" length:3])); + VerifyOrReturn(CheckValueAsString("e", ((CHIPTestClusterClusterSimpleStruct *) actualValue).e, @"")); + VerifyOrReturn(CheckValue("f", ((CHIPTestClusterClusterSimpleStruct *) actualValue).f, 17)); + VerifyOrReturn(CheckValue("g", ((CHIPTestClusterClusterSimpleStruct *) actualValue).g, 1.5f)); + VerifyOrReturn(CheckValue("h", ((CHIPTestClusterClusterSimpleStruct *) actualValue).h, 3.14159265358979)); } NextTest(); @@ -59330,1422 +67230,1771 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } +}; + +class TestConstraints : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestConstraints() + : TestCommandBridge("TestConstraints") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_416() + ~TestConstraints() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted signed 16-bit integer Error: %@", - err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestConstraints\n"); + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestConstraints\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - NextTest(); - }]; + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Write attribute INT32U Value\n"); + err = TestWriteAttributeInt32uValue_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute INT32U Value MinValue Constraints\n"); + err = TestReadAttributeInt32uValueMinValueConstraints_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute INT32U Value MaxValue Constraints\n"); + err = TestReadAttributeInt32uValueMaxValueConstraints_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute INT32U Value NotValue Constraints\n"); + err = TestReadAttributeInt32uValueNotValueConstraints_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write attribute INT32U Value Back to Default Value\n"); + err = TestWriteAttributeInt32uValueBackToDefaultValue_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute CHAR_STRING Value MinLength Constraints\n"); + err = TestReadAttributeCharStringValueMinLengthConstraints_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute CHAR_STRING Value MaxLength Constraints\n"); + err = TestReadAttributeCharStringValueMaxLengthConstraints_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute CHAR_STRING Value StartsWith Constraints\n"); + err = TestReadAttributeCharStringValueStartsWithConstraints_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute CHAR_STRING Value EndsWith Constraints\n"); + err = TestReadAttributeCharStringValueEndsWithConstraints_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_13(); + break; + case 14: + ChipLogProgress( + chipTool, " ***** Test Step 14 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_15(); + break; + case 16: + ChipLogProgress( + chipTool, " ***** Test Step 16 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Write attribute CHAR_STRING Value Back to Default Value\n"); + err = TestWriteAttributeCharStringValueBackToDefaultValue_21(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_417() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("range_restricted_int16s", actualValue, 7)); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 22; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNullableRangeRestrictedUnsigned8BitInteger_418() + CHIP_ERROR TestWriteAttributeInt32uValue_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted unsigned 8-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:5UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 70)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_419() + CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Value MinValue Constraints Error: %@", err); - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_420() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted " - @"unsigned 8-bit integer Error: %@", - err); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("int32u", [value unsignedIntValue], 5UL)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_421() + CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted " - @"unsigned 8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Value MaxValue Constraints Error: %@", err); - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_422() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("int32u", [value unsignedIntValue], 5UL)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_423() + CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value has not changed Error: %@", err); + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Value NotValue Constraints Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 70)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("int32u", value, 6UL)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_424() + CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Value Back to Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_425() + CHIP_ERROR TestWriteAttributeCharStringValue_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id charStringArgument; + charStringArgument = @"** Test **"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 20)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_426() + CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value MinLength Constraints Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintMinLength("charString", [value length], 5)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_427() + CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_8() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value MaxLength Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 100)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintMaxLength("charString", [value length], 20)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_428() + CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_9() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted unsigned " - @"8-bit integer Error: %@", - err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value StartsWith Constraints Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintStartsWith("charString", value, "**")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_429() + CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_10() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value EndsWith Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8u", actualValue, 50)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintEndsWith("charString", value, "**")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_430() + CHIP_ERROR TestWriteAttributeCharStringValue_11() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); + id charStringArgument; + charStringArgument = @"lowercase"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_431() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is null Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_range_restricted_int8u", actualValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, true)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNullableRangeRestrictedUnsigned16BitInteger_432() + CHIP_ERROR TestWriteAttributeCharStringValue_13() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted unsigned 16-bit integer Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id charStringArgument; + charStringArgument = @"UPPERCASE"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 200U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_433() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted unsigned 16-bit integer " - @"Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_434() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; - [cluster - writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, false)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_435() + CHIP_ERROR TestWriteAttributeCharStringValue_15() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; - [cluster - writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_436() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + id charStringArgument; + charStringArgument = @"lowUPPER"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster - writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted unsigned 16-bit integer " - @"Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_437() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 200U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, false)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_438() + CHIP_ERROR TestWriteAttributeCharStringValue_17() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); + id charStringArgument; + charStringArgument = @"ABCDEF012V"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_439() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_18() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 100U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsHexString("charString", value, false)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_440() + CHIP_ERROR TestWriteAttributeCharStringValue_19() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); + id charStringArgument; + charStringArgument = @"ABCDEF0123"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_441() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_20() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 1000U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintIsHexString("charString", value, true)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_442() + CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_21() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); + id charStringArgument; + charStringArgument = @""; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Back to Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_443() +class TestDelayCommands : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestDelayCommands() + : TestCommandBridge("TestDelayCommands") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); + ~TestDelayCommands() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16u", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16u", actualValue, 500U)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestDelayCommands\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestDelayCommands\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return CHIP_NO_ERROR; + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Wait 100ms\n"); + err = TestWait100ms_1(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_444() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted unsigned 16-bit " - @"integer Error: %@", - err); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; - VerifyOrReturn(CheckValue("status", err, 0)); + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - NextTest(); - }]; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWait100ms_1() + { + WaitForMs(100); return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_445() +class TestLogCommands : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestLogCommands() + : TestCommandBridge("TestLogCommands") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is null Error: %@", err); + ~TestLogCommands() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_range_restricted_int16u", actualValue)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestLogCommands\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestLogCommands\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return CHIP_NO_ERROR; + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Log a simple message\n"); + err = TestLogASimpleMessage_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Do a simple user prompt message\n"); + err = TestDoASimpleUserPromptMessage_2(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadNullableRangeRestrictedSigned8BitInteger_446() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted signed 8-bit integer Error: %@", err); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; - VerifyOrReturn(CheckValue("status", err, 0)); + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -20)); - } + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestLogASimpleMessage_1() + { + Log(@"This is a simple message"); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestDoASimpleUserPromptMessage_2() + { + UserPrompt(@"This is a simple message"); return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_447() +class TestSaveAs : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestSaveAs() + : TestCommandBridge("TestSaveAs") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted signed 8-bit integer " - @"Error: %@", - err); + ~TestSaveAs() {} - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestSaveAs\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestSaveAs\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Add Arguments Command\n"); + err = TestSendTestAddArgumentsCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute BOOLEAN Default Value\n"); + err = TestReadAttributeBooleanDefaultValue_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write attribute BOOLEAN Not Default Value\n"); + err = TestWriteAttributeBooleanNotDefaultValue_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Not Default Value\n"); + err = TestReadAttributeBooleanNotDefaultValue_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN DefaultValue\n"); + err = TestWriteAttributeBooleanDefaultValue_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN False\n"); + err = TestReadAttributeBooleanFalse_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute BITMAP8 Default Value\n"); + err = TestReadAttributeBitmap8DefaultValue_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Write attribute BITMAP8 Not Default Value\n"); + err = TestWriteAttributeBitmap8NotDefaultValue_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Not Default Value\n"); + err = TestReadAttributeBitmap8NotDefaultValue_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Default Value\n"); + err = TestWriteAttributeBitmap8DefaultValue_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Default Value\n"); + err = TestReadAttributeBitmap8DefaultValue_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read attribute BITMAP16 Default Value\n"); + err = TestReadAttributeBitmap16DefaultValue_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Write attribute BITMAP16 Not Default Value\n"); + err = TestWriteAttributeBitmap16NotDefaultValue_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute BITMAP16 Not Default Value\n"); + err = TestReadAttributeBitmap16NotDefaultValue_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute BITMAP16 Default Value\n"); + err = TestWriteAttributeBitmap16DefaultValue_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute BITMAP16 Default Value\n"); + err = TestReadAttributeBitmap16DefaultValue_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute BITMAP32 Default Value\n"); + err = TestReadAttributeBitmap32DefaultValue_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Write attribute BITMAP32 Not Default Value\n"); + err = TestWriteAttributeBitmap32NotDefaultValue_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute BITMAP32 Not Default Value\n"); + err = TestReadAttributeBitmap32NotDefaultValue_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute BITMAP32 Default Value\n"); + err = TestWriteAttributeBitmap32DefaultValue_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute BITMAP32 Default Value\n"); + err = TestReadAttributeBitmap32DefaultValue_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Read attribute BITMAP64 Default Value\n"); + err = TestReadAttributeBitmap64DefaultValue_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Write attribute BITMAP64 Not Default Value\n"); + err = TestWriteAttributeBitmap64NotDefaultValue_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); + err = TestReadAttributeBitmap64DefaultValue_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Default Value\n"); + err = TestWriteAttributeBitmap64DefaultValue_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Default Value\n"); + err = TestReadAttributeBitmap64DefaultValue_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Read attribute INT8U Default Value\n"); + err = TestReadAttributeInt8uDefaultValue_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute INT8U Not Default Value\n"); + err = TestWriteAttributeInt8uNotDefaultValue_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Not Default Value\n"); + err = TestReadAttributeInt8uNotDefaultValue_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Default Value\n"); + err = TestWriteAttributeInt8uDefaultValue_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Default Value\n"); + err = TestReadAttributeInt8uDefaultValue_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Read attribute INT16U Default Value\n"); + err = TestReadAttributeInt16uDefaultValue_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Write attribute INT16U Not Default Value\n"); + err = TestWriteAttributeInt16uNotDefaultValue_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Not Default Value\n"); + err = TestReadAttributeInt16uNotDefaultValue_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Default Value\n"); + err = TestWriteAttributeInt16uDefaultValue_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Default Value\n"); + err = TestReadAttributeInt16uDefaultValue_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute INT32U Default Value\n"); + err = TestReadAttributeInt32uDefaultValue_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Write attribute INT32U Not Default Value\n"); + err = TestWriteAttributeInt32uNotDefaultValue_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Not Default Value\n"); + err = TestReadAttributeInt32uNotDefaultValue_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Default Value\n"); + err = TestWriteAttributeInt32uDefaultValue_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Default Value\n"); + err = TestReadAttributeInt32uDefaultValue_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Read attribute INT64U Default Value\n"); + err = TestReadAttributeInt64uDefaultValue_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Write attribute INT64U Not Default Value\n"); + err = TestWriteAttributeInt64uNotDefaultValue_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Not Default Value\n"); + err = TestReadAttributeInt64uNotDefaultValue_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Default Value\n"); + err = TestWriteAttributeInt64uDefaultValue_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Default Value\n"); + err = TestReadAttributeInt64uDefaultValue_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute INT8S Not Default Value\n"); + err = TestWriteAttributeInt8sNotDefaultValue_50(); + break; + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Not Default Value\n"); + err = TestReadAttributeInt8sNotDefaultValue_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Default Value\n"); + err = TestWriteAttributeInt8sDefaultValue_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Default Value\n"); + err = TestReadAttributeInt8sDefaultValue_53(); + break; + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Write attribute INT16S Not Default Value\n"); + err = TestWriteAttributeInt16sNotDefaultValue_55(); + break; + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Read attribute INT16S Not Default Value\n"); + err = TestReadAttributeInt16sNotDefaultValue_56(); + break; + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Write attribute INT16S Default Value\n"); + err = TestWriteAttributeInt16sDefaultValue_57(); + break; + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); + err = TestReadAttributeInt16sDefaultValue_58(); + break; + case 59: + ChipLogProgress(chipTool, " ***** Test Step 59 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_59(); + break; + case 60: + ChipLogProgress(chipTool, " ***** Test Step 60 : Write attribute INT32S Not Default Value\n"); + err = TestWriteAttributeInt32sNotDefaultValue_60(); + break; + case 61: + ChipLogProgress(chipTool, " ***** Test Step 61 : Read attribute INT32S Not Default Value\n"); + err = TestReadAttributeInt32sNotDefaultValue_61(); + break; + case 62: + ChipLogProgress(chipTool, " ***** Test Step 62 : Write attribute INT32S Default Value\n"); + err = TestWriteAttributeInt32sDefaultValue_62(); + break; + case 63: + ChipLogProgress(chipTool, " ***** Test Step 63 : Read attribute INT32S Default Value\n"); + err = TestReadAttributeInt32sDefaultValue_63(); + break; + case 64: + ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_64(); + break; + case 65: + ChipLogProgress(chipTool, " ***** Test Step 65 : Write attribute INTS Not Default Value\n"); + err = TestWriteAttributeIntsNotDefaultValue_65(); + break; + case 66: + ChipLogProgress(chipTool, " ***** Test Step 66 : Read attribute INT64S Not Default Value\n"); + err = TestReadAttributeInt64sNotDefaultValue_66(); + break; + case 67: + ChipLogProgress(chipTool, " ***** Test Step 67 : Write attribute INT64S Default Value\n"); + err = TestWriteAttributeInt64sDefaultValue_67(); + break; + case 68: + ChipLogProgress(chipTool, " ***** Test Step 68 : Read attribute INT64S Default Value\n"); + err = TestReadAttributeInt64sDefaultValue_68(); + break; + case 69: + ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute ENUM8 Default Value\n"); + err = TestReadAttributeEnum8DefaultValue_69(); + break; + case 70: + ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute ENUM8 Not Default Value\n"); + err = TestWriteAttributeEnum8NotDefaultValue_70(); + break; + case 71: + ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute ENUM8 Not Default Value\n"); + err = TestReadAttributeEnum8NotDefaultValue_71(); + break; + case 72: + ChipLogProgress(chipTool, " ***** Test Step 72 : Write attribute ENUM8 Default Value\n"); + err = TestWriteAttributeEnum8DefaultValue_72(); + break; + case 73: + ChipLogProgress(chipTool, " ***** Test Step 73 : Read attribute ENUM8 Default Value\n"); + err = TestReadAttributeEnum8DefaultValue_73(); + break; + case 74: + ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute ENUM16 Default Value\n"); + err = TestReadAttributeEnum16DefaultValue_74(); + break; + case 75: + ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute ENUM16 Not Default Value\n"); + err = TestWriteAttributeEnum16NotDefaultValue_75(); + break; + case 76: + ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute ENUM16 Not Default Value\n"); + err = TestReadAttributeEnum16NotDefaultValue_76(); + break; + case 77: + ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute ENUM16 Default Value\n"); + err = TestWriteAttributeEnum16DefaultValue_77(); + break; + case 78: + ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute ENUM16 Default Value\n"); + err = TestReadAttributeEnum16DefaultValue_78(); + break; + case 79: + ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute EPOCH_US Default Value\n"); + err = TestReadAttributeEpochUsDefaultValue_79(); + break; + case 80: + ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute EPOCH_US Not Default Value\n"); + err = TestWriteAttributeEpochUsNotDefaultValue_80(); + break; + case 81: + ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute EPOCH_US Not Default Value\n"); + err = TestReadAttributeEpochUsNotDefaultValue_81(); + break; + case 82: + ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute EPOCH_US Default Value\n"); + err = TestWriteAttributeEpochUsDefaultValue_82(); + break; + case 83: + ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute EPOCH_US Default Value\n"); + err = TestReadAttributeEpochUsDefaultValue_83(); + break; + case 84: + ChipLogProgress(chipTool, " ***** Test Step 84 : Read attribute EPOCH_S Default Value\n"); + err = TestReadAttributeEpochSDefaultValue_84(); + break; + case 85: + ChipLogProgress(chipTool, " ***** Test Step 85 : Write attribute EPOCH_S Not Default Value\n"); + err = TestWriteAttributeEpochSNotDefaultValue_85(); + break; + case 86: + ChipLogProgress(chipTool, " ***** Test Step 86 : Read attribute EPOCH_S Not Default Value\n"); + err = TestReadAttributeEpochSNotDefaultValue_86(); + break; + case 87: + ChipLogProgress(chipTool, " ***** Test Step 87 : Write attribute EPOCH_S Default Value\n"); + err = TestWriteAttributeEpochSDefaultValue_87(); + break; + case 88: + ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute EPOCH_S Default Value\n"); + err = TestReadAttributeEpochSDefaultValue_88(); + break; + case 89: + ChipLogProgress(chipTool, " ***** Test Step 89 : Read attribute vendor_id Default Value\n"); + err = TestReadAttributeVendorIdDefaultValue_89(); + break; + case 90: + ChipLogProgress(chipTool, " ***** Test Step 90 : Write attribute vendor_id Not Default Value\n"); + err = TestWriteAttributeVendorIdNotDefaultValue_90(); + break; + case 91: + ChipLogProgress(chipTool, " ***** Test Step 91 : Read attribute vendor_id Not Default Value\n"); + err = TestReadAttributeVendorIdNotDefaultValue_91(); + break; + case 92: + ChipLogProgress(chipTool, " ***** Test Step 92 : Write attribute vendor_id Default Value\n"); + err = TestWriteAttributeVendorIdDefaultValue_92(); + break; + case 93: + ChipLogProgress(chipTool, " ***** Test Step 93 : Read attribute vendor_id Default Value\n"); + err = TestReadAttributeVendorIdDefaultValue_93(); + break; + case 94: + ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute char_string Default Value\n"); + err = TestReadAttributeCharStringDefaultValue_94(); + break; + case 95: + ChipLogProgress( + chipTool, " ***** Test Step 95 : Read attribute char_string Default Value and compare to saved value\n"); + err = TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95(); + break; + case 96: + ChipLogProgress(chipTool, " ***** Test Step 96 : Write attribute char_string Not Default Value\n"); + err = TestWriteAttributeCharStringNotDefaultValue_96(); + break; + case 97: + ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute char_string Not Default Value\n"); + err = TestReadAttributeCharStringNotDefaultValue_97(); + break; + case 98: + ChipLogProgress( + chipTool, " ***** Test Step 98 : Read attribute char_string Not Default Value and compare to saved value\n"); + err = TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98(); + break; + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Write attribute char_string Not Default Value from saved value\n"); + err = TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99(); + break; + case 100: + ChipLogProgress( + chipTool, " ***** Test Step 100 : Read attribute char_string Not Default Value and compare to expected value\n"); + err = TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100(); + break; + case 101: + ChipLogProgress(chipTool, " ***** Test Step 101 : Write attribute char_string Default Value\n"); + err = TestWriteAttributeCharStringDefaultValue_101(); + break; + case 102: + ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute octet_string Default Value\n"); + err = TestReadAttributeOctetStringDefaultValue_102(); + break; + case 103: + ChipLogProgress( + chipTool, " ***** Test Step 103 : Read attribute octet_string Default Value and compare to saved value\n"); + err = TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103(); + break; + case 104: + ChipLogProgress(chipTool, " ***** Test Step 104 : Write attribute octet_string Not Default Value\n"); + err = TestWriteAttributeOctetStringNotDefaultValue_104(); + break; + case 105: + ChipLogProgress(chipTool, " ***** Test Step 105 : Read attribute octet_string Not Default Value\n"); + err = TestReadAttributeOctetStringNotDefaultValue_105(); + break; + case 106: + ChipLogProgress( + chipTool, " ***** Test Step 106 : Read attribute octet_string Not Default Value and compare to saved value\n"); + err = TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106(); + break; + case 107: + ChipLogProgress(chipTool, " ***** Test Step 107 : Write attribute octet_string Not Default Value from saved value\n"); + err = TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107(); + break; + case 108: + ChipLogProgress( + chipTool, " ***** Test Step 108 : Read attribute octet_string Not Default Value and compare to expected value\n"); + err = TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108(); + break; + case 109: + ChipLogProgress(chipTool, " ***** Test Step 109 : Write attribute octet_string Default Value\n"); + err = TestWriteAttributeOctetStringDefaultValue_109(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_448() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted signed " - @"8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_449() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted signed " - @"8-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 110; - return CHIP_NO_ERROR; - } + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_450() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted signed 8-bit integer " - @"Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } + NSNumber * _Nonnull TestAddArgumentDefaultValue; - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_451() + CHIP_ERROR TestSendTestAddArgumentsCommand_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -20)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_452() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:3]; + params.arg2 = [NSNumber numberWithUnsignedChar:17]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Add Arguments Command Error: %@", err); - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted signed 8-bit " - @"integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.returnValue; + VerifyOrReturn(CheckValue("returnValue", actualValue, 20)); + } + { + TestAddArgumentDefaultValue = values.returnValue; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_453() + CHIP_ERROR TestSendTestAddArgumentsCommand_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, -40)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_454() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:3]; + params.arg2 = [NSNumber numberWithUnsignedChar:17]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Add Arguments Command Error: %@", err); - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted signed 8-bit " - @"integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.returnValue; + VerifyOrReturn(CheckValue("returnValue", actualValue, TestAddArgumentDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_455() + CHIP_ERROR TestSendTestAddArgumentsCommand_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at max valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, 50)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_456() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:3]; + params.arg2 = [TestAddArgumentDefaultValue copy]; + [cluster testAddArgumentsWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Test Add Arguments Command Error: %@", err); - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted signed " - @"8-bit integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + if (values.returnValue != nil) { + VerifyOrReturn( + CheckConstraintNotValue("returnValue", values.returnValue, TestAddArgumentDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBooleanDefaultValue; - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_457() + CHIP_ERROR TestReadAttributeBooleanDefaultValue_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at mid valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int8s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int8s", actualValue, 6)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_458() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted signed 8-bit " - @"integer Error: %@", - err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + } + { + readAttributeBooleanDefaultValue = value; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_459() + CHIP_ERROR TestWriteAttributeBooleanNotDefaultValue_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at null Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id booleanArgument; + booleanArgument = [NSNumber numberWithBool:1]; + [cluster writeAttributeBooleanWithValue:booleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BOOLEAN Not Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_range_restricted_int8s", actualValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNullableRangeRestrictedSigned16BitInteger_460() + CHIP_ERROR TestReadAttributeBooleanNotDefaultValue_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted signed 16-bit integer Error: %@", err); + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -100)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("boolean", value, readAttributeBooleanDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_461() + CHIP_ERROR TestWriteAttributeBooleanDefaultValue_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster - writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted signed 16-bit integer " - @"Error: %@", - err); + id booleanArgument; + booleanArgument = [readAttributeBooleanDefaultValue copy]; + [cluster writeAttributeBooleanWithValue:booleanArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BOOLEAN DefaultValue Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_462() + CHIP_ERROR TestReadAttributeBooleanFalse_8() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; - [cluster - writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted signed " - @"16-bit integer Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BOOLEAN False Error: %@", err); - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_463() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; - [cluster - writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted signed " - @"16-bit integer Error: %@", - err); + { + id actualValue = value; + VerifyOrReturn(CheckValue("boolean", actualValue, readAttributeBooleanDefaultValue)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBitmap8DefaultValue; - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_464() + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_9() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; - [cluster - writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted signed 16-bit integer " - @"Error: %@", - err); + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + } + { + readAttributeBitmap8DefaultValue = value; + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_465() + CHIP_ERROR TestWriteAttributeBitmap8NotDefaultValue_10() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value has not changed Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id bitmap8Argument; + bitmap8Argument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP8 Not Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -100)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_466() + CHIP_ERROR TestReadAttributeBitmap8NotDefaultValue_11() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted signed 16-bit " - @"integer Error: %@", - err); + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap8", value, readAttributeBitmap8DefaultValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_467() + CHIP_ERROR TestWriteAttributeBitmap8DefaultValue_12() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at min valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id bitmap8Argument; + bitmap8Argument = [readAttributeBitmap8DefaultValue copy]; + [cluster writeAttributeBitmap8WithValue:bitmap8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP8 Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, -150)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_468() + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_13() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted signed 16-bit " - @"integer Error: %@", - err); + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap8", actualValue, readAttributeBitmap8DefaultValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBitmap16DefaultValue; - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_469() + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_14() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at max valid Error: %@", err); + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, 200)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + } + { + readAttributeBitmap16DefaultValue = value; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_470() + CHIP_ERROR TestWriteAttributeBitmap16NotDefaultValue_15() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted signed " - @"16-bit integer Error: %@", - err); + id bitmap16Argument; + bitmap16Argument = [NSNumber numberWithUnsignedShort:1U]; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP16 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_471() + CHIP_ERROR TestReadAttributeBitmap16NotDefaultValue_16() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at mid valid Error: %@", err); + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("nullable_range_restricted_int16s", actualValue)); - VerifyOrReturn(CheckValue("nullable_range_restricted_int16s", actualValue, 7)); - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap16", value, readAttributeBitmap16DefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_472() + CHIP_ERROR TestWriteAttributeBitmap16DefaultValue_17() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted signed 16-bit " - @"integer Error: %@", - err); + id bitmap16Argument; + bitmap16Argument = [readAttributeBitmap16DefaultValue copy]; + [cluster writeAttributeBitmap16WithValue:bitmap16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP16 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_473() + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_18() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is null Error: %@", err); + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNull("nullable_range_restricted_int16s", actualValue)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap16", actualValue, readAttributeBitmap16DefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBitmap32DefaultValue; - CHIP_ERROR TestWriteAttributeThatReturnsGeneralStatusOnWrite_474() + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_19() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id generalErrorBooleanArgument; - generalErrorBooleanArgument = [NSNumber numberWithBool:false]; - [cluster writeAttributeGeneralErrorBooleanWithValue:generalErrorBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute that returns general status on write Error: %@", err); + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + } + { + readAttributeBitmap32DefaultValue = value; + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeThatReturnsClusterSpecificStatusOnWrite_475() + CHIP_ERROR TestWriteAttributeBitmap32NotDefaultValue_20() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id clusterErrorBooleanArgument; - clusterErrorBooleanArgument = [NSNumber numberWithBool:false]; - [cluster - writeAttributeClusterErrorBooleanWithValue:clusterErrorBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute that returns cluster-specific status on write Error: %@", err); + id bitmap32Argument; + bitmap32Argument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeThatReturnsGeneralStatusOnRead_476() + CHIP_ERROR TestReadAttributeBitmap32NotDefaultValue_21() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneralErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute that returns general status on read Error: %@", err); + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Not Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap32", value, readAttributeBitmap32DefaultValue)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_DATA_TYPE)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeThatReturnsClusterSpecificStatusOnRead_477() + CHIP_ERROR TestWriteAttributeBitmap32DefaultValue_22() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read attribute that returns cluster-specific status on read Error: %@", err); + id bitmap32Argument; + bitmap32Argument = [readAttributeBitmap32DefaultValue copy]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAcceptedCommandListAttribute_478() + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_23() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"read AcceptedCommandList attribute Error: %@", err); + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(18))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 7UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 8UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 9UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); - VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); - VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); - VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); - VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); - VerifyOrReturn(CheckValue("", actualValue[13], 17UL)); - VerifyOrReturn(CheckValue("", actualValue[14], 18UL)); - VerifyOrReturn(CheckValue("", actualValue[15], 19UL)); - VerifyOrReturn(CheckValue("", actualValue[16], 20UL)); - VerifyOrReturn(CheckValue("", actualValue[17], 21UL)); + VerifyOrReturn(CheckValue("bitmap32", actualValue, readAttributeBitmap32DefaultValue)); } NextTest(); @@ -60753,29 +69002,25 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nonnull readAttributeBitmap64DefaultValue; - CHIP_ERROR TestReadGeneratedCommandListAttribute_479() + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_24() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"read GeneratedCommandList attribute Error: %@", err); + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(8))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 5UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 6UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 9UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 10UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 11UL)); + VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + } + { + readAttributeBitmap64DefaultValue = value; } NextTest(); @@ -60784,58 +69029,39 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteStructTypedAttribute_480() + CHIP_ERROR TestWriteAttributeBitmap64NotDefaultValue_25() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id structAttrArgument; - structAttrArgument = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).a = [NSNumber numberWithUnsignedChar:5]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).d = [[NSData alloc] initWithBytes:"abc" length:3]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).e = @""; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).f = [NSNumber numberWithUnsignedChar:17]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).g = [NSNumber numberWithFloat:1.5f]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).h = [NSNumber numberWithDouble:3.14159265358979]; - - [cluster writeAttributeStructAttrWithValue:structAttrArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write struct-typed attribute Error: %@", err); + id bitmap64Argument; + bitmap64Argument = [NSNumber numberWithUnsignedLongLong:1ULL]; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP64 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadStructTypedAttribute_481() + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStructAttrWithCompletionHandler:^( - CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read struct-typed attribute Error: %@", err); + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("a", ((CHIPTestClusterClusterSimpleStruct *) actualValue).a, 5)); - VerifyOrReturn(CheckValue("b", ((CHIPTestClusterClusterSimpleStruct *) actualValue).b, true)); - VerifyOrReturn(CheckValue("c", ((CHIPTestClusterClusterSimpleStruct *) actualValue).c, 2)); - VerifyOrReturn(CheckValueAsString( - "d", ((CHIPTestClusterClusterSimpleStruct *) actualValue).d, [[NSData alloc] initWithBytes:"abc" length:3])); - VerifyOrReturn(CheckValueAsString("e", ((CHIPTestClusterClusterSimpleStruct *) actualValue).e, @"")); - VerifyOrReturn(CheckValue("f", ((CHIPTestClusterClusterSimpleStruct *) actualValue).f, 17)); - VerifyOrReturn(CheckValue("g", ((CHIPTestClusterClusterSimpleStruct *) actualValue).g, 1.5f)); - VerifyOrReturn(CheckValue("h", ((CHIPTestClusterClusterSimpleStruct *) actualValue).h, 3.14159265358979)); + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("bitmap64", value, readAttributeBitmap64DefaultValue)); } NextTest(); @@ -60843,623 +69069,176 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class TestSaveAs : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestSaveAs() - : TestCommandBridge("TestSaveAs") - , mTestIndex(0) + CHIP_ERROR TestWriteAttributeBitmap64DefaultValue_27() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap64Argument; + bitmap64Argument = [readAttributeBitmap64DefaultValue copy]; + [cluster writeAttributeBitmap64WithValue:bitmap64Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP64 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestSaveAs() {} + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_28() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); - /////////// TestCommand Interface ///////// - void NextTest() override + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap64", actualValue, readAttributeBitmap64DefaultValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull readAttributeInt8uDefaultValue; + + CHIP_ERROR TestReadAttributeInt8uDefaultValue_29() { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestSaveAs\n"); - } + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Default Value Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestSaveAs\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + } + { + readAttributeInt8uDefaultValue = value; + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute BOOLEAN Default Value\n"); - err = TestReadAttributeBooleanDefaultValue_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write attribute BOOLEAN Not Default Value\n"); - err = TestWriteAttributeBooleanNotDefaultValue_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Not Default Value\n"); - err = TestReadAttributeBooleanNotDefaultValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN DefaultValue\n"); - err = TestWriteAttributeBooleanDefaultValue_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN False\n"); - err = TestReadAttributeBooleanFalse_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute BITMAP8 Default Value\n"); - err = TestReadAttributeBitmap8DefaultValue_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Write attribute BITMAP8 Not Default Value\n"); - err = TestWriteAttributeBitmap8NotDefaultValue_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Not Default Value\n"); - err = TestReadAttributeBitmap8NotDefaultValue_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Default Value\n"); - err = TestWriteAttributeBitmap8DefaultValue_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Default Value\n"); - err = TestReadAttributeBitmap8DefaultValue_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read attribute BITMAP16 Default Value\n"); - err = TestReadAttributeBitmap16DefaultValue_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Write attribute BITMAP16 Not Default Value\n"); - err = TestWriteAttributeBitmap16NotDefaultValue_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute BITMAP16 Not Default Value\n"); - err = TestReadAttributeBitmap16NotDefaultValue_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute BITMAP16 Default Value\n"); - err = TestWriteAttributeBitmap16DefaultValue_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute BITMAP16 Default Value\n"); - err = TestReadAttributeBitmap16DefaultValue_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute BITMAP32 Default Value\n"); - err = TestReadAttributeBitmap32DefaultValue_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Write attribute BITMAP32 Not Default Value\n"); - err = TestWriteAttributeBitmap32NotDefaultValue_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute BITMAP32 Not Default Value\n"); - err = TestReadAttributeBitmap32NotDefaultValue_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute BITMAP32 Default Value\n"); - err = TestWriteAttributeBitmap32DefaultValue_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute BITMAP32 Default Value\n"); - err = TestReadAttributeBitmap32DefaultValue_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Write attribute BITMAP64 Not Default Value\n"); - err = TestWriteAttributeBitmap64NotDefaultValue_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute BITMAP64 Default Value\n"); - err = TestWriteAttributeBitmap64DefaultValue_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute BITMAP64 Default Value\n"); - err = TestReadAttributeBitmap64DefaultValue_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute INT8U Not Default Value\n"); - err = TestWriteAttributeInt8uNotDefaultValue_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute INT8U Not Default Value\n"); - err = TestReadAttributeInt8uNotDefaultValue_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute INT8U Default Value\n"); - err = TestWriteAttributeInt8uDefaultValue_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Default Value\n"); - err = TestReadAttributeInt8uDefaultValue_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Write attribute INT16U Not Default Value\n"); - err = TestWriteAttributeInt16uNotDefaultValue_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Not Default Value\n"); - err = TestReadAttributeInt16uNotDefaultValue_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Default Value\n"); - err = TestWriteAttributeInt16uDefaultValue_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Write attribute INT32U Not Default Value\n"); - err = TestWriteAttributeInt32uNotDefaultValue_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Not Default Value\n"); - err = TestReadAttributeInt32uNotDefaultValue_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Default Value\n"); - err = TestWriteAttributeInt32uDefaultValue_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Write attribute INT64U Not Default Value\n"); - err = TestWriteAttributeInt64uNotDefaultValue_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Not Default Value\n"); - err = TestReadAttributeInt64uNotDefaultValue_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Default Value\n"); - err = TestWriteAttributeInt64uDefaultValue_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute INT8S Not Default Value\n"); - err = TestWriteAttributeInt8sNotDefaultValue_50(); - break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Not Default Value\n"); - err = TestReadAttributeInt8sNotDefaultValue_51(); - break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Default Value\n"); - err = TestWriteAttributeInt8sDefaultValue_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_53(); - break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_54(); - break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Write attribute INT16S Not Default Value\n"); - err = TestWriteAttributeInt16sNotDefaultValue_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Read attribute INT16S Not Default Value\n"); - err = TestReadAttributeInt16sNotDefaultValue_56(); - break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Write attribute INT16S Default Value\n"); - err = TestWriteAttributeInt16sDefaultValue_57(); - break; - case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute INT16S Default Value\n"); - err = TestReadAttributeInt16sDefaultValue_58(); - break; - case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_59(); - break; - case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Write attribute INT32S Not Default Value\n"); - err = TestWriteAttributeInt32sNotDefaultValue_60(); - break; - case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : Read attribute INT32S Not Default Value\n"); - err = TestReadAttributeInt32sNotDefaultValue_61(); - break; - case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Write attribute INT32S Default Value\n"); - err = TestWriteAttributeInt32sDefaultValue_62(); - break; - case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Read attribute INT32S Default Value\n"); - err = TestReadAttributeInt32sDefaultValue_63(); - break; - case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_64(); - break; - case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Write attribute INTS Not Default Value\n"); - err = TestWriteAttributeIntsNotDefaultValue_65(); - break; - case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Read attribute INT64S Not Default Value\n"); - err = TestReadAttributeInt64sNotDefaultValue_66(); - break; - case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Write attribute INT64S Default Value\n"); - err = TestWriteAttributeInt64sDefaultValue_67(); - break; - case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Read attribute INT64S Default Value\n"); - err = TestReadAttributeInt64sDefaultValue_68(); - break; - case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_69(); - break; - case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Write attribute ENUM8 Not Default Value\n"); - err = TestWriteAttributeEnum8NotDefaultValue_70(); - break; - case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Read attribute ENUM8 Not Default Value\n"); - err = TestReadAttributeEnum8NotDefaultValue_71(); - break; - case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Write attribute ENUM8 Default Value\n"); - err = TestWriteAttributeEnum8DefaultValue_72(); - break; - case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Read attribute ENUM8 Default Value\n"); - err = TestReadAttributeEnum8DefaultValue_73(); - break; - case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_74(); - break; - case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute ENUM16 Not Default Value\n"); - err = TestWriteAttributeEnum16NotDefaultValue_75(); - break; - case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute ENUM16 Not Default Value\n"); - err = TestReadAttributeEnum16NotDefaultValue_76(); - break; - case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute ENUM16 Default Value\n"); - err = TestWriteAttributeEnum16DefaultValue_77(); - break; - case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_78(); - break; - case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_79(); - break; - case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Write attribute EPOCH_US Not Default Value\n"); - err = TestWriteAttributeEpochUsNotDefaultValue_80(); - break; - case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Read attribute EPOCH_US Not Default Value\n"); - err = TestReadAttributeEpochUsNotDefaultValue_81(); - break; - case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Write attribute EPOCH_US Default Value\n"); - err = TestWriteAttributeEpochUsDefaultValue_82(); - break; - case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_83(); - break; - case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_84(); - break; - case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Write attribute EPOCH_S Not Default Value\n"); - err = TestWriteAttributeEpochSNotDefaultValue_85(); - break; - case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Read attribute EPOCH_S Not Default Value\n"); - err = TestReadAttributeEpochSNotDefaultValue_86(); - break; - case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Write attribute EPOCH_S Default Value\n"); - err = TestWriteAttributeEpochSDefaultValue_87(); - break; - case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_88(); - break; - case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_89(); - break; - case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Write attribute vendor_id Not Default Value\n"); - err = TestWriteAttributeVendorIdNotDefaultValue_90(); - break; - case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Read attribute vendor_id Not Default Value\n"); - err = TestReadAttributeVendorIdNotDefaultValue_91(); - break; - case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Write attribute vendor_id Default Value\n"); - err = TestWriteAttributeVendorIdDefaultValue_92(); - break; - case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_93(); - break; - case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute char_string Default Value\n"); - err = TestReadAttributeCharStringDefaultValue_94(); - break; - case 95: - ChipLogProgress( - chipTool, " ***** Test Step 95 : Read attribute char_string Default Value and compare to saved value\n"); - err = TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95(); - break; - case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Write attribute char_string Not Default Value\n"); - err = TestWriteAttributeCharStringNotDefaultValue_96(); - break; - case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Read attribute char_string Not Default Value\n"); - err = TestReadAttributeCharStringNotDefaultValue_97(); - break; - case 98: - ChipLogProgress( - chipTool, " ***** Test Step 98 : Read attribute char_string Not Default Value and compare to saved value\n"); - err = TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98(); - break; - case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Write attribute char_string Not Default Value from saved value\n"); - err = TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99(); - break; - case 100: - ChipLogProgress( - chipTool, " ***** Test Step 100 : Read attribute char_string Not Default Value and compare to expected value\n"); - err = TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100(); - break; - case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Write attribute char_string Default Value\n"); - err = TestWriteAttributeCharStringDefaultValue_101(); - break; - case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute octet_string Default Value\n"); - err = TestReadAttributeOctetStringDefaultValue_102(); - break; - case 103: - ChipLogProgress( - chipTool, " ***** Test Step 103 : Read attribute octet_string Default Value and compare to saved value\n"); - err = TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103(); - break; - case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Write attribute octet_string Not Default Value\n"); - err = TestWriteAttributeOctetStringNotDefaultValue_104(); - break; - case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Read attribute octet_string Not Default Value\n"); - err = TestReadAttributeOctetStringNotDefaultValue_105(); - break; - case 106: - ChipLogProgress( - chipTool, " ***** Test Step 106 : Read attribute octet_string Not Default Value and compare to saved value\n"); - err = TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106(); - break; - case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Write attribute octet_string Not Default Value from saved value\n"); - err = TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107(); - break; - case 108: - ChipLogProgress( - chipTool, " ***** Test Step 108 : Read attribute octet_string Not Default Value and compare to expected value\n"); - err = TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108(); - break; - case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Write attribute octet_string Default Value\n"); - err = TestWriteAttributeOctetStringDefaultValue_109(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestWriteAttributeInt8uNotDefaultValue_30() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id int8uArgument; + int8uArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeInt8uWithValue:int8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8U Not Default Value Error: %@", err); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 110; + VerifyOrReturn(CheckValue("status", err, 0)); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - NSNumber * _Nonnull TestAddArgumentDefaultValue; - CHIP_ERROR TestSendTestAddArgumentsCommand_1() + CHIP_ERROR TestReadAttributeInt8uNotDefaultValue_31() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [NSNumber numberWithUnsignedChar:17]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, 20)); - } - { - TestAddArgumentDefaultValue = values.returnValue; - } + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("int8u", value, readAttributeInt8uDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestAddArgumentsCommand_2() + CHIP_ERROR TestWriteAttributeInt8uDefaultValue_32() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [NSNumber numberWithUnsignedChar:17]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id int8uArgument; + int8uArgument = [readAttributeInt8uDefaultValue copy]; + [cluster writeAttributeInt8uWithValue:int8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8U Default Value Error: %@", err); - { - id actualValue = values.returnValue; - VerifyOrReturn(CheckValue("returnValue", actualValue, TestAddArgumentDefaultValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendTestAddArgumentsCommand_3() + CHIP_ERROR TestReadAttributeInt8uDefaultValue_33() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [TestAddArgumentDefaultValue copy]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8U Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - if (values.returnValue != nil) { - VerifyOrReturn( - CheckConstraintNotValue("returnValue", values.returnValue, TestAddArgumentDefaultValue)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("int8u", actualValue, readAttributeInt8uDefaultValue)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBooleanDefaultValue; + NSNumber * _Nonnull readAttributeInt16uDefaultValue; - CHIP_ERROR TestReadAttributeBooleanDefaultValue_4() + CHIP_ERROR TestReadAttributeInt16uDefaultValue_34() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, 0)); + VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); } { - readAttributeBooleanDefaultValue = value; + readAttributeInt16uDefaultValue = value; } NextTest(); @@ -61468,39 +69247,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanNotDefaultValue_5() + CHIP_ERROR TestWriteAttributeInt16uNotDefaultValue_35() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id booleanArgument; - booleanArgument = [NSNumber numberWithBool:1]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN Not Default Value Error: %@", err); + id int16uArgument; + int16uArgument = [NSNumber numberWithUnsignedShort:1U]; + [cluster writeAttributeInt16uWithValue:int16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanNotDefaultValue_6() + CHIP_ERROR TestReadAttributeInt16uNotDefaultValue_36() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN Not Default Value Error: %@", err); + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("boolean", value, readAttributeBooleanDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int16u", value, readAttributeInt16uDefaultValue)); } NextTest(); @@ -61509,40 +69288,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBooleanDefaultValue_7() + CHIP_ERROR TestWriteAttributeInt16uDefaultValue_37() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id booleanArgument; - booleanArgument = [readAttributeBooleanDefaultValue copy]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN DefaultValue Error: %@", err); + id int16uArgument; + int16uArgument = [readAttributeInt16uDefaultValue copy]; + [cluster writeAttributeInt16uWithValue:int16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16U Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBooleanFalse_8() + CHIP_ERROR TestReadAttributeInt16uDefaultValue_38() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN False Error: %@", err); + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("boolean", actualValue, readAttributeBooleanDefaultValue)); + VerifyOrReturn(CheckValue("int16u", actualValue, readAttributeInt16uDefaultValue)); } NextTest(); @@ -61550,25 +69329,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap8DefaultValue; + NSNumber * _Nonnull readAttributeInt32uDefaultValue; - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_9() + CHIP_ERROR TestReadAttributeInt32uDefaultValue_39() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, 0)); + VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); } { - readAttributeBitmap8DefaultValue = value; + readAttributeInt32uDefaultValue = value; } NextTest(); @@ -61577,39 +69356,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8NotDefaultValue_10() + CHIP_ERROR TestWriteAttributeInt32uNotDefaultValue_40() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap8Argument; - bitmap8Argument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Not Default Value Error: %@", err); + id int32uArgument; + int32uArgument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8NotDefaultValue_11() + CHIP_ERROR TestReadAttributeInt32uNotDefaultValue_41() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Not Default Value Error: %@", err); + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("bitmap8", value, readAttributeBitmap8DefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int32u", value, readAttributeInt32uDefaultValue)); } NextTest(); @@ -61618,40 +69397,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap8DefaultValue_12() + CHIP_ERROR TestWriteAttributeInt32uDefaultValue_42() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap8Argument; - bitmap8Argument = [readAttributeBitmap8DefaultValue copy]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Default Value Error: %@", err); + id int32uArgument; + int32uArgument = [readAttributeInt32uDefaultValue copy]; + [cluster writeAttributeInt32uWithValue:int32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32U Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_13() + CHIP_ERROR TestReadAttributeInt32uDefaultValue_43() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap8", actualValue, readAttributeBitmap8DefaultValue)); + VerifyOrReturn(CheckValue("int32u", actualValue, readAttributeInt32uDefaultValue)); } NextTest(); @@ -61659,25 +69438,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap16DefaultValue; + NSNumber * _Nonnull readAttributeInt64uDefaultValue; - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_14() + CHIP_ERROR TestReadAttributeInt64uDefaultValue_44() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, 0U)); + VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); } { - readAttributeBitmap16DefaultValue = value; + readAttributeInt64uDefaultValue = value; } NextTest(); @@ -61686,39 +69465,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16NotDefaultValue_15() + CHIP_ERROR TestWriteAttributeInt64uNotDefaultValue_45() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap16Argument; - bitmap16Argument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Not Default Value Error: %@", err); + id int64uArgument; + int64uArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; + [cluster writeAttributeInt64uWithValue:int64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64U Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16NotDefaultValue_16() + CHIP_ERROR TestReadAttributeInt64uNotDefaultValue_46() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Not Default Value Error: %@", err); + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("bitmap16", value, readAttributeBitmap16DefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int64u", value, readAttributeInt64uDefaultValue)); } NextTest(); @@ -61727,40 +69506,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap16DefaultValue_17() + CHIP_ERROR TestWriteAttributeInt64uDefaultValue_47() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap16Argument; - bitmap16Argument = [readAttributeBitmap16DefaultValue copy]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Default Value Error: %@", err); + id int64uArgument; + int64uArgument = [readAttributeInt64uDefaultValue copy]; + [cluster writeAttributeInt64uWithValue:int64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT64U Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_18() + CHIP_ERROR TestReadAttributeInt64uDefaultValue_48() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64U Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap16", actualValue, readAttributeBitmap16DefaultValue)); + VerifyOrReturn(CheckValue("int64u", actualValue, readAttributeInt64uDefaultValue)); } NextTest(); @@ -61768,25 +69547,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap32DefaultValue; + NSNumber * _Nonnull readAttributeInt8sDefaultValue; - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_19() + CHIP_ERROR TestReadAttributeInt8sDefaultValue_49() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, 0UL)); + VerifyOrReturn(CheckValue("int8s", actualValue, 0)); } { - readAttributeBitmap32DefaultValue = value; + readAttributeInt8sDefaultValue = value; } NextTest(); @@ -61795,39 +69574,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32NotDefaultValue_20() + CHIP_ERROR TestWriteAttributeInt8sNotDefaultValue_50() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap32Argument; - bitmap32Argument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Not Default Value Error: %@", err); + id int8sArgument; + int8sArgument = [NSNumber numberWithChar:1]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32NotDefaultValue_21() + CHIP_ERROR TestReadAttributeInt8sNotDefaultValue_51() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Not Default Value Error: %@", err); + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("bitmap32", value, readAttributeBitmap32DefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int8s", value, readAttributeInt8sDefaultValue)); } NextTest(); @@ -61836,40 +69615,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32DefaultValue_22() + CHIP_ERROR TestWriteAttributeInt8sDefaultValue_52() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap32Argument; - bitmap32Argument = [readAttributeBitmap32DefaultValue copy]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Default Value Error: %@", err); + id int8sArgument; + int8sArgument = [readAttributeInt8sDefaultValue copy]; + [cluster writeAttributeInt8sWithValue:int8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT8S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_23() + CHIP_ERROR TestReadAttributeInt8sDefaultValue_53() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT8S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap32", actualValue, readAttributeBitmap32DefaultValue)); + VerifyOrReturn(CheckValue("int8s", actualValue, readAttributeInt8sDefaultValue)); } NextTest(); @@ -61877,25 +69656,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeBitmap64DefaultValue; + NSNumber * _Nonnull readAttributeInt16sDefaultValue; - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_24() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_54() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, 0ULL)); + VerifyOrReturn(CheckValue("int16s", actualValue, 0)); } { - readAttributeBitmap64DefaultValue = value; + readAttributeInt16sDefaultValue = value; } NextTest(); @@ -61904,39 +69683,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64NotDefaultValue_25() + CHIP_ERROR TestWriteAttributeInt16sNotDefaultValue_55() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap64Argument; - bitmap64Argument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Not Default Value Error: %@", err); + id int16sArgument; + int16sArgument = [NSNumber numberWithShort:1]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() + CHIP_ERROR TestReadAttributeInt16sNotDefaultValue_56() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("bitmap64", value, readAttributeBitmap64DefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int16s", value, readAttributeInt16sDefaultValue)); } NextTest(); @@ -61945,40 +69724,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap64DefaultValue_27() + CHIP_ERROR TestWriteAttributeInt16sDefaultValue_57() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bitmap64Argument; - bitmap64Argument = [readAttributeBitmap64DefaultValue copy]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Default Value Error: %@", err); + id int16sArgument; + int16sArgument = [readAttributeInt16sDefaultValue copy]; + [cluster writeAttributeInt16sWithValue:int16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT16S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_28() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT16S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("bitmap64", actualValue, readAttributeBitmap64DefaultValue)); + VerifyOrReturn(CheckValue("int16s", actualValue, readAttributeInt16sDefaultValue)); } NextTest(); @@ -61986,25 +69765,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt8uDefaultValue; + NSNumber * _Nonnull readAttributeInt32sDefaultValue; - CHIP_ERROR TestReadAttributeInt8uDefaultValue_29() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_59() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, 0)); + VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); } { - readAttributeInt8uDefaultValue = value; + readAttributeInt32sDefaultValue = value; } NextTest(); @@ -62013,39 +69792,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uNotDefaultValue_30() + CHIP_ERROR TestWriteAttributeInt32sNotDefaultValue_60() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8uArgument; - int8uArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Not Default Value Error: %@", err); + id int32sArgument; + int32sArgument = [NSNumber numberWithInt:1L]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uNotDefaultValue_31() + CHIP_ERROR TestReadAttributeInt32sNotDefaultValue_61() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Not Default Value Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int8u", value, readAttributeInt8uDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int32s", value, readAttributeInt32sDefaultValue)); } NextTest(); @@ -62054,40 +69833,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8uDefaultValue_32() + CHIP_ERROR TestWriteAttributeInt32sDefaultValue_62() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8uArgument; - int8uArgument = [readAttributeInt8uDefaultValue copy]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Default Value Error: %@", err); + id int32sArgument; + int32sArgument = [readAttributeInt32sDefaultValue copy]; + [cluster writeAttributeInt32sWithValue:int32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute INT32S Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8uDefaultValue_33() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_63() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT32S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8u", actualValue, readAttributeInt8uDefaultValue)); + VerifyOrReturn(CheckValue("int32s", actualValue, readAttributeInt32sDefaultValue)); } NextTest(); @@ -62095,25 +69874,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt16uDefaultValue; + NSNumber * _Nonnull readAttributeInt64sDefaultValue; - CHIP_ERROR TestReadAttributeInt16uDefaultValue_34() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_64() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, 0U)); + VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); } { - readAttributeInt16uDefaultValue = value; + readAttributeInt64sDefaultValue = value; } NextTest(); @@ -62122,17 +69901,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uNotDefaultValue_35() + CHIP_ERROR TestWriteAttributeIntsNotDefaultValue_65() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16uArgument; - int16uArgument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeInt16uWithValue:int16uArgument + id int64sArgument; + int64sArgument = [NSNumber numberWithLongLong:1LL]; + [cluster writeAttributeInt64sWithValue:int64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Not Default Value Error: %@", err); + NSLog(@"Write attribute INTS Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62142,19 +69921,19 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uNotDefaultValue_36() + CHIP_ERROR TestReadAttributeInt64sNotDefaultValue_66() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Not Default Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int16u", value, readAttributeInt16uDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("int64s", value, readAttributeInt64sDefaultValue)); } NextTest(); @@ -62163,17 +69942,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16uDefaultValue_37() + CHIP_ERROR TestWriteAttributeInt64sDefaultValue_67() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16uArgument; - int16uArgument = [readAttributeInt16uDefaultValue copy]; - [cluster writeAttributeInt16uWithValue:int16uArgument + id int64sArgument; + int64sArgument = [readAttributeInt64sDefaultValue copy]; + [cluster writeAttributeInt64sWithValue:int64sArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Default Value Error: %@", err); + NSLog(@"Write attribute INT64S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62183,20 +69962,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16uDefaultValue_38() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_68() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute INT64S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16u", actualValue, readAttributeInt16uDefaultValue)); + VerifyOrReturn(CheckValue("int64s", actualValue, readAttributeInt64sDefaultValue)); } NextTest(); @@ -62204,25 +69983,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt32uDefaultValue; + NSNumber * _Nonnull readAttributeEnum8DefaultValue; - CHIP_ERROR TestReadAttributeInt32uDefaultValue_39() + CHIP_ERROR TestReadAttributeEnum8DefaultValue_69() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, 0UL)); + VerifyOrReturn(CheckValue("enum8", actualValue, 0)); } { - readAttributeInt32uDefaultValue = value; + readAttributeEnum8DefaultValue = value; } NextTest(); @@ -62231,39 +70010,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uNotDefaultValue_40() + CHIP_ERROR TestWriteAttributeEnum8NotDefaultValue_70() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Not Default Value Error: %@", err); + id enum8Argument; + enum8Argument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeEnum8WithValue:enum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute ENUM8 Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uNotDefaultValue_41() + CHIP_ERROR TestReadAttributeEnum8NotDefaultValue_71() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Not Default Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int32u", value, readAttributeInt32uDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("enum8", value, readAttributeEnum8DefaultValue)); } NextTest(); @@ -62272,40 +70051,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uDefaultValue_42() + CHIP_ERROR TestWriteAttributeEnum8DefaultValue_72() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [readAttributeInt32uDefaultValue copy]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Default Value Error: %@", err); + id enum8Argument; + enum8Argument = [readAttributeEnum8DefaultValue copy]; + [cluster writeAttributeEnum8WithValue:enum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute ENUM8 Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uDefaultValue_43() + CHIP_ERROR TestReadAttributeEnum8DefaultValue_73() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32u", actualValue, readAttributeInt32uDefaultValue)); + VerifyOrReturn(CheckValue("enum8", actualValue, readAttributeEnum8DefaultValue)); } NextTest(); @@ -62313,25 +70092,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt64uDefaultValue; + NSNumber * _Nonnull readAttributeEnum16DefaultValue; - CHIP_ERROR TestReadAttributeInt64uDefaultValue_44() + CHIP_ERROR TestReadAttributeEnum16DefaultValue_74() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, 0ULL)); + VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); } { - readAttributeInt64uDefaultValue = value; + readAttributeEnum16DefaultValue = value; } NextTest(); @@ -62340,17 +70119,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uNotDefaultValue_45() + CHIP_ERROR TestWriteAttributeEnum16NotDefaultValue_75() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64uArgument; - int64uArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeInt64uWithValue:int64uArgument + id enum16Argument; + enum16Argument = [NSNumber numberWithUnsignedShort:1U]; + [cluster writeAttributeEnum16WithValue:enum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Not Default Value Error: %@", err); + NSLog(@"Write attribute ENUM16 Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62360,19 +70139,19 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uNotDefaultValue_46() + CHIP_ERROR TestReadAttributeEnum16NotDefaultValue_76() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Not Default Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int64u", value, readAttributeInt64uDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("enum16", value, readAttributeEnum16DefaultValue)); } NextTest(); @@ -62381,17 +70160,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64uDefaultValue_47() + CHIP_ERROR TestWriteAttributeEnum16DefaultValue_77() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64uArgument; - int64uArgument = [readAttributeInt64uDefaultValue copy]; - [cluster writeAttributeInt64uWithValue:int64uArgument + id enum16Argument; + enum16Argument = [readAttributeEnum16DefaultValue copy]; + [cluster writeAttributeEnum16WithValue:enum16Argument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Default Value Error: %@", err); + NSLog(@"Write attribute ENUM16 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62401,20 +70180,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt64uDefaultValue_48() + CHIP_ERROR TestReadAttributeEnum16DefaultValue_78() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64u", actualValue, readAttributeInt64uDefaultValue)); + VerifyOrReturn(CheckValue("enum16", actualValue, readAttributeEnum16DefaultValue)); } NextTest(); @@ -62422,25 +70201,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt8sDefaultValue; + NSNumber * _Nonnull readAttributeEpochUSDefaultValue; - CHIP_ERROR TestReadAttributeInt8sDefaultValue_49() + CHIP_ERROR TestReadAttributeEpochUsDefaultValue_79() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, 0)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); } { - readAttributeInt8sDefaultValue = value; + readAttributeEpochUSDefaultValue = value; } NextTest(); @@ -62449,39 +70228,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sNotDefaultValue_50() + CHIP_ERROR TestWriteAttributeEpochUsNotDefaultValue_80() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:1]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Not Default Value Error: %@", err); + id epochUsArgument; + epochUsArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_US Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sNotDefaultValue_51() + CHIP_ERROR TestReadAttributeEpochUsNotDefaultValue_81() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Not Default Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int8s", value, readAttributeInt8sDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("epochUs", value, readAttributeEpochUSDefaultValue)); } NextTest(); @@ -62490,40 +70269,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt8sDefaultValue_52() + CHIP_ERROR TestWriteAttributeEpochUsDefaultValue_82() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int8sArgument; - int8sArgument = [readAttributeInt8sDefaultValue copy]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Default Value Error: %@", err); + id epochUsArgument; + epochUsArgument = [readAttributeEpochUSDefaultValue copy]; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute EPOCH_US Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt8sDefaultValue_53() + CHIP_ERROR TestReadAttributeEpochUsDefaultValue_83() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int8s", actualValue, readAttributeInt8sDefaultValue)); + VerifyOrReturn(CheckValue("epoch_us", actualValue, readAttributeEpochUSDefaultValue)); } NextTest(); @@ -62531,25 +70310,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt16sDefaultValue; + NSNumber * _Nonnull readAttributeEpochSDefaultValue; - CHIP_ERROR TestReadAttributeInt16sDefaultValue_54() + CHIP_ERROR TestReadAttributeEpochSDefaultValue_84() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, 0)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); } { - readAttributeInt16sDefaultValue = value; + readAttributeEpochSDefaultValue = value; } NextTest(); @@ -62558,17 +70337,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sNotDefaultValue_55() + CHIP_ERROR TestWriteAttributeEpochSNotDefaultValue_85() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:1]; - [cluster writeAttributeInt16sWithValue:int16sArgument + id epochSArgument; + epochSArgument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeEpochSWithValue:epochSArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Not Default Value Error: %@", err); + NSLog(@"Write attribute EPOCH_S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62578,19 +70357,19 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sNotDefaultValue_56() + CHIP_ERROR TestReadAttributeEpochSNotDefaultValue_86() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Not Default Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int16s", value, readAttributeInt16sDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("epochS", value, readAttributeEpochSDefaultValue)); } NextTest(); @@ -62599,17 +70378,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt16sDefaultValue_57() + CHIP_ERROR TestWriteAttributeEpochSDefaultValue_87() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int16sArgument; - int16sArgument = [readAttributeInt16sDefaultValue copy]; - [cluster writeAttributeInt16sWithValue:int16sArgument + id epochSArgument; + epochSArgument = [readAttributeEpochSDefaultValue copy]; + [cluster writeAttributeEpochSWithValue:epochSArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Default Value Error: %@", err); + NSLog(@"Write attribute EPOCH_S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -62619,20 +70398,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() + CHIP_ERROR TestReadAttributeEpochSDefaultValue_88() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int16s", actualValue, readAttributeInt16sDefaultValue)); + VerifyOrReturn(CheckValue("epoch_s", actualValue, readAttributeEpochSDefaultValue)); } NextTest(); @@ -62640,25 +70419,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt32sDefaultValue; + NSNumber * _Nonnull readAttributeVendorIdDefaultValue; - CHIP_ERROR TestReadAttributeInt32sDefaultValue_59() + CHIP_ERROR TestReadAttributeVendorIdDefaultValue_89() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, 0L)); + VerifyOrReturn(CheckValue("vendor_id", actualValue, 0U)); } { - readAttributeInt32sDefaultValue = value; + readAttributeVendorIdDefaultValue = value; } NextTest(); @@ -62667,39 +70446,39 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sNotDefaultValue_60() + CHIP_ERROR TestWriteAttributeVendorIdNotDefaultValue_90() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:1L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Not Default Value Error: %@", err); + id vendorIdArgument; + vendorIdArgument = [NSNumber numberWithUnsignedShort:1U]; + [cluster writeAttributeVendorIdWithValue:vendorIdArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute vendor_id Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sNotDefaultValue_61() + CHIP_ERROR TestReadAttributeVendorIdNotDefaultValue_91() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Not Default Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int32s", value, readAttributeInt32sDefaultValue)); + VerifyOrReturn(CheckConstraintNotValue("vendorId", value, readAttributeVendorIdDefaultValue)); } NextTest(); @@ -62708,40 +70487,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sDefaultValue_62() + CHIP_ERROR TestWriteAttributeVendorIdDefaultValue_92() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32sArgument; - int32sArgument = [readAttributeInt32sDefaultValue copy]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Default Value Error: %@", err); + id vendorIdArgument; + vendorIdArgument = [readAttributeVendorIdDefaultValue copy]; + [cluster writeAttributeVendorIdWithValue:vendorIdArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute vendor_id Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32sDefaultValue_63() + CHIP_ERROR TestReadAttributeVendorIdDefaultValue_93() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute vendor_id Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int32s", actualValue, readAttributeInt32sDefaultValue)); + VerifyOrReturn(CheckValue("vendor_id", actualValue, readAttributeVendorIdDefaultValue)); } NextTest(); @@ -62749,25 +70528,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeInt64sDefaultValue; + NSString * _Nonnull readAttributeCharStringDefaultValue; - CHIP_ERROR TestReadAttributeInt64sDefaultValue_64() + CHIP_ERROR TestReadAttributeCharStringDefaultValue_94() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, 0LL)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"")); } { - readAttributeInt64sDefaultValue = value; + readAttributeCharStringDefaultValue = value; } NextTest(); @@ -62776,39 +70555,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeIntsNotDefaultValue_65() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:1LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INTS Not Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeInt64sNotDefaultValue_66() + CHIP_ERROR TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Not Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Default Value and compare to saved value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int64s", value, readAttributeInt64sDefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("char_string", actualValue, readAttributeCharStringDefaultValue)); } NextTest(); @@ -62817,40 +70577,48 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt64sDefaultValue_67() + CHIP_ERROR TestWriteAttributeCharStringNotDefaultValue_96() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int64sArgument; - int64sArgument = [readAttributeInt64sDefaultValue copy]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Default Value Error: %@", err); + id charStringArgument; + charStringArgument = @"NotDefault"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute char_string Not Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSString * _Nonnull readAttributeCharStringNotDefaultValue; - CHIP_ERROR TestReadAttributeInt64sDefaultValue_68() + CHIP_ERROR TestReadAttributeCharStringNotDefaultValue_97() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("int64s", actualValue, readAttributeInt64sDefaultValue)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"NotDefault")); + } + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("charString", value, readAttributeCharStringDefaultValue)); + } + { + readAttributeCharStringNotDefaultValue = value; } NextTest(); @@ -62858,25 +70626,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEnum8DefaultValue; - CHIP_ERROR TestReadAttributeEnum8DefaultValue_69() + CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Not Default Value and compare to saved value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, 0)); + VerifyOrReturn(CheckValueAsString("char_string", actualValue, readAttributeCharStringNotDefaultValue)); } - { - readAttributeEnum8DefaultValue = value; + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("charString", value, readAttributeCharStringDefaultValue)); } NextTest(); @@ -62885,39 +70653,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8NotDefaultValue_70() + CHIP_ERROR TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id enum8Argument; - enum8Argument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Not Default Value Error: %@", err); + id charStringArgument; + charStringArgument = [readAttributeCharStringNotDefaultValue copy]; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute char_string Not Default Value from saved value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEnum8NotDefaultValue_71() + CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Not Default Value Error: %@", err); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute char_string Not Default Value and compare to expected value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("enum8", value, readAttributeEnum8DefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"NotDefault")); } NextTest(); @@ -62926,66 +70695,44 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum8DefaultValue_72() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id enum8Argument; - enum8Argument = [readAttributeEnum8DefaultValue copy]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeEnum8DefaultValue_73() + CHIP_ERROR TestWriteAttributeCharStringDefaultValue_101() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id charStringArgument; + charStringArgument = [readAttributeCharStringDefaultValue copy]; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute char_string Default Value Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enum8", actualValue, readAttributeEnum8DefaultValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEnum16DefaultValue; + NSData * _Nonnull readAttributeOctetStringDefaultValue; - CHIP_ERROR TestReadAttributeEnum16DefaultValue_74() + CHIP_ERROR TestReadAttributeOctetStringDefaultValue_102() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, 0U)); + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); } { - readAttributeEnum16DefaultValue = value; + readAttributeOctetStringDefaultValue = value; } NextTest(); @@ -62994,39 +70741,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16NotDefaultValue_75() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id enum16Argument; - enum16Argument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Not Default Value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadAttributeEnum16NotDefaultValue_76() + CHIP_ERROR TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Not Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Default Value and compare to saved value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("enum16", value, readAttributeEnum16DefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringDefaultValue)); } NextTest(); @@ -63035,40 +70763,49 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEnum16DefaultValue_77() + CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValue_104() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id enum16Argument; - enum16Argument = [readAttributeEnum16DefaultValue copy]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Default Value Error: %@", err); + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturn(CheckValue("status", err, 0)); + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"NotDefault" length:10]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute octet_string Not Default Value Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } + NSData * _Nonnull readAttributeOctetStringNotDefaultValue; - CHIP_ERROR TestReadAttributeEnum16DefaultValue_78() + CHIP_ERROR TestReadAttributeOctetStringNotDefaultValue_105() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Not Default Value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("enum16", actualValue, readAttributeEnum16DefaultValue)); + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); + } + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); + } + { + readAttributeOctetStringNotDefaultValue = value; } NextTest(); @@ -63076,25 +70813,25 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEpochUSDefaultValue; - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_79() + CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Not Default Value and compare to saved value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, 0ULL)); + VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringNotDefaultValue)); } - { - readAttributeEpochUSDefaultValue = value; + + if (value != nil) { + VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); } NextTest(); @@ -63103,39 +70840,41 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochUsNotDefaultValue_80() + CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochUsArgument; - epochUsArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Not Default Value Error: %@", err); + id octetStringArgument; + octetStringArgument = [readAttributeOctetStringNotDefaultValue copy]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute octet_string Not Default Value from saved value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochUsNotDefaultValue_81() + CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Not Default Value Error: %@", err); + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute octet_string Not Default Value and compare to expected value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("epochUs", value, readAttributeEpochUSDefaultValue)); + { + id actualValue = value; + VerifyOrReturn( + CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); } NextTest(); @@ -63144,40 +70883,129 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochUsDefaultValue_82() + CHIP_ERROR TestWriteAttributeOctetStringDefaultValue_109() { CHIPDevice * device = GetConnectedDevice(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochUsArgument; - epochUsArgument = [readAttributeEpochUSDefaultValue copy]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Default Value Error: %@", err); + id octetStringArgument; + octetStringArgument = [readAttributeOctetStringDefaultValue copy]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute octet_string Default Value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_83() +class TestDescriptorCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestDescriptorCluster() + : TestCommandBridge("TestDescriptorCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TestDescriptorCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestDescriptorCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestDescriptorCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Device list\n"); + err = TestReadAttributeDeviceList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute Server list\n"); + err = TestReadAttributeServerList_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute Client list\n"); + err = TestReadAttributeClientList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute Parts list\n"); + err = TestReadAttributePartsList_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeDeviceList_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); + [cluster readAttributeDeviceListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Device list Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_us", actualValue, readAttributeEpochUSDefaultValue)); + VerifyOrReturn(CheckValue("device list", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("type", ((CHIPDescriptorClusterDeviceType *) actualValue[0]).type, 22UL)); + VerifyOrReturn(CheckValue("revision", ((CHIPDescriptorClusterDeviceType *) actualValue[0]).revision, 1U)); } NextTest(); @@ -63185,25 +71013,46 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeEpochSDefaultValue; - CHIP_ERROR TestReadAttributeEpochSDefaultValue_84() + CHIP_ERROR TestReadAttributeServerList_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); + [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Server list Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, 0UL)); - } - { - readAttributeEpochSDefaultValue = value; + VerifyOrReturn(CheckValue("server list", [actualValue count], static_cast(25))); + VerifyOrReturn(CheckValue("", actualValue[0], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 29UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 30UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 31UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 40UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 42UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 43UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 44UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 45UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 46UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 48UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 49UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 50UL)); + VerifyOrReturn(CheckValue("", actualValue[14], 51UL)); + VerifyOrReturn(CheckValue("", actualValue[15], 52UL)); + VerifyOrReturn(CheckValue("", actualValue[16], 53UL)); + VerifyOrReturn(CheckValue("", actualValue[17], 54UL)); + VerifyOrReturn(CheckValue("", actualValue[18], 55UL)); + VerifyOrReturn(CheckValue("", actualValue[19], 60UL)); + VerifyOrReturn(CheckValue("", actualValue[20], 62UL)); + VerifyOrReturn(CheckValue("", actualValue[21], 63UL)); + VerifyOrReturn(CheckValue("", actualValue[22], 64UL)); + VerifyOrReturn(CheckValue("", actualValue[23], 65UL)); + VerifyOrReturn(CheckValue("", actualValue[24], 1029UL)); } NextTest(); @@ -63212,39 +71061,45 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeEpochSNotDefaultValue_85() + CHIP_ERROR TestReadAttributeClientList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Not Default Value Error: %@", err); + [cluster readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Client list Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("client list", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 41UL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeEpochSNotDefaultValue_86() + CHIP_ERROR TestReadAttributePartsList_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Not Default Value Error: %@", err); + [cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Parts list Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("epochS", value, readAttributeEpochSDefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("parts list", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("", actualValue[0], 1U)); + VerifyOrReturn(CheckValue("", actualValue[1], 2U)); } NextTest(); @@ -63252,67 +71107,160 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestWriteAttributeEpochSDefaultValue_87() +class TestBasicInformation : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestBasicInformation() + : TestCommandBridge("TestBasicInformation") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - id epochSArgument; - epochSArgument = [readAttributeEpochSDefaultValue copy]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Default Value Error: %@", err); + ~TestBasicInformation() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - NextTest(); - }]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestBasicInformation\n"); + } - return CHIP_NO_ERROR; - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestBasicInformation\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestReadAttributeEpochSDefaultValue_88() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + Wait(); - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read location\n"); + err = TestReadLocation_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Write location\n"); + err = TestWriteLocation_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read back location\n"); + err = TestReadBackLocation_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Restore initial location value\n"); + err = TestRestoreInitialLocationValue_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read AttributeList value\n"); + err = TestReadAttributeListValue_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read NodeLabel\n"); + err = TestReadNodeLabel_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write NodeLabel\n"); + err = TestWriteNodeLabel_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read back NodeLabel\n"); + err = TestReadBackNodeLabel_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read LocalConfigDisabled\n"); + err = TestReadLocalConfigDisabled_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Write LocalConfigDisabled\n"); + err = TestWriteLocalConfigDisabled_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read back LocalConfigDisabled\n"); + err = TestReadBackLocalConfigDisabled_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reboot the device\n"); + err = TestRebootTheDevice_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Connect to the device again\n"); + err = TestConnectToTheDeviceAgain_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read back NodeLabel after reboot\n"); + err = TestReadBackNodeLabelAfterReboot_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Restore initial NodeLabel value\n"); + err = TestRestoreInitialNodeLabelValue_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Read back LocalConfigDisabled after reboot\n"); + err = TestReadBackLocalConfigDisabledAfterReboot_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Restore initial LocalConfigDisabled value\n"); + err = TestRestoreInitialLocalConfigDisabledValue_17(); + break; + } - VerifyOrReturn(CheckValue("status", err, 0)); + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("epoch_s", actualValue, readAttributeEpochSDefaultValue)); - } + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 18; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - NSNumber * _Nonnull readAttributeVendorIdDefaultValue; - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_89() + CHIP_ERROR TestReadLocation_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); + [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read location Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("vendor_id", actualValue, 0U)); - } - { - readAttributeVendorIdDefaultValue = value; + VerifyOrReturn(CheckValueAsString("Location", actualValue, @"XX")); } NextTest(); @@ -63321,17 +71269,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeVendorIdNotDefaultValue_90() + CHIP_ERROR TestWriteLocation_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id vendorIdArgument; - vendorIdArgument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument + id locationArgument; + locationArgument = @"US"; + [cluster writeAttributeLocationWithValue:locationArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Not Default Value Error: %@", err); + NSLog(@"Write location Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -63341,19 +71289,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeVendorIdNotDefaultValue_91() + CHIP_ERROR TestReadBackLocation_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Not Default Value Error: %@", err); + [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back location Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("vendorId", value, readAttributeVendorIdDefaultValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("Location", actualValue, @"US")); } NextTest(); @@ -63362,17 +71311,17 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeVendorIdDefaultValue_92() + CHIP_ERROR TestRestoreInitialLocationValue_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id vendorIdArgument; - vendorIdArgument = [readAttributeVendorIdDefaultValue copy]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument + id locationArgument; + locationArgument = @"XX"; + [cluster writeAttributeLocationWithValue:locationArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Default Value Error: %@", err); + NSLog(@"Restore initial location value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -63382,20 +71331,44 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_93() + CHIP_ERROR TestReadAttributeListValue_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read AttributeList value Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("vendor_id", actualValue, readAttributeVendorIdDefaultValue)); + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(24))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 8UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 9UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[14], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[15], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[16], 16UL)); + VerifyOrReturn(CheckValue("", actualValue[17], 17UL)); + VerifyOrReturn(CheckValue("", actualValue[18], 18UL)); + VerifyOrReturn(CheckValue("", actualValue[19], 19UL)); + VerifyOrReturn(CheckValue("", actualValue[20], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[21], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[22], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[23], 65533UL)); } NextTest(); @@ -63403,25 +71376,63 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - NSString * _Nonnull readAttributeCharStringDefaultValue; - CHIP_ERROR TestReadAttributeCharStringDefaultValue_94() + CHIP_ERROR TestReadNodeLabel_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Default Value Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read NodeLabel Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"")); + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"")); } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteNodeLabel_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nodeLabelArgument; + nodeLabelArgument = @"My node"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write NodeLabel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadBackNodeLabel_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back NodeLabel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + { - readAttributeCharStringDefaultValue = value; + id actualValue = value; + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"My node")); } NextTest(); @@ -63430,20 +71441,20 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringDefaultValueAndCompareToSavedValue_95() + CHIP_ERROR TestReadLocalConfigDisabled_9() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Default Value and compare to saved value Error: %@", err); + [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read LocalConfigDisabled Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, readAttributeCharStringDefaultValue)); + VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, false)); } NextTest(); @@ -63452,48 +71463,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringNotDefaultValue_96() + CHIP_ERROR TestWriteLocalConfigDisabled_10() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"NotDefault"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute char_string Not Default Value Error: %@", err); + id localConfigDisabledArgument; + localConfigDisabledArgument = [NSNumber numberWithBool:true]; + [cluster writeAttributeLocalConfigDisabledWithValue:localConfigDisabledArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write LocalConfigDisabled Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSString * _Nonnull readAttributeCharStringNotDefaultValue; - CHIP_ERROR TestReadAttributeCharStringNotDefaultValue_97() + CHIP_ERROR TestReadBackLocalConfigDisabled_11() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Not Default Value Error: %@", err); + [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back LocalConfigDisabled Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"NotDefault")); - } - - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("charString", value, readAttributeCharStringDefaultValue)); - } + { - readAttributeCharStringNotDefaultValue = value; + id actualValue = value; + VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, true)); } NextTest(); @@ -63502,24 +71505,32 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToSavedValue_98() + CHIP_ERROR TestRebootTheDevice_12() + { + Reboot(); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestConnectToTheDeviceAgain_13() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadBackNodeLabelAfterReboot_14() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Not Default Value and compare to saved value Error: %@", err); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back NodeLabel after reboot Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, readAttributeCharStringNotDefaultValue)); - } - - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("charString", value, readAttributeCharStringDefaultValue)); + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"My node")); } NextTest(); @@ -63528,40 +71539,40 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringNotDefaultValueFromSavedValue_99() + CHIP_ERROR TestRestoreInitialNodeLabelValue_15() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = [readAttributeCharStringNotDefaultValue copy]; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute char_string Not Default Value from saved value Error: %@", err); + id nodeLabelArgument; + nodeLabelArgument = @""; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Restore initial NodeLabel value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringNotDefaultValueAndCompareToExpectedValue_100() + CHIP_ERROR TestReadBackLocalConfigDisabledAfterReboot_16() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Not Default Value and compare to expected value Error: %@", err); + [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read back LocalConfigDisabled after reboot Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("char_string", actualValue, @"NotDefault")); + VerifyOrReturn(CheckValue("LocalConfigDisabled", actualValue, true)); } NextTest(); @@ -63570,66 +71581,236 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringDefaultValue_101() + CHIP_ERROR TestRestoreInitialLocalConfigDisabledValue_17() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = [readAttributeCharStringDefaultValue copy]; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute char_string Default Value Error: %@", err); + id localConfigDisabledArgument; + localConfigDisabledArgument = [NSNumber numberWithBool:false]; + [cluster writeAttributeLocalConfigDisabledWithValue:localConfigDisabledArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Restore initial LocalConfigDisabled value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSData * _Nonnull readAttributeOctetStringDefaultValue; +}; - CHIP_ERROR TestReadAttributeOctetStringDefaultValue_102() +class TestIdentifyCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestIdentifyCluster() + : TestCommandBridge("TestIdentifyCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TestIdentifyCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestIdentifyCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestIdentifyCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Identify command and expect success response\n"); + err = TestSendIdentifyCommandAndExpectSuccessResponse_1(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendIdentifyCommandAndExpectSuccessResponse_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Default Value Error: %@", err); + __auto_type * params = [[CHIPIdentifyClusterIdentifyParams alloc] init]; + params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; + [cluster identifyWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Identify command and expect success response Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"" length:0])); - } - { - readAttributeOctetStringDefaultValue = value; - } + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } +}; + +class TestOperationalCredentialsCluster : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestOperationalCredentialsCluster() + : TestCommandBridge("TestOperationalCredentialsCluster") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TestOperationalCredentialsCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestOperationalCredentialsCluster\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestOperationalCredentialsCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of supported fabrics\n"); + err = TestReadNumberOfSupportedFabrics_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read number of commissioned fabrics\n"); + err = TestReadNumberOfCommissionedFabrics_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read current fabric index\n"); + err = TestReadCurrentFabricIndex_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Remove nonexistent fabric\n"); + err = TestRemoveNonexistentFabric_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read fabric list before setting label\n"); + err = TestReadFabricListBeforeSettingLabel_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Set the fabric label\n"); + err = TestSetTheFabricLabel_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read fabric list after setting label\n"); + err = TestReadFabricListAfterSettingLabel_7(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringDefaultValueAndCompareToSavedValue_103() + CHIP_ERROR TestReadNumberOfSupportedFabrics_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Default Value and compare to saved value Error: %@", err); + [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read number of supported fabrics Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringDefaultValue)); + VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", [value unsignedCharValue], 4)); } NextTest(); @@ -63638,49 +71819,50 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValue_104() + CHIP_ERROR TestReadNumberOfCommissionedFabrics_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"NotDefault" length:10]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_string Not Default Value Error: %@", err); + [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read number of commissioned fabrics Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", [value unsignedCharValue], 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - NSData * _Nonnull readAttributeOctetStringNotDefaultValue; + NSNumber * _Nonnull ourFabricIndex; - CHIP_ERROR TestReadAttributeOctetStringNotDefaultValue_105() + CHIP_ERROR TestReadCurrentFabricIndex_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Not Default Value Error: %@", err); + [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current fabric index Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); - } - + VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); + VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1)); } { - readAttributeOctetStringNotDefaultValue = value; + ourFabricIndex = value; } NextTest(); @@ -63689,111 +71871,149 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToSavedValue_106() + CHIP_ERROR TestRemoveNonexistentFabric_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Not Default Value and compare to saved value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.fabricIndex = [NSNumber numberWithUnsignedChar:243]; + [cluster removeFabricWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove nonexistent fabric Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("octet_string", actualValue, readAttributeOctetStringNotDefaultValue)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("octetString", value, readAttributeOctetStringDefaultValue)); - } + { + id actualValue = values.statusCode; + VerifyOrReturn(CheckValue("StatusCode", actualValue, 11)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringNotDefaultValueFromSavedValue_107() + CHIP_ERROR TestReadFabricListBeforeSettingLabel_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [readAttributeOctetStringNotDefaultValue copy]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_string Not Default Value from saved value Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read fabric list before setting label Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, + ourFabricIndex)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeOctetStringNotDefaultValueAndCompareToExpectedValue_108() + CHIP_ERROR TestSetTheFabricLabel_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Not Default Value and compare to expected value Error: %@", err); + __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; + params.label = @"Batcave"; + [cluster updateFabricLabelWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Set the fabric label Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn( - CheckValueAsString("octet_string", actualValue, [[NSData alloc] initWithBytes:"NotDefault" length:10])); - } + { + id actualValue = values.statusCode; + VerifyOrReturn(CheckValue("StatusCode", actualValue, 0)); + } - NextTest(); - }]; + { + id actualValue = values.fabricIndex; + VerifyOrReturn(CheckValue("FabricIndex", actualValue, ourFabricIndex)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeOctetStringDefaultValue_109() + CHIP_ERROR TestReadFabricListAfterSettingLabel_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id octetStringArgument; - octetStringArgument = [readAttributeOctetStringDefaultValue copy]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_string Default Value Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read fabric list after setting label Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"Batcave")); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, + ourFabricIndex)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class TestConstraints : public TestCommandBridge { +class TestModeSelectCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestConstraints() - : TestCommandBridge("TestConstraints") + TestModeSelectCluster() + : TestCommandBridge("TestModeSelectCluster") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestConstraints() {} + ~TestModeSelectCluster() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -63801,11 +72021,11 @@ class TestConstraints : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestConstraints\n"); + ChipLogProgress(chipTool, " **** Test Start: TestModeSelectCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestConstraints\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestModeSelectCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -63822,91 +72042,129 @@ class TestConstraints : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write attribute INT32U Value\n"); - err = TestWriteAttributeInt32uValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read Description\n"); + err = TestReadDescription_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute INT32U Value MinValue Constraints\n"); - err = TestReadAttributeInt32uValueMinValueConstraints_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read StandardNamespace\n"); + err = TestReadStandardNamespace_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute INT32U Value MaxValue Constraints\n"); - err = TestReadAttributeInt32uValueMaxValueConstraints_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read SupportedModes\n"); + err = TestReadSupportedModes_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute INT32U Value NotValue Constraints\n"); - err = TestReadAttributeInt32uValueNotValueConstraints_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentMode\n"); + err = TestReadCurrentMode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write attribute INT32U Value Back to Default Value\n"); - err = TestWriteAttributeInt32uValueBackToDefaultValue_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read StartUpMode\n"); + err = TestReadStartUpMode_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read OnMode\n"); + err = TestReadOnMode_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute CHAR_STRING Value MinLength Constraints\n"); - err = TestReadAttributeCharStringValueMinLengthConstraints_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Change to Supported Mode\n"); + err = TestChangeToSupportedMode_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute CHAR_STRING Value MaxLength Constraints\n"); - err = TestReadAttributeCharStringValueMaxLengthConstraints_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify Current Mode Change\n"); + err = TestVerifyCurrentModeChange_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute CHAR_STRING Value StartsWith Constraints\n"); - err = TestReadAttributeCharStringValueStartsWithConstraints_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Change to Unsupported Mode\n"); + err = TestChangeToUnsupportedMode_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute CHAR_STRING Value EndsWith Constraints\n"); - err = TestReadAttributeCharStringValueEndsWithConstraints_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Toggle OnOff\n"); + err = TestToggleOnOff_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Toggle OnOff\n"); + err = TestToggleOnOff_11(); break; case 12: - ChipLogProgress( - chipTool, " ***** Test Step 12 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); - err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Verify Current Mode does not change when OnMode is null\n"); + err = TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Change to Unsupported OnMode\n"); + err = TestChangeToUnsupportedOnMode_13(); break; case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); - err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Change OnMode\n"); + err = TestChangeOnMode_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Verify OnMode\n"); + err = TestVerifyOnMode_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Toggle OnOff\n"); + err = TestToggleOnOff_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Toggle OnOff\n"); + err = TestToggleOnOff_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Verify Current Mode Changes if OnMode is not null\n"); + err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Change to Unsupported StartUp Mode\n"); + err = TestChangeToUnsupportedStartUpMode_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Change to Supported StartUp Mode\n"); + err = TestChangeToSupportedStartUpMode_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Verify StartUp Mode Change\n"); + err = TestVerifyStartUpModeChange_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Change CurrentMode to another value\n"); + err = TestChangeCurrentModeToAnotherValue_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Change On Mode\n"); + err = TestChangeOnMode_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Set StartUpOnOff\n"); + err = TestSetStartUpOnOff_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Reboot target device\n"); + err = TestRebootTargetDevice_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_26(); break; - case 16: + case 27: ChipLogProgress( - chipTool, " ***** Test Step 16 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); - err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_17(); + chipTool, " ***** Test Step 27 : Verify Current Mode Change based on OnMode, as it overwrites StartUpMode\n"); + err = TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27(); break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute CHAR_STRING Value isHexString Constraints\n"); - err = TestReadAttributeCharStringValueIsHexStringConstraints_18(); + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Change On Mode to Null\n"); + err = TestChangeOnModeToNull_28(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_19(); + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Reboot target device\n"); + err = TestRebootTargetDevice_29(); break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute CHAR_STRING Value isHexString Constraints\n"); - err = TestReadAttributeCharStringValueIsHexStringConstraints_20(); + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_30(); break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Write attribute CHAR_STRING Value Back to Default Value\n"); - err = TestWriteAttributeCharStringValueBackToDefaultValue_21(); + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Verify Current Mode Change based on new StartUp Mode\n"); + err = TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31(); break; } @@ -63923,11 +72181,12 @@ class TestConstraints : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 22; + const uint16_t mTestCount = 32; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDiscriminator; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -63936,39 +72195,43 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uValue_1() + CHIP_ERROR TestReadDescription_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:5UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Value Error: %@", err); + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Description Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("Description", actualValue, @"Coffee")); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_2() + CHIP_ERROR TestReadStandardNamespace_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Value MinValue Constraints Error: %@", err); + [cluster readAttributeStandardNamespaceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StandardNamespace Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("int32u", [value unsignedIntValue], 5UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StandardNamespace", actualValue)); + VerifyOrReturn(CheckValue("StandardNamespace", actualValue, 0U)); } NextTest(); @@ -63977,19 +72240,35 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_3() + CHIP_ERROR TestReadSupportedModes_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Value MaxValue Constraints Error: %@", err); + [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read SupportedModes Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("int32u", [value unsignedIntValue], 5UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("SupportedModes", [actualValue count], static_cast(3))); + VerifyOrReturn( + CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).label, @"Black")); + VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).mode, 0)); + VerifyOrReturn( + CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTag, 0UL)); + VerifyOrReturn( + CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).label, @"Cappuccino")); + VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).mode, 4)); + VerifyOrReturn( + CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTag, 0UL)); + VerifyOrReturn( + CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).label, @"Espresso")); + VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).mode, 7)); + VerifyOrReturn( + CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTag, 0UL)); } NextTest(); @@ -63998,19 +72277,20 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_4() + CHIP_ERROR TestReadCurrentMode_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Value NotValue Constraints Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintNotValue("int32u", value, 6UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, 0)); } NextTest(); @@ -64019,337 +72299,510 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_5() + CHIP_ERROR TestReadStartUpMode_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Value Back to Default Value Error: %@", err); + [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StartUpMode Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StartUpMode", actualValue)); + VerifyOrReturn(CheckValue("StartUpMode", actualValue, 0)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_6() + CHIP_ERROR TestReadOnMode_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"** Test **"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OnMode Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("OnMode", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_7() + CHIP_ERROR TestChangeToSupportedMode_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value MinLength Constraints Error: %@", err); + __auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init]; + params.newMode = [NSNumber numberWithUnsignedChar:4]; + [cluster changeToModeWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Supported Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull currentModeBeforeToggle; + + CHIP_ERROR TestVerifyCurrentModeChange_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintMinLength("charString", [value length], 5)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, 4)); + } + { + currentModeBeforeToggle = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_8() + CHIP_ERROR TestChangeToUnsupportedMode_9() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value MaxLength Constraints Error: %@", err); + __auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init]; + params.newMode = [NSNumber numberWithUnsignedChar:2]; + [cluster changeToModeWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Unsupported Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestToggleOnOff_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintMaxLength("charString", [value length], 20)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_9() + CHIP_ERROR TestToggleOnOff_11() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value StartsWith Constraints Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintStartsWith("charString", value, "**")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_10() + CHIP_ERROR TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value EndsWith Constraints Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode does not change when OnMode is null Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintEndsWith("charString", value, "**")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, currentModeBeforeToggle)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_11() + CHIP_ERROR TestChangeToUnsupportedOnMode_13() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"lowercase"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + id onModeArgument; + onModeArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Unsupported OnMode Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestChangeOnMode_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id onModeArgument; + onModeArgument = [NSNumber numberWithUnsignedChar:7]; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change OnMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nullable OnModeValue; - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12() + CHIP_ERROR TestVerifyOnMode_15() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify OnMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, false)); - VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, true)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("OnMode", actualValue)); + VerifyOrReturn(CheckValue("OnMode", actualValue, 7)); + } + { + OnModeValue = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_13() + CHIP_ERROR TestToggleOnOff_16() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"UPPERCASE"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14() + CHIP_ERROR TestToggleOnOff_17() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, true)); - VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, false)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_15() + CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_18() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"lowUPPER"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Changes if OnMode is not null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, OnModeValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16() + CHIP_ERROR TestChangeToUnsupportedStartUpMode_19() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + id startUpModeArgument; + startUpModeArgument = [NSNumber numberWithUnsignedChar:2]; + [cluster writeAttributeStartUpModeWithValue:startUpModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Unsupported StartUp Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestChangeToSupportedStartUpMode_20() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id startUpModeArgument; + startUpModeArgument = [NSNumber numberWithUnsignedChar:7]; + [cluster writeAttributeStartUpModeWithValue:startUpModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change to Supported StartUp Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyStartUpModeChange_21() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify StartUp Mode Change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, false)); - VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, false)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StartUpMode", actualValue)); + VerifyOrReturn(CheckValue("StartUpMode", actualValue, 7)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_17() + CHIP_ERROR TestChangeCurrentModeToAnotherValue_22() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"ABCDEF012V"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + __auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init]; + params.newMode = [NSNumber numberWithUnsignedChar:0]; + [cluster changeToModeWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change CurrentMode to another value Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_18() + CHIP_ERROR TestChangeOnMode_23() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); + id onModeArgument; + onModeArgument = [NSNumber numberWithUnsignedChar:4]; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change On Mode Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsHexString("charString", value, false)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_19() + CHIP_ERROR TestSetStartUpOnOff_24() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @"ABCDEF0123"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:1]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Set StartUpOnOff Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_20() + CHIP_ERROR TestRebootTargetDevice_25() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_26() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Change based on OnMode, as it overwrites StartUpMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintIsHexString("charString", value, true)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, 4)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_21() + CHIP_ERROR TestChangeOnModeToNull_28() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id charStringArgument; - charStringArgument = @""; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Back to Default Value Error: %@", err); + id onModeArgument; + onModeArgument = nil; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change On Mode to Null Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRebootTargetDevice_29() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_30() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Change based on new StartUp Mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, 7)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class TestDelayCommands : public TestCommandBridge { +class TestSelfFabricRemoval : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestDelayCommands() - : TestCommandBridge("TestDelayCommands") + TestSelfFabricRemoval() + : TestCommandBridge("TestSelfFabricRemoval") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -64359,7 +72812,7 @@ class TestDelayCommands : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestDelayCommands() {} + ~TestSelfFabricRemoval() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -64367,11 +72820,11 @@ class TestDelayCommands : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestDelayCommands\n"); + ChipLogProgress(chipTool, " **** Test Start: TestSelfFabricRemoval\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestDelayCommands\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestSelfFabricRemoval\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -64388,8 +72841,16 @@ class TestDelayCommands : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Wait 100ms\n"); - err = TestWait100ms_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of commissioned fabrics\n"); + err = TestReadNumberOfCommissionedFabrics_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read current fabric index\n"); + err = TestReadCurrentFabricIndex_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Remove single own fabric\n"); + err = TestRemoveSingleOwnFabric_3(); break; } @@ -64406,7 +72867,7 @@ class TestDelayCommands : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -64419,18 +72880,88 @@ class TestDelayCommands : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_1() + CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() { - WaitForMs(100); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read number of commissioned fabrics Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CommissionedFabrics", actualValue, 1)); + } + + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull ourFabricIndex; + + CHIP_ERROR TestReadCurrentFabricIndex_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current fabric index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1)); + } + { + ourFabricIndex = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRemoveSingleOwnFabric_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.fabricIndex = [ourFabricIndex copy]; + [cluster removeFabricWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove single own fabric Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } }; -class TestDescriptorCluster : public TestCommandBridge { +class TestBinding : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestDescriptorCluster() - : TestCommandBridge("TestDescriptorCluster") + TestBinding() + : TestCommandBridge("TestBinding") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -64440,7 +72971,7 @@ class TestDescriptorCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestDescriptorCluster() {} + ~TestBinding() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -64448,11 +72979,11 @@ class TestDescriptorCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestDescriptorCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: TestBinding\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestDescriptorCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestBinding\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -64469,20 +73000,36 @@ class TestDescriptorCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Device list\n"); - err = TestReadAttributeDeviceList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write empty binding table\n"); + err = TestWriteEmptyBindingTable_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute Server list\n"); - err = TestReadAttributeServerList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read empty binding table\n"); + err = TestReadEmptyBindingTable_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute Client list\n"); - err = TestReadAttributeClientList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write invalid binding table\n"); + err = TestWriteInvalidBindingTable_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute Parts list\n"); - err = TestReadAttributePartsList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Write binding table (endpoint 1)\n"); + err = TestWriteBindingTableEndpoint1_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read binding table (endpoint 1)\n"); + err = TestReadBindingTableEndpoint1_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Write binding table (endpoint 0)\n"); + err = TestWriteBindingTableEndpoint0_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read binding table (endpoint 0)\n"); + err = TestReadBindingTableEndpoint0_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify endpoint 1 not changed\n"); + err = TestVerifyEndpoint1NotChanged_8(); break; } @@ -64499,7 +73046,7 @@ class TestDescriptorCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -64512,140 +73059,282 @@ class TestDescriptorCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeDeviceList_1() + CHIP_ERROR TestWriteEmptyBindingTable_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDeviceListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Device list Error: %@", err); + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write empty binding table Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("device list", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("type", ((CHIPDescriptorClusterDeviceType *) actualValue[0]).type, 22UL)); - VerifyOrReturn(CheckValue("revision", ((CHIPDescriptorClusterDeviceType *) actualValue[0]).revision, 1U)); - } + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadEmptyBindingTable_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read empty binding table Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeServerList_2() + CHIP_ERROR TestWriteInvalidBindingTable_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Server list Error: %@", err); + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).group = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("server list", [actualValue count], static_cast(25))); - VerifyOrReturn(CheckValue("", actualValue[0], 3UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 4UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 29UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 30UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 31UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 40UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 42UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 43UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 44UL)); - VerifyOrReturn(CheckValue("", actualValue[9], 45UL)); - VerifyOrReturn(CheckValue("", actualValue[10], 46UL)); - VerifyOrReturn(CheckValue("", actualValue[11], 48UL)); - VerifyOrReturn(CheckValue("", actualValue[12], 49UL)); - VerifyOrReturn(CheckValue("", actualValue[13], 50UL)); - VerifyOrReturn(CheckValue("", actualValue[14], 51UL)); - VerifyOrReturn(CheckValue("", actualValue[15], 52UL)); - VerifyOrReturn(CheckValue("", actualValue[16], 53UL)); - VerifyOrReturn(CheckValue("", actualValue[17], 54UL)); - VerifyOrReturn(CheckValue("", actualValue[18], 55UL)); - VerifyOrReturn(CheckValue("", actualValue[19], 60UL)); - VerifyOrReturn(CheckValue("", actualValue[20], 62UL)); - VerifyOrReturn(CheckValue("", actualValue[21], 63UL)); - VerifyOrReturn(CheckValue("", actualValue[22], 64UL)); - VerifyOrReturn(CheckValue("", actualValue[23], 65UL)); - VerifyOrReturn(CheckValue("", actualValue[24], 1029UL)); - } + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write invalid binding table Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeClientList_3() + CHIP_ERROR TestWriteBindingTableEndpoint1_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Client list Error: %@", err); + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).group = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - VerifyOrReturn(CheckValue("status", err, 0)); + temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; + ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("client list", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 41UL)); - } + temp_0[2] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[2]).node = [NSNumber numberWithUnsignedLongLong:2ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[2]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - NextTest(); - }]; + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write binding table (endpoint 1) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributePartsList_4() + CHIP_ERROR TestReadBindingTableEndpoint1_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Parts list Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read binding table (endpoint 1) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("parts list", [actualValue count], static_cast(2))); - VerifyOrReturn(CheckValue("", actualValue[0], 1U)); - VerifyOrReturn(CheckValue("", actualValue[1], 2U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("Group", ((CHIPBindingClusterTargetStruct *) actualValue[0]).group, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[1]).node, 1ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("Cluster", ((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster, 6UL)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[2]).node, 2ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex, 1)); + } - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteBindingTableEndpoint0_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bindingArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).node = [NSNumber numberWithUnsignedLongLong:3ULL]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + + bindingArgument = temp_0; + } + [cluster writeAttributeBindingWithValue:bindingArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write binding table (endpoint 0) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadBindingTableEndpoint0_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read binding table (endpoint 0) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[0]).node, 3ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[0]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyEndpoint1NotChanged_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify endpoint 1 not changed Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("Group", ((CHIPBindingClusterTargetStruct *) actualValue[0]).group, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[1]).node, 1ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("Cluster", ((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster, 6UL)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[2]).node, 2ULL)); + VerifyOrReturn( + CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint, 1U)); + VerifyOrReturn( + CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex, 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class TestGroupsCluster : public TestCommandBridge { +class TestUserLabelCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestGroupsCluster() - : TestCommandBridge("TestGroupsCluster") + TestUserLabelCluster() + : TestCommandBridge("TestUserLabelCluster") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestGroupsCluster() {} + ~TestUserLabelCluster() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -64653,11 +73342,11 @@ class TestGroupsCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestGroupsCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: TestUserLabelCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestGroupsCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestUserLabelCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -64674,76 +73363,28 @@ class TestGroupsCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : View Group 0 (invalid)\n"); - err = TestViewGroup0Invalid_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Clear User Label List\n"); + err = TestClearUserLabelList_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : View Group 1 (not found)\n"); - err = TestViewGroup1NotFound_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read User Label List\n"); + err = TestReadUserLabelList_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Add Group 1 (new)\n"); - err = TestAddGroup1New_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write User Label List\n"); + err = TestWriteUserLabelList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : View Group 1 (new)\n"); - err = TestViewGroup1New_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reboot target device\n"); + err = TestRebootTargetDevice_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : View Group 2 (not found)\n"); - err = TestViewGroup2NotFound_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Get Group Membership 1 (all)\n"); - err = TestGetGroupMembership1All_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : View Group 3 (not found)\n"); - err = TestViewGroup3NotFound_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : View Group 1 (existing)\n"); - err = TestViewGroup1Existing_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Remove Group 0 (invalid)\n"); - err = TestRemoveGroup0Invalid_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Remove Group 4 (not found)\n"); - err = TestRemoveGroup4NotFound_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : View Group 1 (not removed)\n"); - err = TestViewGroup1NotRemoved_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : View Group 2 (removed)\n"); - err = TestViewGroup2Removed_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Get Group Membership 3\n"); - err = TestGetGroupMembership3_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Remove All\n"); - err = TestRemoveAll_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : View Group 1 (removed)\n"); - err = TestViewGroup1Removed_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : View Group 2 (still removed)\n"); - err = TestViewGroup2StillRemoved_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : View Group 3 (removed)\n"); - err = TestViewGroup3Removed_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Get Group Membership 4\n"); - err = TestGetGroupMembership4_18(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Verify\n"); + err = TestVerify_6(); break; } @@ -64760,11 +73401,12 @@ class TestGroupsCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 19; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDiscriminator; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -64773,314 +73415,281 @@ class TestGroupsCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup0Invalid_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:0U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 0 (invalid) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 135)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestViewGroup1NotFound_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (not found) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestAddGroup1New_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - params.groupName = @"Group #1"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 1 (new) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestViewGroup1New_4() + CHIP_ERROR TestClearUserLabelList_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (new) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } - - { - id actualValue = values.groupName; - VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); - } + id labelListArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + labelListArgument = temp_0; + } + [cluster writeAttributeLabelListWithValue:labelListArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear User Label List Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup2NotFound_5() + CHIP_ERROR TestReadUserLabelList_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (not found) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read User Label List Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("label list", [actualValue count], static_cast(0))); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestGetGroupMembership1All_6() + CHIP_ERROR TestWriteUserLabelList_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; + id labelListArgument; { NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - params.groupList = temp_0; + temp_0[0] = [[CHIPUserLabelClusterLabelStruct alloc] init]; + ((CHIPUserLabelClusterLabelStruct *) temp_0[0]).label = @"room"; + ((CHIPUserLabelClusterLabelStruct *) temp_0[0]).value = @"bedroom 2"; + + temp_0[1] = [[CHIPUserLabelClusterLabelStruct alloc] init]; + ((CHIPUserLabelClusterLabelStruct *) temp_0[1]).label = @"orientation"; + ((CHIPUserLabelClusterLabelStruct *) temp_0[1]).value = @"North"; + + temp_0[2] = [[CHIPUserLabelClusterLabelStruct alloc] init]; + ((CHIPUserLabelClusterLabelStruct *) temp_0[2]).label = @"floor"; + ((CHIPUserLabelClusterLabelStruct *) temp_0[2]).value = @"5"; + + temp_0[3] = [[CHIPUserLabelClusterLabelStruct alloc] init]; + ((CHIPUserLabelClusterLabelStruct *) temp_0[3]).label = @"direction"; + ((CHIPUserLabelClusterLabelStruct *) temp_0[3]).value = @"up"; + + labelListArgument = temp_0; } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 1 (all) Error: %@", err); + [cluster writeAttributeLabelListWithValue:labelListArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write User Label List Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNull("capacity", actualValue)); - } + NextTest(); + }]; - { - id actualValue = values.groupList; - VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1U)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestRebootTargetDevice_4() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_5() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup3NotFound_7() + CHIP_ERROR TestVerify_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (not found) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 32767U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("label list", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValueAsString("label", ((CHIPUserLabelClusterLabelStruct *) actualValue[0]).label, @"room")); + VerifyOrReturn( + CheckValueAsString("value", ((CHIPUserLabelClusterLabelStruct *) actualValue[0]).value, @"bedroom 2")); + VerifyOrReturn( + CheckValueAsString("label", ((CHIPUserLabelClusterLabelStruct *) actualValue[1]).label, @"orientation")); + VerifyOrReturn(CheckValueAsString("value", ((CHIPUserLabelClusterLabelStruct *) actualValue[1]).value, @"North")); + VerifyOrReturn(CheckValueAsString("label", ((CHIPUserLabelClusterLabelStruct *) actualValue[2]).label, @"floor")); + VerifyOrReturn(CheckValueAsString("value", ((CHIPUserLabelClusterLabelStruct *) actualValue[2]).value, @"5")); + VerifyOrReturn( + CheckValueAsString("label", ((CHIPUserLabelClusterLabelStruct *) actualValue[3]).label, @"direction")); + VerifyOrReturn(CheckValueAsString("value", ((CHIPUserLabelClusterLabelStruct *) actualValue[3]).value, @"up")); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestViewGroup1Existing_8() +class TestArmFailSafe : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestArmFailSafe() + : TestCommandBridge("TestArmFailSafe") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (existing) Error: %@", err); + ~TestArmFailSafe() {} - VerifyOrReturn(CheckValue("status", err, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestArmFailSafe\n"); + } - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestArmFailSafe\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - id actualValue = values.groupName; - VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); - } + Wait(); - NextTest(); - }]; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Reboot target device\n"); + err = TestRebootTargetDevice_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Wait for the alpha device to be retrieved \n"); + err = TestWaitForTheAlphaDeviceToBeRetrieved_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Query fabrics list\n"); + err = TestQueryFabricsList_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : ArmFailSafe on target device with timeout 0\n"); + err = TestArmFailSafeOnTargetDeviceWithTimeout0_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads NodeLabel mandatory attribute of target device\n"); + err = TestReadsNodeLabelMandatoryAttributeOfTargetDevice_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + CHIP_ERROR TestRebootTargetDevice_0() + { + Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveGroup0Invalid_9() + CHIP_ERROR TestWaitForTheAlphaDeviceToBeRetrieved_1() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestQueryFabricsList_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:0U]; - [cluster removeGroupWithParams:params - completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove Group 0 (invalid) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Query fabrics list Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 135)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 0U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString("Label", + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); + } - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveGroup4NotFound_10() + CHIP_ERROR TestArmFailSafeOnTargetDeviceWithTimeout0_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4U]; - [cluster removeGroupWithParams:params - completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove Group 4 (not found) Error: %@", err); + __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; + params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:0U]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster armFailSafeWithParams:params + completionHandler:^( + CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"ArmFailSafe on target device with timeout 0 Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 4U)); + id actualValue = values.errorCode; + VerifyOrReturn(CheckValue("errorCode", actualValue, 0)); } NextTest(); @@ -65089,262 +73698,289 @@ class TestGroupsCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup1NotRemoved_11() + CHIP_ERROR TestReadsNodeLabelMandatoryAttributeOfTargetDevice_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (not removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads NodeLabel mandatory attribute of target device Error: %@", err); - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupName; - VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"")); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestViewGroup2Removed_12() +class Test_TC_SWDIAG_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_SWDIAG_1_1() + : TestCommandBridge("Test_TC_SWDIAG_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + ~Test_TC_SWDIAG_1_1() {} - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); - } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - NextTest(); - }]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_1_1\n"); + } - return CHIP_NO_ERROR; - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestGetGroupMembership3_13() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + Wait(); - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; - temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; - temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; - temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; - params.groupList = temp_0; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads a list of ThreadMetrics struct non-global attribute from DUT.\n"); + if (ShouldSkip("A_THREADMETRICS")) { + NextTest(); + return; + } + err = TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapFree non-global attribute value from DUT\n"); + err = TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapUsed non-global attribute value from DUT\n"); + if (ShouldSkip("A_CURRENTHEAPUSED")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads CurrentHeapHighWaterMark non-global attribute value from DUT\n"); + if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4(); + break; } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 3 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNull("capacity", actualValue)); - } + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - { - id actualValue = values.groupList; - VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1U)); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveAll_14() + CHIP_ERROR TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Remove All Error: %@", err); + [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads a list of ThreadMetrics struct non-global attribute from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("threadMetrics", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup1Removed_15() + CHIP_ERROR TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapFree non-global attribute value from DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHeapFree", "", "uint64")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup2StillRemoved_16() + CHIP_ERROR TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (still removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapUsed non-global attribute value from DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestViewGroup3Removed_17() + CHIP_ERROR TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (removed) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 32767U)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestGetGroupMembership4_18() +class Test_TC_SWDIAG_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_SWDIAG_2_1() + : TestCommandBridge("Test_TC_SWDIAG_2_1") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; - temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; - temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; - temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; - temp_0[4] = [NSNumber numberWithUnsignedShort:32767U]; - params.groupList = temp_0; + ~Test_TC_SWDIAG_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_2_1\n"); } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 4 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNull("capacity", actualValue)); - } + Wait(); - { - id actualValue = values.groupList; - VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(0))); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + } - NextTest(); - }]; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - return CHIP_NO_ERROR; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; }; -class TestGroupKeyManagementCluster : public TestCommandBridge { +class Test_TC_SWDIAG_3_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestGroupKeyManagementCluster() - : TestCommandBridge("TestGroupKeyManagementCluster") + Test_TC_SWDIAG_3_1() + : TestCommandBridge("Test_TC_SWDIAG_3_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -65354,7 +73990,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestGroupKeyManagementCluster() {} + ~Test_TC_SWDIAG_3_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -65362,11 +73998,11 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestGroupKeyManagementCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_3_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestGroupKeyManagementCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_3_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -65383,72 +74019,28 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read maxGroupsPerFabric\n"); - err = TestReadMaxGroupsPerFabric_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Sends ResetWatermarks to DUT\n"); + if (ShouldSkip("CR_RESETWATERMARKS")) { + NextTest(); + return; + } + err = TestSendsResetWatermarksToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read maxGroupKeysPerFabric\n"); - err = TestReadMaxGroupKeysPerFabric_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapUsed attribute value from DUT\n"); + if (ShouldSkip("A_CURRENTHEAPUSED")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapUsedAttributeValueFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Add Group 1\n"); - err = TestAddGroup1_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Add Group 2\n"); - err = TestAddGroup2_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : KeySet Write 1\n"); - err = TestKeySetWrite1_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : KeySet Write 2\n"); - err = TestKeySetWrite2_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : KeySet Read\n"); - err = TestKeySetRead_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys (invalid)\n"); - err = TestWriteGroupKeysInvalid_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write Group Keys\n"); - err = TestWriteGroupKeys_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read Group Keys\n"); - err = TestReadGroupKeys_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read GroupTable\n"); - err = TestReadGroupTable_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : KeySet Remove 1\n"); - err = TestKeySetRemove1_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : KeySet Read (removed)\n"); - err = TestKeySetReadRemoved_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : KeySet Read (not removed)\n"); - err = TestKeySetReadNotRemoved_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Remove All\n"); - err = TestRemoveAll_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Remove 2\n"); - err = TestKeySetRemove2_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : KeySet Read (also removed)\n"); - err = TestKeySetReadAlsoRemoved_17(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapHighWaterMark attribute value from DUT\n"); + if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_3(); break; } @@ -65465,7 +74057,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -65478,490 +74070,294 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMaxGroupsPerFabric_1() + CHIP_ERROR TestSendsResetWatermarksToDut_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read maxGroupsPerFabric Error: %@", err); + [cluster resetWatermarksWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends ResetWatermarks to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxGroupsPerFabric", [value unsignedShortValue], 2U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMaxGroupKeysPerFabric_2() + CHIP_ERROR TestReadsCurrentHeapUsedAttributeValueFromDut_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read maxGroupKeysPerFabric Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapUsed attribute value from DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("MaxGroupKeysPerFabric", actualValue, 2U)); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; } + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestAddGroup1_3() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:257U]; - params.groupName = @"Group #1"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 1 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 257U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestAddGroup2_4() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:258U]; - params.groupName = @"Group #2"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 2 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } - - { - id actualValue = values.groupId; - VerifyOrReturn(CheckValue("groupId", actualValue, 258U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestKeySetWrite1_5() + CHIP_ERROR TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; - params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = - [NSNumber numberWithUnsignedShort:417U]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = - [[NSData alloc] initWithBytes:"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = - [NSNumber numberWithUnsignedLongLong:1110000ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = - [[NSData alloc] initWithBytes:"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = - [NSNumber numberWithUnsignedLongLong:1110001ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = - [[NSData alloc] initWithBytes:"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = - [NSNumber numberWithUnsignedLongLong:1110002ULL]; + [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapHighWaterMark attribute value from DUT Error: %@", err); - [cluster keySetWriteWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Write 1 Error: %@", err); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestKeySetWrite2_6() +class TestSubscribe_OnOff : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestSubscribe_OnOff() + : TestCommandBridge("TestSubscribe_OnOff") + , mTestIndex(0) { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; - params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = - [NSNumber numberWithUnsignedShort:418U]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = - [[NSData alloc] initWithBytes:"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = - [NSNumber numberWithUnsignedLongLong:2110000ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = - [[NSData alloc] initWithBytes:"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = - [NSNumber numberWithUnsignedLongLong:2110001ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = - [[NSData alloc] initWithBytes:"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = - [NSNumber numberWithUnsignedLongLong:2110002ULL]; - - [cluster keySetWriteWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Write 2 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - CHIP_ERROR TestKeySetRead_7() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - [cluster - keySetReadWithParams:params - completionHandler:^( - CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = values.groupKeySet; - VerifyOrReturn(CheckValue( - "GroupKeySetID", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 417U)); - VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 0)); - VerifyOrReturn( - CheckValueNull("EpochKey0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); - VerifyOrReturn(CheckValue("EpochStartTime0", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 1110000ULL)); - VerifyOrReturn( - CheckValueNull("EpochKey1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); - VerifyOrReturn(CheckValue("EpochStartTime1", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, 1110001ULL)); - VerifyOrReturn( - CheckValueNull("EpochKey2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); - VerifyOrReturn(CheckValue("EpochStartTime2", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, 1110002ULL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + ~TestSubscribe_OnOff() {} - CHIP_ERROR TestWriteGroupKeysInvalid_8() + /////////// TestCommand Interface ///////// + void NextTest() override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id groupKeyMapArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:258U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:0U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + CHIP_ERROR err = CHIP_NO_ERROR; - groupKeyMapArgument = temp_0; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestSubscribe_OnOff\n"); } - [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Group Keys (invalid) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteGroupKeys_9() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestSubscribe_OnOff\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - id groupKeyMapArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:257U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + Wait(); - temp_0[1] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupId = [NSNumber numberWithUnsignedShort:258U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Set OnOff Attribute to false\n"); + err = TestSetOnOffAttributeToFalse_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Report: Subscribe OnOff Attribute\n"); + err = TestReportSubscribeOnOffAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Subscribe OnOff Attribute\n"); + err = TestSubscribeOnOffAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn On the light to see attribute change\n"); + err = TestTurnOnTheLightToSeeAttributeChange_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check for attribute report\n"); + err = TestCheckForAttributeReport_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Turn Off the light to see attribute change\n"); + err = TestTurnOffTheLightToSeeAttributeChange_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check for attribute report\n"); + err = TestCheckForAttributeReport_7(); + break; + } - groupKeyMapArgument = temp_0; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); } - [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Group Keys Error: %@", err); + } - VerifyOrReturn(CheckValue("status", err, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGroupKeys_10() + CHIP_ERROR TestSetOnOffAttributeToFalse_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeGroupKeyMapWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read Group Keys Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Set OnOff Attribute to false Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GroupKeyMap", [actualValue count], static_cast(2))); - VerifyOrReturn(CheckValue("GroupId", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupId, 257U)); - VerifyOrReturn(CheckValue("GroupKeySetID", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupKeySetID, 417U)); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("GroupId", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupId, 258U)); - VerifyOrReturn(CheckValue("GroupKeySetID", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupKeySetID, 418U)); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).fabricIndex, 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + bool testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_TestSubscribe_OnOff_OnOff_Reported = nil; - CHIP_ERROR TestReadGroupTable_11() + CHIP_ERROR TestReportSubscribeOnOffAttribute_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeGroupTableWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read GroupTable Error: %@", err); + test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: Subscribe OnOff Attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast(2))); - VerifyOrReturn(CheckValue("GroupId", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId, 257U)); - VerifyOrReturn(CheckValueAsString("GroupName", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName, - @"Group #1")); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("GroupId", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupId, 258U)); - VerifyOrReturn(CheckValueAsString("GroupName", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupName, - @"Group #2")); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).fabricIndex, 1)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, false)); + } - NextTest(); - }]; + testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = true; + }; + NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetRemove1_12() + CHIP_ERROR TestSubscribeOnOffAttribute_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - [cluster keySetRemoveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Remove 1 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + uint16_t minIntervalArgument = 2U; + uint16_t maxIntervalArgument = 5U; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeOnOffWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn(testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled, + SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + NextTest(); + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Subscribe OnOff Attribute Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + if (test_TestSubscribe_OnOff_OnOff_Reported != nil) { + ResponseHandler callback = test_TestSubscribe_OnOff_OnOff_Reported; + test_TestSubscribe_OnOff_OnOff_Reported = nil; + callback(value, err); + } + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadRemoved_13() + CHIP_ERROR TestTurnOnTheLightToSeeAttributeChange_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - [cluster keySetReadWithParams:params - completionHandler:^( - CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read (removed) Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn On the light to see attribute change Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_NOT_FOUND)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadNotRemoved_14() + CHIP_ERROR TestCheckForAttributeReport_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - [cluster - keySetReadWithParams:params - completionHandler:^( - CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read (not removed) Error: %@", err); + test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check for attribute report Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.groupKeySet; - VerifyOrReturn(CheckValue( - "GroupKeySetID", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 418U)); - VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 1)); - VerifyOrReturn( - CheckValueNull("EpochKey0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); - VerifyOrReturn(CheckValue("EpochStartTime0", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 2110000ULL)); - VerifyOrReturn( - CheckValueNull("EpochKey1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); - VerifyOrReturn(CheckValue("EpochStartTime1", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, 2110001ULL)); - VerifyOrReturn( - CheckValueNull("EpochKey2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); - VerifyOrReturn(CheckValueNonNull( - "EpochStartTime2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); - VerifyOrReturn(CheckValue("EpochStartTime2", - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, 2110002ULL)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, true)); + } - NextTest(); - }]; + NextTest(); + }; return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveAll_15() + CHIP_ERROR TestTurnOffTheLightToSeeAttributeChange_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Remove All Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn Off the light to see attribute change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -65971,56 +74367,34 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetRemove2_16() + CHIP_ERROR TestCheckForAttributeReport_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - [cluster keySetRemoveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Remove 2 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check for attribute report Error: %@", err); - CHIP_ERROR TestKeySetReadAlsoRemoved_17() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err, 0)); - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - [cluster keySetReadWithParams:params - completionHandler:^( - CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read (also removed) Error: %@", err); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, false)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_NOT_FOUND)); - NextTest(); - }]; + NextTest(); + }; return CHIP_NO_ERROR; } }; -class TestIdentifyCluster : public TestCommandBridge { +class DL_LockUnlock : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestIdentifyCluster() - : TestCommandBridge("TestIdentifyCluster") + DL_LockUnlock() + : TestCommandBridge("DL_LockUnlock") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -66030,7 +74404,7 @@ class TestIdentifyCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestIdentifyCluster() {} + ~DL_LockUnlock() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -66038,11 +74412,11 @@ class TestIdentifyCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestIdentifyCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: DL_LockUnlock\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestIdentifyCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: DL_LockUnlock\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -66059,8 +74433,44 @@ class TestIdentifyCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Identify command and expect success response\n"); - err = TestSendIdentifyCommandAndExpectSuccessResponse_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Try to unlock the door with invalid PIN\n"); + err = TestTryToUnlockTheDoorWithInvalidPin_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Verify that lock state attribute value is set to Locked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToLocked_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Try to unlock the door with valid PIN\n"); + err = TestTryToUnlockTheDoorWithValidPin_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Verify that lock state attribute value is set to Unlocked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Try to lock the door with invalid PIN\n"); + err = TestTryToLockTheDoorWithInvalidPin_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Verify that lock state attribute value is set to Unlocked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Try to unlock the door with valid PIN\n"); + err = TestTryToUnlockTheDoorWithValidPin_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Verify that lock state attribute value is set to Locked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToLocked_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Clean the created credential\n"); + err = TestCleanTheCreatedCredential_10(); break; } @@ -66077,7 +74487,7 @@ class TestIdentifyCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 11; chip::Optional mNodeId; chip::Optional mCluster; @@ -66090,123 +74500,251 @@ class TestIdentifyCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendIdentifyCommandAndExpectSuccessResponse_1() + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPIdentifyClusterIdentifyParams alloc] init]; - params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; - [cluster identifyWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Identify command and expect success response Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } -}; -class TestLogCommands : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestLogCommands() - : TestCommandBridge("TestLogCommands") - , mTestIndex(0) + CHIP_ERROR TestTryToUnlockTheDoorWithInvalidPin_2() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"000000" length:6]; + [cluster unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with invalid PIN Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestLogCommands() {} + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that lock state attribute value is set to Locked Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTryToUnlockTheDoorWithValidPin_4() { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestLogCommands\n"); - } + __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with valid PIN Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestLogCommands\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + NextTest(); + }]; - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Log a simple message\n"); - err = TestLogASimpleMessage_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Do a simple user prompt message\n"); - err = TestDoASimpleUserPromptMessage_2(); - break; - } + return CHIP_NO_ERROR; + } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that lock state attribute value is set to Unlocked Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 2)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestTryToLockTheDoorWithInvalidPin_6() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"000000" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to lock the door with invalid PIN Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that lock state attribute value is set to Unlocked Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 2)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTryToUnlockTheDoorWithValidPin_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with valid PIN Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that lock state attribute value is set to Locked Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR TestLogASimpleMessage_1() - { - Log(@"This is a simple message"); return CHIP_NO_ERROR; } - CHIP_ERROR TestDoASimpleUserPromptMessage_2() + CHIP_ERROR TestCleanTheCreatedCredential_10() { - UserPrompt(@"This is a simple message"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + [cluster clearCredentialWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clean the created credential Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + return CHIP_NO_ERROR; } }; -class TestOperationalCredentialsCluster : public TestCommandBridge { +class Test_TC_DL_1_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestOperationalCredentialsCluster() - : TestCommandBridge("TestOperationalCredentialsCluster") + Test_TC_DL_1_3() + : TestCommandBridge("Test_TC_DL_1_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -66216,7 +74754,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestOperationalCredentialsCluster() {} + ~Test_TC_DL_1_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -66224,11 +74762,11 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestOperationalCredentialsCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_1_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestOperationalCredentialsCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_1_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -66245,32 +74783,36 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of supported fabrics\n"); - err = TestReadNumberOfSupportedFabrics_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read number of commissioned fabrics\n"); - err = TestReadNumberOfCommissionedFabrics_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); + err = TestPreconditionDoorIsInLockedState_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read current fabric index\n"); - err = TestReadCurrentFabricIndex_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); + err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Remove nonexistent fabric\n"); - err = TestRemoveNonexistentFabric_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock Door command to the DUT with valid PINCode\n"); + err = TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read fabric list before setting label\n"); - err = TestReadFabricListBeforeSettingLabel_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); + err = TestThReadsAutoRelockTimeAttributeFromDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Set the fabric label\n"); - err = TestSetTheFabricLabel_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10000ms\n"); + err = TestWait10000ms_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read fabric list after setting label\n"); - err = TestReadFabricListAfterSettingLabel_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attriute\n"); + err = TestThReadsLockStateAttriute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Clean the created credential\n"); + err = TestCleanTheCreatedCredential_8(); break; } @@ -66287,7 +74829,7 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -66300,201 +74842,179 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNumberOfSupportedFabrics_1() + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read number of supported fabrics Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - VerifyOrReturn(CheckValue("status", err, 0)); + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); - VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", [value unsignedCharValue], 4)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNumberOfCommissionedFabrics_2() + CHIP_ERROR TestPreconditionDoorIsInLockedState_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read number of commissioned fabrics Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Precondition: Door is in locked state Error: %@", err); - VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", [value unsignedCharValue], 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull ourFabricIndex; - CHIP_ERROR TestReadCurrentFabricIndex_3() + CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read current fabric index Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + id autoRelockTimeArgument; + autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; + [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1)); - } - { - ourFabricIndex = value; - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveNonexistentFabric_4() + CHIP_ERROR TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; - params.fabricIndex = [NSNumber numberWithUnsignedChar:243]; - [cluster removeFabricWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove nonexistent fabric Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends the unlock Door command to the DUT with valid PINCode Error: %@", err); - { - id actualValue = values.statusCode; - VerifyOrReturn(CheckValue("StatusCode", actualValue, 11)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadFabricListBeforeSettingLabel_5() + CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeFabricsWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read fabric list before setting label Error: %@", err); + [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValueAsString("Label", - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"")); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, - ourFabricIndex)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSetTheFabricLabel_6() + CHIP_ERROR TestWait10000ms_6() + { + WaitForMs(10000); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsLockStateAttriute_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; - params.label = @"Batcave"; - [cluster updateFabricLabelWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Set the fabric label Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LockState attriute Error: %@", err); - { - id actualValue = values.statusCode; - VerifyOrReturn(CheckValue("StatusCode", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = values.fabricIndex; - VerifyOrReturn(CheckValue("FabricIndex", actualValue, ourFabricIndex)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadFabricListAfterSettingLabel_7() + CHIP_ERROR TestCleanTheCreatedCredential_8() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeFabricsWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read fabric list after setting label Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster clearCredentialWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clean the created credential Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Fabrics", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValueAsString("Label", - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label, @"Batcave")); - VerifyOrReturn(CheckValue("FabricIndex", - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, - ourFabricIndex)); - } + VerifyOrReturn(CheckValue("status", err, 0)); NextTest(); }]; @@ -66503,11 +75023,11 @@ class TestOperationalCredentialsCluster : public TestCommandBridge { } }; -class TestSelfFabricRemoval : public TestCommandBridge { +class TestGroupsCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestSelfFabricRemoval() - : TestCommandBridge("TestSelfFabricRemoval") + TestGroupsCluster() + : TestCommandBridge("TestGroupsCluster") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -66517,7 +75037,7 @@ class TestSelfFabricRemoval : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~TestSelfFabricRemoval() {} + ~TestGroupsCluster() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -66525,510 +75045,698 @@ class TestSelfFabricRemoval : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestSelfFabricRemoval\n"); + ChipLogProgress(chipTool, " **** Test Start: TestGroupsCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestSelfFabricRemoval\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestGroupsCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } Wait(); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of commissioned fabrics\n"); - err = TestReadNumberOfCommissionedFabrics_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read current fabric index\n"); - err = TestReadCurrentFabricIndex_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Remove single own fabric\n"); - err = TestRemoveSingleOwnFabric_3(); - break; - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : View Group 0 (invalid)\n"); + err = TestViewGroup0Invalid_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : View Group 1 (not found)\n"); + err = TestViewGroup1NotFound_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Add Group 1 (new)\n"); + err = TestAddGroup1New_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : View Group 1 (new)\n"); + err = TestViewGroup1New_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : View Group 2 (not found)\n"); + err = TestViewGroup2NotFound_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Get Group Membership 1 (all)\n"); + err = TestGetGroupMembership1All_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : View Group 3 (not found)\n"); + err = TestViewGroup3NotFound_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : View Group 1 (existing)\n"); + err = TestViewGroup1Existing_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Remove Group 0 (invalid)\n"); + err = TestRemoveGroup0Invalid_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Remove Group 4 (not found)\n"); + err = TestRemoveGroup4NotFound_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : View Group 1 (not removed)\n"); + err = TestViewGroup1NotRemoved_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : View Group 2 (removed)\n"); + err = TestViewGroup2Removed_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Get Group Membership 3\n"); + err = TestGetGroupMembership3_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Remove All\n"); + err = TestRemoveAll_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : View Group 1 (removed)\n"); + err = TestViewGroup1Removed_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : View Group 2 (still removed)\n"); + err = TestViewGroup2StillRemoved_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : View Group 3 (removed)\n"); + err = TestViewGroup3Removed_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Get Group Membership 4\n"); + err = TestGetGroupMembership4_18(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 19; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestViewGroup0Invalid_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:0U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 0 (invalid) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 135)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestViewGroup1NotFound_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (not found) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestAddGroup1New_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + params.groupName = @"Group #1"; + [cluster addGroupWithParams:params + completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 1 (new) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestViewGroup1New_4() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (new) Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + { + id actualValue = values.groupName; + VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); + } + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() + CHIP_ERROR TestViewGroup2NotFound_5() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read number of commissioned fabrics Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:4369U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 2 (not found) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CommissionedFabrics", actualValue, 1)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } - VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull ourFabricIndex; - CHIP_ERROR TestReadCurrentFabricIndex_2() + CHIP_ERROR TestGetGroupMembership1All_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read current fabric index Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + params.groupList = temp_0; + } + [cluster getGroupMembershipWithParams:params + completionHandler:^( + CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Group Membership 1 (all) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1)); - } - { - ourFabricIndex = value; - } + { + id actualValue = values.capacity; + VerifyOrReturn(CheckValueNull("capacity", actualValue)); + } - NextTest(); - }]; + { + id actualValue = values.groupList; + VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveSingleOwnFabric_3() + CHIP_ERROR TestViewGroup3NotFound_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; - params.fabricIndex = [ourFabricIndex copy]; - [cluster removeFabricWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove single own fabric Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:32767U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 3 (not found) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 32767U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class TestBinding : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestBinding() - : TestCommandBridge("TestBinding") - , mTestIndex(0) + CHIP_ERROR TestViewGroup1Existing_8() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~TestBinding() {} + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (existing) Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("status", err, 0)); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestBinding\n"); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestBinding\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } - Wait(); + { + id actualValue = values.groupName; + VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write empty binding table\n"); - err = TestWriteEmptyBindingTable_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read empty binding table\n"); - err = TestReadEmptyBindingTable_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write invalid binding table\n"); - err = TestWriteInvalidBindingTable_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Write binding table (endpoint 1)\n"); - err = TestWriteBindingTableEndpoint1_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read binding table (endpoint 1)\n"); - err = TestReadBindingTableEndpoint1_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write binding table (endpoint 0)\n"); - err = TestWriteBindingTableEndpoint0_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read binding table (endpoint 0)\n"); - err = TestReadBindingTableEndpoint0_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Verify endpoint 1 not changed\n"); - err = TestVerifyEndpoint1NotChanged_8(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestRemoveGroup0Invalid_9() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:0U]; + [cluster removeGroupWithParams:params + completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove Group 0 (invalid) Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 135)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 0U)); + } + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteEmptyBindingTable_1() + CHIP_ERROR TestRemoveGroup4NotFound_10() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write empty binding table Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:4U]; + [cluster removeGroupWithParams:params + completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove Group 4 (not found) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 4U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEmptyBindingTable_2() + CHIP_ERROR TestViewGroup1NotRemoved_11() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read empty binding table Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (not removed) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(0))); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + { + id actualValue = values.groupName; + VerifyOrReturn(CheckValueAsString("groupName", actualValue, @"Group #1")); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteInvalidBindingTable_3() + CHIP_ERROR TestViewGroup2Removed_12() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:4369U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 2 (removed) Error: %@", err); - temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).group = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + VerifyOrReturn(CheckValue("status", err, 0)); - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write invalid binding table Error: %@", err); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteBindingTableEndpoint1_4() + CHIP_ERROR TestGetGroupMembership3_13() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bindingArgument; + __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; { NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).group = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; + temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; + temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; + temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; + params.groupList = temp_0; + } + [cluster getGroupMembershipWithParams:params + completionHandler:^( + CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Group Membership 3 Error: %@", err); - temp_0[2] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[2]).node = [NSNumber numberWithUnsignedLongLong:2ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[2]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + VerifyOrReturn(CheckValue("status", err, 0)); - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write binding table (endpoint 1) Error: %@", err); + { + id actualValue = values.capacity; + VerifyOrReturn(CheckValueNull("capacity", actualValue)); + } - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.groupList; + VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBindingTableEndpoint1_5() + CHIP_ERROR TestRemoveAll_14() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read binding table (endpoint 1) Error: %@", err); + [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Remove All Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("Group", ((CHIPBindingClusterTargetStruct *) actualValue[0]).group, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[1]).node, 1ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("Cluster", ((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster, 6UL)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[2]).node, 2ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex, 1)); - } + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestViewGroup1Removed_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - NextTest(); - }]; + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:1U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 1 (removed) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 1U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteBindingTableEndpoint0_6() + CHIP_ERROR TestViewGroup2StillRemoved_16() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).node = [NSNumber numberWithUnsignedLongLong:3ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:4369U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 2 (still removed) Error: %@", err); - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write binding table (endpoint 0) Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 4369U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBindingTableEndpoint0_7() + CHIP_ERROR TestViewGroup3Removed_17() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read binding table (endpoint 0) Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:32767U]; + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"View Group 3 (removed) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[0]).node, 3ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[0]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 32767U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyEndpoint1NotChanged_8() + CHIP_ERROR TestGetGroupMembership4_18() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify endpoint 1 not changed Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; + temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; + temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; + temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; + temp_0[4] = [NSNumber numberWithUnsignedShort:32767U]; + params.groupList = temp_0; + } + [cluster getGroupMembershipWithParams:params + completionHandler:^( + CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Group Membership 4 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Binding", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("Group", ((CHIPBindingClusterTargetStruct *) actualValue[0]).group, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[1]).node, 1ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("Cluster", ((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster, 6UL)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex, 1)); - VerifyOrReturn(CheckValue("Node", ((CHIPBindingClusterTargetStruct *) actualValue[2]).node, 2ULL)); - VerifyOrReturn( - CheckValue("Endpoint", ((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint, 1U)); - VerifyOrReturn( - CheckValue("FabricIndex", ((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex, 1)); - } + { + id actualValue = values.capacity; + VerifyOrReturn(CheckValueNull("capacity", actualValue)); + } - NextTest(); - }]; + { + id actualValue = values.groupList; + VerifyOrReturn(CheckValue("groupList", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_SWDIAG_1_1 : public TestCommandBridge { +class TestGroupKeyManagementCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_SWDIAG_1_1() - : TestCommandBridge("Test_TC_SWDIAG_1_1") + TestGroupKeyManagementCluster() + : TestCommandBridge("TestGroupKeyManagementCluster") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -67038,7 +75746,7 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_SWDIAG_1_1() {} + ~TestGroupKeyManagementCluster() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -67046,11 +75754,11 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: TestGroupKeyManagementCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: TestGroupKeyManagementCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -67067,32 +75775,72 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads a list of ThreadMetrics struct non-global attribute from DUT.\n"); - if (ShouldSkip("A_THREADMETRICS")) { - NextTest(); - return; - } - err = TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read maxGroupsPerFabric\n"); + err = TestReadMaxGroupsPerFabric_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapFree non-global attribute value from DUT\n"); - err = TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read maxGroupKeysPerFabric\n"); + err = TestReadMaxGroupKeysPerFabric_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapUsed non-global attribute value from DUT\n"); - if (ShouldSkip("A_CURRENTHEAPUSED")) { - NextTest(); - return; - } - err = TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Add Group 1\n"); + err = TestAddGroup1_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads CurrentHeapHighWaterMark non-global attribute value from DUT\n"); - if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) { - NextTest(); - return; - } - err = TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Add Group 2\n"); + err = TestAddGroup2_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : KeySet Write 1\n"); + err = TestKeySetWrite1_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : KeySet Write 2\n"); + err = TestKeySetWrite2_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : KeySet Read\n"); + err = TestKeySetRead_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys (invalid)\n"); + err = TestWriteGroupKeysInvalid_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Write Group Keys\n"); + err = TestWriteGroupKeys_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read Group Keys\n"); + err = TestReadGroupKeys_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read GroupTable\n"); + err = TestReadGroupTable_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : KeySet Remove 1\n"); + err = TestKeySetRemove1_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : KeySet Read (removed)\n"); + err = TestKeySetReadRemoved_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : KeySet Read (not removed)\n"); + err = TestKeySetReadNotRemoved_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Remove All\n"); + err = TestRemoveAll_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Remove 2\n"); + err = TestKeySetRemove2_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : KeySet Read (also removed)\n"); + err = TestKeySetReadAlsoRemoved_17(); break; } @@ -67109,7 +75857,7 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -67122,572 +75870,539 @@ class Test_TC_SWDIAG_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1() + CHIP_ERROR TestReadMaxGroupsPerFabric_1() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads a list of ThreadMetrics struct non-global attribute from DUT. Error: %@", err); + [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read maxGroupsPerFabric Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("threadMetrics", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapFree non-global attribute value from DUT Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxGroupsPerFabric", [value unsignedShortValue], 2U)); } - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("currentHeapFree", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3() + CHIP_ERROR TestReadMaxGroupKeysPerFabric_2() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapUsed non-global attribute value from DUT Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read maxGroupKeysPerFabric Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("MaxGroupKeysPerFabric", actualValue, 2U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4() + CHIP_ERROR TestAddGroup1_3() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT Error: %@", err); + __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:257U]; + params.groupName = @"Group #1"; + [cluster addGroupWithParams:params + completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 1 Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } - VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); - NextTest(); - }]; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 257U)); + } - return CHIP_NO_ERROR; - } -}; + NextTest(); + }]; -class Test_TC_SWDIAG_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_SWDIAG_2_1() - : TestCommandBridge("Test_TC_SWDIAG_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_SWDIAG_2_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestAddGroup2_4() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - } + __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:258U]; + params.groupName = @"Group #2"; + [cluster addGroupWithParams:params + completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 2 Error: %@", err); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + VerifyOrReturn(CheckValue("status", err, 0)); - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; + { + id actualValue = values.groupId; + VerifyOrReturn(CheckValue("groupId", actualValue, 258U)); + } - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; -}; + NextTest(); + }]; -class Test_TC_SWDIAG_3_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_SWDIAG_3_1() - : TestCommandBridge("Test_TC_SWDIAG_3_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_SWDIAG_3_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestKeySetWrite1_5() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWDIAG_3_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWDIAG_3_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Sends ResetWatermarks to DUT\n"); - if (ShouldSkip("CR_RESETWATERMARKS")) { - NextTest(); - return; - } - err = TestSendsResetWatermarksToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapUsed attribute value from DUT\n"); - if (ShouldSkip("A_CURRENTHEAPUSED")) { - NextTest(); - return; - } - err = TestReadsCurrentHeapUsedAttributeValueFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapHighWaterMark attribute value from DUT\n"); - if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) { - NextTest(); - return; - } - err = TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_3(); - break; - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:417U]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1110000ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:1110001ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1110002ULL]; - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + [cluster keySetWriteWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Write 1 Error: %@", err); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + VerifyOrReturn(CheckValue("status", err, 0)); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsResetWatermarksToDut_1() + CHIP_ERROR TestKeySetWrite2_6() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster resetWatermarksWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ResetWatermarks to DUT Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:418U]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:2110000ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:2110001ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:2110002ULL]; - VerifyOrReturn(CheckValue("status", err, 0)); + [cluster keySetWriteWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Write 2 Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapUsedAttributeValueFromDut_2() + CHIP_ERROR TestKeySetRead_7() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapUsed attribute value from DUT Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; + [cluster + keySetReadWithParams:params + completionHandler:^( + CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = values.groupKeySet; + VerifyOrReturn(CheckValue( + "GroupKeySetID", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 417U)); + VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 0)); + VerifyOrReturn( + CheckValueNull("EpochKey0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); + VerifyOrReturn(CheckValue("EpochStartTime0", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 1110000ULL)); + VerifyOrReturn( + CheckValueNull("EpochKey1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); + VerifyOrReturn(CheckValue("EpochStartTime1", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, 1110001ULL)); + VerifyOrReturn( + CheckValueNull("EpochKey2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); + VerifyOrReturn(CheckValue("EpochStartTime2", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, 1110002ULL)); + } - VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_3() + CHIP_ERROR TestWriteGroupKeysInvalid_8() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapHighWaterMark attribute value from DUT Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + id groupKeyMapArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:258U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:0U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; - VerifyOrReturn(CheckValue("status", err, 0)); + groupKeyMapArgument = temp_0; + } + [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Group Keys (invalid) Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class TestSubscribe_OnOff : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestSubscribe_OnOff() - : TestCommandBridge("TestSubscribe_OnOff") - , mTestIndex(0) + CHIP_ERROR TestWriteGroupKeys_9() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~TestSubscribe_OnOff() {} + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + id groupKeyMapArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:257U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestSubscribe_OnOff\n"); - } + temp_0[1] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupId = [NSNumber numberWithUnsignedShort:258U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestSubscribe_OnOff\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; + groupKeyMapArgument = temp_0; } + [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Group Keys Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err, 0)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Set OnOff Attribute to false\n"); - err = TestSetOnOffAttributeToFalse_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Report: Subscribe OnOff Attribute\n"); - err = TestReportSubscribeOnOffAttribute_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Subscribe OnOff Attribute\n"); - err = TestSubscribeOnOffAttribute_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn On the light to see attribute change\n"); - err = TestTurnOnTheLightToSeeAttributeChange_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check for attribute report\n"); - err = TestCheckForAttributeReport_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Turn Off the light to see attribute change\n"); - err = TestTurnOffTheLightToSeeAttributeChange_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check for attribute report\n"); - err = TestCheckForAttributeReport_7(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestReadGroupKeys_10() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster + readAttributeGroupKeyMapWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Group Keys Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GroupKeyMap", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("GroupId", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupId, 257U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupKeySetID, 417U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("GroupId", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupId, 258U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupKeySetID, 418U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).fabricIndex, 1)); + } + + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestSetOnOffAttributeToFalse_1() + CHIP_ERROR TestReadGroupTable_11() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Set OnOff Attribute to false Error: %@", err); + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = [NSNumber numberWithBool:true]; + [cluster readAttributeGroupTableWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read GroupTable Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValue("GroupId", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId, 257U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName, + @"Group #1")); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).fabricIndex, 1)); + VerifyOrReturn(CheckValue("GroupId", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupId, 258U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupName, + @"Group #2")); + VerifyOrReturn(CheckValue("FabricIndex", + ((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).fabricIndex, 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - bool testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = false; - ResponseHandler _Nullable test_TestSubscribe_OnOff_OnOff_Reported = nil; - CHIP_ERROR TestReportSubscribeOnOffAttribute_2() + CHIP_ERROR TestKeySetRemove1_12() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Report: Subscribe OnOff Attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; + [cluster keySetRemoveWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Remove 1 Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, false)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = true; - }; + NextTest(); + }]; - NextTest(); return CHIP_NO_ERROR; } - CHIP_ERROR TestSubscribeOnOffAttribute_3() + CHIP_ERROR TestKeySetReadRemoved_13() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - uint16_t minIntervalArgument = 2U; - uint16_t maxIntervalArgument = 5U; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - [cluster subscribeAttributeOnOffWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] - maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] - params:params - subscriptionEstablished:^{ - VerifyOrReturn(testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled, - SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); - NextTest(); - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Subscribe OnOff Attribute Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; + [cluster keySetReadWithParams:params + completionHandler:^( + CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read (removed) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); - if (test_TestSubscribe_OnOff_OnOff_Reported != nil) { - ResponseHandler callback = test_TestSubscribe_OnOff_OnOff_Reported; - test_TestSubscribe_OnOff_OnOff_Reported = nil; - callback(value, err); - } - }]; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_NOT_FOUND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOnTheLightToSeeAttributeChange_4() + CHIP_ERROR TestKeySetReadNotRemoved_14() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn On the light to see attribute change Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; + [cluster + keySetReadWithParams:params + completionHandler:^( + CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read (not removed) Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + { + id actualValue = values.groupKeySet; + VerifyOrReturn(CheckValue( + "GroupKeySetID", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 418U)); + VerifyOrReturn(CheckValue("GroupKeySecurityPolicy", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 1)); + VerifyOrReturn( + CheckValueNull("EpochKey0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime0", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0)); + VerifyOrReturn(CheckValue("EpochStartTime0", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 2110000ULL)); + VerifyOrReturn( + CheckValueNull("EpochKey1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime1", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1)); + VerifyOrReturn(CheckValue("EpochStartTime1", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, 2110001ULL)); + VerifyOrReturn( + CheckValueNull("EpochKey2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2)); + VerifyOrReturn(CheckValueNonNull( + "EpochStartTime2", ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2)); + VerifyOrReturn(CheckValue("EpochStartTime2", + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, 2110002ULL)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckForAttributeReport_5() + CHIP_ERROR TestRemoveAll_15() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check for attribute report Error: %@", err); + [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Remove All Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, true)); - } - NextTest(); - }; + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffTheLightToSeeAttributeChange_6() + CHIP_ERROR TestKeySetRemove2_16() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn Off the light to see attribute change Error: %@", err); + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; + [cluster keySetRemoveWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Remove 2 Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckForAttributeReport_7() + CHIP_ERROR TestKeySetReadAlsoRemoved_17() { CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check for attribute report Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, false)); - } + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; + [cluster keySetReadWithParams:params + completionHandler:^( + CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read (also removed) Error: %@", err); - NextTest(); - }; + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_NOT_FOUND)); + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -67740,7 +76455,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -67748,11 +76463,11 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -67804,6 +76519,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -67839,26 +76555,50 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), - make_unique(), - make_unique(), + make_unique(), make_unique(), - make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), #endif // CONFIG_ENABLE_YAML_TESTS }; From 1894ec4f2c81ebdb156fab0a8098dea33ac2bd79 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 29 Apr 2022 04:03:48 +0200 Subject: [PATCH 35/59] [chip-tool] Ensure that the event subscription success is dispatched to SubscribeEvent (#17842) --- .../chip-tool/commands/clusters/ReportCommand.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/chip-tool/commands/clusters/ReportCommand.h b/examples/chip-tool/commands/clusters/ReportCommand.h index dbe4e60174e231..5a3a3307020604 100644 --- a/examples/chip-tool/commands/clusters/ReportCommand.h +++ b/examples/chip-tool/commands/clusters/ReportCommand.h @@ -32,8 +32,7 @@ class ReportCommand : public ModelCommand, public chip::app::ReadClient::Callbac ModelCommand(commandName, credsIssuerConfig), mBufferedReadAdapter(*this) {} - virtual void OnAttributeSubscription(){}; - virtual void OnEventSubscription(){}; + virtual void OnSubscription(){}; /////////// ReadClient Callback Interface ///////// void OnAttributeData(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader * data, @@ -105,7 +104,7 @@ class ReportCommand : public ModelCommand, public chip::app::ReadClient::Callbac SetCommandExitStatus(mError); } - void OnSubscriptionEstablished(uint64_t subscriptionId) override { OnAttributeSubscription(); } + void OnSubscriptionEstablished(uint64_t subscriptionId) override { OnSubscription(); } protected: CHIP_ERROR ReportAttribute(ChipDevice * device, std::vector endpointIds, @@ -431,11 +430,9 @@ class SubscribeAttribute : public ReportCommand mDataVersion); } - chip::System::Clock::Timeout GetWaitDuration() const override { return ReportCommand::GetWaitDuration(); } - - void OnAttributeSubscription() override + void OnSubscription() override { - // The ReadClient instance can not be released directly into the OnAttributeSubscription + // The ReadClient instance can not be released directly into the OnSubscription // callback since it happens to be called by ReadClient itself which is doing additional // work after that. chip::DeviceLayer::PlatformMgr().ScheduleWork( @@ -547,9 +544,7 @@ class SubscribeEvent : public ReportCommand chip::app::ReadClient::InteractionType::Subscribe, mMinInterval, mMaxInterval); } - chip::System::Clock::Timeout GetWaitDuration() const override { return ReportCommand::GetWaitDuration(); } - - void OnEventSubscription() override + void OnSubscription() override { // The ReadClient instance can not be released directly into the OnEventSubscription // callback since it happens to be called by ReadClient itself which is doing additional From 23488984a80d93d9779c0b41b4382e66851a9cff Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Thu, 28 Apr 2022 22:05:04 -0400 Subject: [PATCH 36/59] Move extern template instantiates to the end of file (#17849) There is a difference in behavior between gcc and clang when it comes to explicit instantiating extern templates. With clang, instantiating before all templated member definitions are defined will leave those members uninstantiated in the translation unit, causing undefined symbol errors. Move the instantiation to the end of file so these platforms can build with clang. --- .../internal/GenericConnectivityManagerImpl_BLE.ipp | 7 ++++--- .../internal/GenericConnectivityManagerImpl_WiFi.ipp | 7 ++++--- .../platform/internal/GenericPlatformManagerImpl.ipp | 1 + .../internal/GenericPlatformManagerImpl_FreeRTOS.ipp | 7 ++++--- .../platform/internal/GenericPlatformManagerImpl_POSIX.ipp | 1 + .../internal/GenericPlatformManagerImpl_Zephyr.ipp | 7 ++++--- .../FreeRTOS/GenericThreadStackManagerImpl_FreeRTOS.cpp | 7 ++++--- .../GenericThreadStackManagerImpl_OpenThread.cpp | 6 ++++-- .../GenericThreadStackManagerImpl_OpenThread_LwIP.cpp | 7 ++++--- 9 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.ipp b/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.ipp index 1dc9c5a692e797..8e616bc98ccad6 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.ipp +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.ipp @@ -31,9 +31,6 @@ namespace chip { namespace DeviceLayer { namespace Internal { -// Fully instantiate the template class in whatever compilation unit includes this file. -template class GenericConnectivityManagerImpl_BLE; - template const char * GenericConnectivityManagerImpl_BLE::_CHIPoBLEServiceModeToStr(ConnectivityManager::CHIPoBLEServiceMode mode) { @@ -50,6 +47,10 @@ const char * GenericConnectivityManagerImpl_BLE::_CHIPoBLEServiceMode } } +// Fully instantiate the template class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. +template class GenericConnectivityManagerImpl_BLE; + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp index 411eb4d4dcf69a..4597f27a5d416b 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp @@ -32,9 +32,6 @@ namespace chip { namespace DeviceLayer { namespace Internal { -// Fully instantiate the generic implementation class in whatever compilation unit includes this file. -template class GenericConnectivityManagerImpl_WiFi; - template const char * GenericConnectivityManagerImpl_WiFi::_WiFiStationModeToStr(ConnectivityManager::WiFiStationMode mode) { @@ -121,6 +118,10 @@ bool GenericConnectivityManagerImpl_WiFi::_IsWiFiStationEnabled() return Impl()->GetWiFiStationMode() == ConnectivityManager::kWiFiStationMode_Enabled; } +// Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. +template class GenericConnectivityManagerImpl_WiFi; + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.ipp b/src/include/platform/internal/GenericPlatformManagerImpl.ipp index 9bb7dd8065e654..c3e2370748395c 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl.ipp @@ -321,6 +321,7 @@ void GenericPlatformManagerImpl::HandleMessageLayerActivityChanged(bo } // Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. template class GenericPlatformManagerImpl; } // namespace Internal diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp b/src/include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp index 216665c08560de..b69448724b9002 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp @@ -39,9 +39,6 @@ namespace chip { namespace DeviceLayer { namespace Internal { -// Fully instantiate the generic implementation class in whatever compilation unit includes this file. -template class GenericPlatformManagerImpl_FreeRTOS; - template CHIP_ERROR GenericPlatformManagerImpl_FreeRTOS::_InitChipStack(void) { @@ -288,6 +285,10 @@ CHIP_ERROR GenericPlatformManagerImpl_FreeRTOS::_StopEventLoopTask(vo return CHIP_NO_ERROR; } +// Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. +template class GenericPlatformManagerImpl_FreeRTOS; + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp b/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp index 81d7e00ee3da3c..708f44e3bdf431 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp @@ -311,6 +311,7 @@ CHIP_ERROR GenericPlatformManagerImpl_POSIX::_Shutdown() } // Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. template class GenericPlatformManagerImpl_POSIX; } // namespace Internal diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp b/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp index 89fea684bee9ce..217edb70fed89b 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp @@ -51,9 +51,6 @@ System::LayerSocketsLoop & SystemLayerSocketsLoop() } // anonymous namespace -// Fully instantiate the generic implementation class in whatever compilation unit includes this file. -template class GenericPlatformManagerImpl_Zephyr; - template CHIP_ERROR GenericPlatformManagerImpl_Zephyr::_InitChipStack(void) { @@ -197,6 +194,10 @@ CHIP_ERROR GenericPlatformManagerImpl_Zephyr::_StartEventLoopTask(voi return CHIP_NO_ERROR; } +// Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. +template class GenericPlatformManagerImpl_Zephyr; + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/FreeRTOS/GenericThreadStackManagerImpl_FreeRTOS.cpp b/src/platform/FreeRTOS/GenericThreadStackManagerImpl_FreeRTOS.cpp index ab8af54c569dc5..4dbee81b23af01 100644 --- a/src/platform/FreeRTOS/GenericThreadStackManagerImpl_FreeRTOS.cpp +++ b/src/platform/FreeRTOS/GenericThreadStackManagerImpl_FreeRTOS.cpp @@ -37,9 +37,6 @@ namespace chip { namespace DeviceLayer { namespace Internal { -// Fully instantiate the generic implementation class in whatever compilation unit includes this file. -template class GenericThreadStackManagerImpl_FreeRTOS; - template CHIP_ERROR GenericThreadStackManagerImpl_FreeRTOS::DoInit(void) { @@ -144,6 +141,10 @@ void GenericThreadStackManagerImpl_FreeRTOS::ThreadTaskMain(void * ar } } +// Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. +template class GenericThreadStackManagerImpl_FreeRTOS; + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp index 5d786ca9815ce2..3713b5ccaf6576 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp @@ -102,8 +102,6 @@ void initNetworkCommissioningThreadDriver(void) NetworkCommissioning::ThreadScanResponse * sScanResult; otScanResponseIterator mScanResponseIter(sScanResult); } // namespace -// Fully instantiate the generic implementation class in whatever compilation unit includes this file. -template class GenericThreadStackManagerImpl_OpenThread; /** * Called by OpenThread to alert the ThreadStackManager of a change in the state of the Thread stack. @@ -2584,6 +2582,10 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_DnsResolve(cons #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT +// Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. +template class GenericThreadStackManagerImpl_OpenThread; + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp index 4d235a925470de..a08c4acea48eab 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp @@ -48,9 +48,6 @@ namespace chip { namespace DeviceLayer { namespace Internal { -// Fully instantiate the generic implementation class in whatever compilation unit includes this file. -template class GenericThreadStackManagerImpl_OpenThread_LwIP; - template void GenericThreadStackManagerImpl_OpenThread_LwIP::_OnPlatformEvent(const ChipDeviceEvent * event) { @@ -422,6 +419,10 @@ void GenericThreadStackManagerImpl_OpenThread_LwIP::ReceivePacket(otM } } +// Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. +template class GenericThreadStackManagerImpl_OpenThread_LwIP; + } // namespace Internal } // namespace DeviceLayer } // namespace chip From b292ec6c25b1d3a638262d518b5e3bff9ed90283 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Thu, 28 Apr 2022 21:12:24 -0700 Subject: [PATCH 37/59] add more event tests (#17851) --- src/app/tests/TestEventLogging.cpp | 45 ++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/src/app/tests/TestEventLogging.cpp b/src/app/tests/TestEventLogging.cpp index a9d70c28d4de82..e0f390728be788 100644 --- a/src/app/tests/TestEventLogging.cpp +++ b/src/app/tests/TestEventLogging.cpp @@ -233,20 +233,37 @@ static void CheckLogEventWithEvictToNextBuffer(nlTestSuite * apSuite, void * apC NL_TEST_ASSERT(apSuite, (eid4 + 1) == eid5); NL_TEST_ASSERT(apSuite, (eid5 + 1) == eid6); - chip::app::ObjectList testEventPathParams1; - testEventPathParams1.mValue.mEndpointId = kTestEndpointId1; - testEventPathParams1.mValue.mClusterId = kLivenessClusterId; - chip::app::ObjectList testEventPathParams2; - testEventPathParams2.mValue.mEndpointId = kTestEndpointId2; - testEventPathParams2.mValue.mClusterId = kLivenessClusterId; - testEventPathParams2.mValue.mEventId = kLivenessChangeEvent; - - CheckLogReadOut(apSuite, logMgmt, 0, 3, &testEventPathParams1); - CheckLogReadOut(apSuite, logMgmt, 1, 2, &testEventPathParams1); - CheckLogReadOut(apSuite, logMgmt, 2, 1, &testEventPathParams1); - CheckLogReadOut(apSuite, logMgmt, 3, 3, &testEventPathParams2); - CheckLogReadOut(apSuite, logMgmt, 4, 2, &testEventPathParams2); - CheckLogReadOut(apSuite, logMgmt, 5, 1, &testEventPathParams2); + chip::app::ObjectList paths[2]; + + paths[0].mValue.mEndpointId = kTestEndpointId1; + paths[0].mValue.mClusterId = kLivenessClusterId; + + paths[1].mValue.mEndpointId = kTestEndpointId2; + paths[1].mValue.mClusterId = kLivenessClusterId; + paths[1].mValue.mEventId = kLivenessChangeEvent; + + // interested paths are path list, expect to retrieve all events for each particular interested path + CheckLogReadOut(apSuite, logMgmt, 0, 3, &paths[0]); + CheckLogReadOut(apSuite, logMgmt, 1, 2, &paths[0]); + CheckLogReadOut(apSuite, logMgmt, 2, 1, &paths[0]); + CheckLogReadOut(apSuite, logMgmt, 3, 3, &paths[1]); + CheckLogReadOut(apSuite, logMgmt, 4, 2, &paths[1]); + CheckLogReadOut(apSuite, logMgmt, 5, 1, &paths[1]); + + paths[0].mpNext = &paths[1]; + // interested paths are path list, expect to retrieve all events for those interested paths + CheckLogReadOut(apSuite, logMgmt, 0, 6, paths); + + chip::app::ObjectList pathsWithWildcard[2]; + paths[0].mValue.mEndpointId = kTestEndpointId1; + paths[0].mValue.mClusterId = kLivenessClusterId; + + // second path is wildcard path at default, expect to retrieve all events + CheckLogReadOut(apSuite, logMgmt, 0, 6, &pathsWithWildcard[1]); + + paths[0].mpNext = &paths[1]; + // first path is not wildcard, second path is wildcard path at default, expect to retrieve all events + CheckLogReadOut(apSuite, logMgmt, 0, 6, pathsWithWildcard); } static void CheckLogEventWithDiscardLowEvent(nlTestSuite * apSuite, void * apContext) From 665b11ceb28a333e5cbc8cc138cafd3577c44004 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Fri, 29 Apr 2022 02:23:22 -0400 Subject: [PATCH 38/59] Fix clang warnings -Wmissing-braces (#17867) ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp:789:63: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] gapAdStructure_t adv_data[BLEKW_ADV_MAX_NO] = { 0 }; ^ {} ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp:790:63: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] gapAdStructure_t scan_rsp_data[BLEKW_SCAN_RSP_MAX_NO] = { 0 }; ^ {} 2 errors generated. --- src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp index 06f35303f42975..bba089c98572b8 100644 --- a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp @@ -786,8 +786,8 @@ CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) uint16_t discriminator; uint16_t advInterval = 0; gapAdvertisingData_t adv = { 0 }; - gapAdStructure_t adv_data[BLEKW_ADV_MAX_NO] = { 0 }; - gapAdStructure_t scan_rsp_data[BLEKW_SCAN_RSP_MAX_NO] = { 0 }; + gapAdStructure_t adv_data[BLEKW_ADV_MAX_NO] = { { 0 } }; + gapAdStructure_t scan_rsp_data[BLEKW_SCAN_RSP_MAX_NO] = { { 0 } }; uint8_t advPayload[BLEKW_MAX_ADV_DATA_LEN] = { 0 }; gapScanResponseData_t scanRsp = { 0 }; gapAdvertisingParameters_t adv_params = { 0 }; From e5f2ab7fcaa3e225611c328717b4bc56a500f298 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Fri, 29 Apr 2022 02:25:16 -0400 Subject: [PATCH 39/59] Fix clang warnings -Wshadow (#17866) ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp:1400:85: error: declaration shadows a variable in namespace 'chip::DeviceLayer::Internal::(anonymous)' [-Werror,-Wshadow] CHIP_ERROR BLEManagerImpl::blekw_msg_add_att_written(blekw_msg_type_t type, uint8_t device_id, uint16_t handle, uint8_t * data, ^ ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp:130:9: note: previous declaration is here uint8_t device_id; ^ ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp:1435:82: error: declaration shadows a variable in namespace 'chip::DeviceLayer::Internal::(anonymous)' [-Werror,-Wshadow] CHIP_ERROR BLEManagerImpl::blekw_msg_add_att_read(blekw_msg_type_t type, uint8_t device_id, uint16_t handle) ^ ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp:130:9: note: previous declaration is here uint8_t device_id; ^ 4 errors generated. --- src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp index bba089c98572b8..288cfbffbec3ea 100644 --- a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp @@ -127,7 +127,7 @@ TimerHandle_t connectionTimeout; EventGroupHandle_t bleAppTaskLoopEvent; /* keep the device ID of the connected peer */ -uint8_t device_id; +uint8_t g_device_id; const uint8_t ShortUUID_CHIPoBLEService[] = { 0xF6, 0xFF }; const ChipBleUUID ChipUUID_CHIPoBLEChar_RX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, @@ -1035,7 +1035,7 @@ void BLEManagerImpl::bleAppTask(void * p_arg) ChipLogProgress(DeviceLayer, "BLE connection timeout: Forcing disconnection."); /* Set the advertising parameters */ - if (Gap_Disconnect(device_id) != gBleSuccess_c) + if (Gap_Disconnect(g_device_id) != gBleSuccess_c) { ChipLogProgress(DeviceLayer, "Gap_Disconnect() failed."); } @@ -1053,7 +1053,7 @@ void BLEManagerImpl::HandleConnectEvent(blekw_msg_t * msg) uint8_t device_id_loc = msg->data.u8; ChipLogProgress(DeviceLayer, "BLE is connected with device: %d.\n", device_id_loc); - device_id = device_id_loc; + g_device_id = device_id_loc; blekw_start_connection_timeout(); sInstance.AddConnection(device_id_loc); mFlags.Set(Flags::kRestartAdvertising); From dd0c57fbda5c1da50917e4fa3aba635d7a9b4db9 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Fri, 29 Apr 2022 02:25:27 -0400 Subject: [PATCH 40/59] Fix clang warnings -Wunreachable-code (#17865) ../../third_party/connectedhomeip/src/transport/raw/TCP.cpp:236:63: error: code will never be executed [-Werror,-Wunreachable-code] endPoint->mAppState = reinterpret_cast(this); ^~~~ 1 error generated. --- src/transport/raw/TCP.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/transport/raw/TCP.cpp b/src/transport/raw/TCP.cpp index b8ab3ddbed9306..8e6cae72da4f36 100644 --- a/src/transport/raw/TCP.cpp +++ b/src/transport/raw/TCP.cpp @@ -224,14 +224,11 @@ CHIP_ERROR TCPBase::SendAfterConnect(const PeerAddress & addr, System::PacketBuf // Ensures sufficient active connections size exist VerifyOrReturnError(mUsedEndPointCount < mActiveConnectionsSize, CHIP_ERROR_NO_MEMORY); - Inet::TCPEndPoint * endPoint = nullptr; #if INET_CONFIG_ENABLE_TCP_ENDPOINT + Inet::TCPEndPoint * endPoint = nullptr; ReturnErrorOnFailure(mListenSocket->GetEndPointManager().NewEndPoint(&endPoint)); auto EndPointDeletor = [](Inet::TCPEndPoint * e) { e->Free(); }; std::unique_ptr endPointHolder(endPoint, EndPointDeletor); -#else - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -#endif endPoint->mAppState = reinterpret_cast(this); endPoint->OnDataReceived = OnTcpReceive; @@ -247,11 +244,12 @@ CHIP_ERROR TCPBase::SendAfterConnect(const PeerAddress & addr, System::PacketBuf VerifyOrReturnError(mPendingPackets.CreateObject(addr, std::move(msg)) != nullptr, CHIP_ERROR_NO_MEMORY); mUsedEndPointCount++; -#if INET_CONFIG_ENABLE_TCP_ENDPOINT endPointHolder.release(); -#endif return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif } CHIP_ERROR TCPBase::ProcessReceivedBuffer(Inet::TCPEndPoint * endPoint, const PeerAddress & peerAddress, From ae5b4642389b7e2f62f89b52e214af8ae8a173e3 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Fri, 29 Apr 2022 02:27:19 -0400 Subject: [PATCH 41/59] Fix clang warnings -Wformat-nonliteral (#17864) ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/Logging.cpp:169:16: error: format string is not a string literal [-Werror,-Wformat-nonliteral] GenericLog(msg, v, module, chip::Logging::kLogCategory_None); ^~~ ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/Logging.cpp:187:16: error: format string is not a string literal [-Werror,-Wformat-nonliteral] GenericLog(aFormat, v, module, chip::Logging::kLogCategory_None); ^~~~~~~ 2 errors generated. --- src/lib/support/EnforceFormat.h | 2 +- src/platform/nxp/k32w/k32w0/Logging.cpp | 4 ++-- third_party/openthread/platforms/nxp/k32w/k32w0/BUILD.gn | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/lib/support/EnforceFormat.h b/src/lib/support/EnforceFormat.h index 7d8f681b7de777..7fc52c6834c3dc 100644 --- a/src/lib/support/EnforceFormat.h +++ b/src/lib/support/EnforceFormat.h @@ -27,7 +27,7 @@ * varargs. */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) #define ENFORCE_FORMAT(n, m) __attribute__((format(printf, n, m))) #else // __GNUC__ #define ENFORCE_FORMAT(n, m) /* How to do with MSVC? */ diff --git a/src/platform/nxp/k32w/k32w0/Logging.cpp b/src/platform/nxp/k32w/k32w0/Logging.cpp index 69db5817e664e9..a4302a3ec906b7 100644 --- a/src/platform/nxp/k32w/k32w0/Logging.cpp +++ b/src/platform/nxp/k32w/k32w0/Logging.cpp @@ -159,7 +159,7 @@ void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char /** * LwIP log output function. */ -extern "C" void LwIPLog(const char * msg, ...) +extern "C" void ENFORCE_FORMAT(1, 2) LwIPLog(const char * msg, ...) { va_list v; const char * module = "LWIP"; @@ -174,7 +174,7 @@ extern "C" void LwIPLog(const char * msg, ...) #undef K32W_LOG_MODULE_NAME #define K32W_LOG_MODULE_NAME thread -extern "C" void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char * aFormat, ...) +extern "C" void ENFORCE_FORMAT(3, 4) otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char * aFormat, ...) { va_list v; const char * module = "OT"; diff --git a/third_party/openthread/platforms/nxp/k32w/k32w0/BUILD.gn b/third_party/openthread/platforms/nxp/k32w/k32w0/BUILD.gn index f78dda627c5f47..913daa683c61ec 100644 --- a/third_party/openthread/platforms/nxp/k32w/k32w0/BUILD.gn +++ b/third_party/openthread/platforms/nxp/k32w/k32w0/BUILD.gn @@ -12,9 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("//build_overrides/k32w0_sdk.gni") import("//build_overrides/openthread.gni") + +import("${build_root}/config/compiler/compiler.gni") import("${chip_root}/third_party/nxp/k32w0_sdk/k32w0_sdk.gni") openthread_nxp_root = "${chip_root}/third_party/openthread/ot-nxp" @@ -23,6 +26,10 @@ config("openthread_k32w0_config") { include_dirs = [ "${openthread_nxp_root}/src/k32w0/k32w061" ] include_dirs += [ "${chip_root}/examples/platform/nxp/k32w/k32w0" ] + if (is_clang) { + cflags = [ "-Wno-format-nonliteral" ] + } + defines = [ "OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1", "OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1", From 181b1406bee247116ad295a5963552b09ed1a9a7 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Fri, 29 Apr 2022 02:29:34 -0400 Subject: [PATCH 42/59] Fix clang warnings -Wheader-hygiene (#17862) ../../third_party/connectedhomeip/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp:77:23: error: using namespace directive in global context in header [-Werror,-Wheader-hygiene] using namespace chip::app; ^ ../../third_party/connectedhomeip/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp:78:28: error: using namespace directive in global context in header [-Werror,-Wheader-hygiene] using namespace chip::app::Clusters; ^ ../../third_party/connectedhomeip/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp:79:28: error: using namespace directive in global context in header [-Werror,-Wheader-hygiene] using namespace chip::app::DataModel; ^ ../../third_party/connectedhomeip/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp:80:36: error: using namespace directive in global context in header [-Werror,-Wheader-hygiene] using namespace chip::DeviceLayer::NetworkCommissioning; ^ 4 errors generated. --- ...nericThreadStackManagerImpl_OpenThread.cpp | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp index 3713b5ccaf6576..53f0314b0bdbbd 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp @@ -74,13 +74,6 @@ extern "C" void otSysProcessDrivers(otInstance * aInstance); extern "C" void otAppCliInit(otInstance * aInstance); #endif -using namespace chip::app; -using namespace chip::app::Clusters; -using namespace chip::app::DataModel; -using namespace chip::DeviceLayer::NetworkCommissioning; - -using chip::Inet::IPPrefix; - namespace chip { namespace DeviceLayer { namespace Internal { @@ -89,7 +82,7 @@ namespace Internal { namespace { #ifndef _NO_NETWORK_COMMISSIONING_DRIVER_ NetworkCommissioning::GenericThreadDriver sGenericThreadDriver; -Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sGenericThreadDriver); +app::Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sGenericThreadDriver); #endif void initNetworkCommissioningThreadDriver(void) @@ -100,7 +93,7 @@ void initNetworkCommissioningThreadDriver(void) } NetworkCommissioning::ThreadScanResponse * sScanResult; -otScanResponseIterator mScanResponseIter(sScanResult); +NetworkCommissioning::otScanResponseIterator mScanResponseIter(sScanResult); } // namespace /** @@ -172,7 +165,7 @@ bool GenericThreadStackManagerImpl_OpenThread::_HaveRouteToAddress(co while ((otErr = otNetDataGetNextRoute(Impl()->OTInstance(), &routeIter, &routeConfig)) == OT_ERROR_NONE) { - const IPPrefix prefix = ToIPPrefix(routeConfig.mPrefix); + const Inet::IPPrefix prefix = ToIPPrefix(routeConfig.mPrefix); char addrStr[64]; prefix.IPAddr.ToString(addrStr); if (!routeConfig.mNextHopIsThisDevice && (!destIsULA || routeConfig.mPrefix.mLength > 0) && @@ -392,7 +385,8 @@ void GenericThreadStackManagerImpl_OpenThread::_OnThreadAttachFinishe } template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_StartThreadScan(ThreadDriver::ScanCallback * callback) +CHIP_ERROR +GenericThreadStackManagerImpl_OpenThread::_StartThreadScan(NetworkCommissioning::ThreadDriver::ScanCallback * callback) { // If there is another ongoing scan request, reject the new one. VerifyOrReturnError(mpScanCallback == nullptr, CHIP_ERROR_INCORRECT_STATE); @@ -1007,6 +1001,8 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_WriteThreadNetw { CHIP_ERROR err; + namespace ThreadNetworkDiagnostics = app::Clusters::ThreadNetworkDiagnostics; + switch (attributeId) { case ThreadNetworkDiagnostics::Attributes::Channel::Id: { @@ -1923,11 +1919,12 @@ void GenericThreadStackManagerImpl_OpenThread::_UpdateNetworkStatus() // We have already connected to the network, thus return success. if (ThreadStackMgrImpl().IsThreadAttached()) { - mpStatusChangeCallback->OnNetworkingStatusChange(Status::kSuccess, MakeOptional(extpanid), NullOptional); + mpStatusChangeCallback->OnNetworkingStatusChange(NetworkCommissioning::Status::kSuccess, MakeOptional(extpanid), + NullOptional); } else { - mpStatusChangeCallback->OnNetworkingStatusChange(Status::kNetworkNotFound, MakeOptional(extpanid), + mpStatusChangeCallback->OnNetworkingStatusChange(NetworkCommissioning::Status::kNetworkNotFound, MakeOptional(extpanid), MakeOptional(static_cast(OT_ERROR_DETACHED))); } } From 2ce37b3f4fe6cc070e2d87a2a368fc366657c5b1 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Fri, 29 Apr 2022 02:29:48 -0400 Subject: [PATCH 43/59] Fix clang warnings -Wformat (#17863) ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/Logging.cpp:48:49: error: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int') [-Werror,-Wformat] writtenLen = snprintf(buf, bufLen, "[%lu]", otPlatAlarmMilliGetNow()); ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~ %u 1 error generated. --- src/platform/nxp/k32w/k32w0/Logging.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/nxp/k32w/k32w0/Logging.cpp b/src/platform/nxp/k32w/k32w0/Logging.cpp index a4302a3ec906b7..4d3a5ce2f8c9c5 100644 --- a/src/platform/nxp/k32w/k32w0/Logging.cpp +++ b/src/platform/nxp/k32w/k32w0/Logging.cpp @@ -2,6 +2,7 @@ #include +#include #include #include #include @@ -45,7 +46,7 @@ void GetMessageString(char * buf, uint8_t bufLen, const char * module, uint8_t c */ assert(bufLen >= (timestamp_max_len_bytes + category_max_len_bytes + (strlen(module) + 2) + 1)); - writtenLen = snprintf(buf, bufLen, "[%lu]", otPlatAlarmMilliGetNow()); + writtenLen = snprintf(buf, bufLen, "[%" PRIu32, otPlatAlarmMilliGetNow()); bufLen -= writtenLen; buf += writtenLen; From 782ae24979143ef729273fc07f960c0992101707 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Fri, 29 Apr 2022 02:30:45 -0400 Subject: [PATCH 44/59] Fix clang warnings -Wmissing-declarations (#17861) ../../third_party/connectedhomeip/src/platform/nxp/k32w/k32w0/CHIPDevicePlatformEvent.h:59:5: error: declaration does not declare anything [-Werror,-Wmissing-declarations] union ^ 1 error generated. --- src/platform/nxp/k32w/k32w0/CHIPDevicePlatformEvent.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/platform/nxp/k32w/k32w0/CHIPDevicePlatformEvent.h b/src/platform/nxp/k32w/k32w0/CHIPDevicePlatformEvent.h index df0c42e0b008e5..26540c7bcb9ab3 100644 --- a/src/platform/nxp/k32w/k32w0/CHIPDevicePlatformEvent.h +++ b/src/platform/nxp/k32w/k32w0/CHIPDevicePlatformEvent.h @@ -56,10 +56,6 @@ enum InternalPlatformSpecificEventTypes struct ChipDevicePlatformEvent final { - union - { - /* None currently defined */ - }; }; } // namespace DeviceLayer From 6672d6edfe230f11443d0959783ab9faec880b44 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Fri, 29 Apr 2022 02:33:07 -0400 Subject: [PATCH 45/59] Suppress clang warnings -Wparentheses-equality, -Wself-assign, unknown argument (#17860) clang-14: error: unknown argument: '-fno-optimize-strlen' /home/spang/sdk/k32w_sdk/boards/k32w061dk6/wireless_examples/openthread/reed/bm/board.c:1581:23: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] if ( (reset_cause == RESET_WAKE_PD) ) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /home/spang/sdk/k32w_sdk/boards/k32w061dk6/wireless_examples/openthread/reed/bm/board.c:1581:23: note: remove extraneous parentheses around the comparison to silence this warning if ( (reset_cause == RESET_WAKE_PD) ) ~ ^ ~ /home/spang/sdk/k32w_sdk/boards/k32w061dk6/wireless_examples/openthread/reed/bm/board.c:1581:23: note: use '=' to turn this equality comparison into an assignment if ( (reset_cause == RESET_WAKE_PD) ) ^~ = 1 error generated. /home/spang/sdk/k32w_sdk/middleware/wireless/framework/Keyboard/Source/Keyboard.c:590:20: error: explicitly assigning value of variable of type 'switchScan_t' (aka 'unsigned int') to itself [-Werror,-Wself-assign] previousPressed=previousPressed; /* avoid compiler warnings */ ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ 1 error generated. --- third_party/nxp/k32w0_sdk/k32w0_sdk.gni | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni index 4206ceded05c79..2a2c122397c9a3 100644 --- a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni +++ b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni @@ -11,10 +11,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("//build_overrides/k32w0_sdk.gni") import("//build_overrides/mbedtls.gni") import("//build_overrides/openthread.gni") + +import("${build_root}/config/compiler/compiler.gni") import("${chip_root}/src/crypto/crypto.gni") import("${chip_root}/src/platform/nxp/k32w/k32w0/args.gni") @@ -268,12 +272,20 @@ template("k32w0_sdk") { "-Wno-sign-compare", "-Wno-clobbered", "-Wno-implicit-fallthrough", - "-fno-optimize-strlen", "-mthumb", "-MMD", "-MP", ] + if (is_clang) { + cflags += [ + "-Wno-self-assign", + "-Wno-parentheses-equality", + ] + } else { + cflags += [ "-fno-optimize-strlen" ] + } + # Now add our "system-header" include dirs foreach(include_dir, _sdk_include_dirs) { cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] From 2299a9127ee0f0f9023b8449756bc9a5d9969c3b Mon Sep 17 00:00:00 2001 From: Jiacheng Guo Date: Fri, 29 Apr 2022 15:49:46 +0800 Subject: [PATCH 46/59] [binding] fix wrong cluster ID type when loading from storage (#17884) --- src/app/tests/TestBindingTable.cpp | 2 +- src/app/util/binding-table.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tests/TestBindingTable.cpp b/src/app/tests/TestBindingTable.cpp index c8203c962bdd02..c1a3e6e23a39b6 100644 --- a/src/app/tests/TestBindingTable.cpp +++ b/src/app/tests/TestBindingTable.cpp @@ -135,7 +135,7 @@ void TestPersistentStorage(nlTestSuite * aSuite, void * aContext) chip::TestPersistentStorageDelegate testStorage; BindingTable table; chip::DefaultStorageKeyAllocator key; - chip::Optional cluster = chip::MakeOptional(static_cast(6)); + chip::Optional cluster = chip::MakeOptional(static_cast(UINT16_MAX + 6)); std::vector expected = { EmberBindingTableEntry::ForNode(0, 0, 0, 0, NullOptional), EmberBindingTableEntry::ForNode(1, 1, 0, 0, cluster), diff --git a/src/app/util/binding-table.cpp b/src/app/util/binding-table.cpp index d92df75454461a..64abcc6175d025 100644 --- a/src/app/util/binding-table.cpp +++ b/src/app/util/binding-table.cpp @@ -198,7 +198,7 @@ CHIP_ERROR BindingTable::LoadEntryFromStorage(uint8_t index, uint8_t & nextIndex ReturnErrorOnFailure(reader.Next()); if (reader.GetTag() == TLV::ContextTag(kTagCluster)) { - uint16_t clusterId; + ClusterId clusterId; ReturnErrorOnFailure(reader.Get(clusterId)); entry.clusterId.SetValue(clusterId); ReturnErrorOnFailure(reader.Next()); From 60322cb9d1bfcc3b9d8793cd4c8b96ea6f994bfb Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Fri, 29 Apr 2022 15:52:08 +0800 Subject: [PATCH 47/59] Remove unused code FindCommissioneeDevice(session) (#17880) * Remove unused code FindCommissioneeDevice(session) * Remove unused API, do not expose SessionHolder --- src/app/CASESessionManager.cpp | 5 ----- src/app/CASESessionManager.h | 1 - src/app/OperationalDeviceProxy.h | 2 -- src/app/OperationalDeviceProxyPool.h | 17 ----------------- src/controller/CHIPDeviceController.cpp | 16 ---------------- src/controller/CHIPDeviceController.h | 1 - src/controller/CommissioneeDeviceProxy.h | 3 --- 7 files changed, 45 deletions(-) diff --git a/src/app/CASESessionManager.cpp b/src/app/CASESessionManager.cpp index 597be920fe984a..b26f6b1e9cb5b0 100644 --- a/src/app/CASESessionManager.cpp +++ b/src/app/CASESessionManager.cpp @@ -83,11 +83,6 @@ CHIP_ERROR CASESessionManager::GetPeerAddress(PeerId peerId, Transport::PeerAddr return CHIP_NO_ERROR; } -OperationalDeviceProxy * CASESessionManager::FindSession(const SessionHandle & session) const -{ - return mConfig.devicePool->FindDevice(session); -} - OperationalDeviceProxy * CASESessionManager::FindExistingSession(PeerId peerId) const { return mConfig.devicePool->FindDevice(peerId); diff --git a/src/app/CASESessionManager.h b/src/app/CASESessionManager.h index 09395288df8cd5..3d454b5fe2517f 100644 --- a/src/app/CASESessionManager.h +++ b/src/app/CASESessionManager.h @@ -82,7 +82,6 @@ class CASESessionManager CHIP_ERROR GetPeerAddress(PeerId peerId, Transport::PeerAddress & addr); private: - OperationalDeviceProxy * FindSession(const SessionHandle & session) const; void ReleaseSession(OperationalDeviceProxy * device) const; CASESessionManagerConfig mConfig; diff --git a/src/app/OperationalDeviceProxy.h b/src/app/OperationalDeviceProxy.h index b588f84fbfb831..e01e8cf9adf9cd 100644 --- a/src/app/OperationalDeviceProxy.h +++ b/src/app/OperationalDeviceProxy.h @@ -179,8 +179,6 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, PeerId GetPeerId() const { return mPeerId; } - bool MatchesSession(const SessionHandle & session) const { return mSecureSession.Contains(session); } - CHIP_ERROR ShutdownSubscriptions() override; Messaging::ExchangeManager * GetExchangeManager() const override { return mInitParams.exchangeMgr; } diff --git a/src/app/OperationalDeviceProxyPool.h b/src/app/OperationalDeviceProxyPool.h index 194c325bf426a4..2b504c07b4b04b 100644 --- a/src/app/OperationalDeviceProxyPool.h +++ b/src/app/OperationalDeviceProxyPool.h @@ -33,8 +33,6 @@ class OperationalDeviceProxyPoolDelegate virtual void Release(OperationalDeviceProxy * device) = 0; - virtual OperationalDeviceProxy * FindDevice(const SessionHandle & session) = 0; - virtual OperationalDeviceProxy * FindDevice(PeerId peerId) = 0; virtual void ReleaseDevicesForFabric(CompressedFabricId compressedFabricId) = 0; @@ -63,21 +61,6 @@ class OperationalDeviceProxyPool : public OperationalDeviceProxyPoolDelegate void Release(OperationalDeviceProxy * device) override { mDevicePool.ReleaseObject(device); } - OperationalDeviceProxy * FindDevice(const SessionHandle & session) override - { - OperationalDeviceProxy * foundDevice = nullptr; - mDevicePool.ForEachActiveObject([&](auto * activeDevice) { - if (activeDevice->MatchesSession(session)) - { - foundDevice = activeDevice; - return Loop::Break; - } - return Loop::Continue; - }); - - return foundDevice; - } - OperationalDeviceProxy * FindDevice(PeerId peerId) override { OperationalDeviceProxy * foundDevice = nullptr; diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index d761951e58be42..07013eab5923f5 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -426,22 +426,6 @@ CHIP_ERROR DeviceCommissioner::Shutdown() return CHIP_NO_ERROR; } -CommissioneeDeviceProxy * DeviceCommissioner::FindCommissioneeDevice(const SessionHandle & session) -{ - MATTER_TRACE_EVENT_SCOPE("FindCommissioneeDevice", "DeviceCommissioner"); - CommissioneeDeviceProxy * foundDevice = nullptr; - mCommissioneeDevicePool.ForEachActiveObject([&](auto * deviceProxy) { - if (deviceProxy->MatchesSession(session)) - { - foundDevice = deviceProxy; - return Loop::Break; - } - return Loop::Continue; - }); - - return foundDevice; -} - CommissioneeDeviceProxy * DeviceCommissioner::FindCommissioneeDevice(NodeId id) { MATTER_TRACE_EVENT_SCOPE("FindCommissioneeDevice", "DeviceCommissioner"); diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index c31f7fdfee8d5e..fa25e0997a5a5f 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -730,7 +730,6 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, void HandleAttestationResult(CHIP_ERROR err); - CommissioneeDeviceProxy * FindCommissioneeDevice(const SessionHandle & session); CommissioneeDeviceProxy * FindCommissioneeDevice(NodeId id); CommissioneeDeviceProxy * FindCommissioneeDevice(const Transport::PeerAddress & peerAddress); void ReleaseCommissioneeDevice(CommissioneeDeviceProxy * device); diff --git a/src/controller/CommissioneeDeviceProxy.h b/src/controller/CommissioneeDeviceProxy.h index 62e4e0f61e1275..547868fe9f3dee 100644 --- a/src/controller/CommissioneeDeviceProxy.h +++ b/src/controller/CommissioneeDeviceProxy.h @@ -138,9 +138,6 @@ class CommissioneeDeviceProxy : public DeviceProxy, public SessionReleaseDelegat CHIP_ERROR SetPeerId(ByteSpan rcac, ByteSpan noc) override; const Transport::PeerAddress & GetPeerAddress() const { return mDeviceAddress; } - bool MatchesSession(const SessionHandle & session) const { return mSecureSession.Contains(session); } - - SessionHolder & GetSecureSessionHolder() { return mSecureSession; } chip::Optional GetSecureSession() const override { return mSecureSession.ToOptional(); } Messaging::ExchangeManager * GetExchangeManager() const override { return mExchangeMgr; } From 145d7bf80a4c433e45cbf5da4d3124b27e183764 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 29 Apr 2022 14:28:35 +0200 Subject: [PATCH 48/59] [Darwin] Remove auto generated tests (#17843) --- .../tests/CHIPTestClustersObjc-src.zapt | 2 +- .../tests/partials/test_cluster.zapt | 6 +- .../templates/tests/templates.json | 1 - scripts/tools/zap_regen_all.py | 7 +- .../Framework/CHIP.xcodeproj/project.pbxproj | 8 - .../Framework/CHIP/templates/templates.json | 10 - .../templates/tests/CHIPClustersTests.zapt | 237 - .../Framework/CHIP/templates/tests/helper.js | 35 - .../tests/partials/check_test_value.zapt | 53 - .../tests/partials/defined_value.zapt | 7 - .../tests/partials/test_cluster.zapt | 246 - .../templates/tests/partials/test_value.zapt | 43 - .../CHIP/templates/tests/templates.json | 45 - .../Framework/CHIP/templates/tests/tests.js | 313 - .../CHIP/zap-generated/CHIPTestClustersObjc.h | 1304 - .../zap-generated/CHIPTestClustersObjc.mm | 17157 ------ .../Framework/CHIPTests/CHIPClustersTests.m | 48493 ---------------- .../cluster/CHIPTestClustersObjc.mm | 2 +- .../zap-generated/test/Commands.h | 38 +- 19 files changed, 25 insertions(+), 67982 deletions(-) delete mode 100644 src/darwin/Framework/CHIP/templates/tests/CHIPClustersTests.zapt delete mode 100644 src/darwin/Framework/CHIP/templates/tests/helper.js delete mode 100644 src/darwin/Framework/CHIP/templates/tests/partials/check_test_value.zapt delete mode 100644 src/darwin/Framework/CHIP/templates/tests/partials/defined_value.zapt delete mode 100644 src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt delete mode 100644 src/darwin/Framework/CHIP/templates/tests/partials/test_value.zapt delete mode 100644 src/darwin/Framework/CHIP/templates/tests/templates.json delete mode 100644 src/darwin/Framework/CHIP/templates/tests/tests.js delete mode 100644 src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h delete mode 100644 src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm diff --git a/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt b/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt index a535be1a73dfd3..6ea0650e10aba2 100644 --- a/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt +++ b/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt @@ -9,7 +9,7 @@ #import "CHIPDevice_Internal.h" #import "zap-generated/tests/CHIPClustersTest.h" -#import "zap-generated/CHIPTestClustersObjc.h" +#import "zap-generated/cluster/CHIPTestClustersObjc.h" #include #include diff --git a/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt b/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt index fe95b6f59304c2..55ffd02d3c2eb0 100644 --- a/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt +++ b/examples/chip-tool-darwin/templates/tests/partials/test_cluster.zapt @@ -82,7 +82,7 @@ class {{filename}}: public TestCommandBridge {{#chip_tests_items}} {{#if async}} - bool testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase command}}_Fulfilled = false; + bool testSendCluster{{parent.filename}}_{{index}}_{{asUpperCamelCase command}}_Fulfilled = false; {{/if}} {{#chip_tests_item_responses}} {{#chip_tests_item_response_parameters}} @@ -140,7 +140,7 @@ class {{filename}}: public TestCommandBridge maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] params:params subscriptionEstablished:^{ - VerifyOrReturn(testSendCluster{{parent.filename}}_{{asTestIndex waitForReport.index}}_{{asUpperCamelCase waitForReport.command}}_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + VerifyOrReturn(testSendCluster{{parent.filename}}_{{waitForReport.index}}_{{asUpperCamelCase waitForReport.command}}_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); NextTest(); } reportHandler:^({{asObjectiveCClass attributeObject.type cluster forceList=attributeObject.isArray}} * _Nullable value, NSError * _Nullable err) { @@ -235,7 +235,7 @@ class {{filename}}: public TestCommandBridge {{#unless async}} NextTest(); {{else}} - testSendCluster{{parent.filename}}_{{asTestIndex ../index}}_{{asUpperCamelCase command}}_Fulfilled = true; + testSendCluster{{parent.filename}}_{{../index}}_{{asUpperCamelCase command}}_Fulfilled = true; {{/unless}} {{else}} {{! We're a subscription }} diff --git a/examples/chip-tool-darwin/templates/tests/templates.json b/examples/chip-tool-darwin/templates/tests/templates.json index f01e767b43121f..064fab84e08b67 100644 --- a/examples/chip-tool-darwin/templates/tests/templates.json +++ b/examples/chip-tool-darwin/templates/tests/templates.json @@ -9,7 +9,6 @@ "../../../../src/app/zap-templates/templates/chip/helper.js", "../../../../src/app/zap-templates/common/ClusterTestGeneration.js", "../../../../src/darwin/Framework/CHIP/templates/helper.js", - "../../../../src/darwin/Framework/CHIP/templates/tests/helper.js", "../helper.js", "tests.js" ], diff --git a/scripts/tools/zap_regen_all.py b/scripts/tools/zap_regen_all.py index b439df4f359038..7a876814dfce53 100755 --- a/scripts/tools/zap_regen_all.py +++ b/scripts/tools/zap_regen_all.py @@ -80,7 +80,7 @@ def setupArgumentsParser(): description='Generate content from ZAP files') parser.add_argument('--type', default='all', choices=['all', 'tests'], help='Choose which content type to generate (default: all)') - parser.add_argument('--tests', default='all', choices=['all', 'chip-tool', 'chip-tool-darwin', 'darwin', 'app1', 'app2'], + parser.add_argument('--tests', default='all', choices=['all', 'chip-tool', 'chip-tool-darwin', 'app1', 'app2'], help='When generating tests only target, Choose which tests to generate (default: all)') parser.add_argument('--dry-run', default=False, action='store_true', help="Don't do any generationl just log what targets would be generated (default: False)") @@ -145,11 +145,6 @@ def getTestsTemplatesTargets(test_target): 'zap': 'src/controller/data_model/controller-clusters.zap', 'template': 'examples/chip-tool-darwin/templates/tests/templates.json', 'output_dir': 'zzz_generated/chip-tool-darwin/zap-generated' - }, - 'darwin': { - 'zap': 'src/controller/data_model/controller-clusters.zap', - 'template': 'src/darwin/Framework/CHIP/templates/tests/templates.json', - 'output_dir': None } } diff --git a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj index 3b397fba31441e..fb9b6a2a6d63e3 100644 --- a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj @@ -7,8 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 1E16A90226B98AB700683C53 /* CHIPTestClustersObjc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1E16A8FA26B9835700683C53 /* CHIPTestClustersObjc.mm */; }; - 1E16A90326B98AF100683C53 /* CHIPTestClustersObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E16A8F926B9835600683C53 /* CHIPTestClustersObjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1E85730C265519AE0050A4D9 /* callback-stub.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E857307265519AE0050A4D9 /* callback-stub.cpp */; }; 1EB41B7B263C4CC60048E4C1 /* CHIPClustersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EB41B7A263C4CC60048E4C1 /* CHIPClustersTests.m */; }; 1EC3238D271999E2002A8BF0 /* cluster-objects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EC3238C271999E2002A8BF0 /* cluster-objects.cpp */; }; @@ -112,8 +110,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 1E16A8F926B9835600683C53 /* CHIPTestClustersObjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CHIPTestClustersObjc.h; path = "zap-generated/CHIPTestClustersObjc.h"; sourceTree = ""; }; - 1E16A8FA26B9835700683C53 /* CHIPTestClustersObjc.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CHIPTestClustersObjc.mm; path = "zap-generated/CHIPTestClustersObjc.mm"; sourceTree = ""; }; 1E857307265519AE0050A4D9 /* callback-stub.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "callback-stub.cpp"; path = "../../../../zzz_generated/controller-clusters/zap-generated/callback-stub.cpp"; sourceTree = ""; }; 1EB41B7A263C4CC60048E4C1 /* CHIPClustersTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CHIPClustersTests.m; sourceTree = ""; }; 1EC3238C271999E2002A8BF0 /* cluster-objects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "cluster-objects.cpp"; path = "../../../../zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp"; sourceTree = ""; }; @@ -250,8 +246,6 @@ 51B22C212740CB1D008D5055 /* CHIPCommandPayloadsObjc.h */, 51B22C1D2740CB0A008D5055 /* CHIPStructsObjc.h */, 1EC3238C271999E2002A8BF0 /* cluster-objects.cpp */, - 1E16A8F926B9835600683C53 /* CHIPTestClustersObjc.h */, - 1E16A8FA26B9835700683C53 /* CHIPTestClustersObjc.mm */, 1ED276DF26C57CF000547A89 /* CHIPCallbackBridge.mm */, 1E857307265519AE0050A4D9 /* callback-stub.cpp */, 1EC4CE6325CC276600D7304F /* CHIPClustersObjc.h */, @@ -394,7 +388,6 @@ 51B22C1E2740CB0A008D5055 /* CHIPStructsObjc.h in Headers */, 2CB7163B252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.h in Headers */, 5ACDDD7A27CD129700EFD68A /* CHIPAttributeCacheContainer.h in Headers */, - 1E16A90326B98AF100683C53 /* CHIPTestClustersObjc.h in Headers */, 5A6FEC9227B5669C00F25F42 /* CHIPDeviceControllerOverXPC.h in Headers */, 2C1B027B2641DB4E00780EF1 /* CHIPOperationalCredentialsDelegate.h in Headers */, 99D466E12798936D0089A18F /* CHIPCommissioningParameters.h in Headers */, @@ -561,7 +554,6 @@ 997DED162695343400975E97 /* CHIPThreadOperationalDataset.mm in Sources */, 27A53C1827FBC6920053F131 /* CHIPAttestationTrustStoreBridge.mm in Sources */, 998F287126D56940001846C6 /* CHIPP256KeypairBridge.mm in Sources */, - 1E16A90226B98AB700683C53 /* CHIPTestClustersObjc.mm in Sources */, 5136661428067D550025EDAE /* MatterControllerFactory.mm in Sources */, 51B22C2A2740CB47008D5055 /* CHIPCommandPayloadsObjc.mm in Sources */, 2C5EEEF7268A85C400CAE3D3 /* CHIPDeviceConnectionBridge.mm in Sources */, diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index 88c738ce8d2a19..cfd25795167387 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -87,16 +87,6 @@ "name": "Objc reflections of CHIP command payloads header", "output": "src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm" }, - { - "path": "../../../../../examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc.zapt", - "name": "Test Objc API Header", - "output": "src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h" - }, - { - "path": "../../../../../examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt", - "name": "Test Objc API", - "output": "src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm" - }, { "path": "CHIPAttributeTLVValueDecoder-src.zapt", "name": "Decode TLV attribute values into Objc objects", diff --git a/src/darwin/Framework/CHIP/templates/tests/CHIPClustersTests.zapt b/src/darwin/Framework/CHIP/templates/tests/CHIPClustersTests.zapt deleted file mode 100644 index 0423c35f3aff0b..00000000000000 --- a/src/darwin/Framework/CHIP/templates/tests/CHIPClustersTests.zapt +++ /dev/null @@ -1,237 +0,0 @@ -// -// CHIPClustersTests.m -// CHIPClustersTests -{{>header}} - -// module headers -#import -#import - -#import "CHIPErrorTestUtils.h" -#import "CHIPTestStorage.h" - -#import - -#import // For INFINITY - -// system dependencies -#import - -const uint16_t kPairingTimeoutInSeconds = 10; -const uint16_t kAddressResolveTimeoutInSeconds = 10; -const uint16_t kCASESetupTimeoutInSeconds = 30; -const uint16_t kTimeoutInSeconds = 20; -const uint64_t nodeId = 0x12344321; -const uint16_t kDiscriminator = 3840; -const uint32_t kSetupPINCode = 20202021; -const uint16_t kRemotePort = 5540; -const uint16_t kLocalPort = 5541; -NSString * kAddress = @"::1"; -static uint16_t kTestVendorId = 0xFFF1u; - -// This test suite reuses a device object to speed up the test process for CI. -// The following global variable holds the reference to the device object. -static CHIPDevice * mConnectedDevice; - -// Singleton controller we use. -static CHIPDeviceController * sController = nil; - -// Test Util APIs -void WaitForMs(XCTestExpectation * expectation, dispatch_queue_t queue, unsigned int ms) -{ - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, ms * NSEC_PER_MSEC), queue, ^{ - [expectation fulfill]; - }); -} - -void Log(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message){ - NSLog(@"%@", message); - [expectation fulfill]; -} - -// Stub for User Prompts for XCTests to run. -void UserPrompt(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message) { - [expectation fulfill]; -} - -// Stub for reboot target device. -void Reboot(XCTestExpectation * expectation, dispatch_queue_t queue, uint16_t discriminator) -{ - [expectation fulfill]; -} - -void WaitForCommissionee(XCTestExpectation * expectation, dispatch_queue_t queue, uint64_t deviceId) -{ - CHIPDeviceController * controller = sController; - XCTAssertNotNil(controller); - - [controller getConnectedDevice:deviceId - queue:dispatch_get_main_queue() - completionHandler:^(CHIPDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertEqual(error.code, 0); - [expectation fulfill]; - mConnectedDevice = device; - }]; -} - -CHIPDevice * GetConnectedDevice(void) -{ - XCTAssertNotNil(mConnectedDevice); - return mConnectedDevice; -} - -@interface CHIPToolPairingDelegate : NSObject -@property (nonatomic, strong) XCTestExpectation * expectation; -@end - -@implementation CHIPToolPairingDelegate -- (id)initWithExpectation:(XCTestExpectation *)expectation -{ - self = [super init]; - if (self) { - _expectation = expectation; - } - return self; -} - -- (void)onPairingComplete:(NSError *)error -{ - XCTAssertEqual(error.code, 0); - // Keep waiting for onCommissioningComplete -} - -- (void)onCommissioningComplete:(NSError *)error -{ - XCTAssertEqual(error.code, 0); - [_expectation fulfill]; - _expectation = nil; -} - -- (void)onAddressUpdated:(NSError *)error -{ - XCTAssertEqual(error.code, 0); - [_expectation fulfill]; - _expectation = nil; -} -@end - -@interface CHIPClustersTests : XCTestCase -@end - -@implementation CHIPClustersTests - -- (void)setUp { - [super setUp]; - [self setContinueAfterFailure:NO]; -} - -- (void)testInitStack -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Pairing Complete"]; - - __auto_type * factory = [MatterControllerFactory sharedInstance]; - XCTAssertNotNil(factory); - - __auto_type * storage = [[CHIPTestStorage alloc] init]; - __auto_type * factoryParams = [[MatterControllerFactoryParams alloc] initWithStorage:storage]; - factoryParams.port = @(kLocalPort); - - BOOL ok = [factory startup:factoryParams]; - XCTAssertTrue(ok); - - __auto_type * params = [[CHIPDeviceControllerStartupParams alloc] initWithKeypair:nil]; - params.vendorId = kTestVendorId; - params.fabricId = 1; - - // TODO: Once we have a non-nil keypair, use startControllerOnNewFabric. - CHIPDeviceController * controller = [factory startControllerOnExistingFabric:params]; - XCTAssertNotNil(controller); - - sController = controller; - - CHIPToolPairingDelegate * pairing = [[CHIPToolPairingDelegate alloc] initWithExpectation:expectation]; - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.pairing", DISPATCH_QUEUE_SERIAL); - - [controller setPairingDelegate:pairing queue:callbackQueue]; - - NSError * error; - [controller pairDevice:nodeId - address:kAddress - port:kRemotePort - discriminator:kDiscriminator - setupPINCode:kSetupPINCode - error:&error]; - XCTAssertEqual(error.code, 0); - - [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; - - __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; - [controller getConnectedDevice:nodeId - queue:dispatch_get_main_queue() - completionHandler:^(CHIPDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertEqual(error.code, 0); - [connectionExpectation fulfill]; - connectionExpectation = nil; - }]; - [self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil]; -} - -- (void)testShutdownStack -{ - CHIPDeviceController * controller = sController; - XCTAssertNotNil(controller); - - [controller shutdown]; - XCTAssertFalse([controller isRunning]); - - [[MatterControllerFactory sharedInstance] shutdown]; - XCTAssertFalse([[MatterControllerFactory sharedInstance] isRunning]); -} - -- (void)testReuseChipClusterObject -{ - CHIPDeviceController * controller = sController; - XCTAssertNotNil(controller); - - __block CHIPDevice * device; - __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; - [controller getConnectedDevice:nodeId - queue:dispatch_get_main_queue() - completionHandler:^(CHIPDevice * _Nullable retrievedDevice, NSError * _Nullable error) { - XCTAssertEqual(error.code, 0); - [connectionExpectation fulfill]; - connectionExpectation = nil; - device = retrievedDevice; - }]; - [self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil]; - - XCTestExpectation * expectation = [self expectationWithDescription:@"ReuseCHIPClusterObjectFirstCall"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster testWithCompletionHandler:^(NSError * err) { - NSLog(@"ReuseCHIPClusterObject test Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - expectation = [self expectationWithDescription:@"ReuseCHIPClusterObjectSecondCall"]; - - // Reuse the CHIPCluster Object for multiple times. - - [cluster testWithCompletionHandler:^(NSError * err) { - NSLog(@"ReuseCHIPClusterObject test Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -{{>test_cluster tests=(getTests)}} - -@end diff --git a/src/darwin/Framework/CHIP/templates/tests/helper.js b/src/darwin/Framework/CHIP/templates/tests/helper.js deleted file mode 100644 index b188e85b9656b4..00000000000000 --- a/src/darwin/Framework/CHIP/templates/tests/helper.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * In order to run the tests into an expected order, an index is - * added to the generated test step. This is because tests using - * the XCTest framework are expected to be independent and should - * normally run as independent steps. But since the current code is - * dealing with a simulated accessory running into its own process - * for the whole duration of the tests, its state is not resetted - * between each steps which defeats XCTest expectation. - */ -function asTestIndex(index) -{ - return index.toString().padStart(6, 0); -} - -// -// Module exports -// -exports.asTestIndex = asTestIndex; diff --git a/src/darwin/Framework/CHIP/templates/tests/partials/check_test_value.zapt b/src/darwin/Framework/CHIP/templates/tests/partials/check_test_value.zapt deleted file mode 100644 index 0cfd749c0cb034..00000000000000 --- a/src/darwin/Framework/CHIP/templates/tests/partials/check_test_value.zapt +++ /dev/null @@ -1,53 +0,0 @@ -{{#if (chip_tests_config_has expected)}} - {{! Just replace the value's name with the actual value in the rest of the processing~}} - {{>check_test_value target=target expected=(chip_tests_config_get_default_value expected) cluster=cluster depth=depth}} -{{else if isOptional}} - {{! This just means we expect a non-nil value. Go ahead and check the value, - stripping the optionality off. }} - {{>check_test_value actual=actual expected=expected cluster=cluster isOptional=false}} -{{else if isNullable}} - {{#if (isLiteralNull expected)}} - XCTAssertTrue({{actual}} == nil); - {{else}} - {{#if (chip_tests_variables_has expected)}} - {{! Expected value is also a nullable. }} - if ({{expected}} == nil) { - XCTAssertTrue({{actual}} == nil); - } else { - {{/if}} - XCTAssertFalse({{actual}} == nil); - {{>check_test_value actual=actual expected=expected cluster=cluster isNullable=false}} - {{#if (chip_tests_variables_has expected)}} - } - {{/if}} - {{/if}} -{{else if isArray}} - {{ensureIsArray expected~}} - XCTAssertEqual([{{actual}} count], {{expected.length}}); - {{#each expected}} - {{>check_test_value actual=(concat ../actual "[" @index "]") expected=this cluster=../cluster isArray=false type=../type parent=../parent}} - {{/each}} -{{else}} - {{#if_is_struct type}} - {{! Iterate over the actual types in the struct, so we pick up the right - type/optionality/nullability information for them for our recursive - call. }} - {{#zcl_struct_items_by_struct_name type}} - {{#if (hasProperty ../expected label)}} - {{>check_test_value actual=(concat "((CHIP" (asUpperCamelCase ../cluster) "Cluster" (asUpperCamelCase ../type) " *)" ../actual ")." (asStructPropertyName label)) expected=(lookup ../expected label) cluster=../cluster}} - {{/if}} - {{/zcl_struct_items_by_struct_name}} - {{! Maybe we should add a check for properties in the expected object (other - than "global") that are not present in the struct ? }} - {{else}} - {{#if (chip_tests_variables_has expected)}} - XCTAssertEqualObjects({{actual}}, {{expected}}); - {{else if (isOctetString type)}} - XCTAssertTrue([{{actual}} isEqualToData:[[NSData alloc] initWithBytes:"{{octetStringEscapedForCLiteral expected}}" length:{{expected.length}}]]); - {{else if (isCharString type)}} - XCTAssertTrue([{{actual}} isEqualToString:@"{{expected}}"]); - {{else}} - XCTAssertEqual([{{actual}} {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expected type}}); - {{/if}} - {{/if_is_struct}} -{{/if}} diff --git a/src/darwin/Framework/CHIP/templates/tests/partials/defined_value.zapt b/src/darwin/Framework/CHIP/templates/tests/partials/defined_value.zapt deleted file mode 100644 index 0b4a2db4a98048..00000000000000 --- a/src/darwin/Framework/CHIP/templates/tests/partials/defined_value.zapt +++ /dev/null @@ -1,7 +0,0 @@ -{{! If the defined value is the name of a config variable, just - substitute the value of the variable instead. }} -{{#if (chip_tests_config_has definedValue)~}} - {{chip_tests_config_get_default_value definedValue}} -{{~else~}} - {{definedValue}} -{{~/if}} diff --git a/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt b/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt deleted file mode 100644 index c6b388389700ca..00000000000000 --- a/src/darwin/Framework/CHIP/templates/tests/partials/test_cluster.zapt +++ /dev/null @@ -1,246 +0,0 @@ -{{#chip_tests tests useSynthesizeWaitForReport=true}} -{{#chip_tests_items}} -{{#if async}} -bool testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase command}}_Fulfilled = false; -{{/if}} -{{#chip_tests_item_responses}} -{{#chip_tests_item_response_parameters}} -{{#if saveAs}} -{{asObjectiveCType type ../cluster}} {{saveAs}}; -{{/if}} -{{/chip_tests_item_response_parameters}} -{{/chip_tests_item_responses}} - -{{~#*inline "subscribeDataCallback"}} -test_{{parent.filename}}_{{attribute}}_Reported -{{/inline}} -{{#if allocateSubscribeDataCallback}} -ResponseHandler {{> subscribeDataCallback}} = nil; -{{/if~}} - -- (void)testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase command}} -{ - {{#unless async}} - XCTestExpectation * expectation = [self expectationWithDescription:@"{{label}}"]; - {{/unless}} - -{{#if (isTestOnlyCluster cluster)}} - dispatch_queue_t queue = dispatch_get_main_queue(); - {{#if (isStrEqual command "UserPrompt")}} - {{! We only support the first arg, and our impl is a no-op anyway. }} - {{command}}(expectation, queue{{#chip_tests_item_parameters}}{{#first}}, {{#if (isString type)}}@"{{/if}}{{> defined_value}}{{#if (isString type)}}"{{/if}}{{/first}}{{/chip_tests_item_parameters}}); - {{else}} - {{command}}(expectation, queue{{#chip_tests_item_parameters}}, {{#if (isString type)}}@"{{/if}}{{> defined_value}}{{#if (isString type)}}"{{/if}}{{/chip_tests_item_parameters}}); - {{/if}} -{{else}} - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTest{{asUpperCamelCase cluster}} * cluster = [[CHIPTest{{asUpperCamelCase cluster}} alloc] initWithDevice:device endpoint:{{endpoint}} queue:queue]; - XCTAssertNotNil(cluster); - - {{#if isCommand}} - {{#if commandObject.arguments.length}} - __auto_type * params = [[CHIP{{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase command}}Params alloc] init]; - {{/if}} - {{#chip_tests_item_parameters}} - {{>test_value target=(concat "params." (asStructPropertyName label)) definedValue=definedValue cluster=parent.cluster depth=0}} - {{/chip_tests_item_parameters}} - [cluster {{asLowerCamelCase command}}With - {{~#if commandObject.arguments.length~}} - Params:params completionHandler: - {{else~}} - CompletionHandler: - {{/if}} - {{#if commandObject.hasSpecificResponse}} - ^(CHIP{{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase commandObject.responseName}}Params * _Nullable values, NSError * _Nullable err) { - {{else}} - ^(NSError * _Nullable err) { - {{/if}} - {{else if isSubscribeAttribute}} - {{#chip_tests_item_parameters}} - {{asObjectiveCBasicType type}} {{asLowerCamelCase name}}Argument = {{asTypedLiteral definedValue type}}; - {{/chip_tests_item_parameters}} - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:{{fabricFiltered}}]; - [cluster subscribeAttribute{{asUpperCamelCase attribute}}WithMinInterval:@(minIntervalArgument) - maxInterval:@(maxIntervalArgument) - params:params - subscriptionEstablished:^{ - XCTAssertEqual(testSendCluster{{parent.filename}}_{{asTestIndex waitForReport.index}}_{{asUpperCamelCase waitForReport.command}}_Fulfilled, true); - [expectation fulfill]; - } - reportHandler:^({{asObjectiveCClass attributeObject.type cluster forceList=attributeObject.isArray}} * _Nullable value, NSError * _Nullable err) { - {{else if isWaitForReport}} - {{> subscribeDataCallback }} = ^({{asObjectiveCClass attributeObject.type cluster forceList=attributeObject.isArray}} * _Nullable value, NSError * _Nullable err) { - {{else if isReadAttribute}} - {{#if_is_fabric_scoped_struct attributeObject.type}} - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:{{fabricFiltered}}]; - [cluster readAttribute{{asUpperCamelCase attribute}}WithParams:params completionHandler: - {{else}} - [cluster readAttribute{{asUpperCamelCase attribute}}WithCompletionHandler: - {{/if_is_fabric_scoped_struct}} - ^({{asObjectiveCClass attributeObject.type cluster forceList=attributeObject.isArray}} * _Nullable value, NSError * _Nullable err) { - {{else if isWriteAttribute}} - {{#chip_tests_item_parameters}} - id {{asLowerCamelCase name}}Argument; - {{>test_value target=(concat (asLowerCamelCase name) "Argument") definedValue=definedValue cluster=parent.cluster depth=0}} - {{/chip_tests_item_parameters}} - [cluster writeAttribute{{asUpperCamelCase attribute}}WithValue:{{#chip_tests_item_parameters}}{{asLowerCamelCase name}}Argument{{/chip_tests_item_parameters}} completionHandler:^(NSError * _Nullable err) { - {{/if}} - {{#chip_tests_item_responses}} - NSLog(@"{{../label}} Error: %@", err); - - {{#if optional}} - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - {{/if}} - - {{#if error}} - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], {{error}}); - [expectation fulfill]; - {{else}} - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - {{#unless isSubscribeAttribute}} - - {{#chip_tests_item_response_parameters}} - {{#*inline "actualValue"}} - {{#if parent.isAttribute}} - id actualValue = value; - {{else}} - id actualValue = values.{{asStructPropertyName name}}; - {{/if}} - {{/inline}} - {{#if hasExpectedValue}} - { - {{> actualValue}} - {{>check_test_value actual="actualValue" expected=expectedValue cluster=../cluster}} - } - {{/if}} - {{#if hasExpectedConstraints}} - {{#if (hasProperty expectedConstraints "minLength")}} - { - {{> actualValue}} - XCTAssertGreaterThanOrEqual([actualValue length], {{expectedConstraints.minLength}}); - } - {{/if}} - {{#if (hasProperty expectedConstraints "startsWith")}} - { - {{> actualValue}} - XCTAssertTrue([actualValue hasPrefix:@"{{expectedConstraints.startsWith}}"]); - } - {{/if}} - {{#if (hasProperty expectedConstraints "endsWith")}} - { - {{> actualValue}} - XCTAssertTrue([actualValue hasSuffix:@"{{expectedConstraints.endsWith}}"]); - } - {{/if}} - {{#if (hasProperty expectedConstraints "isLowerCase")}} - { - {{> actualValue}} - BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]]; - XCTAssert{{#if (isStrEqual "true" expectedConstraints.isLowerCase)}}True{{else}}False{{/if}}(isLowerCase); - } - {{/if}} - {{#if (hasProperty expectedConstraints "isUpperCase")}} - { - {{> actualValue}} - BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]]; - XCTAssert{{#if (isStrEqual "true" expectedConstraints.isUpperCase)}}True{{else}}False{{/if}}(isUpperCase); - } - {{/if}} - {{#if (hasProperty expectedConstraints "isHexString")}} - { - {{> actualValue}} - NSCharacterSet *chars = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet]; - BOOL isHexString = (NSNotFound == [actualValue rangeOfCharacterFromSet:chars].location); - XCTAssert{{#if (isStrEqual "true" expectedConstraints.isHexString)}}True{{else}}False{{/if}}(isHexString); - } - {{/if}} - {{#if (hasProperty expectedConstraints "maxLength")}} - { - {{> actualValue}} - XCTAssertLessThanOrEqual([actualValue length], {{expectedConstraints.maxLength}}); - } - {{/if}} - {{#if (hasProperty expectedConstraints "minValue")}} - { - {{> actualValue}} - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.minValue type}}); - } - } - {{/if}} - {{#if (hasProperty expectedConstraints "maxValue")}} - { - {{> actualValue}} - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.maxValue type}}); - } - } - {{/if}} - {{#if (hasProperty expectedConstraints "notValue")}} - { - {{> actualValue}} - {{#if (isLiteralNull expectedConstraints.notValue)}} - XCTAssertFalse(actualValue == nil); - {{else}} - {{#if (chip_tests_variables_has expectedConstraints.notValue)}} - XCTAssertNotEqualObjects(actualValue, {{expectedConstraints.notValue}}); - {{else}} - if (actualValue != nil) { - {{#if (isString type)}} - XCTAssertNotEqualObjects(actualValue, {{expectedConstraints.notValue}}); - {{else}} - XCTAssertNotEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.notValue type}}); - {{/if}} - } - {{/if}} - {{/if}} - } - {{/if}} - {{/if}} - {{#if saveAs}} - { - {{> actualValue}} - {{saveAs}} = actualValue; - } - {{/if}} - {{/chip_tests_item_response_parameters}} - - {{#unless async}} - [expectation fulfill]; - {{else}} - testSendCluster{{parent.filename}}_{{asTestIndex ../index}}_{{asUpperCamelCase command}}_Fulfilled = true; - {{/unless}} - {{else}} - {{! We're a subscription }} - if ({{> subscribeDataCallback}} != nil) { - ResponseHandler callback = {{> subscribeDataCallback}}; - {{> subscribeDataCallback}} = nil; - callback(value, err); - } - {{/unless}} - {{/if}} - {{/chip_tests_item_responses}} - }{{#unless isWaitForReport}}]{{/unless}}; - -{{/if}} - {{#unless async}} - {{#*inline "minCommandTimeout"~}} - {{#if (isTestOnlyCluster cluster)~}} - {{#if (isStrEqual command "WaitForMs")~}} - {{#chip_tests_item_parameters}}{{#if (isStrEqual name "ms")}}({{> defined_value}} / 1000) + {{/if}}{{/chip_tests_item_parameters}} - {{~/if}} - {{~/if}} - {{~/inline}} - [self waitForExpectationsWithTimeout:{{#if stepTimeoutSecs}}{{stepTimeoutSecs}}{{else}}{{> minCommandTimeout}}kTimeoutInSeconds{{/if}} handler:nil]; - {{/unless}} -} -{{/chip_tests_items}} - -{{/chip_tests}} - diff --git a/src/darwin/Framework/CHIP/templates/tests/partials/test_value.zapt b/src/darwin/Framework/CHIP/templates/tests/partials/test_value.zapt deleted file mode 100644 index 77438fd32fb7f3..00000000000000 --- a/src/darwin/Framework/CHIP/templates/tests/partials/test_value.zapt +++ /dev/null @@ -1,43 +0,0 @@ -{{#if (chip_tests_config_has definedValue)}} - {{! Just replace the value's name with the actual value in the rest of the processing~}} - {{>test_value target=target definedValue=(chip_tests_config_get_default_value definedValue) cluster=cluster depth=depth}} -{{else if isOptional}} - {{! Just go ahead and assign to the value, stripping the optionality bit off. }} - {{>test_value target=target definedValue=definedValue cluster=cluster isOptional=false depth=(incrementDepth depth)}} -{{else if isNullable}} - {{#if (isLiteralNull definedValue)}} - {{target}} = nil; - {{else}} - {{>test_value target=target definedValue=definedValue cluster=cluster isNullable=false depth=(incrementDepth depth)}} - {{/if}} -{{else if isArray}} - {{ensureIsArray definedValue~}} - { - NSMutableArray * temp_{{depth}} = [[NSMutableArray alloc] init]; - {{#each definedValue}} - {{>test_value target=(concat "temp_" ../depth "[" @index "]") definedValue=this cluster=../cluster depth=(incrementDepth ../depth) type=../type isArray=false parent=../parent}} - {{/each}} - {{target}} = temp_{{depth}}; - } -{{else}} - {{#if_is_struct type}} - {{target}} = [[CHIP{{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} alloc] init]; - {{#zcl_struct_items_by_struct_name type}} - {{#if_include_struct_item_value ../definedValue name}} - {{! target may be some place where we lost type information (e.g. an - id), so add explicit cast when trying to assign to our - properties. }} - {{>test_value target=(concat "((CHIP" (asUpperCamelCase ../cluster) "Cluster" (asUpperCamelCase ../type) " *)" ../target ")." (asStructPropertyName label)) definedValue=(lookup ../definedValue name) cluster=../cluster depth=(incrementDepth ../depth)}} - {{/if_include_struct_item_value}} - {{/zcl_struct_items_by_struct_name}} - - {{else if (chip_tests_variables_has definedValue)}} - {{target}} = [{{definedValue}} copy]; - {{else if (isCharString type)}} - {{target}} = @"{{definedValue}}"; - {{else if (isOctetString type)}} - {{target}} = [[NSData alloc] initWithBytes:"{{octetStringEscapedForCLiteral definedValue}}" length:{{definedValue.length}}]; - {{else}} - {{target}} = [NSNumber numberWith{{asObjectiveCNumberType definedValue type false}}:{{asTypedLiteral definedValue type}}]; - {{/if_is_struct}} -{{/if}} diff --git a/src/darwin/Framework/CHIP/templates/tests/templates.json b/src/darwin/Framework/CHIP/templates/tests/templates.json deleted file mode 100644 index b095c453edab58..00000000000000 --- a/src/darwin/Framework/CHIP/templates/tests/templates.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "Framework Tests templates", - "version": "chip-v1", - "helpers": [ - "../../../../../../src/app/zap-templates/partials/helper.js", - "../../../../../../src/app/zap-templates/common/ChipTypesHelper.js", - "../../../../../../src/app/zap-templates/common/StringHelper.js", - "../../../../../../src/app/zap-templates/templates/app/helper.js", - "../../../../../../src/app/zap-templates/templates/chip/helper.js", - "../../../../../../src/app/zap-templates/common/ClusterTestGeneration.js", - "../helper.js", - "helper.js", - "tests.js" - ], - "override": "../../../../../../src/app/zap-templates/common/override.js", - "partials": [ - { - "name": "header", - "path": "../../../../../../src/app/zap-templates/partials/header.zapt" - }, - { - "name": "test_cluster", - "path": "partials/test_cluster.zapt" - }, - { - "name": "test_value", - "path": "partials/test_value.zapt" - }, - { - "name": "check_test_value", - "path": "partials/check_test_value.zapt" - }, - { - "name": "defined_value", - "path": "partials/defined_value.zapt" - } - ], - "templates": [ - { - "path": "CHIPClustersTests.zapt", - "name": "Cluster Tests", - "output": "src/darwin/Framework/CHIPTests/CHIPClustersTests.m" - } - ] -} diff --git a/src/darwin/Framework/CHIP/templates/tests/tests.js b/src/darwin/Framework/CHIP/templates/tests/tests.js deleted file mode 100644 index 270878ced0ff93..00000000000000 --- a/src/darwin/Framework/CHIP/templates/tests/tests.js +++ /dev/null @@ -1,313 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function getManualTests() -{ - return []; -} - -function getTests() -{ - const AccessControl = [ - 'TestAccessControlCluster', - ]; - - const BinaryInput = [ - 'Test_TC_BI_1_1', - 'Test_TC_BI_2_1', - 'Test_TC_BI_2_2', - ]; - - const BooleanState = [ - 'Test_TC_BOOL_2_1', - ]; - - const BridgedActions = [ - 'Test_TC_BRAC_1_1', - ]; - - const ColorControl = [ - 'Test_TC_CC_2_1', - 'Test_TC_CC_3_1', - 'Test_TC_CC_3_2', - 'Test_TC_CC_3_3', - 'Test_TC_CC_4_1', - 'Test_TC_CC_4_2', - 'Test_TC_CC_4_3', - 'Test_TC_CC_4_4', - 'Test_TC_CC_5_1', - 'Test_TC_CC_5_2', - 'Test_TC_CC_5_3', - 'Test_TC_CC_6_1', - 'Test_TC_CC_6_2', - 'Test_TC_CC_6_3', - 'Test_TC_CC_7_1', - 'Test_TC_CC_7_2', - 'Test_TC_CC_7_3', - 'Test_TC_CC_7_4', - 'Test_TC_CC_8_1', - 'Test_TC_CC_9_1', - 'Test_TC_CC_9_2', - 'Test_TC_CC_9_3', - ]; - - const DeviceDiscovery = [ - 'Test_TC_DD_1_5', - 'Test_TC_DD_1_6', - 'Test_TC_DD_1_7', - 'Test_TC_DD_1_8', - 'Test_TC_DD_1_9', - ]; - - const DeviceManagement = [ - 'Test_TC_DM_1_1', - 'Test_TC_DM_3_1', - ]; - - const DoorLock = [ - 'Test_TC_DL_1_3', - ]; - - const ElectricalMeasurement = [ - 'Test_TC_EMR_1_1', - ]; - - const EthernetNetworkDiagnostics = [ - 'Test_TC_ETHDIAG_1_1', - 'Test_TC_ETHDIAG_2_1', - ]; - - const FlowMeasurement = [ - 'Test_TC_FLW_2_1', - 'Test_TC_FLW_2_2', - ]; - - const GeneralCommissioning = [ - 'Test_TC_GC_1_1', - ]; - - const Identify = [ - 'Test_TC_I_2_1', - 'Test_TC_I_2_3', - ]; - - const IlluminanceMeasurement = [ - 'Test_TC_ILL_2_1', - ]; - - const OccupancySensing = [ - 'Test_TC_OCC_2_1', - 'Test_TC_OCC_2_2', - ]; - - const LevelControl = [ - 'Test_TC_LVL_2_1', - 'Test_TC_LVL_2_2', - 'Test_TC_LVL_3_1', - 'Test_TC_LVL_4_1', - 'Test_TC_LVL_5_1', - 'Test_TC_LVL_6_1', - ]; - - const MediaControl = [ - 'Test_TC_MC_2_1', - 'Test_TC_MC_3_6', - 'Test_TC_MC_3_7', - 'Test_TC_MC_3_8', - 'Test_TC_MC_3_9', - 'Test_TC_MC_3_10', - 'Test_TC_MC_3_11', - 'Test_TC_MC_5_1', - 'Test_TC_MC_5_2', - 'Test_TC_MC_5_3', - 'Test_TC_MC_6_1', - 'Test_TC_MC_6_2', - 'Test_TC_MC_6_3', - 'Test_TC_MC_6_4', - 'Test_TC_MC_7_1', - 'Test_TC_MC_7_2', - 'Test_TC_MC_8_1', - 'Test_TC_MC_9_1', - 'Test_TC_MC_10_1', - ]; - - const ModeSelect = [ - 'Test_TC_MOD_1_1', - ]; - - const OnOff = [ - 'Test_TC_OO_2_1', 'Test_TC_OO_2_2', 'Test_TC_OO_2_3', - // 'Test_TC_OO_2_4', Disable this Test for now as Darwin does not support reboot commands currently - ]; - - const PowerSource = [ - 'Test_TC_PS_2_1', - ]; - - const PressureMeasurement = [ - 'Test_TC_PRS_2_1', - ]; - - const PumpConfigurationControl = [ - 'Test_TC_PCC_1_1', - 'Test_TC_PCC_2_1', - 'Test_TC_PCC_2_2', - 'Test_TC_PCC_2_3', - 'Test_TC_PCC_2_4', - ]; - - const PowerSourceConfiguration = [ - 'Test_TC_PSCFG_1_1', - ]; - - const RelativeHumidityMeasurement = [ - 'Test_TC_RH_2_2', - ]; - - const Switch = [ - 'Test_TC_SWTCH_2_1', - 'Test_TC_SWTCH_2_2', - ]; - - const TemperatureMeasurement = [ - 'Test_TC_TM_2_1', - 'Test_TC_TM_2_2', - ]; - - const Thermostat = [ - 'Test_TC_TSTAT_1_1', - 'Test_TC_TSTAT_2_1', - 'Test_TC_TSTAT_2_2', - ]; - - const ThermostatUserConfiguration = [ - 'Test_TC_TSUIC_2_1', - 'Test_TC_TSUIC_2_2', - ]; - - const ThreadNetworkDiagnostics = [ - 'Test_TC_DIAG_TH_NW_1_1', - 'Test_TC_DIAG_TH_NW_1_2', - ]; - - const UserLabel = [ - 'Test_TC_LC_1_2', - ]; - - const WiFiNetworkDiagnostics = [ - 'Test_TC_WIFIDIAG_1_1', - 'Test_TC_WIFIDIAG_3_1', - ]; - - const WindowCovering = [ - // WindowCovering is make uses of multiples "subscribeAttribute", but it triggers - // some failures on darwin supposely because the ReadClient stays open for the - // whole duration of the tests and that goes past some internal limits. - // Because of this, some of the tests are disabled on darwin. - 'Test_TC_WNCV_1_1', - 'Test_TC_WNCV_2_1', - 'Test_TC_WNCV_2_2', - 'Test_TC_WNCV_2_3', - 'Test_TC_WNCV_2_4', - 'Test_TC_WNCV_2_5', - //'Test_TC_WNCV_3_1', - //'Test_TC_WNCV_3_2', - //'Test_TC_WNCV_3_3', - 'Test_TC_WNCV_3_4', - 'Test_TC_WNCV_3_5', - 'Test_TC_WNCV_4_1', - 'Test_TC_WNCV_4_2', - 'Test_TC_WNCV_4_3', - 'Test_TC_WNCV_4_4', - ]; - - const Others = [ - 'TestCluster', - 'TestSaveAs', - 'TestConstraints', - 'TestDelayCommands', - 'TestDescriptorCluster', - // TestBasicInformation needs support for Reboot with no discriminator - //'TestBasicInformation', - // TestGeneralCommissioning does reboots that need to have side-effects, so - // can't be tested in this test framework. - //'TestGeneralCommissioning', - 'TestGroupsCluster', - 'TestGroupKeyManagementCluster', - 'TestIdentifyCluster', - 'TestLogCommands', - 'TestOperationalCredentialsCluster', - // 'TestSelfFabricRemoval', --> TODO: Integrate here when Darwin can live with current fabric going away - 'TestBinding', - 'TestUserLabelCluster', - ]; - - const SoftwareDiagnostics = [ - 'Test_TC_SWDIAG_1_1', - 'Test_TC_SWDIAG_2_1', - 'Test_TC_SWDIAG_3_1', - ]; - - const Subscriptions = [ - 'TestSubscribe_OnOff', - ]; - - const tests = [ - AccessControl, // - BinaryInput, // - BooleanState, // - BridgedActions, // - ColorControl, // - DeviceDiscovery, // - DeviceManagement, // - DoorLock, // - ElectricalMeasurement, // - EthernetNetworkDiagnostics, // - FlowMeasurement, // - GeneralCommissioning, // - Identify, // - IlluminanceMeasurement, // - LevelControl, // - MediaControl, // - ModeSelect, // - OccupancySensing, // - OnOff, // - PowerSource, // - PressureMeasurement, // - PumpConfigurationControl, // - PowerSourceConfiguration, // - RelativeHumidityMeasurement, // - Switch, // - TemperatureMeasurement, // - Thermostat, // - ThermostatUserConfiguration, // - ThreadNetworkDiagnostics, // - UserLabel, // - WiFiNetworkDiagnostics, // - WindowCovering, // - Others, // - SoftwareDiagnostics, // - Subscriptions, // - ]; - return tests.flat(1); -} - -// -// Module exports -// -exports.getTests = getTests; -exports.getManualTests = getManualTests; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h deleted file mode 100644 index f5a0ebf1e25ae0..00000000000000 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ /dev/null @@ -1,1304 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// THIS FILE IS GENERATED BY ZAP - -#import - -@class CHIPDevice; - -NS_ASSUME_NONNULL_BEGIN - -/** - * Cluster Access Control - * - */ -@interface CHIPTestAccessControl : CHIPAccessControl - -- (void)writeAttributeSubjectsPerAccessControlEntryWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTargetsPerAccessControlEntryWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAccessControlEntriesPerFabricWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Account Login - * - */ -@interface CHIPTestAccountLogin : CHIPAccountLogin - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster AdministratorCommissioning - * - */ -@interface CHIPTestAdministratorCommissioning : CHIPAdministratorCommissioning - -- (void)writeAttributeWindowStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAdminFabricIndexWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAdminVendorIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Application Basic - * - */ -@interface CHIPTestApplicationBasic : CHIPApplicationBasic - -- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeVendorIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeApplicationNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeApplicationWithValue:(CHIPApplicationBasicClusterApplicationBasicApplication * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeApplicationVersionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAllowedVendorListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Application Launcher - * - */ -@interface CHIPTestApplicationLauncher : CHIPApplicationLauncher - -- (void)writeAttributeCatalogListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Audio Output - * - */ -@interface CHIPTestAudioOutput : CHIPAudioOutput - -- (void)writeAttributeOutputListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentOutputWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Barrier Control - * - */ -@interface CHIPTestBarrierControl : CHIPBarrierControl - -- (void)writeAttributeBarrierMovingStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBarrierSafetyStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBarrierCapabilitiesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBarrierPositionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Basic - * - */ -@interface CHIPTestBasic : CHIPBasic - -- (void)writeAttributeDataModelRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeVendorIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeHardwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeHardwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSoftwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSoftwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeManufacturingDateWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePartNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductURLWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSerialNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeReachableWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeUniqueIDWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCapabilityMinimaWithValue:(CHIPBasicClusterCapabilityMinimaStruct * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Binary Input (Basic) - * - */ -@interface CHIPTestBinaryInputBasic : CHIPBinaryInputBasic - -- (void)writeAttributeStatusFlagsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Binding - * - */ -@interface CHIPTestBinding : CHIPBinding - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Boolean State - * - */ -@interface CHIPTestBooleanState : CHIPBooleanState - -- (void)writeAttributeStateValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Bridged Actions - * - */ -@interface CHIPTestBridgedActions : CHIPBridgedActions - -- (void)writeAttributeActionListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeEndpointListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSetupUrlWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Bridged Device Basic - * - */ -@interface CHIPTestBridgedDeviceBasic : CHIPBridgedDeviceBasic - -- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeVendorIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeHardwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeHardwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSoftwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSoftwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeManufacturingDateWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePartNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductURLWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSerialNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeReachableWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeUniqueIDWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Channel - * - */ -@interface CHIPTestChannel : CHIPChannel - -- (void)writeAttributeChannelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeLineupWithValue:(CHIPChannelClusterLineupInfo * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentChannelWithValue:(CHIPChannelClusterChannelInfo * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Color Control - * - */ -@interface CHIPTestColorControl : CHIPColorControl - -- (void)writeAttributeCurrentHueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentSaturationWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRemainingTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentXWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentYWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeDriftCompensationWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCompensationTextWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNumberOfPrimariesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary1XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary1YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary1IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary2XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary2YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary2IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary3XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary3YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary3IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary4XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary4YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary4IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary5XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary5YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary5IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary6XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary6YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePrimary6IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeEnhancedCurrentHueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeEnhancedColorModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorLoopActiveWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorLoopDirectionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorLoopTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorLoopStartEnhancedHueWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorLoopStoredEnhancedHueWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorCapabilitiesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorTempPhysicalMinWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeColorTempPhysicalMaxWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCoupleColorTempToLevelMinMiredsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Content Launcher - * - */ -@interface CHIPTestContentLauncher : CHIPContentLauncher - -- (void)writeAttributeAcceptHeaderWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Descriptor - * - */ -@interface CHIPTestDescriptor : CHIPDescriptor - -- (void)writeAttributeDeviceListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeServerListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClientListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePartsListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Diagnostic Logs - * - */ -@interface CHIPTestDiagnosticLogs : CHIPDiagnosticLogs - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Door Lock - * - */ -@interface CHIPTestDoorLock : CHIPDoorLock - -- (void)writeAttributeLockStateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeLockTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActuatorEnabledWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeDoorStateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNumberOfTotalUsersSupportedWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNumberOfPINUsersSupportedWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNumberOfRFIDUsersSupportedWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNumberOfWeekDaySchedulesSupportedPerUserWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNumberOfYearDaySchedulesSupportedPerUserWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNumberOfHolidaySchedulesSupportedWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxPINCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMinPINCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxRFIDCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMinRFIDCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSupportedOperatingModesWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Electrical Measurement - * - */ -@interface CHIPTestElectricalMeasurement : CHIPElectricalMeasurement - -- (void)writeAttributeMeasurementTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTotalActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRmsVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRmsVoltageMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRmsVoltageMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRmsCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRmsCurrentMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRmsCurrentMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActivePowerMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActivePowerMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Ethernet Network Diagnostics - * - */ -@interface CHIPTestEthernetNetworkDiagnostics : CHIPEthernetNetworkDiagnostics - -- (void)writeAttributePHYRateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFullDuplexWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePacketRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePacketTxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxErrCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCollisionCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCarrierDetectWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTimeSinceResetWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Fan Control - * - */ -@interface CHIPTestFanControl : CHIPFanControl - -- (void)writeAttributePercentCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSpeedMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSpeedCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRockSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeWindSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Fixed Label - * - */ -@interface CHIPTestFixedLabel : CHIPFixedLabel - -- (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Flow Measurement - * - */ -@interface CHIPTestFlowMeasurement : CHIPFlowMeasurement - -- (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)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster General Commissioning - * - */ -@interface CHIPTestGeneralCommissioning : CHIPGeneralCommissioning - -- (void)writeAttributeBasicCommissioningInfoWithValue:(CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRegulatoryConfigWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeLocationCapabilityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSupportsConcurrentConnectionWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster General Diagnostics - * - */ -@interface CHIPTestGeneralDiagnostics : CHIPGeneralDiagnostics - -- (void)writeAttributeNetworkInterfacesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRebootCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeUpTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTotalOperationalHoursWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBootReasonsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActiveHardwareFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActiveRadioFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActiveNetworkFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Group Key Management - * - */ -@interface CHIPTestGroupKeyManagement : CHIPGroupKeyManagement - -- (void)writeAttributeGroupTableWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxGroupsPerFabricWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxGroupKeysPerFabricWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Groups - * - */ -@interface CHIPTestGroups : CHIPGroups - -- (void)writeAttributeNameSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Identify - * - */ -@interface CHIPTestIdentify : CHIPIdentify - -- (void)writeAttributeIdentifyTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Illuminance Measurement - * - */ -@interface CHIPTestIlluminanceMeasurement : CHIPIlluminanceMeasurement - -- (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)writeAttributeLightSensorTypeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Keypad Input - * - */ -@interface CHIPTestKeypadInput : CHIPKeypadInput - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Level Control - * - */ -@interface CHIPTestLevelControl : CHIPLevelControl - -- (void)writeAttributeCurrentLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRemainingTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMinFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Localization Configuration - * - */ -@interface CHIPTestLocalizationConfiguration : CHIPLocalizationConfiguration - -- (void)writeAttributeSupportedLocalesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Low Power - * - */ -@interface CHIPTestLowPower : CHIPLowPower - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Media Input - * - */ -@interface CHIPTestMediaInput : CHIPMediaInput - -- (void)writeAttributeInputListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentInputWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Media Playback - * - */ -@interface CHIPTestMediaPlayback : CHIPMediaPlayback - -- (void)writeAttributeCurrentStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeStartTimeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeDurationWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSampledPositionWithValue:(CHIPMediaPlaybackClusterPlaybackPosition * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePlaybackSpeedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSeekRangeEndWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSeekRangeStartWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Mode Select - * - */ -@interface CHIPTestModeSelect : CHIPModeSelect - -- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeStandardNamespaceWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSupportedModesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Network Commissioning - * - */ -@interface CHIPTestNetworkCommissioning : CHIPNetworkCommissioning - -- (void)writeAttributeMaxNetworksWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNetworksWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeScanMaxTimeSecondsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeConnectMaxTimeSecondsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeLastNetworkingStatusWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeLastNetworkIDWithValue:(NSData * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeLastConnectErrorValueWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster OTA Software Update Provider - * - */ -@interface CHIPTestOtaSoftwareUpdateProvider : CHIPOtaSoftwareUpdateProvider - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster OTA Software Update Requestor - * - */ -@interface CHIPTestOtaSoftwareUpdateRequestor : CHIPOtaSoftwareUpdateRequestor - -- (void)writeAttributeUpdatePossibleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeUpdateStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeUpdateStateProgressWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Occupancy Sensing - * - */ -@interface CHIPTestOccupancySensing : CHIPOccupancySensing - -- (void)writeAttributeOccupancyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeOccupancySensorTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeOccupancySensorTypeBitmapWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster On/Off - * - */ -@interface CHIPTestOnOff : CHIPOnOff - -- (void)writeAttributeOnOffWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGlobalSceneControlWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster On/off Switch Configuration - * - */ -@interface CHIPTestOnOffSwitchConfiguration : CHIPOnOffSwitchConfiguration - -- (void)writeAttributeSwitchTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Operational Credentials - * - */ -@interface CHIPTestOperationalCredentials : CHIPOperationalCredentials - -- (void)writeAttributeNOCsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFabricsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSupportedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCommissionedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTrustedRootCertificatesWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentFabricIndexWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Power Source - * - */ -@interface CHIPTestPowerSource : CHIPPowerSource - -- (void)writeAttributeStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeOrderWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBatteryVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBatteryPercentRemainingWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBatteryTimeRemainingWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBatteryChargeLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActiveBatteryFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBatteryChargeStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Power Source Configuration - * - */ -@interface CHIPTestPowerSourceConfiguration : CHIPPowerSourceConfiguration - -- (void)writeAttributeSourcesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Pressure Measurement - * - */ -@interface CHIPTestPressureMeasurement : CHIPPressureMeasurement - -- (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)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Pump Configuration and Control - * - */ -@interface CHIPTestPumpConfigurationAndControl : CHIPPumpConfigurationAndControl - -- (void)writeAttributeMaxPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxSpeedWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxFlowWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMinConstPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxConstPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMinCompPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxCompPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMinConstSpeedWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxConstSpeedWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMinConstFlowWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxConstFlowWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMinConstTempWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMaxConstTempWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePumpStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeEffectiveOperationModeWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeEffectiveControlModeWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCapacityWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSpeedWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePowerWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAlarmMaskWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Relative Humidity Measurement - * - */ -@interface CHIPTestRelativeHumidityMeasurement : CHIPRelativeHumidityMeasurement - -- (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)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Scenes - * - */ -@interface CHIPTestScenes : CHIPScenes - -- (void)writeAttributeSceneCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentSceneWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentGroupWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSceneValidWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNameSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Software Diagnostics - * - */ -@interface CHIPTestSoftwareDiagnostics : CHIPSoftwareDiagnostics - -- (void)writeAttributeThreadMetricsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentHeapFreeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentHeapUsedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentHeapHighWatermarkWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Switch - * - */ -@interface CHIPTestSwitch : CHIPSwitch - -- (void)writeAttributeNumberOfPositionsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMultiPressMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Target Navigator - * - */ -@interface CHIPTestTargetNavigator : CHIPTargetNavigator - -- (void)writeAttributeTargetListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentTargetWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Temperature Measurement - * - */ -@interface CHIPTestTemperatureMeasurement : CHIPTemperatureMeasurement - -- (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; - -@end - -/** - * Cluster Test Cluster - * - */ -@interface CHIPTestTestCluster : CHIPTestCluster - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Thermostat - * - */ -@interface CHIPTestThermostat : CHIPThermostat - -- (void)writeAttributeLocalTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAbsMinHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAbsMaxHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAbsMinCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAbsMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeStartOfWeekWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNumberOfWeeklyTransitionsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNumberOfDailyTransitionsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Thermostat User Interface Configuration - * - */ -@interface CHIPTestThermostatUserInterfaceConfiguration : CHIPThermostatUserInterfaceConfiguration - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Thread Network Diagnostics - * - */ -@interface CHIPTestThreadNetworkDiagnostics : CHIPThreadNetworkDiagnostics - -- (void)writeAttributeChannelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRoutingRoleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNetworkNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePanIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeExtendedPanIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeMeshLocalPrefixWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeNeighborTableListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRouteTableListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePartitionIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeWeightingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeDataVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeStableDataVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeLeaderRouterIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeDetachedRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeChildRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRouterRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeLeaderRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttachAttemptCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePartitionIdChangeCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBetterPartitionAttachAttemptCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeParentChangeCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxTotalCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxUnicastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxBroadcastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxAckRequestedCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxAckedCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxNoAckRequestedCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxDataCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxDataPollCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxBeaconCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxBeaconRequestCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxOtherCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxRetryCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxDirectMaxRetryExpiryCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxIndirectMaxRetryExpiryCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxErrCcaCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxErrAbortCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTxErrBusyChannelCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxTotalCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxUnicastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxBroadcastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxDataCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxDataPollCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxBeaconCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxBeaconRequestCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxOtherCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxAddressFilteredCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxDestAddrFilteredCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxDuplicatedCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxErrNoFrameCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxErrUnknownNeighborCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxErrInvalidSrcAddrCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxErrSecCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxErrFcsCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRxErrOtherCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActiveTimestampWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePendingTimestampWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeDelayWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSecurityPolicyWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeChannelMaskWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeOperationalDatasetComponentsWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeActiveNetworkFaultsListWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Time Format Localization - * - */ -@interface CHIPTestTimeFormatLocalization : CHIPTimeFormatLocalization - -- (void)writeAttributeSupportedCalendarTypesWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Unit Localization - * - */ -@interface CHIPTestUnitLocalization : CHIPUnitLocalization - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster User Label - * - */ -@interface CHIPTestUserLabel : CHIPUserLabel - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Wake on LAN - * - */ -@interface CHIPTestWakeOnLan : CHIPWakeOnLan - -- (void)writeAttributeMACAddressWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster WiFi Network Diagnostics - * - */ -@interface CHIPTestWiFiNetworkDiagnostics : CHIPWiFiNetworkDiagnostics - -- (void)writeAttributeBssidWithValue:(NSData * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSecurityTypeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeWiFiVersionWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeChannelNumberWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeRssiWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBeaconLostCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeBeaconRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePacketMulticastRxCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePacketMulticastTxCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePacketUnicastRxCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePacketUnicastTxCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentMaxRateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -/** - * Cluster Window Covering - * - */ -@interface CHIPTestWindowCovering : CHIPWindowCovering - -- (void)writeAttributeTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionLiftWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionTiltWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeConfigStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionLiftPercentageWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionTiltPercentageWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeOperationalStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTargetPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTargetPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeEndProductTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeInstalledOpenLimitLiftWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeInstalledClosedLimitLiftWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeInstalledOpenLimitTiltWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeInstalledClosedLimitTiltWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSafetyStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - -NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm deleted file mode 100644 index dfcc84369068fb..00000000000000 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ /dev/null @@ -1,17157 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// THIS FILE IS GENERATED BY ZAP -#import -#import - -#import "CHIPCallbackBridge_internal.h" -#import "CHIPCluster_internal.h" -#import "CHIPDevice.h" -#import "CHIPDevice_Internal.h" - -#import "zap-generated/CHIPTestClustersObjc.h" -#import "zap-generated/tests/CHIPClustersTest.h" - -#include -#include - -using chip::Callback::Callback; -using chip::Callback::Cancelable; -using namespace chip::app::Clusters; - -@interface CHIPTestAccessControl () -@property (readonly) chip::Controller::AccessControlClusterTest cppCluster; -@end - -@implementation CHIPTestAccessControl - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeSubjectsPerAccessControlEntryWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccessControl::Attributes::SubjectsPerAccessControlEntry::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTargetsPerAccessControlEntryWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccessControl::Attributes::TargetsPerAccessControlEntry::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAccessControlEntriesPerFabricWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccessControl::Attributes::AccessControlEntriesPerFabric::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccessControl::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccessControl::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccessControl::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccessControl::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestAccountLogin () -@property (readonly) chip::Controller::AccountLoginClusterTest cppCluster; -@end - -@implementation CHIPTestAccountLogin - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccountLogin::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccountLogin::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccountLogin::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AccountLogin::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestAdministratorCommissioning () -@property (readonly) chip::Controller::AdministratorCommissioningClusterTest cppCluster; -@end - -@implementation CHIPTestAdministratorCommissioning - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeWindowStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AdministratorCommissioning::Attributes::WindowStatus::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAdminFabricIndexWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AdministratorCommissioning::Attributes::AdminFabricIndex::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAdminVendorIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AdministratorCommissioning::Attributes::AdminVendorId::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AdministratorCommissioning::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AdministratorCommissioning::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AdministratorCommissioning::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AdministratorCommissioning::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestApplicationBasic () -@property (readonly) chip::Controller::ApplicationBasicClusterTest cppCluster; -@end - -@implementation CHIPTestApplicationBasic - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::VendorName::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeVendorIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::VendorID::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeApplicationNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::ApplicationName::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::ProductID::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeApplicationWithValue:(CHIPApplicationBasicClusterApplicationBasicApplication * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::Application::TypeInfo; - TypeInfo::Type cppValue; - cppValue.catalogVendorId = value.catalogVendorId.unsignedShortValue; - cppValue.applicationId = [self asCharSpan:value.applicationId]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::Status::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeApplicationVersionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::ApplicationVersion::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAllowedVendorListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::AllowedVendorList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = static_castmList[i_0])>>( - element_0.unsignedShortValue); - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationBasic::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestApplicationLauncher () -@property (readonly) chip::Controller::ApplicationLauncherClusterTest cppCluster; -@end - -@implementation CHIPTestApplicationLauncher - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeCatalogListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationLauncher::Attributes::CatalogList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedShortValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationLauncher::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationLauncher::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationLauncher::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ApplicationLauncher::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestAudioOutput () -@property (readonly) chip::Controller::AudioOutputClusterTest cppCluster; -@end - -@implementation CHIPTestAudioOutput - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeOutputListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AudioOutput::Attributes::OutputList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPAudioOutputClusterOutputInfo class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPAudioOutputClusterOutputInfo *) value[i_0]; - listHolder_0->mList[i_0].index = element_0.index.unsignedCharValue; - listHolder_0->mList[i_0].outputType - = static_castmList[i_0].outputType)>>( - element_0.outputType.unsignedCharValue); - listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentOutputWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AudioOutput::Attributes::CurrentOutput::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AudioOutput::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AudioOutput::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AudioOutput::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = AudioOutput::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestBarrierControl () -@property (readonly) chip::Controller::BarrierControlClusterTest cppCluster; -@end - -@implementation CHIPTestBarrierControl - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeBarrierMovingStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BarrierControl::Attributes::BarrierMovingState::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBarrierSafetyStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BarrierControl::Attributes::BarrierSafetyStatus::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBarrierCapabilitiesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BarrierControl::Attributes::BarrierCapabilities::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBarrierPositionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BarrierControl::Attributes::BarrierPosition::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BarrierControl::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BarrierControl::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BarrierControl::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BarrierControl::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestBasic () -@property (readonly) chip::Controller::BasicClusterTest cppCluster; -@end - -@implementation CHIPTestBasic - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeDataModelRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::DataModelRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::VendorName::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeVendorIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::VendorID::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedShortValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::ProductName::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::ProductID::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeHardwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::HardwareVersion::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeHardwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::HardwareVersionString::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSoftwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::SoftwareVersion::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSoftwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::SoftwareVersionString::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeManufacturingDateWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::ManufacturingDate::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePartNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::PartNumber::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductURLWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::ProductURL::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::ProductLabel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSerialNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::SerialNumber::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeReachableWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::Reachable::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeUniqueIDWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::UniqueID::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCapabilityMinimaWithValue:(CHIPBasicClusterCapabilityMinimaStruct * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::CapabilityMinima::TypeInfo; - TypeInfo::Type cppValue; - cppValue.caseSessionsPerFabric = value.caseSessionsPerFabric.unsignedShortValue; - cppValue.subscriptionsPerFabric = value.subscriptionsPerFabric.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Basic::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestBinaryInputBasic () -@property (readonly) chip::Controller::BinaryInputBasicClusterTest cppCluster; -@end - -@implementation CHIPTestBinaryInputBasic - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeStatusFlagsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BinaryInputBasic::Attributes::StatusFlags::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BinaryInputBasic::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BinaryInputBasic::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BinaryInputBasic::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BinaryInputBasic::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestBinding () -@property (readonly) chip::Controller::BindingClusterTest cppCluster; -@end - -@implementation CHIPTestBinding - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Binding::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Binding::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Binding::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Binding::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestBooleanState () -@property (readonly) chip::Controller::BooleanStateClusterTest cppCluster; -@end - -@implementation CHIPTestBooleanState - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeStateValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BooleanState::Attributes::StateValue::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BooleanState::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BooleanState::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BooleanState::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BooleanState::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestBridgedActions () -@property (readonly) chip::Controller::BridgedActionsClusterTest cppCluster; -@end - -@implementation CHIPTestBridgedActions - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeActionListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedActions::Attributes::ActionList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPBridgedActionsClusterActionStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPBridgedActionsClusterActionStruct *) value[i_0]; - listHolder_0->mList[i_0].actionID = element_0.actionID.unsignedShortValue; - listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; - listHolder_0->mList[i_0].type - = static_castmList[i_0].type)>>( - element_0.type.unsignedCharValue); - listHolder_0->mList[i_0].endpointListID = element_0.endpointListID.unsignedShortValue; - listHolder_0->mList[i_0].supportedCommands = element_0.supportedCommands.unsignedShortValue; - listHolder_0->mList[i_0].status - = static_castmList[i_0].status)>>( - element_0.status.unsignedCharValue); - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeEndpointListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedActions::Attributes::EndpointList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPBridgedActionsClusterEndpointListStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPBridgedActionsClusterEndpointListStruct *) value[i_0]; - listHolder_0->mList[i_0].endpointListID = element_0.endpointListID.unsignedShortValue; - listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; - listHolder_0->mList[i_0].type - = static_castmList[i_0].type)>>( - element_0.type.unsignedCharValue); - { - using ListType_2 = std::remove_reference_tmList[i_0].endpoints)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.endpoints.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.endpoints.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.endpoints.count; ++i_2) { - if (![element_0.endpoints[i_2] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSNumber *) element_0.endpoints[i_2]; - listHolder_2->mList[i_2] = element_2.unsignedShortValue; - } - listHolder_0->mList[i_0].endpoints = ListType_2(listHolder_2->mList, element_0.endpoints.count); - } else { - listHolder_0->mList[i_0].endpoints = ListType_2(); - } - } - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSetupUrlWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedActions::Attributes::SetupUrl::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedActions::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedActions::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedActions::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedActions::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestBridgedDeviceBasic () -@property (readonly) chip::Controller::BridgedDeviceBasicClusterTest cppCluster; -@end - -@implementation CHIPTestBridgedDeviceBasic - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::VendorName::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeVendorIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::VendorID::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedShortValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::ProductName::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeHardwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersion::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeHardwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersionString::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSoftwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersion::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSoftwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersionString::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeManufacturingDateWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::ManufacturingDate::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePartNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::PartNumber::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductURLWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::ProductURL::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::ProductLabel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSerialNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::SerialNumber::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeReachableWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::Reachable::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeUniqueIDWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::UniqueID::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestChannel () -@property (readonly) chip::Controller::ChannelClusterTest cppCluster; -@end - -@implementation CHIPTestChannel - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeChannelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Channel::Attributes::ChannelList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPChannelClusterChannelInfo class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPChannelClusterChannelInfo *) value[i_0]; - listHolder_0->mList[i_0].majorNumber = element_0.majorNumber.unsignedShortValue; - listHolder_0->mList[i_0].minorNumber = element_0.minorNumber.unsignedShortValue; - if (element_0.name != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); - definedValue_2 = [self asCharSpan:element_0.name]; - } - if (element_0.callSign != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].callSign.Emplace(); - definedValue_2 = [self asCharSpan:element_0.callSign]; - } - if (element_0.affiliateCallSign != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].affiliateCallSign.Emplace(); - definedValue_2 = [self asCharSpan:element_0.affiliateCallSign]; - } - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeLineupWithValue:(CHIPChannelClusterLineupInfo * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Channel::Attributes::Lineup::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.operatorName = [self asCharSpan:value.operatorName]; - if (value.lineupName != nil) { - auto & definedValue_2 = nonNullValue_0.lineupName.Emplace(); - definedValue_2 = [self asCharSpan:value.lineupName]; - } - if (value.postalCode != nil) { - auto & definedValue_2 = nonNullValue_0.postalCode.Emplace(); - definedValue_2 = [self asCharSpan:value.postalCode]; - } - nonNullValue_0.lineupInfoType = static_cast>( - value.lineupInfoType.unsignedCharValue); - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentChannelWithValue:(CHIPChannelClusterChannelInfo * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Channel::Attributes::CurrentChannel::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.majorNumber = value.majorNumber.unsignedShortValue; - nonNullValue_0.minorNumber = value.minorNumber.unsignedShortValue; - if (value.name != nil) { - auto & definedValue_2 = nonNullValue_0.name.Emplace(); - definedValue_2 = [self asCharSpan:value.name]; - } - if (value.callSign != nil) { - auto & definedValue_2 = nonNullValue_0.callSign.Emplace(); - definedValue_2 = [self asCharSpan:value.callSign]; - } - if (value.affiliateCallSign != nil) { - auto & definedValue_2 = nonNullValue_0.affiliateCallSign.Emplace(); - definedValue_2 = [self asCharSpan:value.affiliateCallSign]; - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Channel::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Channel::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Channel::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Channel::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestColorControl () -@property (readonly) chip::Controller::ColorControlClusterTest cppCluster; -@end - -@implementation CHIPTestColorControl - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeCurrentHueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::CurrentHue::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentSaturationWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::CurrentSaturation::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRemainingTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::RemainingTime::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentXWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::CurrentX::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentYWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::CurrentY::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeDriftCompensationWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::DriftCompensation::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCompensationTextWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::CompensationText::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorTemperature::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorMode::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNumberOfPrimariesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::NumberOfPrimaries::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary1XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary1X::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary1YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary1Y::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary1IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary1Intensity::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary2XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary2X::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary2YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary2Y::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary2IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary2Intensity::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary3XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary3X::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary3YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary3Y::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary3IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary3Intensity::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary4XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary4X::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary4YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary4Y::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary4IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary4Intensity::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary5XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary5X::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary5YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary5Y::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary5IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary5Intensity::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary6XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary6X::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary6YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary6Y::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePrimary6IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::Primary6Intensity::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeEnhancedCurrentHueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::EnhancedCurrentHue::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeEnhancedColorModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::EnhancedColorMode::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorLoopActiveWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorLoopActive::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorLoopDirectionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorLoopDirection::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorLoopTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorLoopTime::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorLoopStartEnhancedHueWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorLoopStartEnhancedHue::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorLoopStoredEnhancedHueWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorLoopStoredEnhancedHue::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorCapabilitiesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorCapabilities::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorTempPhysicalMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorTempPhysicalMin::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeColorTempPhysicalMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ColorTempPhysicalMax::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCoupleColorTempToLevelMinMiredsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ColorControl::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestContentLauncher () -@property (readonly) chip::Controller::ContentLauncherClusterTest cppCluster; -@end - -@implementation CHIPTestContentLauncher - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeAcceptHeaderWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ContentLauncher::Attributes::AcceptHeader::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSString class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSString *) value[i_0]; - listHolder_0->mList[i_0] = [self asCharSpan:element_0]; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ContentLauncher::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ContentLauncher::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ContentLauncher::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ContentLauncher::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestDescriptor () -@property (readonly) chip::Controller::DescriptorClusterTest cppCluster; -@end - -@implementation CHIPTestDescriptor - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeDeviceListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Descriptor::Attributes::DeviceList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPDescriptorClusterDeviceType class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPDescriptorClusterDeviceType *) value[i_0]; - listHolder_0->mList[i_0].type = element_0.type.unsignedIntValue; - listHolder_0->mList[i_0].revision = element_0.revision.unsignedShortValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeServerListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Descriptor::Attributes::ServerList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClientListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Descriptor::Attributes::ClientList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePartsListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Descriptor::Attributes::PartsList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedShortValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Descriptor::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Descriptor::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Descriptor::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Descriptor::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestDiagnosticLogs () -@property (readonly) chip::Controller::DiagnosticLogsClusterTest cppCluster; -@end - -@implementation CHIPTestDiagnosticLogs - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DiagnosticLogs::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DiagnosticLogs::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DiagnosticLogs::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestDoorLock () -@property (readonly) chip::Controller::DoorLockClusterTest cppCluster; -@end - -@implementation CHIPTestDoorLock - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeLockStateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::LockState::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeLockTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::LockType::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActuatorEnabledWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::ActuatorEnabled::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeDoorStateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::DoorState::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNumberOfTotalUsersSupportedWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::NumberOfTotalUsersSupported::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNumberOfPINUsersSupportedWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::NumberOfPINUsersSupported::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNumberOfRFIDUsersSupportedWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::NumberOfRFIDUsersSupported::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNumberOfWeekDaySchedulesSupportedPerUserWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNumberOfYearDaySchedulesSupportedPerUserWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::NumberOfYearDaySchedulesSupportedPerUser::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNumberOfHolidaySchedulesSupportedWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::NumberOfHolidaySchedulesSupported::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxPINCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::MaxPINCodeLength::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinPINCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::MinPINCodeLength::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxRFIDCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::MaxRFIDCodeLength::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinRFIDCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::MinRFIDCodeLength::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSupportedOperatingModesWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::SupportedOperatingModes::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedShortValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = DoorLock::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestElectricalMeasurement () -@property (readonly) chip::Controller::ElectricalMeasurementClusterTest cppCluster; -@end - -@implementation CHIPTestElectricalMeasurement - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeMeasurementTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::MeasurementType::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTotalActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.intValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRmsVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRmsVoltageMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRmsVoltageMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRmsCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRmsCurrentMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRmsCurrentMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePower::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.shortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActivePowerMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.shortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActivePowerMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.shortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestEthernetNetworkDiagnostics () -@property (readonly) chip::Controller::EthernetNetworkDiagnosticsClusterTest cppCluster; -@end - -@implementation CHIPTestEthernetNetworkDiagnostics - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributePHYRateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::PHYRate::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFullDuplexWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.boolValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePacketRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePacketTxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxErrCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCollisionCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCarrierDetectWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.boolValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTimeSinceResetWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestFanControl () -@property (readonly) chip::Controller::FanControlClusterTest cppCluster; -@end - -@implementation CHIPTestFanControl - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributePercentCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::PercentCurrent::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSpeedMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::SpeedMax::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSpeedCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::SpeedCurrent::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRockSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::RockSupport::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeWindSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::WindSupport::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FanControl::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestFixedLabel () -@property (readonly) chip::Controller::FixedLabelClusterTest cppCluster; -@end - -@implementation CHIPTestFixedLabel - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FixedLabel::Attributes::LabelList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPFixedLabelClusterLabelStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPFixedLabelClusterLabelStruct *) value[i_0]; - listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label]; - listHolder_0->mList[i_0].value = [self asCharSpan:element_0.value]; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FixedLabel::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FixedLabel::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FixedLabel::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FixedLabel::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestFlowMeasurement () -@property (readonly) chip::Controller::FlowMeasurementClusterTest cppCluster; -@end - -@implementation CHIPTestFlowMeasurement - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FlowMeasurement::Attributes::MeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FlowMeasurement::Attributes::MinMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FlowMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FlowMeasurement::Attributes::Tolerance::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FlowMeasurement::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FlowMeasurement::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FlowMeasurement::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = FlowMeasurement::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestGeneralCommissioning () -@property (readonly) chip::Controller::GeneralCommissioningClusterTest cppCluster; -@end - -@implementation CHIPTestGeneralCommissioning - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeBasicCommissioningInfoWithValue:(CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralCommissioning::Attributes::BasicCommissioningInfo::TypeInfo; - TypeInfo::Type cppValue; - cppValue.failSafeExpiryLengthSeconds = value.failSafeExpiryLengthSeconds.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRegulatoryConfigWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralCommissioning::Attributes::RegulatoryConfig::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeLocationCapabilityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralCommissioning::Attributes::LocationCapability::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSupportsConcurrentConnectionWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralCommissioning::Attributes::SupportsConcurrentConnection::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralCommissioning::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralCommissioning::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralCommissioning::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralCommissioning::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestGeneralDiagnostics () -@property (readonly) chip::Controller::GeneralDiagnosticsClusterTest cppCluster; -@end - -@implementation CHIPTestGeneralDiagnostics - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeNetworkInterfacesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::NetworkInterfaces::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPGeneralDiagnosticsClusterNetworkInterfaceType class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPGeneralDiagnosticsClusterNetworkInterfaceType *) value[i_0]; - listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; - listHolder_0->mList[i_0].isOperational = element_0.isOperational.boolValue; - if (element_0.offPremiseServicesReachableIPv4 == nil) { - listHolder_0->mList[i_0].offPremiseServicesReachableIPv4.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].offPremiseServicesReachableIPv4.SetNonNull(); - nonNullValue_2 = element_0.offPremiseServicesReachableIPv4.boolValue; - } - if (element_0.offPremiseServicesReachableIPv6 == nil) { - listHolder_0->mList[i_0].offPremiseServicesReachableIPv6.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].offPremiseServicesReachableIPv6.SetNonNull(); - nonNullValue_2 = element_0.offPremiseServicesReachableIPv6.boolValue; - } - listHolder_0->mList[i_0].hardwareAddress = [self asByteSpan:element_0.hardwareAddress]; - { - using ListType_2 = std::remove_reference_tmList[i_0].IPv4Addresses)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.iPv4Addresses.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.iPv4Addresses.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.iPv4Addresses.count; ++i_2) { - if (![element_0.iPv4Addresses[i_2] isKindOfClass:[NSData class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSData *) element_0.iPv4Addresses[i_2]; - listHolder_2->mList[i_2] = [self asByteSpan:element_2]; - } - listHolder_0->mList[i_0].IPv4Addresses - = ListType_2(listHolder_2->mList, element_0.iPv4Addresses.count); - } else { - listHolder_0->mList[i_0].IPv4Addresses = ListType_2(); - } - } - { - using ListType_2 = std::remove_reference_tmList[i_0].IPv6Addresses)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.iPv6Addresses.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.iPv6Addresses.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.iPv6Addresses.count; ++i_2) { - if (![element_0.iPv6Addresses[i_2] isKindOfClass:[NSData class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSData *) element_0.iPv6Addresses[i_2]; - listHolder_2->mList[i_2] = [self asByteSpan:element_2]; - } - listHolder_0->mList[i_0].IPv6Addresses - = ListType_2(listHolder_2->mList, element_0.iPv6Addresses.count); - } else { - listHolder_0->mList[i_0].IPv6Addresses = ListType_2(); - } - } - listHolder_0->mList[i_0].type - = static_castmList[i_0].type)>>( - element_0.type.unsignedCharValue); - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRebootCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::RebootCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeUpTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::UpTime::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTotalOperationalHoursWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::TotalOperationalHours::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBootReasonsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::BootReasons::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActiveHardwareFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::ActiveHardwareFaults::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedCharValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActiveRadioFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::ActiveRadioFaults::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedCharValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActiveNetworkFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::ActiveNetworkFaults::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedCharValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestGroupKeyManagement () -@property (readonly) chip::Controller::GroupKeyManagementClusterTest cppCluster; -@end - -@implementation CHIPTestGroupKeyManagement - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGroupTableWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::GroupTable::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupInfoMapStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPGroupKeyManagementClusterGroupInfoMapStruct *) value[i_0]; - listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; - { - using ListType_2 = std::remove_reference_tmList[i_0].endpoints)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.endpoints.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.endpoints.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.endpoints.count; ++i_2) { - if (![element_0.endpoints[i_2] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSNumber *) element_0.endpoints[i_2]; - listHolder_2->mList[i_2] = element_2.unsignedShortValue; - } - listHolder_0->mList[i_0].endpoints = ListType_2(listHolder_2->mList, element_0.endpoints.count); - } else { - listHolder_0->mList[i_0].endpoints = ListType_2(); - } - } - if (element_0.groupName != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].groupName.Emplace(); - definedValue_2 = [self asCharSpan:element_0.groupName]; - } - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxGroupsPerFabricWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxGroupKeysPerFabricWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestGroups () -@property (readonly) chip::Controller::GroupsClusterTest cppCluster; -@end - -@implementation CHIPTestGroups - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeNameSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Groups::Attributes::NameSupport::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Groups::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Groups::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Groups::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Groups::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestIdentify () -@property (readonly) chip::Controller::IdentifyClusterTest cppCluster; -@end - -@implementation CHIPTestIdentify - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeIdentifyTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Identify::Attributes::IdentifyType::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Identify::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Identify::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Identify::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Identify::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestIlluminanceMeasurement () -@property (readonly) chip::Controller::IlluminanceMeasurementClusterTest cppCluster; -@end - -@implementation CHIPTestIlluminanceMeasurement - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::MinMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::Tolerance::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeLightSensorTypeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestKeypadInput () -@property (readonly) chip::Controller::KeypadInputClusterTest cppCluster; -@end - -@implementation CHIPTestKeypadInput - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = KeypadInput::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = KeypadInput::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = KeypadInput::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = KeypadInput::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestLevelControl () -@property (readonly) chip::Controller::LevelControlClusterTest cppCluster; -@end - -@implementation CHIPTestLevelControl - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeCurrentLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::CurrentLevel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRemainingTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::RemainingTime::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::MinLevel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::MaxLevel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::CurrentFrequency::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::MinFrequency::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::MaxFrequency::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LevelControl::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestLocalizationConfiguration () -@property (readonly) chip::Controller::LocalizationConfigurationClusterTest cppCluster; -@end - -@implementation CHIPTestLocalizationConfiguration - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeSupportedLocalesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LocalizationConfiguration::Attributes::SupportedLocales::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSString class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSString *) value[i_0]; - listHolder_0->mList[i_0] = [self asCharSpan:element_0]; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LocalizationConfiguration::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LocalizationConfiguration::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LocalizationConfiguration::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestLowPower () -@property (readonly) chip::Controller::LowPowerClusterTest cppCluster; -@end - -@implementation CHIPTestLowPower - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LowPower::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LowPower::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LowPower::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = LowPower::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestMediaInput () -@property (readonly) chip::Controller::MediaInputClusterTest cppCluster; -@end - -@implementation CHIPTestMediaInput - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeInputListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaInput::Attributes::InputList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPMediaInputClusterInputInfo class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPMediaInputClusterInputInfo *) value[i_0]; - listHolder_0->mList[i_0].index = element_0.index.unsignedCharValue; - listHolder_0->mList[i_0].inputType - = static_castmList[i_0].inputType)>>( - element_0.inputType.unsignedCharValue); - listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; - listHolder_0->mList[i_0].description = [self asCharSpan:element_0.descriptionString]; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentInputWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaInput::Attributes::CurrentInput::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaInput::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaInput::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaInput::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaInput::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestMediaPlayback () -@property (readonly) chip::Controller::MediaPlaybackClusterTest cppCluster; -@end - -@implementation CHIPTestMediaPlayback - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeCurrentStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::CurrentState::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeStartTimeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::StartTime::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeDurationWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::Duration::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSampledPositionWithValue:(CHIPMediaPlaybackClusterPlaybackPosition * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::SampledPosition::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0.updatedAt = value.updatedAt.unsignedLongLongValue; - if (value.position == nil) { - nonNullValue_0.position.SetNull(); - } else { - auto & nonNullValue_2 = nonNullValue_0.position.SetNonNull(); - nonNullValue_2 = value.position.unsignedLongLongValue; - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePlaybackSpeedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::PlaybackSpeed::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.floatValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSeekRangeEndWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::SeekRangeEnd::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSeekRangeStartWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::SeekRangeStart::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = MediaPlayback::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestModeSelect () -@property (readonly) chip::Controller::ModeSelectClusterTest cppCluster; -@end - -@implementation CHIPTestModeSelect - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeStandardNamespaceWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::StandardNamespace::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSupportedModesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::SupportedModes::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPModeSelectClusterModeOptionStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPModeSelectClusterModeOptionStruct *) value[i_0]; - listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label]; - listHolder_0->mList[i_0].mode = element_0.mode.unsignedCharValue; - listHolder_0->mList[i_0].semanticTag = element_0.semanticTag.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestNetworkCommissioning () -@property (readonly) chip::Controller::NetworkCommissioningClusterTest cppCluster; -@end - -@implementation CHIPTestNetworkCommissioning - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeMaxNetworksWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::MaxNetworks::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNetworksWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::Networks::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPNetworkCommissioningClusterNetworkInfo class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPNetworkCommissioningClusterNetworkInfo *) value[i_0]; - listHolder_0->mList[i_0].networkID = [self asByteSpan:element_0.networkID]; - listHolder_0->mList[i_0].connected = element_0.connected.boolValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeScanMaxTimeSecondsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::ScanMaxTimeSeconds::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeConnectMaxTimeSecondsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::ConnectMaxTimeSeconds::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeLastNetworkingStatusWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::LastNetworkingStatus::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeLastNetworkIDWithValue:(NSData * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::LastNetworkID::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = [self asByteSpan:value]; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeLastConnectErrorValueWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::LastConnectErrorValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.intValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestOtaSoftwareUpdateProvider () -@property (readonly) chip::Controller::OtaSoftwareUpdateProviderClusterTest cppCluster; -@end - -@implementation CHIPTestOtaSoftwareUpdateProvider - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OtaSoftwareUpdateProvider::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestOtaSoftwareUpdateRequestor () -@property (readonly) chip::Controller::OtaSoftwareUpdateRequestorClusterTest cppCluster; -@end - -@implementation CHIPTestOtaSoftwareUpdateRequestor - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeUpdatePossibleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeUpdateStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeUpdateStateProgressWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestOccupancySensing () -@property (readonly) chip::Controller::OccupancySensingClusterTest cppCluster; -@end - -@implementation CHIPTestOccupancySensing - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeOccupancyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OccupancySensing::Attributes::Occupancy::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeOccupancySensorTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OccupancySensing::Attributes::OccupancySensorType::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeOccupancySensorTypeBitmapWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OccupancySensing::Attributes::OccupancySensorTypeBitmap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OccupancySensing::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OccupancySensing::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OccupancySensing::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OccupancySensing::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestOnOff () -@property (readonly) chip::Controller::OnOffClusterTest cppCluster; -@end - -@implementation CHIPTestOnOff - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeOnOffWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOff::Attributes::OnOff::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGlobalSceneControlWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOff::Attributes::GlobalSceneControl::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOff::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOff::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOff::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOff::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOff::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestOnOffSwitchConfiguration () -@property (readonly) chip::Controller::OnOffSwitchConfigurationClusterTest cppCluster; -@end - -@implementation CHIPTestOnOffSwitchConfiguration - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeSwitchTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOffSwitchConfiguration::Attributes::SwitchType::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOffSwitchConfiguration::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOffSwitchConfiguration::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOffSwitchConfiguration::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OnOffSwitchConfiguration::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestOperationalCredentials () -@property (readonly) chip::Controller::OperationalCredentialsClusterTest cppCluster; -@end - -@implementation CHIPTestOperationalCredentials - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeNOCsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::NOCs::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPOperationalCredentialsClusterNOCStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPOperationalCredentialsClusterNOCStruct *) value[i_0]; - listHolder_0->mList[i_0].noc = [self asByteSpan:element_0.noc]; - if (element_0.icac == nil) { - listHolder_0->mList[i_0].icac.SetNull(); - } else { - auto & nonNullValue_2 = listHolder_0->mList[i_0].icac.SetNonNull(); - nonNullValue_2 = [self asByteSpan:element_0.icac]; - } - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFabricsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::Fabrics::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPOperationalCredentialsClusterFabricDescriptor class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPOperationalCredentialsClusterFabricDescriptor *) value[i_0]; - listHolder_0->mList[i_0].rootPublicKey = [self asByteSpan:element_0.rootPublicKey]; - listHolder_0->mList[i_0].vendorId = element_0.vendorId.unsignedShortValue; - listHolder_0->mList[i_0].fabricId = element_0.fabricId.unsignedLongLongValue; - listHolder_0->mList[i_0].nodeId = element_0.nodeId.unsignedLongLongValue; - listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label]; - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSupportedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::SupportedFabrics::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCommissionedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::CommissionedFabrics::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTrustedRootCertificatesWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::TrustedRootCertificates::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSData class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSData *) value[i_0]; - listHolder_0->mList[i_0] = [self asByteSpan:element_0]; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentFabricIndexWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::CurrentFabricIndex::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestPowerSource () -@property (readonly) chip::Controller::PowerSourceClusterTest cppCluster; -@end - -@implementation CHIPTestPowerSource - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::Status::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeOrderWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::Order::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::Description::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBatteryVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::BatteryVoltage::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBatteryPercentRemainingWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBatteryTimeRemainingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBatteryChargeLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::BatteryChargeLevel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActiveBatteryFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::ActiveBatteryFaults::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedCharValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBatteryChargeStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::BatteryChargeState::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSource::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestPowerSourceConfiguration () -@property (readonly) chip::Controller::PowerSourceConfigurationClusterTest cppCluster; -@end - -@implementation CHIPTestPowerSourceConfiguration - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeSourcesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSourceConfiguration::Attributes::Sources::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedCharValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSourceConfiguration::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSourceConfiguration::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSourceConfiguration::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestPressureMeasurement () -@property (readonly) chip::Controller::PressureMeasurementClusterTest cppCluster; -@end - -@implementation CHIPTestPressureMeasurement - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PressureMeasurement::Attributes::MeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - 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 * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PressureMeasurement::Attributes::MinMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - 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 * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PressureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PressureMeasurement::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PressureMeasurement::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestPumpConfigurationAndControl () -@property (readonly) chip::Controller::PumpConfigurationAndControlClusterTest cppCluster; -@end - -@implementation CHIPTestPumpConfigurationAndControl - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeMaxPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxPressure::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributeMaxSpeedWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxSpeed::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxFlowWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxFlow::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinConstPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstPressure::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributeMaxConstPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstPressure::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributeMinCompPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinCompPressure::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributeMaxCompPressureWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxCompPressure::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributeMinConstSpeedWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstSpeed::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxConstSpeedWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstSpeed::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinConstFlowWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstFlow::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxConstFlowWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstFlow::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinConstTempWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstTemp::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributeMaxConstTempWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstTemp::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributePumpStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::PumpStatus::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeEffectiveOperationModeWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::EffectiveOperationMode::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeEffectiveControlModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::EffectiveControlMode::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCapacityWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::Capacity::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributeSpeedWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::Speed::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePowerWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::Power::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAlarmMaskWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::AlarmMask::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = PumpConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestRelativeHumidityMeasurement () -@property (readonly) chip::Controller::RelativeHumidityMeasurementClusterTest cppCluster; -@end - -@implementation CHIPTestRelativeHumidityMeasurement - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = RelativeHumidityMeasurement::Attributes::Tolerance::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = RelativeHumidityMeasurement::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = RelativeHumidityMeasurement::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = RelativeHumidityMeasurement::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = RelativeHumidityMeasurement::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestScenes () -@property (readonly) chip::Controller::ScenesClusterTest cppCluster; -@end - -@implementation CHIPTestScenes - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeSceneCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Scenes::Attributes::SceneCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentSceneWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Scenes::Attributes::CurrentScene::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentGroupWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Scenes::Attributes::CurrentGroup::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSceneValidWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Scenes::Attributes::SceneValid::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNameSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Scenes::Attributes::NameSupport::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Scenes::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Scenes::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Scenes::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Scenes::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestSoftwareDiagnostics () -@property (readonly) chip::Controller::SoftwareDiagnosticsClusterTest cppCluster; -@end - -@implementation CHIPTestSoftwareDiagnostics - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeThreadMetricsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = SoftwareDiagnostics::Attributes::ThreadMetrics::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPSoftwareDiagnosticsClusterThreadMetrics class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPSoftwareDiagnosticsClusterThreadMetrics *) value[i_0]; - listHolder_0->mList[i_0].id = element_0.id.unsignedLongLongValue; - listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; - listHolder_0->mList[i_0].stackFreeCurrent = element_0.stackFreeCurrent.unsignedIntValue; - listHolder_0->mList[i_0].stackFreeMinimum = element_0.stackFreeMinimum.unsignedIntValue; - listHolder_0->mList[i_0].stackSize = element_0.stackSize.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentHeapFreeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapFree::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentHeapUsedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapUsed::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentHeapHighWatermarkWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = SoftwareDiagnostics::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = SoftwareDiagnostics::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = SoftwareDiagnostics::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = SoftwareDiagnostics::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = SoftwareDiagnostics::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestSwitch () -@property (readonly) chip::Controller::SwitchClusterTest cppCluster; -@end - -@implementation CHIPTestSwitch - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeNumberOfPositionsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Switch::Attributes::NumberOfPositions::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentPositionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Switch::Attributes::CurrentPosition::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMultiPressMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Switch::Attributes::MultiPressMax::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Switch::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Switch::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Switch::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Switch::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Switch::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestTargetNavigator () -@property (readonly) chip::Controller::TargetNavigatorClusterTest cppCluster; -@end - -@implementation CHIPTestTargetNavigator - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeTargetListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TargetNavigator::Attributes::TargetList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPTargetNavigatorClusterTargetInfo class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPTargetNavigatorClusterTargetInfo *) value[i_0]; - listHolder_0->mList[i_0].identifier = element_0.identifier.unsignedCharValue; - listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentTargetWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TargetNavigator::Attributes::CurrentTarget::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TargetNavigator::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TargetNavigator::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TargetNavigator::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TargetNavigator::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestTemperatureMeasurement () -@property (readonly) chip::Controller::TemperatureMeasurementClusterTest cppCluster; -@end - -@implementation CHIPTestTemperatureMeasurement - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - 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 * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - 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 * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - TypeInfo::Type cppValue; - 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)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TemperatureMeasurement::Attributes::Tolerance::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TemperatureMeasurement::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TemperatureMeasurement::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestTestCluster () -@property (readonly) chip::Controller::TestClusterClusterTest cppCluster; -@end - -@implementation CHIPTestTestCluster - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TestCluster::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TestCluster::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TestCluster::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TestCluster::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestThermostat () -@property (readonly) chip::Controller::ThermostatClusterTest cppCluster; -@end - -@implementation CHIPTestThermostat - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeLocalTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::LocalTemperature::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.shortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAbsMinHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.shortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAbsMaxHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::AbsMaxHeatSetpointLimit::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.shortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAbsMinCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.shortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAbsMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.shortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeStartOfWeekWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::StartOfWeek::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNumberOfWeeklyTransitionsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNumberOfDailyTransitionsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestThermostatUserInterfaceConfiguration () -@property (readonly) chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cppCluster; -@end - -@implementation CHIPTestThermostatUserInterfaceConfiguration - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestThreadNetworkDiagnostics () -@property (readonly) chip::Controller::ThreadNetworkDiagnosticsClusterTest cppCluster; -@end - -@implementation CHIPTestThreadNetworkDiagnostics - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeChannelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRoutingRoleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RoutingRole::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNetworkNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::NetworkName::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePanIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::PanId::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeExtendedPanIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ExtendedPanId::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeMeshLocalPrefixWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asByteSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNeighborTableListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::NeighborTableList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPThreadNetworkDiagnosticsClusterNeighborTable class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPThreadNetworkDiagnosticsClusterNeighborTable *) value[i_0]; - listHolder_0->mList[i_0].extAddress = element_0.extAddress.unsignedLongLongValue; - listHolder_0->mList[i_0].age = element_0.age.unsignedIntValue; - listHolder_0->mList[i_0].rloc16 = element_0.rloc16.unsignedShortValue; - listHolder_0->mList[i_0].linkFrameCounter = element_0.linkFrameCounter.unsignedIntValue; - listHolder_0->mList[i_0].mleFrameCounter = element_0.mleFrameCounter.unsignedIntValue; - listHolder_0->mList[i_0].lqi = element_0.lqi.unsignedCharValue; - listHolder_0->mList[i_0].averageRssi = element_0.averageRssi.charValue; - listHolder_0->mList[i_0].lastRssi = element_0.lastRssi.charValue; - listHolder_0->mList[i_0].frameErrorRate = element_0.frameErrorRate.unsignedCharValue; - listHolder_0->mList[i_0].messageErrorRate = element_0.messageErrorRate.unsignedCharValue; - listHolder_0->mList[i_0].rxOnWhenIdle = element_0.rxOnWhenIdle.boolValue; - listHolder_0->mList[i_0].fullThreadDevice = element_0.fullThreadDevice.boolValue; - listHolder_0->mList[i_0].fullNetworkData = element_0.fullNetworkData.boolValue; - listHolder_0->mList[i_0].isChild = element_0.isChild.boolValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRouteTableListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RouteTableList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPThreadNetworkDiagnosticsClusterRouteTable class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPThreadNetworkDiagnosticsClusterRouteTable *) value[i_0]; - listHolder_0->mList[i_0].extAddress = element_0.extAddress.unsignedLongLongValue; - listHolder_0->mList[i_0].rloc16 = element_0.rloc16.unsignedShortValue; - listHolder_0->mList[i_0].routerId = element_0.routerId.unsignedCharValue; - listHolder_0->mList[i_0].nextHop = element_0.nextHop.unsignedCharValue; - listHolder_0->mList[i_0].pathCost = element_0.pathCost.unsignedCharValue; - listHolder_0->mList[i_0].LQIIn = element_0.lqiIn.unsignedCharValue; - listHolder_0->mList[i_0].LQIOut = element_0.lqiOut.unsignedCharValue; - listHolder_0->mList[i_0].age = element_0.age.unsignedCharValue; - listHolder_0->mList[i_0].allocated = element_0.allocated.boolValue; - listHolder_0->mList[i_0].linkEstablished = element_0.linkEstablished.boolValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePartitionIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::PartitionId::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeWeightingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::Weighting::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeDataVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::DataVersion::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeStableDataVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::StableDataVersion::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeLeaderRouterIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::LeaderRouterId::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeDetachedRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeChildRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ChildRoleCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRouterRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RouterRoleCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeLeaderRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttachAttemptCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePartitionIdChangeCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBetterPartitionAttachAttemptCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeParentChangeCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ParentChangeCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxTotalCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxTotalCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxUnicastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxUnicastCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxBroadcastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxAckRequestedCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxAckedCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxAckedCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxNoAckRequestedCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxDataCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDataCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxDataPollCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDataPollCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxBeaconCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBeaconCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxBeaconRequestCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxOtherCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxOtherCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxRetryCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxRetryCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxDirectMaxRetryExpiryCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxIndirectMaxRetryExpiryCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxErrCcaCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxErrAbortCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTxErrBusyChannelCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxTotalCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxTotalCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxUnicastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxUnicastCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxBroadcastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxDataCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDataCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxDataPollCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDataPollCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxBeaconCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBeaconCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxBeaconRequestCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxOtherCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxOtherCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxAddressFilteredCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxDestAddrFilteredCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxDuplicatedCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxErrNoFrameCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxErrUnknownNeighborCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxErrInvalidSrcAddrCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxErrSecCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrSecCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxErrFcsCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRxErrOtherCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActiveTimestampWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePendingTimestampWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::PendingTimestamp::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeDelayWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::Delay::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSecurityPolicyWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::SecurityPolicy::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPThreadNetworkDiagnosticsClusterSecurityPolicy class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPThreadNetworkDiagnosticsClusterSecurityPolicy *) value[i_0]; - listHolder_0->mList[i_0].rotationTime = element_0.rotationTime.unsignedShortValue; - listHolder_0->mList[i_0].flags = element_0.flags.unsignedShortValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeChannelMaskWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ChannelMask::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asByteSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeOperationalDatasetComponentsWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPThreadNetworkDiagnosticsClusterOperationalDatasetComponents class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPThreadNetworkDiagnosticsClusterOperationalDatasetComponents *) value[i_0]; - listHolder_0->mList[i_0].activeTimestampPresent = element_0.activeTimestampPresent.boolValue; - listHolder_0->mList[i_0].pendingTimestampPresent = element_0.pendingTimestampPresent.boolValue; - listHolder_0->mList[i_0].masterKeyPresent = element_0.masterKeyPresent.boolValue; - listHolder_0->mList[i_0].networkNamePresent = element_0.networkNamePresent.boolValue; - listHolder_0->mList[i_0].extendedPanIdPresent = element_0.extendedPanIdPresent.boolValue; - listHolder_0->mList[i_0].meshLocalPrefixPresent = element_0.meshLocalPrefixPresent.boolValue; - listHolder_0->mList[i_0].delayPresent = element_0.delayPresent.boolValue; - listHolder_0->mList[i_0].panIdPresent = element_0.panIdPresent.boolValue; - listHolder_0->mList[i_0].channelPresent = element_0.channelPresent.boolValue; - listHolder_0->mList[i_0].pskcPresent = element_0.pskcPresent.boolValue; - listHolder_0->mList[i_0].securityPolicyPresent = element_0.securityPolicyPresent.boolValue; - listHolder_0->mList[i_0].channelMaskPresent = element_0.channelMaskPresent.boolValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeActiveNetworkFaultsListWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] - = static_castmList[i_0])>>(element_0.unsignedCharValue); - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestTimeFormatLocalization () -@property (readonly) chip::Controller::TimeFormatLocalizationClusterTest cppCluster; -@end - -@implementation CHIPTestTimeFormatLocalization - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeSupportedCalendarTypesWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TimeFormatLocalization::Attributes::SupportedCalendarTypes::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] - = static_castmList[i_0])>>(element_0.unsignedCharValue); - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TimeFormatLocalization::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TimeFormatLocalization::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TimeFormatLocalization::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestUnitLocalization () -@property (readonly) chip::Controller::UnitLocalizationClusterTest cppCluster; -@end - -@implementation CHIPTestUnitLocalization - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = UnitLocalization::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = UnitLocalization::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = UnitLocalization::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestUserLabel () -@property (readonly) chip::Controller::UserLabelClusterTest cppCluster; -@end - -@implementation CHIPTestUserLabel - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = UserLabel::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = UserLabel::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = UserLabel::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestWakeOnLan () -@property (readonly) chip::Controller::WakeOnLanClusterTest cppCluster; -@end - -@implementation CHIPTestWakeOnLan - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeMACAddressWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WakeOnLan::Attributes::MACAddress::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WakeOnLan::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WakeOnLan::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WakeOnLan::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WakeOnLan::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestWiFiNetworkDiagnostics () -@property (readonly) chip::Controller::WiFiNetworkDiagnosticsClusterTest cppCluster; -@end - -@implementation CHIPTestWiFiNetworkDiagnostics - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeBssidWithValue:(NSData * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::Bssid::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = [self asByteSpan:value]; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSecurityTypeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::SecurityType::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeWiFiVersionWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::WiFiVersion::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeChannelNumberWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::ChannelNumber::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeRssiWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::Rssi::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.charValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBeaconLostCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::BeaconLostCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeBeaconRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::BeaconRxCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePacketMulticastRxCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePacketMulticastTxCountWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePacketUnicastRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePacketUnicastTxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentMaxRateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestWindowCovering () -@property (readonly) chip::Controller::WindowCoveringClusterTest cppCluster; -@end - -@implementation CHIPTestWindowCovering - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::Type::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentPositionLiftWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::CurrentPositionLift::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentPositionTiltWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeConfigStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::ConfigStatus::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentPositionLiftPercentageWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentPositionTiltPercentageWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeOperationalStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::OperationalStatus::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTargetPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeTargetPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeEndProductTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::EndProductType::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeCurrentPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeInstalledOpenLimitLiftWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::InstalledOpenLimitLift::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeInstalledClosedLimitLiftWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::InstalledClosedLimitLift::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeInstalledOpenLimitTiltWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::InstalledOpenLimitTilt::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeInstalledClosedLimitTiltWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::InstalledClosedLimitTilt::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSafetyStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::SafetyStatus::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = WindowCovering::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 50d4b8a4d56c1c..ee60eb2c7150ca 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -22,7 +22,6 @@ // module headers #import -#import #import "CHIPErrorTestUtils.h" #import "CHIPTestStorage.h" @@ -53,40 +52,6 @@ // Singleton controller we use. static CHIPDeviceController * sController = nil; -// Test Util APIs -void WaitForMs(XCTestExpectation * expectation, dispatch_queue_t queue, unsigned int ms) -{ - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, ms * NSEC_PER_MSEC), queue, ^{ - [expectation fulfill]; - }); -} - -void Log(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message) -{ - NSLog(@"%@", message); - [expectation fulfill]; -} - -// Stub for User Prompts for XCTests to run. -void UserPrompt(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message) { [expectation fulfill]; } - -// Stub for reboot target device. -void Reboot(XCTestExpectation * expectation, dispatch_queue_t queue, uint16_t discriminator) { [expectation fulfill]; } - -void WaitForCommissionee(XCTestExpectation * expectation, dispatch_queue_t queue, uint64_t deviceId) -{ - CHIPDeviceController * controller = sController; - XCTAssertNotNil(controller); - - [controller getConnectedDevice:deviceId - queue:dispatch_get_main_queue() - completionHandler:^(CHIPDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertEqual(error.code, 0); - [expectation fulfill]; - mConnectedDevice = device; - }]; -} - CHIPDevice * GetConnectedDevice(void) { XCTAssertNotNil(mConnectedDevice); @@ -246,48462 +211,4 @@ - (void)testReuseChipClusterObject [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestAccessControlCluster_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for commissionee"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000001_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write entries"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:0U]; - ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; - - temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:1UL]; - ((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil; - ((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil; - - temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:2UL]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:3U]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil; - - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = temp_3; - } - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [NSNumber numberWithUnsignedLongLong:4ULL]; - temp_3[1] = [NSNumber numberWithUnsignedLongLong:5ULL]; - temp_3[2] = [NSNumber numberWithUnsignedLongLong:6ULL]; - temp_3[3] = [NSNumber numberWithUnsignedLongLong:7ULL]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = temp_3; - } - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:8U]; - ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; - - temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:9UL]; - ((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil; - ((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil; - - temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:10UL]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:11U]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil; - - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3; - } - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[2] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).privilege = [NSNumber numberWithUnsignedChar:3]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).authMode = [NSNumber numberWithUnsignedChar:3]; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [NSNumber numberWithUnsignedLongLong:12ULL]; - temp_3[1] = [NSNumber numberWithUnsignedLongLong:13ULL]; - temp_3[2] = [NSNumber numberWithUnsignedLongLong:14ULL]; - temp_3[3] = [NSNumber numberWithUnsignedLongLong:15ULL]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).subjects = temp_3; - } - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:16U]; - ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; - - temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:17UL]; - ((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil; - ((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil; - - temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:18UL]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:19U]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil; - - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).targets = temp_3; - } - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write entries Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeAclWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 3); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); - XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); - XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets count], 3); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[0]) - .cluster - == nil); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[0]) - .endpoint - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[0]).endpoint unsignedShortValue], - 0U); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[0]) - .deviceType - == nil); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[1]) - .cluster - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[1]).cluster unsignedIntValue], - 1UL); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[1]) - .endpoint - == nil); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[1]) - .deviceType - == nil); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[2]) - .cluster - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[2]).cluster unsignedIntValue], - 2UL); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[2]) - .endpoint - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[2]).endpoint unsignedShortValue], - 3U); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) - .targets[2]) - .deviceType - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).privilege unsignedCharValue], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).authMode unsignedCharValue], 2); - XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects == nil); - XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects count], 4); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[0] unsignedLongLongValue], - 4ULL); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[1] unsignedLongLongValue], - 5ULL); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[2] unsignedLongLongValue], - 6ULL); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[3] unsignedLongLongValue], - 7ULL); - XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets == nil); - XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets count], 3); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[0]) - .cluster - == nil); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[0]) - .endpoint - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[0]).endpoint unsignedShortValue], - 8U); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[0]) - .deviceType - == nil); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[1]) - .cluster - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[1]).cluster unsignedIntValue], - 9UL); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[1]) - .endpoint - == nil); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[1]) - .deviceType - == nil); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[2]) - .cluster - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[2]).cluster unsignedIntValue], - 10UL); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[2]) - .endpoint - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[2]).endpoint unsignedShortValue], - 11U); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) - .targets[2]) - .deviceType - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).fabricIndex unsignedCharValue], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).privilege unsignedCharValue], 3); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).authMode unsignedCharValue], 3); - XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects == nil); - XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects count], 4); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[0] unsignedLongLongValue], - 12ULL); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[1] unsignedLongLongValue], - 13ULL); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[2] unsignedLongLongValue], - 14ULL); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[3] unsignedLongLongValue], - 15ULL); - XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets == nil); - XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets count], 3); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[0]) - .cluster - == nil); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[0]) - .endpoint - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[0]).endpoint unsignedShortValue], - 16U); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[0]) - .deviceType - == nil); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[1]) - .cluster - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[1]).cluster unsignedIntValue], - 17UL); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[1]) - .endpoint - == nil); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[1]) - .deviceType - == nil); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[2]) - .cluster - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[2]).cluster unsignedIntValue], - 18UL); - XCTAssertFalse( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[2]) - .endpoint - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[2]).endpoint unsignedShortValue], - 19U); - XCTAssertTrue( - ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) - .targets[2]) - .deviceType - == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000003_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write entries empty lists"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = temp_3; - } - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3; - } - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write entries empty lists Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeAclWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 2); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).privilege unsignedCharValue], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects == nil); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000005_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write entry invalid privilege"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:3]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write entry invalid privilege Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 1); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeAclWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000007_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write entry invalid auth mode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:1]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write entry invalid auth mode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 1); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeAclWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000009_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write entry invalid subject"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [NSNumber numberWithUnsignedLongLong:0ULL]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = temp_3; - } - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write entry invalid subject Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 1); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeAclWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000011_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write entry invalid target"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = nil; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = nil; - ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; - - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3; - } - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write entry invalid target Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 1); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeAclWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000013_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write entry too many subjects"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [NSNumber numberWithUnsignedLongLong:1ULL]; - temp_3[1] = [NSNumber numberWithUnsignedLongLong:2ULL]; - temp_3[2] = [NSNumber numberWithUnsignedLongLong:3ULL]; - temp_3[3] = [NSNumber numberWithUnsignedLongLong:4ULL]; - temp_3[4] = [NSNumber numberWithUnsignedLongLong:5ULL]; - temp_3[5] = [NSNumber numberWithUnsignedLongLong:6ULL]; - temp_3[6] = [NSNumber numberWithUnsignedLongLong:7ULL]; - temp_3[7] = [NSNumber numberWithUnsignedLongLong:8ULL]; - temp_3[8] = [NSNumber numberWithUnsignedLongLong:9ULL]; - temp_3[9] = [NSNumber numberWithUnsignedLongLong:10ULL]; - temp_3[10] = [NSNumber numberWithUnsignedLongLong:11ULL]; - temp_3[11] = [NSNumber numberWithUnsignedLongLong:12ULL]; - temp_3[12] = [NSNumber numberWithUnsignedLongLong:13ULL]; - temp_3[13] = [NSNumber numberWithUnsignedLongLong:14ULL]; - temp_3[14] = [NSNumber numberWithUnsignedLongLong:15ULL]; - temp_3[15] = [NSNumber numberWithUnsignedLongLong:16ULL]; - temp_3[16] = [NSNumber numberWithUnsignedLongLong:17ULL]; - temp_3[17] = [NSNumber numberWithUnsignedLongLong:18ULL]; - temp_3[18] = [NSNumber numberWithUnsignedLongLong:19ULL]; - temp_3[19] = [NSNumber numberWithUnsignedLongLong:20ULL]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = temp_3; - } - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write entry too many subjects Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 1); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeAclWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000015_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write entry too many targets"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = nil; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; - - temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = [NSNumber numberWithUnsignedShort:2U]; - ((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil; - - temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:3U]; - ((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil; - - temp_3[3] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[3]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[3]).endpoint = [NSNumber numberWithUnsignedShort:4U]; - ((CHIPAccessControlClusterTarget *) temp_3[3]).deviceType = nil; - - temp_3[4] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[4]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[4]).endpoint = [NSNumber numberWithUnsignedShort:5U]; - ((CHIPAccessControlClusterTarget *) temp_3[4]).deviceType = nil; - - temp_3[5] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[5]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[5]).endpoint = [NSNumber numberWithUnsignedShort:6U]; - ((CHIPAccessControlClusterTarget *) temp_3[5]).deviceType = nil; - - temp_3[6] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[6]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[6]).endpoint = [NSNumber numberWithUnsignedShort:7U]; - ((CHIPAccessControlClusterTarget *) temp_3[6]).deviceType = nil; - - temp_3[7] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[7]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[7]).endpoint = [NSNumber numberWithUnsignedShort:8U]; - ((CHIPAccessControlClusterTarget *) temp_3[7]).deviceType = nil; - - temp_3[8] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[8]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[8]).endpoint = [NSNumber numberWithUnsignedShort:9U]; - ((CHIPAccessControlClusterTarget *) temp_3[8]).deviceType = nil; - - temp_3[9] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[9]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[9]).endpoint = [NSNumber numberWithUnsignedShort:10U]; - ((CHIPAccessControlClusterTarget *) temp_3[9]).deviceType = nil; - - temp_3[10] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[10]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[10]).endpoint = [NSNumber numberWithUnsignedShort:11U]; - ((CHIPAccessControlClusterTarget *) temp_3[10]).deviceType = nil; - - temp_3[11] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[11]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[11]).endpoint = [NSNumber numberWithUnsignedShort:12U]; - ((CHIPAccessControlClusterTarget *) temp_3[11]).deviceType = nil; - - temp_3[12] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[12]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[12]).endpoint = [NSNumber numberWithUnsignedShort:13U]; - ((CHIPAccessControlClusterTarget *) temp_3[12]).deviceType = nil; - - temp_3[13] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[13]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[13]).endpoint = [NSNumber numberWithUnsignedShort:14U]; - ((CHIPAccessControlClusterTarget *) temp_3[13]).deviceType = nil; - - temp_3[14] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[14]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[14]).endpoint = [NSNumber numberWithUnsignedShort:15U]; - ((CHIPAccessControlClusterTarget *) temp_3[14]).deviceType = nil; - - temp_3[15] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[15]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[15]).endpoint = [NSNumber numberWithUnsignedShort:16U]; - ((CHIPAccessControlClusterTarget *) temp_3[15]).deviceType = nil; - - temp_3[16] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[16]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[16]).endpoint = [NSNumber numberWithUnsignedShort:17U]; - ((CHIPAccessControlClusterTarget *) temp_3[16]).deviceType = nil; - - temp_3[17] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[17]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[17]).endpoint = [NSNumber numberWithUnsignedShort:18U]; - ((CHIPAccessControlClusterTarget *) temp_3[17]).deviceType = nil; - - temp_3[18] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[18]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[18]).endpoint = [NSNumber numberWithUnsignedShort:19U]; - ((CHIPAccessControlClusterTarget *) temp_3[18]).deviceType = nil; - - temp_3[19] = [[CHIPAccessControlClusterTarget alloc] init]; - ((CHIPAccessControlClusterTarget *) temp_3[19]).cluster = nil; - ((CHIPAccessControlClusterTarget *) temp_3[19]).endpoint = [NSNumber numberWithUnsignedShort:20U]; - ((CHIPAccessControlClusterTarget *) temp_3[19]).deviceType = nil; - - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3; - } - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write entry too many targets Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 1); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeAclWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000017_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Restore ACL"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Restore ACL Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeAclWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); - XCTAssertTrue(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); - XCTAssertEqual( - [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000019_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate resource minima (SubjectsPerAccessControlEntry)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeSubjectsPerAccessControlEntryWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate resource minima (SubjectsPerAccessControlEntry) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 4U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000020_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate resource minima (TargetsPerAccessControlEntry)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTargetsPerAccessControlEntryWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate resource minima (TargetsPerAccessControlEntry) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 3U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestAccessControlCluster_000021_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate resource minima (AccessControlEntriesPerFabric)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeAccessControlEntriesPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate resource minima (AccessControlEntriesPerFabric) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 3U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_BI_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_1_1_000003_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_1_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_1_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_BI_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read mandatory non-global attribute: OutOfService"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read mandatory non-global attribute: OutOfService Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read mandatory non-global attribute constraints: OutOfService"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read mandatory non-global attribute constraints: OutOfService Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000003_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory non-global attribute: OutOfService"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id outOfServiceArgument; - outOfServiceArgument = [NSNumber numberWithBool:0]; - [cluster - writeAttributeOutOfServiceWithValue:outOfServiceArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory non-global attribute: OutOfService Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back the mandatory non-global attribute: OutOfService"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back the mandatory non-global attribute: OutOfService Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read mandatory non-global attribute constraints: PresentValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read mandatory non-global attribute constraints: PresentValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000006_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory non-global attribute: PresentValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id presentValueArgument; - presentValueArgument = [NSNumber numberWithBool:0]; - [cluster - writeAttributePresentValueWithValue:presentValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory non-global attribute: PresentValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back the mandatory non-global attribute: PresentValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back the mandatory non-global attribute: PresentValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read mandatory non-global attribute: StatusFlags"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read mandatory non-global attribute: StatusFlags Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read mandatory non-global attribute constraints: StatusFlags"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read mandatory non-global attribute constraints: StatusFlags Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 15); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000010_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory non-global attribute: StatusFlags"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id statusFlagsArgument; - statusFlagsArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeStatusFlagsWithValue:statusFlagsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory non-global attribute: StatusFlags Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_1_000011_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back the mandatory non-global attribute: StatusFlags"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back the mandatory non-global attribute: StatusFlags Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_BI_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads PresentValue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads PresentValue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OutOfService attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OutOfService attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads StatusFlags attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads StatusFlags attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_2_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads PresentValue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads PresentValue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_2_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OutOfService attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OutOfService attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_2_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads StatusFlags attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads StatusFlags attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_2_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads StatusFlags attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads StatusFlags attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BI_2_2_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads StatusFlags attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads StatusFlags attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_BOOL_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read mandatory non-global attribute: StateValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStateValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read mandatory non-global attribute: StateValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read mandatory non-global attribute constraints: StateValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStateValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read mandatory non-global attribute constraints: StateValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_BRAC_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BRAC_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BRAC_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BRAC_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BRAC_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BRAC_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: current hue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: current hue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default value to mandatory attribute: CurrentHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentHueArgument; - currentHueArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeCurrentHueWithValue:currentHueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default value to mandatory attribute: CurrentHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: CurrentHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: CurrentSaturation"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: CurrentSaturation Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000005_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default value to mandatory attribute: CurrentSaturation"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentSaturationArgument; - currentSaturationArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster - writeAttributeCurrentSaturationWithValue:currentSaturationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default value to mandatory attribute: CurrentSaturation Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentSaturation"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: CurrentSaturation Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: CurrentX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: CurrentX Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000008_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default value to mandatory attribute: CurrentX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentXArgument; - currentXArgument = [NSNumber numberWithUnsignedShort:24939U]; - [cluster writeAttributeCurrentXWithValue:currentXArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default value to mandatory attribute: CurrentX Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: CurrentX Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: CurrentY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: CurrentY Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000011_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: CurrentY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentYArgument; - currentYArgument = [NSNumber numberWithUnsignedShort:24701U]; - [cluster writeAttributeCurrentYWithValue:currentYArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: CurrentY Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: CurrentY Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: ColorTemperatureMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorTemperatureMireds Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 2); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: Options"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorControlOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: Options Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000016_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: Options"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorControlOptionsArgument; - colorControlOptionsArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeColorControlOptionsWithValue:colorControlOptionsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: Options Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000017_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: Options"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorControlOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: Options Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: EnhancedCurrentHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: EnhancedCurrentHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000019_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: EnhancedCurrentHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id enhancedCurrentHueArgument; - enhancedCurrentHueArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeEnhancedCurrentHueWithValue:enhancedCurrentHueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: EnhancedCurrentHue Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000020_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: EnhancedCurrentHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: EnhancedCurrentHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000021_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: EnhancedColorMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: EnhancedColorMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000022_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopActive"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopActive Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000023_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopActive"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorLoopActiveArgument; - colorLoopActiveArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster - writeAttributeColorLoopActiveWithValue:colorLoopActiveArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: ColorLoopActive Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000024_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopActive"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: ColorLoopActive Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000025_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopDirection"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopDirection Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000026_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopDirection"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorLoopDirectionArgument; - colorLoopDirectionArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster - writeAttributeColorLoopDirectionWithValue:colorLoopDirectionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: ColorLoopDirection Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000027_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopDirection"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: ColorLoopDirection Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000028_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopTime Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000029_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorLoopTimeArgument; - colorLoopTimeArgument = [NSNumber numberWithUnsignedShort:25U]; - [cluster - writeAttributeColorLoopTimeWithValue:colorLoopTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: ColorLoopTime Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000030_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: ColorLoopTime Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000031_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopStartEnhancedHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopStartEnhancedHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000032_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopStartEnhancedHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorLoopStartEnhancedHueArgument; - colorLoopStartEnhancedHueArgument = [NSNumber numberWithUnsignedShort:8960U]; - [cluster writeAttributeColorLoopStartEnhancedHueWithValue:colorLoopStartEnhancedHueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: ColorLoopStartEnhancedHue " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000033_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopStartEnhancedHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: ColorLoopStartEnhancedHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000034_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopStoredEnhancedHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopStoredEnhancedHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000035_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopStoredEnhancedHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorLoopStoredEnhancedHueArgument; - colorLoopStoredEnhancedHueArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeColorLoopStoredEnhancedHueWithValue:colorLoopStoredEnhancedHueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: " - @"ColorLoopStoredEnhancedHue Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000036_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopStoredEnhancedHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: ColorLoopStoredEnhancedHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000037_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorCapabilities"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorCapabilities Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 31U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000038_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorCapabilities"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorCapabilitiesArgument; - colorCapabilitiesArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeColorCapabilitiesWithValue:colorCapabilitiesArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: ColorCapabilities Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000039_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorCapabilities"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: ColorCapabilities Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 31U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000040_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: ColorTempPhysicalMinMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorTempPhysicalMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorTempPhysicalMinMireds Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000041_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorTempPhysicalMinMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorTempPhysicalMinArgument; - colorTempPhysicalMinArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeColorTempPhysicalMinWithValue:colorTempPhysicalMinArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write the default values to mandatory attribute: ColorTempPhysicalMinMireds Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000042_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back mandatory attribute: ColorTempPhysicalMinMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorTempPhysicalMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: ColorTempPhysicalMinMireds Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000043_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: ColorTempPhysicalMaxMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorTempPhysicalMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorTempPhysicalMaxMireds Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000044_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorTempPhysicalMaxMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorTempPhysicalMaxArgument; - colorTempPhysicalMaxArgument = [NSNumber numberWithUnsignedShort:65279U]; - [cluster - writeAttributeColorTempPhysicalMaxWithValue:colorTempPhysicalMaxArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write the default values to mandatory attribute: ColorTempPhysicalMaxMireds Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000045_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back mandatory attribute: ColorTempPhysicalMaxMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorTempPhysicalMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: ColorTempPhysicalMaxMireds Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000046_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read the optional attribute: CoupleColorTempToLevelMinMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: CoupleColorTempToLevelMinMireds Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000047_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to optional attribute: CoupleColorTempToLevelMinMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id coupleColorTempToLevelMinMiredsArgument; - coupleColorTempToLevelMinMiredsArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeCoupleColorTempToLevelMinMiredsWithValue:coupleColorTempToLevelMinMiredsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to optional attribute: " - @"CoupleColorTempToLevelMinMireds Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000048_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back optional attribute: CoupleColorTempToLevelMinMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back optional attribute: CoupleColorTempToLevelMinMireds Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000049_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read the optional attribute: StartUpColorTemperatureMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeStartUpColorTemperatureMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: StartUpColorTemperatureMireds Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000050_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to optional attribute: StartUpColorTemperatureMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id startUpColorTemperatureMiredsArgument; - startUpColorTemperatureMiredsArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeStartUpColorTemperatureMiredsWithValue:startUpColorTemperatureMiredsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to optional attribute: " - @"StartUpColorTemperatureMireds Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000051_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back optional attribute: StartUpColorTemperatureMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeStartUpColorTemperatureMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back optional attribute: StartUpColorTemperatureMireds Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000052_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RemainingTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RemainingTime Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000053_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to optional attribute: RemainingTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id remainingTimeArgument; - remainingTimeArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeRemainingTimeWithValue:remainingTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to optional attribute: RemainingTime Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000054_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: RemainingTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back optional attribute: RemainingTime Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000055_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: DriftCompensation"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDriftCompensationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: DriftCompensation Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 4); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000056_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to optional attribute: DriftCompensation"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id driftCompensationArgument; - driftCompensationArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster - writeAttributeDriftCompensationWithValue:driftCompensationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to optional attribute: DriftCompensation Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000057_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: DriftCompensation"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDriftCompensationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back optional attribute: DriftCompensation Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 4); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000058_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: CompensationText"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCompensationTextWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: CompensationText Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000059_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to optional attribute: CompensationText"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id compensationTextArgument; - compensationTextArgument = @""; - [cluster - writeAttributeCompensationTextWithValue:compensationTextArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to optional attribute: CompensationText Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000060_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: CompensationText"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCompensationTextWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back optional attribute: CompensationText Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000061_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: NumberOfPrimaries"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNumberOfPrimariesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: NumberOfPrimaries Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000062_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: NumberOfPrimaries"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id numberOfPrimariesArgument; - numberOfPrimariesArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster - writeAttributeNumberOfPrimariesWithValue:numberOfPrimariesArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: NumberOfPrimaries Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000063_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: NumberOfPrimaries"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNumberOfPrimariesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: NumberOfPrimaries Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000064_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary1X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary1XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary1X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000065_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary1X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary1XArgument; - primary1XArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary1XWithValue:primary1XArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary1X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000066_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary1X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary1XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary1X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000067_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary1Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary1YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary1Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000068_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary1Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary1YArgument; - primary1YArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary1YWithValue:primary1YArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary1Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000069_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary1Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary1YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary1Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000070_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary1Intensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary1IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary1Intensity Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000071_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary2X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary2XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary2X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000072_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary2X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary2XArgument; - primary2XArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary2XWithValue:primary2XArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary2X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000073_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary2X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary2XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary2X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000074_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary2Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary2YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary2Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000075_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary2Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary2YArgument; - primary2YArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary2YWithValue:primary2YArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary2Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000076_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary2Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary2YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary2Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000077_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: Primary2Intensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary2IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: Primary2Intensity Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000078_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary3X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary3XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary3X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000079_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary3X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary3XArgument; - primary3XArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary3XWithValue:primary3XArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary3X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000080_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary3X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary3XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary3X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000081_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary3Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary3YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary3Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000082_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary3Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary3YArgument; - primary3YArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary3YWithValue:primary3YArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary3Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000083_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary3Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary3YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary3Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000084_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary3Intensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary3IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary3Intensity Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000085_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary4X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary4XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary4X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000086_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary4X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary4XArgument; - primary4XArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary4XWithValue:primary4XArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary4X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000087_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary4X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary4XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary4X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000088_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary4Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary4YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary4Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000089_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary4Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary4YArgument; - primary4YArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary4YWithValue:primary4YArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary4Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000090_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary4Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary4YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary4Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000091_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary4Intensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary4IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary4Intensity Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000092_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary5X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary5XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary5X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000093_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary5X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary5XArgument; - primary5XArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary5XWithValue:primary5XArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary5X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000094_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary5X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary5XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary5X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000095_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary5Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary5YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary5Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000096_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary5Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary5YArgument; - primary5YArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary5YWithValue:primary5YArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary5Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000097_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary5Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary5YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary5Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000098_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary5Intensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary5IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary5Intensity Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000099_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary6X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary6XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary6X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000100_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary6X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary6XArgument; - primary6XArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary6XWithValue:primary6XArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary6X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000101_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary6X"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary6XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary6X Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000102_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary6Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary6YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary6Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000103_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary6Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id primary6YArgument; - primary6YArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributePrimary6YWithValue:primary6YArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default mandatory attribute: Primary6Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000104_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary6Y"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary6YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the mandatory attribute: Primary6Y Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000105_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary6Intensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePrimary6IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary6Intensity Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000106_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: WhitePointX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeWhitePointXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: WhitePointX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000107_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: WhitePointX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id whitePointXArgument; - whitePointXArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeWhitePointXWithValue:whitePointXArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: WhitePointX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000108_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: WhitePointX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeWhitePointXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: WhitePointX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000109_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: WhitePointY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeWhitePointYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: WhitePointY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000110_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: WhitePointY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id whitePointYArgument; - whitePointYArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeWhitePointYWithValue:whitePointYArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: WhitePointY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000111_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: WhitePointY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeWhitePointYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: WhitePointY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000112_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointRX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointRXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointRX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000113_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointRX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorPointRXArgument; - colorPointRXArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeColorPointRXWithValue:colorPointRXArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: ColorPointRX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000114_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointRX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointRXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: ColorPointRX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000115_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointRY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointRYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointRY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000116_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointRY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorPointRYArgument; - colorPointRYArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeColorPointRYWithValue:colorPointRYArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: ColorPointRY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000117_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointRY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointRYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: ColorPointRY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000118_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointRIntensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointRIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointRIntensity Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000119_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default optional attribute: ColorPointRIntensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorPointRIntensityArgument; - colorPointRIntensityArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeColorPointRIntensityWithValue:colorPointRIntensityArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: ColorPointRIntensity Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000120_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointRIntensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointRIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: ColorPointRIntensity Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000121_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointGX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointGXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointGX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000122_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointGX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorPointGXArgument; - colorPointGXArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeColorPointGXWithValue:colorPointGXArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: ColorPointGX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000123_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointGX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointGXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: ColorPointGX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000124_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointGY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointGYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointGY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000125_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointGY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorPointGYArgument; - colorPointGYArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeColorPointGYWithValue:colorPointGYArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: ColorPointGY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000126_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointGY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointGYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: ColorPointGY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000127_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointGIntensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointGIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointGIntensity Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000128_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default optional attribute: ColorPointGIntensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorPointGIntensityArgument; - colorPointGIntensityArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeColorPointGIntensityWithValue:colorPointGIntensityArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: ColorPointGIntensity Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000129_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointGIntensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointGIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: ColorPointGIntensity Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000130_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointBX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointBXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointBX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000131_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointBX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorPointBXArgument; - colorPointBXArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeColorPointBXWithValue:colorPointBXArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: ColorPointBX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000132_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointBX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointBXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: ColorPointBX Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000133_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointBY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointBYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointBY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000134_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointBY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorPointBYArgument; - colorPointBYArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeColorPointBYWithValue:colorPointBYArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: ColorPointBY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000135_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointBY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointBYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: ColorPointBY Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000136_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointBIntensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointBIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointBIntensity Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000137_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default optional attribute: ColorPointBIntensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id colorPointBIntensityArgument; - colorPointBIntensityArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeColorPointBIntensityWithValue:colorPointBIntensityArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default optional attribute: ColorPointBIntensity Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000138_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointBIntensity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorPointBIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back the optional attribute: ColorPointBIntensity Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_3_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue shortest distance command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:150]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to hue shortest distance command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue longest distance command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:200]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to hue longest distance command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000006_MoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue up command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:250]; - params.direction = [NSNumber numberWithUnsignedChar:2]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to hue up command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000007_MoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue down command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:225]; - params.direction = [NSNumber numberWithUnsignedChar:3]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to hue down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000008_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_3_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_2_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_2_000003_MoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue up command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedChar:50]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move hue up command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_2_000004_MoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:50]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move hue stop command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_2_000005_MoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue down command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedChar:50]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move hue down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_2_000006_MoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:50]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move hue stop command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_2_000007_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_2_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_3_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_3_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_3_000003_StepHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue up command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedChar:5]; - params.transitionTime = [NSNumber numberWithUnsignedChar:25]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step hue up command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_3_000004_StepHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue down command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:3]; - params.stepSize = [NSNumber numberWithUnsignedChar:5]; - params.transitionTime = [NSNumber numberWithUnsignedChar:25]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step hue down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_3_000005_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_3_3_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_4_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_1_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_1_000003_MoveToSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to saturation command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveToSaturationParams alloc] init]; - params.saturation = [NSNumber numberWithUnsignedChar:90]; - params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to saturation command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_1_000004_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_4_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000003_MoveSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation up command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation up command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000004_MoveSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation down command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000005_MoveSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation up command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation up command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000006_MoveSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation stop command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation stop command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000007_MoveSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation down command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000008_MoveSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation stop command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation stop command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000009_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_2_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_4_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_3_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_3_000003_StepSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation up command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedChar:15]; - params.transitionTime = [NSNumber numberWithUnsignedChar:10]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step saturation up command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_3_000004_StepSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation down command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:3]; - params.stepSize = [NSNumber numberWithUnsignedChar:20]; - params.transitionTime = [NSNumber numberWithUnsignedChar:10]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step saturation down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_3_000005_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_3_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_4_4_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_4_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_4_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_4_000003_MoveToHueAndSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move To current hue and saturation command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveToHueAndSaturationParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:40]; - params.saturation = [NSNumber numberWithUnsignedChar:160]; - params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToHueAndSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move To current hue and saturation command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_4_000004_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_4_4_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_5_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_1_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_1_000003_MoveToColor -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to Color command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveToColorParams alloc] init]; - params.colorX = [NSNumber numberWithUnsignedShort:200U]; - params.colorY = [NSNumber numberWithUnsignedShort:300U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:20U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToColorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to Color command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_1_000004_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_5_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_2_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_2_000003_MoveColor -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move Color command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveColorParams alloc] init]; - params.rateX = [NSNumber numberWithShort:15]; - params.rateY = [NSNumber numberWithShort:20]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move Color command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_2_000004_StopMoveStep -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Move Step command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stopMoveStepWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Stop Move Step command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_2_000005_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_2_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_5_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_3_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_3_000003_StepColor -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step Color command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterStepColorParams alloc] init]; - params.stepX = [NSNumber numberWithShort:15]; - params.stepY = [NSNumber numberWithShort:20]; - params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepColorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step Color command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_3_000004_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_5_3_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_6_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_1_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_1_000003_MoveToColorTemperature -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move To Color Temperature command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveToColorTemperatureParams alloc] init]; - params.colorTemperature = [NSNumber numberWithUnsignedShort:100U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move To Color Temperature command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_1_000004_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_6_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read current color temprature"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read current color temprature Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000004_MoveColorTemperature -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move up color temperature command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedShort:10U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move up color temperature command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000005_MoveColorTemperature -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move down color temperature command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedShort:20U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move down color temperature command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000006_MoveColorTemperature -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move up color temperature command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedShort:10U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move up color temperature command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000007_MoveColorTemperature -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Color Temperature command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedShort:10U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Stop Color Temperature command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000008_MoveColorTemperature -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Move down color temperature command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedShort:20U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move down color temperature command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000009_MoveColorTemperature -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Color Temperature command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedShort:10U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Stop Color Temperature command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000010_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_2_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_6_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_3_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_3_000003_StepColorTemperature -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step up color temperature command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedShort:5U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step up color temperature command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_3_000004_StepColorTemperature -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step down color temperature command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:3]; - params.stepSize = [NSNumber numberWithUnsignedShort:5U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step down color temperature command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_3_000005_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_6_3_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_7_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_1_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_1_000003_EnhancedMoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1025U]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.transitionTime = [NSNumber numberWithUnsignedShort:1U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_1_000004_EnhancedMoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1100U]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_1_000005_EnhancedMoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1150U]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_1_000006_EnhancedMoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1200U]; - params.direction = [NSNumber numberWithUnsignedChar:2]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_1_000007_EnhancedMoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1300U]; - params.direction = [NSNumber numberWithUnsignedChar:3]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_1_000008_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_7_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000004_EnhancedMoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Up command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedShort:50U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move Hue Up command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move Hue Stop command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000006_EnhancedMoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Down command "]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedShort:5U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move Hue Down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000007_EnhancedMoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move Hue Stop command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000008_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_7_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_3_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_3_000003_EnhancedStepHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Up command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedStepHueParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:0]; - params.stepSize = [NSNumber numberWithUnsignedShort:50U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:1U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedStepHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Step Hue Up command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_3_000004_EnhancedStepHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Down command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedStepHueParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedShort:75U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:1U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedStepHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Step Hue Down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_3_000005_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_3_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_7_4_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_4_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_4_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_4_000003_EnhancedMoveToHueAndSaturation -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced move to hue and saturation command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueAndSaturationParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1200U]; - params.saturation = [NSNumber numberWithUnsignedChar:90]; - params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueAndSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced move to hue and saturation command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_4_000004_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_4_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_8_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000003_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:14]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.time = [NSNumber numberWithUnsignedShort:100U]; - params.startHue = [NSNumber numberWithUnsignedShort:500U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 100U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopStartEnhancedHue Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopStartEnhancedHue Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 500U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000008_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:1]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000010_ColorLoopSet -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Color Loop Set Command - Set direction and time while running"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:6]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:3500U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set direction and time while running Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 3500U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000013_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set direction while running"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:2]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set direction while running Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000015_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_8_1_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_9_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition : Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition : Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000003_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000005_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:2]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopDirection attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000007_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:4]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:30U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 30U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000009_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:8]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:160U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStartEnhancedHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStartEnhancedHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 160U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000011_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:1]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull EnhancedCurrentHueValue1; -- (void)testSendClusterTest_TC_CC_9_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - EnhancedCurrentHueValue1 = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000015_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue1; -- (void)testSendClusterTest_TC_CC_9_1_000017_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - ColorLoopStoredEnhancedHueValue1 = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000019_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:2]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000020_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopDirection attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000021_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:1]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000022_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull EnhancedCurrentHueValue2; -- (void)testSendClusterTest_TC_CC_9_1_000023_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - EnhancedCurrentHueValue2 = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000024_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue2); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000025_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000026_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue2; -- (void)testSendClusterTest_TC_CC_9_1_000027_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - ColorLoopStoredEnhancedHueValue2 = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000028_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue2); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000029_EnhancedMoveToHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:40960U]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000030_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 2000); - [self waitForExpectationsWithTimeout:(2000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000031_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 40960U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000032_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:2]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000033_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopDirection attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000034_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:2]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000035_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull EnhancedCurrentHueValue3; -- (void)testSendClusterTest_TC_CC_9_1_000036_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - EnhancedCurrentHueValue3 = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000037_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue3); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000038_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000039_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue3; -- (void)testSendClusterTest_TC_CC_9_1_000040_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - ColorLoopStoredEnhancedHueValue3 = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000041_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue3); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000042_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:2]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000043_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopDirection attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000044_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:2]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000045_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull EnhancedCurrentHueValue4; -- (void)testSendClusterTest_TC_CC_9_1_000046_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - EnhancedCurrentHueValue4 = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000047_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue4); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000048_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000049_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull ColorLoopStoredEnhancedHue4; -- (void)testSendClusterTest_TC_CC_9_1_000050_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - ColorLoopStoredEnhancedHue4 = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000051_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHue4); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000052_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn Off light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn Off light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_1_000053_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_9_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition: Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Precondition: Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Precondition: Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000003_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:15]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:30U]; - params.startHue = [NSNumber numberWithUnsignedShort:160U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopDirection attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopTime attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopTime attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 30U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStartEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStartEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 160U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull EnhancedCurrentHueValue; -- (void)testSendClusterTest_TC_CC_9_2_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - EnhancedCurrentHueValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000009_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:1]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000012_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:2]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopDirection attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000014_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue; -- (void)testSendClusterTest_TC_CC_9_2_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - ColorLoopStoredEnhancedHueValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000017_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000018_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_2_000019_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_CC_9_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: Turn on light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition: Turn on light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Precondition: Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Precondition: Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000003_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:15]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:30U]; - params.startHue = [NSNumber numberWithUnsignedShort:160U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopDirection attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopTime attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopTime attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 30U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStartEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStartEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 160U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000008_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributes"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:1]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull EnhancedCurrentHueValue; -- (void)testSendClusterTest_TC_CC_9_3_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - EnhancedCurrentHueValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000012_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:4]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:60U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopTime attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopTime attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 60U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000014_ColorLoopSet -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopActive attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue; -- (void)testSendClusterTest_TC_CC_9_3_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - ColorLoopStoredEnhancedHueValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000017_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000018_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light for color control tests"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light for color control tests Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_9_3_000019_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DD_1_5_000000_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, - @"Verify that the onboarding payload for NFC tags SHALL use NDEF URI Record Type Definition as defined by NFC Forum in URI " - @"Record Type Definition RTD URI"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DD_1_6_000000_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, @"Scan the DUTs QR code using a QR code reader"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DD_1_6_000001_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1 verification"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, - @"Verify the QR code gets scanned successfully and the QR code must be of sufficient size and contrast respective to " - @"surface material as to be readable with standard readers such as smartphones in normal lighting conditions"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DD_1_6_000002_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step 2 verificaiton"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, @"Verify QR code version is 1 or higher"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DD_1_7_000000_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, @"Verify manual pairing code is printed on the device or in additional provided materials"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DD_1_7_000001_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, - @"Verify that the Manual Pairing Code should be printed using a minimum font size of 6 points typically producing a " - @"typeface height of 2.1 mm"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DD_1_8_000000_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, @"Scan the device QR code using DUT"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DD_1_8_000001_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1 verification"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, - @"Verify the DUT is able to scan and parse the QR code successfully to onboard the device onto the CHIP network"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DD_1_9_000000_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, @"Verify that the manual pairing code is printed on the device or in additional provided materials"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DD_1_9_000001_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, - @"Provide the 11 digit or 21 digit pairing code from the Device in text speech or any format supported by DUT"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DD_1_9_000002_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1 verification"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, - @"Verify that the manual pairing code can be provided to DUT and parsed to onboard the device onto the CHIP network"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DM_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Data Model Revision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDataModelRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Data Model Revision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Vendor Name"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Vendor Name Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 32); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query VendorID"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query VendorID Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Product Name"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Product Name Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 32); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductID"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query ProductID Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Node Label"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Node Label Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 32); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query User Location"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query User Location Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 2); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query HardwareVersion"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query HardwareVersion Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query HardwareVersionString"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query HardwareVersionString Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue length], 1); - } - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 64); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query SoftwareVersion"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSoftwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query SoftwareVersion Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query SoftwareVersionString"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSoftwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query SoftwareVersionString Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue length], 1); - } - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 64); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query ManufacturingDate"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeManufacturingDateWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query ManufacturingDate Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue length], 8); - } - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 16); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query PartNumber"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query PartNumber Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 32); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductURL"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeProductURLWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query ProductURL Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 256); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query ProductLabel"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query ProductLabel Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 64); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query SerialNumber"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query SerialNumber Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 32); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000017_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query LocalConfigDisabled"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query LocalConfigDisabled Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Reachable"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeReachableWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Reachable Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_1_1_000019_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query UniqueID"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeUniqueIDWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query UniqueID Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 32); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DM_3_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_3_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query MaxNetworks"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestNetworkCommissioning * cluster = [[CHIPTestNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxNetworksWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query MaxNetworks Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DM_3_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Query Networks"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestNetworkCommissioning * cluster = [[CHIPTestNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNetworksWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Networks Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DL_1_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DL_1_3_000001_SetCredential -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Create new PIN credential and lock/unlock user"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0]; - params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; - [cluster setCredentialWithParams:params - completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.userIndex; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - { - id actualValue = values.nextCredentialIndex; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 2U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DL_1_3_000002_LockDoor -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: Door is in locked state"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition: Door is in locked state Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DL_1_3_000003_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id autoRelockTimeArgument; - autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; - [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DL_1_3_000004_UnlockDoor -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends the unlock Door command to the DUT with valid PINCode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster unlockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends the unlock Door command to the DUT with valid PINCode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DL_1_3_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads AutoRelockTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 10UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DL_1_3_000006_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 10000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 10000); - [self waitForExpectationsWithTimeout:(10000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DL_1_3_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads LockState attriute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LockState attriute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DL_1_3_000008_ClearCredential -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Clean the created credential"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; - params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - [cluster clearCredentialWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clean the created credential Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_EMR_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_EMR_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 3U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_EMR_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_EMR_1_1_000003_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_EMR_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 3U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_EMR_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read PHYRate attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read PHYRate attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read FullDuplex attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read FullDuplex attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read PacketRxCount attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read PacketRxCount attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read PacketTxCount attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read PacketTxCount attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read TxErrCount attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read TxErrCount attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read CollisionCount attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CollisionCount attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read OverrunCount attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read OverrunCount attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read CarrierDetect attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CarrierDetect attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ETHDIAG_1_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read TimeSinceReset attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read TimeSinceReset attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_ETHDIAG_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_FLW_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MinMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000004_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default value to optional attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id measuredValueArgument; - measuredValueArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeMeasuredValueWithValue:measuredValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default value to optional attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000005_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default value to optional attribute: MinMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minMeasuredValueArgument; - minMeasuredValueArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeMinMeasuredValueWithValue:minMeasuredValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default value to optional attribute: MinMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000006_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default value to optional attribute: MaxMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxMeasuredValueArgument; - maxMeasuredValueArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster - writeAttributeMaxMeasuredValueWithValue:maxMeasuredValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default value to optional attribute: MaxMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MinMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Tolerance Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Tolerance Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000012_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to optional attribute: Tolerance"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id toleranceArgument; - toleranceArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeToleranceWithValue:toleranceArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default value to optional attribute: Tolerance Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Tolerance Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_FLW_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_2_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_GC_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_GC_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH1 reads the BreadCrumb Attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the BreadCrumb Attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_GC_1_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH1 writes the BreadCrumb attribute as 1 to the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id breadcrumbArgument; - breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH1 writes the BreadCrumb attribute as 1 to the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_GC_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH1 reads the BreadCrumb attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the BreadCrumb attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 1ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_GC_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH1 reads the RegulatoryConfig attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRegulatoryConfigWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the RegulatoryConfig attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 2); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_GC_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH1 reads the LocationCapability attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLocationCapabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the LocationCapability attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 2); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_I_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyTime attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyType attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_I_2_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"1.Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000001_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 " - @"blink and the effect variant field set to 0x00 default"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:0]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and the " - @"effect variant field set to 0x00 default Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000002_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Manually check DUT executes a blink effect"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT executes a blink effect"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000003_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 " - @"breathe and the effect variant field set to 0x00 default"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:1]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and the " - @"effect variant field set to 0x00 default Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000004_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"check DUT executes a breathe effect"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT executes a breathe effect"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000005_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay " - @"and the effect variant field set to 0x00 default"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:2]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and the " - @"effect variant field set to 0x00 default Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000006_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"check DUT executes an okay effect"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT executes an okay effect"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000007_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b " - @"channel change and the effect variant field set to 0x00 default"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:11]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel change " - @"and the effect variant field set to 0x00 default Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000008_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"check DUT executes a channel change effect"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT executes a channel change effect"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000009_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 " - @"breathe and the effect variant field set to 0x00 default"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:1]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and the " - @"effect variant field set to 0x00 default Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000010_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"check DUT executes a breathe effect"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT executes a breathe effect"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000011_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xfe " - @"finish effect and the effect variant field set to 0x00 default"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:254]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xfe finish effect " - @"and the effect variant field set to 0x00 default Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000012_UserPrompt -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Manually check DUT stops the breathe effect after the current effect sequence"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT stops the breathe effect after the current effect sequence"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000013_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 " - @"breathe and the effect variant field set to 0x00 default"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:1]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and the " - @"effect variant field set to 0x00 default Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000014_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Manually check DUT executes a breathe effect"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT executes a breathe effect"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000015_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop " - @"effect and the effect variant field set to 0x00 default"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:255]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop effect and " - @"the effect variant field set to 0x00 default Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000016_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check DUT stops the breathe effect as soon as possible."]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT stops the breathe effect as soon as possible"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000017_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 " - @"blink and the effect variant field set to 0x42 unknown"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:0]; - params.effectVariant = [NSNumber numberWithUnsignedChar:66]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and the " - @"effect variant field set to 0x42 unknown Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000018_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check DUT executes a blink effect."]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT executes a blink effect"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000019_TriggerEffect -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop " - @"effect and the effect variant field set to 0x00 default"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:255]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop effect and " - @"the effect variant field set to 0x00 default Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_3_000020_UserPrompt -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Check DUT stops any effect that may be still running as soon as possible"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"DUT stops any effect that may be still running as soon as possible"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_ILL_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads MinMeasuredValue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads MinMeasuredValue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 1U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65533U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads MaxMeasuredValue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads MaxMeasuredValue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 2U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65534U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads Tolerance attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads LightSensorType attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_LVL_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000001_MoveToLevel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:254]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset level to 254 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000002_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentLevel attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentLevel attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the RemainingTime attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the RemainingTime attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MinLevel attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MinLevel attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MaxLevel attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MaxLevel attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentFrequency attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentFrequency attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MinFrequency attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MinFrequency attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MaxFrequency attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MaxFrequency attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnOffTransitionTime attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnOffTransitionTime attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnLevel attribute "]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnLevel attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnTransitionTime attribute "]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnTransitionTime attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OffTransitionTime attribute "]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OffTransitionTime attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the DefaultMoveRate attribute "]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the DefaultMoveRate attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_1_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the Options attribute "]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the Options attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_LVL_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnOffTransitionTime attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000002_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"writes the OnOffTransitionTime attribute on the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id onOffTransitionTimeArgument; - onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:10U]; - [cluster writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"writes the OnOffTransitionTime attribute on the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnOffTransitionTime attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 10U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000004_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"writes default value of OnOffTransitionTime attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id onOffTransitionTimeArgument; - onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"writes default value of OnOffTransitionTime attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000005_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"writes the OnLevel attribute on the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id onLevelArgument; - onLevelArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeOnLevelWithValue:onLevelArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"writes the OnLevel attribute on the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnLevel attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnLevel attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000007_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writes the OnTransitionTime attribute on the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id onTransitionTimeArgument; - onTransitionTimeArgument = [NSNumber numberWithUnsignedShort:100U]; - [cluster writeAttributeOnTransitionTimeWithValue:onTransitionTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the OnTransitionTime attribute on the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OnTransitionTime attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnTransitionTime attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 100U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000009_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writes the OffTransitionTime attribute on the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id offTransitionTimeArgument; - offTransitionTimeArgument = [NSNumber numberWithUnsignedShort:100U]; - [cluster writeAttributeOffTransitionTimeWithValue:offTransitionTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the OffTransitionTime attribute on the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the OffTransitionTime attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OffTransitionTime attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 100U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the DefaultMoveRate attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the DefaultMoveRate attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 50); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000012_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writes the DefaultMoveRate attribute on the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id defaultMoveRateArgument; - defaultMoveRateArgument = [NSNumber numberWithUnsignedChar:100]; - [cluster writeAttributeDefaultMoveRateWithValue:defaultMoveRateArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the DefaultMoveRate attribute on the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the DefaultMoveRate attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the DefaultMoveRate attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000014_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"writes the StartUpCurrentLevel attribute on the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id startUpCurrentLevelArgument; - startUpCurrentLevelArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeStartUpCurrentLevelWithValue:startUpCurrentLevelArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"writes the StartUpCurrentLevel attribute on the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_2_2_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads the StartUpCurrentLevel attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads the StartUpCurrentLevel attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_LVL_3_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads CurrentLevel attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MinLevel attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MinLevel attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the MaxLevel attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MaxLevel attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000004_MoveToLevel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:64]; - params.transitionTime = [NSNumber numberWithUnsignedShort:65535U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"sends a Move to level command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000005_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads CurrentLevel attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 64); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000007_MoveToLevel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:100]; - params.transitionTime = [NSNumber numberWithUnsignedShort:100U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"sends a Move to level command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000008_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 11000 second"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 11000); - [self waitForExpectationsWithTimeout:(11000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads CurrentLevel attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads On Off Transition Time attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads On Off Transition Time attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000011_MoveToLevel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move to level command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:128]; - params.transitionTime = [NSNumber numberWithUnsignedShort:65535U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"sends a Move to level command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000012_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 1000); - [self waitForExpectationsWithTimeout:(1000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads CurrentLevel attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 128); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000014_MoveToLevel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:254]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset level to 254 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_3_1_000015_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_LVL_4_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull MaxlevelValue; -- (void)testSendClusterTest_TC_LVL_4_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads max level attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads max level attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - MaxlevelValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000002_Move -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move up command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:32]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"sends a Move up command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000003_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"user prompt message"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, - @"Physically verify that the DUT moves at a rate of 32 units per second or as close as possible to this rate and completes " - @"moving to its maximum level"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000004_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 3000); - [self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads CurrentLevel attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, MaxlevelValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull MinlevelValue; -- (void)testSendClusterTest_TC_LVL_4_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads min level attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads min level attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - MinlevelValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000007_Move -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move down command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedChar:64]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"sends a Move down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000008_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"user prompt message"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, - @"Physically verify that the DUT moves at a rate of 64 units per second or as close as possible to this rate and complete " - @"moving to its minimum level"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000009_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 5000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 5000); - [self waitForExpectationsWithTimeout:(5000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads CurrentLevel attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nullable DefaultMoveRateValue; -- (void)testSendClusterTest_TC_LVL_4_1_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads default move rate attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads default move rate attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - DefaultMoveRateValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000012_Move -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"sends a Move up command at default move rate"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:255]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"sends a Move up command at default move rate Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000013_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads CurrentLevel attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads CurrentLevel attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedCharValue], 255); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000015_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"user prompt message"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, - @"Physically verify that the device moves at the rate recorded in step 3a and completes moving to its maximum level."); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000016_MoveToLevel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:254]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset level to 254 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_4_1_000017_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_LVL_5_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sending on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sending on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000002_Step -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: DUT level is set to its lowest point"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedChar:100]; - params.transitionTime = [NSNumber numberWithUnsignedShort:20U]; - params.optionMask = [NSNumber numberWithUnsignedChar:0]; - params.optionOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition: DUT level is set to its lowest point Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000003_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 3000); - [self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull CurrentlevelValue; -- (void)testSendClusterTest_TC_LVL_5_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads current level attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads current level attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - CurrentlevelValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000005_Step -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends step up command to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:0]; - params.stepSize = [NSNumber numberWithUnsignedChar:64]; - params.transitionTime = [NSNumber numberWithUnsignedShort:2U]; - params.optionMask = [NSNumber numberWithUnsignedChar:0]; - params.optionOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends step up command to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000006_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 5000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 5000); - [self waitForExpectationsWithTimeout:(5000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads current level attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads current level attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, CurrentlevelValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000008_Step -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends a Step down command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedChar:64]; - params.transitionTime = [NSNumber numberWithUnsignedShort:2U]; - params.optionMask = [NSNumber numberWithUnsignedChar:0]; - params.optionOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends a Step down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000009_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 4000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 4000); - [self waitForExpectationsWithTimeout:(4000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads current level attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads current level attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, CurrentlevelValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000011_MoveToLevel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:254]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset level to 254 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000012_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_5_1_000013_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sending off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sending off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_LVL_6_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sending on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sending on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000002_MoveToLevel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition: set DUT to lowest point"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:0]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition: set DUT to lowest point Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000003_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull CurrentLevelValue; -- (void)testSendClusterTest_TC_LVL_6_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentLevel attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentLevel attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1); - } - } - { - id actualValue = value; - CurrentLevelValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000005_Move -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends a move up command to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:1]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends a move up command to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000006_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 2000); - [self waitForExpectationsWithTimeout:(2000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000007_Stop -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends stop command to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterStopParams alloc] init]; - params.optionMask = [NSNumber numberWithUnsignedChar:0]; - params.optionOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stopWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends stop command to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentLevel attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentLevel attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, CurrentLevelValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000009_MoveToLevel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reset level to 254"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:254]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset level to 254 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000010_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_6_1_000011_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sending off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sending off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_2_1_000001_Sleep -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Put the device into low power mode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster sleepWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Put the device into low power mode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_6_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_7_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_8_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_9_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_10_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_3_11_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_5_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_5_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the ChannelList attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the ChannelList attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_5_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_5_2_000001_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"verify that the channel has changed on the device."); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_5_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_5_3_000001_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"verify that the channel has changed on the device"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_6_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_1_000001_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that media is paused"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_1_000002_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Physically verify that the media is playing"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the playback state attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the playback state attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_1_000004_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Physically verify that the media is paused"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_1_000005_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Physically verify that the media is stoped"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_6_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_2_000001_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that media is paused"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_2_000002_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Physically verify that the media is playing"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentState attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_2_000004_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Physically verify that the media is started over"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_2_000005_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the next media item in the queue has been loaded"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_2_000006_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the previous media item in the queue has been loaded"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_2_000007_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the media has skipped forward 10 seconds"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_2_000008_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the media has skipped backward 10 seconds"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_6_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_3_000001_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that media is paused"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_3_000002_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the media has moved to 10 seconds from the starting point."); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_3_000003_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"User prompt needed to enter the value beyond the furthest valid position"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_6_4_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_4_000001_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that media is paused"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_4_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the PlaybackSpeed attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue floatValue], 0.0f); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_4_000003_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the media is playing"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_4_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentState attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_4_000005_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the media play speed has increased"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_4_000006_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the media play has reversed direction"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_4_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentState attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_4_000008_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the media play has reversed direction"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_6_4_000009_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"log a command"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Verify that the media is has resumed playing forward at the default speed"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_7_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_7_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_8_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_8_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the CurrentTarget attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentTarget attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_8_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the TargetList attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTargetListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the TargetList attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_9_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_9_1_000001_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, @"DUT has one or more Content Apps available"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_9_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the VendorName attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the VendorName attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 32); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_9_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the VendorID attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the VendorID attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_9_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the ApplicationName attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeApplicationNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the ApplicationName attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 256); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_9_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the ProductID attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the ProductID attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_9_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the Status attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the Status attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_9_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the ApplicationVersion attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeApplicationVersionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the ApplicationVersion attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 32); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MC_10_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_10_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the AcceptHeader attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptHeaderWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AcceptHeader attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MC_10_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"TH reads the SupportedStreamingProtocols attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSupportedStreamingProtocolsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the SupportedStreamingProtocols attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_MOD_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MOD_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the ClusterRevision attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MOD_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the AttributeList attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MOD_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_MOD_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_OCC_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads mandatory attribute constrains: Occupancy"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute constrains: Occupancy Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the respective default value to mandatory attribute: Occupancy"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupancyArgument; - occupancyArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeOccupancyWithValue:occupancyArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the respective default value to mandatory attribute: Occupancy Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: Occupancy"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: Occupancy Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads mandatory attribute constrains: OccupancySensorType"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute constrains: OccupancySensorType Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 3); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_1_000005_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the respective default value to mandatory attribute: OccupancySensorType"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupancySensorTypeArgument; - occupancySensorTypeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeOccupancySensorTypeWithValue:occupancySensorTypeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the respective default value to mandatory attribute: OccupancySensorType " - @"Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: OccupancySensorType"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: OccupancySensorType Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 7); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_1_000008_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the respective default value to mandatory attribute: OccupancySensorTypeBitmap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupancySensorTypeBitmapArgument; - occupancySensorTypeBitmapArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeOccupancySensorTypeBitmapWithValue:occupancySensorTypeBitmapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the respective default value to mandatory attribute: " - @"OccupancySensorTypeBitmap Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back mandatory attribute: OccupancySensorTypeBitmap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: OccupancySensorTypeBitmap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_OCC_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull OccupancyValue; -- (void)testSendClusterTest_TC_OCC_2_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads Occupancy attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads Occupancy attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = value; - OccupancyValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_2_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads back Occupancy attribute from DUT after few seconds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back Occupancy attribute from DUT after few seconds Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_OO_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: OnOff"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: OnOff Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: GlobalSceneControl"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OnTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: OnTime Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OffWaitTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: OffWaitTime Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: StartUpOnOff"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: StartUpOnOff Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_OO_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000001_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000003_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000005_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000007_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000009_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000011_Toggle -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Toggle Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000012_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 1000); - [self waitForExpectationsWithTimeout:(1000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000013_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Check on/off attribute value is true after toggle command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after toggle command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000014_Toggle -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Toggle Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000015_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 1000); - [self waitForExpectationsWithTimeout:(1000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000016_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Check on/off attribute value is false after toggle command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after toggle command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000017_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User prompt Set OnOff attribute manually to on"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operate on device to set OnOff attribute manually to on"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000018_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User prompt Set OnOff attribute manually to off"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operate on device to set OnOff attribute manually to off"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000019_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reset Off Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset Off Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000020_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_OO_2_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000001_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000002_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 1000); - [self waitForExpectationsWithTimeout:(1000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads GlobalSceneControl attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000005_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000006_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 1000); - [self waitForExpectationsWithTimeout:(1000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads GlobalSceneControl attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000009_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000010_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 1000); - [self waitForExpectationsWithTimeout:(1000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads GlobalSceneControl attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads GlobalSceneControl attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000015_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000017_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000019_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000020_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000021_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000022_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000023_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000024_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000025_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000026_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000027_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000028_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000029_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000030_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000031_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000032_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000033_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000034_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000035_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000036_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000037_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000038_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000039_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000040_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000041_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000042_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000043_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnOff attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnOff attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000044_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OnTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OnTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000045_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads OffWaitTime attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads OffWaitTime attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_3_000046_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_PS_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Test Harness Client reads Status attribute from Server DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads Status attribute from Server DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 3); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Test Harness Client reads Order attribute from Server DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOrderWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads Order attribute from Server DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Test Harness Client reads Description attribute from Server DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads Description attribute from Server DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Test Harness Client reads BatVoltage from Server DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBatteryVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatVoltage from Server DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Test Harness Client reads BatPercentRemaining from Server DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBatteryPercentRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatPercentRemaining from Server DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 200); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Test Harness Client reads BatTimeRemaining from Server DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBatteryTimeRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatTimeRemaining from Server DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Test Harness Client reads BatChargeLevel from Server DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatChargeLevel from Server DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 2); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_2_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Test Harness Client reads ActiveBatFaults from Server DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads ActiveBatFaults from Server DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Test Harness Client reads BatChargeState from Server DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatChargeState from Server DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 3); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_PRS_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute constraints: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute constraints: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_2_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id measuredValueArgument; - measuredValueArgument = [NSNumber numberWithShort:0]; - [cluster - writeAttributeMeasuredValueWithValue:measuredValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read the mandatory attribute constraints: MinMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute constraints: MinMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_2_1_000005_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: MinMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minMeasuredValueArgument; - minMeasuredValueArgument = [NSNumber numberWithShort:0]; - [cluster - writeAttributeMinMeasuredValueWithValue:minMeasuredValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: MinMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: MinMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: MinMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read the mandatory attribute constraints: MaxMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute constraints: MaxMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_2_1_000008_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write the default values to mandatory attribute: MaxMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxMeasuredValueArgument; - maxMeasuredValueArgument = [NSNumber numberWithShort:0]; - [cluster - writeAttributeMaxMeasuredValueWithValue:maxMeasuredValueArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory attribute: MaxMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: MaxMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back mandatory attribute: MaxMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_PCC_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_1_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_1_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_1_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_1_1_000008_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to optional global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_1_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back optional global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_PCC_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxSpeed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxFlow"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: Capacity Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxSpeed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxFlow"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: Capacity Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstPressure Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinCompPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinCompPressure Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxCompPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000017_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstSpeed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstSpeed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000019_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstFlow"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstFlow Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000020_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstFlow"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000021_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstTemp"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstTemp Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000022_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstTemp"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000023_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: PumpStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000024_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: PumpStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000025_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Speed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Speed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000026_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeRunningHours"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000027_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeRunningHours"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000028_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Power"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Power Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000029_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeEnergyConsumed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000030_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeEnergyConsumed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000031_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"write to the optional attribute: LifetimeEnergyConsumed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write to the optional attribute: LifetimeEnergyConsumed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000032_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstPressure Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000033_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000034_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinCompPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinCompPressure Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000035_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxCompPressure"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000036_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstSpeed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000037_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstSpeed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000038_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstFlow"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstFlow Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000039_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstFlow"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000040_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MinConstTemp"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstTemp Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 32767); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000041_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: MaxConstTemp"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 32767); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000042_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: PumpStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000043_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: PumpStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000044_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Speed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Speed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000045_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeRunningHours"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000046_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeRunningHours"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000047_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Power"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Power Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000048_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeEnergyConsumed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_1_000049_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: LifetimeEnergyConsumed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeEnergyConsumed Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_PCC_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_2_000001_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write 1 to the OperationMode attribute to DUT: OperationMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id operationModeArgument; - operationModeArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeOperationModeWithValue:operationModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 1 to the OperationMode attribute to DUT: OperationMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveOperationMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_2_000003_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write 2 to the OperationMode attribute to DUT: OperationMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id operationModeArgument; - operationModeArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeOperationModeWithValue:operationModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 2 to the OperationMode attribute to DUT: OperationMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_2_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveOperationMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 2); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_2_000005_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write 3 to the OperationMode attribute to DUT: OperationMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id operationModeArgument; - operationModeArgument = [NSNumber numberWithUnsignedChar:3]; - [cluster writeAttributeOperationModeWithValue:operationModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 3 to the OperationMode attribute to DUT: OperationMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_2_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveOperationMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 3); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_PCC_2_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000001_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 0 to the OperationMode attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id operationModeArgument; - operationModeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeOperationModeWithValue:operationModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 0 to the OperationMode attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveOperationMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000003_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 0 to the ControlMode attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 0 to the ControlMode attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000005_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 1 to the ControlMode attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 1 to the ControlMode attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000007_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 2 to the ControlMode attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 2 to the ControlMode attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 2); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000009_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 3 to the ControlMode attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:3]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 3 to the ControlMode attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 3); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000011_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 5 to the ControlMode attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:5]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 5 to the ControlMode attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 5); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000013_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 7 to the ControlMode attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id controlModeArgument; - controlModeArgument = [NSNumber numberWithUnsignedChar:7]; - [cluster writeAttributeControlModeWithValue:controlModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 7 to the ControlMode attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_3_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 7); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_PCC_2_4_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000001_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 1 to the LifetimeRunningHours attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id lifetimeRunningHoursArgument; - lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 1 to the LifetimeRunningHours attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeRunningHours"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 1UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000003_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 2 to the LifetimeRunningHours attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id lifetimeRunningHoursArgument; - lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:2UL]; - [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 2 to the LifetimeRunningHours attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeRunningHours"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 2UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000005_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 3 to the LifetimeRunningHours attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id lifetimeRunningHoursArgument; - lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:3UL]; - [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 3 to the LifetimeRunningHours attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeRunningHours"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 3UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000007_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 1 to the LifetimeEnergyConsumed attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 1 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 1UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000009_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 2 to the LifetimeEnergyConsumed attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:2UL]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 2 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 2UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000011_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write 3 to the LifetimeEnergyConsumed attribute to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - id lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:3UL]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write 3 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PCC_2_4_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 3UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_PSCFG_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Commission DUT to TH"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PSCFG_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the ClusterRevision attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PSCFG_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the AttributeList attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PSCFG_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the AcceptedCommandList attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AcceptedCommandList attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PSCFG_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the GeneratedCommandList attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSourceConfiguration * cluster = [[CHIPTestPowerSourceConfiguration alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the GeneratedCommandList attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_RH_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_RH_2_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of attribute: MinMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of attribute: MinMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 9999U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_RH_2_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads MeasuredValue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads MeasuredValue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_RH_2_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_SWTCH_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read NumberOfPositions attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read NumberOfPositions attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 2); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read NumberOfPositions attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read NumberOfPositions attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 2); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentPosition attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentPosition attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read MultiPressMax attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read MultiPressMax attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 2); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read MultiPressMax attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read MultiPressMax attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 2); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_SWTCH_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000001_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Set up subscription to SwitchLatched event"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000002_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator sets switch to first position"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentPosition attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000004_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator sets switch to second position"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000005_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Set up subscription to InitialPress event"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000006_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator does not operate switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentPosition attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000008_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator sets switch to second position"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000009_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator does not operate switch (release switch)"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000010_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Set up subscription to InitialPress and ShortRelease events"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000011_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator does not operate switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000012_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000013_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000014_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch for 5 seconds"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000015_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 3000); - [self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000016_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000017_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000018_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator does not operate switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000019_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000020_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000021_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch for 5 seconds"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000022_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 3000); - [self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000023_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000024_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt( - expectation, queue, @"Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000025_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator does not operate switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000026_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000027_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000028_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000029_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000030_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000031_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000032_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000033_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000034_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000035_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000036_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWTCH_2_2_000037_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"Operator releases switch"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_TM_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MinMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 32766); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -27314); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 32767); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Tolerance Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_TM_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_2_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MinMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MinMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -27315); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 32766); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_2_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxMeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxMeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -27314); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 32767); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_2_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads MeasuredValue attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads MeasuredValue attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_2_2_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: MeasuredValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_TSTAT_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read the optional global attribute constraints: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional global attribute constraints: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_TSTAT_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: LocalTemperature"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLocalTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: LocalTemperature Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAbsMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAbsMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of optional attributes from DUT: AbsMinCoolSetpointLimit"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAbsMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: AbsMinCoolSetpointLimit Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of optional attributes from DUT: AbsMaxCoolSetpointLimit"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAbsMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: AbsMaxCoolSetpointLimit Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 2600); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 2600); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of optional attributes from DUT: MinCoolSetpointLimit"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: MinCoolSetpointLimit Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000011_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000012_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of mandatory attributes from DUT: SystemMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSystemModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: SystemMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000014_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of optional attributes from DUT: MinSetpointDeadBand"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: MinSetpointDeadBand Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue charValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue charValue], 25); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000015_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of optional attributes from DUT: StartOfWeek"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStartOfWeekWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: StartOfWeek Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000016_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNumberOfWeeklyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_1_000017_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads constraints of optional attributes from DUT: NumberOfDailyTransitions"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNumberOfDailyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: NumberOfDailyTransitions Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_TSTAT_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription: - @"Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog( - @"Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 2600); - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 2600); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for OccupiedCoolingSetpoint " - @"attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self - expectationWithDescription:@"Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 2000); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000004_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint " - @"attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000005_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint " - @"attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000006_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription: - @"Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog( - @"Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 2000); - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000007_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2100]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for OccupiedHeatingSetpoint " - @"attribute Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self - expectationWithDescription:@"Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 2100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000009_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint " - @"attribute Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000010_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint " - @"attribute Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000011_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription: - @"Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 700); - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000012_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value back that is different but valid for MinHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for MinHeatSetpointLimit " - @"attribute Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000013_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 2000); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000014_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000015_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000016_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription: - @"Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 3000); - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000017_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value back that is different but valid for MaxHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for MaxHeatSetpointLimit " - @"attribute Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000018_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 2000); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000019_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000020_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000021_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription: - @"Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 1600); - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000022_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value back that is different but valid for MinCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for MinCoolSetpointLimit " - @"attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000023_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 2000); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000024_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute " - @"Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000025_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; - [cluster - writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000026_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription: - @"Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 3200); - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000027_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value back that is different but valid for MaxCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value back that is different but valid for MaxCoolSetpointLimit " - @"attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000028_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 2000); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000029_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute " - @"Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000030_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; - [cluster - writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000031_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit " - @"attribute Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000032_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit " - @"attribute Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000033_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit " - @"attribute Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000034_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit " - @"attribute Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000035_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit " - @"attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000036_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit " - @"attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000037_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit " - @"attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000038_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = [NSNumber numberWithShort:3200]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit " - @"attribute Error: %@", - err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000039_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 4); - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000040_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write Attribute command for ControlSequenceOfOperation with a new valid value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id controlSequenceOfOperationArgument; - controlSequenceOfOperationArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeControlSequenceOfOperationWithValue:controlSequenceOfOperationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Attribute command for ControlSequenceOfOperation with a new valid " - @"value Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000041_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read it back again to confirm the successful write"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read it back again to confirm the successful write Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 2); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000042_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedHeatingSetpoint to default value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000043_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedHeatingSetpoint to default value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000044_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedCoolingSetpoint to default value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000045_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedCoolingSetpoint to default value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000046_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedCoolingSetpoint to default value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000047_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedHeatingSetpoint to default value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000048_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedCoolingSetpoint to default value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSTAT_2_2_000049_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sets OccupiedHeatingSetpoint to default value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; - [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_TSUIC_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_TSUIC_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000001_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value of 0 to TemperatureDisplayMode attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id temperatureDisplayModeArgument; - temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster - writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 0 to TemperatureDisplayMode attribute of DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value of 1 to TemperatureDisplayMode attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id temperatureDisplayModeArgument; - temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster - writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 1 to TemperatureDisplayMode attribute of DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000003_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value of greater than 1 to TemperatureDisplayMode attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id temperatureDisplayModeArgument; - temperatureDisplayModeArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of greater than 1 to TemperatureDisplayMode attribute of DUT " - @"Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000004_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 0 to KeypadLockout attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 0 to KeypadLockout attribute of DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000005_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 1 to KeypadLockout attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 1 to KeypadLockout attribute of DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000006_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 2 to KeypadLockout attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 2 to KeypadLockout attribute of DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000007_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 3 to KeypadLockout attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:3]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 3 to KeypadLockout attribute of DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000008_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 4 to KeypadLockout attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:4]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 4 to KeypadLockout attribute of DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000009_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writes a value of 5 to KeypadLockout attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:5]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 5 to KeypadLockout attribute of DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000010_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value of greater than 5 to KeypadLockout attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id keypadLockoutArgument; - keypadLockoutArgument = [NSNumber numberWithUnsignedChar:6]; - [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of greater than 5 to KeypadLockout attribute of DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000011_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000012_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TSUIC_2_2_000013_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Writes a value of greater than 1 to ScheduleProgrammingVisibility attribute of DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes a value of greater than 1 to ScheduleProgrammingVisibility " - @"attribute of DUT Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_1_000001_ResetCounts -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ResetCounts command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ResetCounts command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the Overruncount attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the Overruncount attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: Channel"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeChannelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: Channel Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: NetworkName"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNetworkNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: NetworkName Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 16); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: PanId"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: PanId Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ExtendedPanId"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeExtendedPanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ExtendedPanId Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: OverrunCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: OverrunCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read PartitionId attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read PartitionId attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: PartitionId"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: PartitionId Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read Weighting attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read Weighting attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: weighting"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: weighting Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read DataVersion attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read DataVersion attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: DataVersion"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: DataVersion Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read StableDataVersion attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read StableDataVersion attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: StableDataVersion"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: StableDataVersion Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read LeaderRouterId attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LeaderRouterId attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: LeaderRouterId"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: LeaderRouterId Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read DetachedRoleCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read DetachedRoleCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000017_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: DetachedRoleCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: DetachedRoleCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read ChildRoleCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read ChildRoleCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000019_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ChildRoleCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ChildRoleCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000020_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RouterRoleCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RouterRoleCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000021_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RouterRoleCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RouterRoleCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000022_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read LeaderRoleCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LeaderRoleCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000023_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: LeaderRoleCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: LeaderRoleCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000024_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read AttachAttemptCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read AttachAttemptCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000025_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: AttachAttemptCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: AttachAttemptCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000026_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read PartitionIdChangeCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read PartitionIdChangeCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000027_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: PartitionIdChangeCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: PartitionIdChangeCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000028_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read BetterPartitionAttachAttemptCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read BetterPartitionAttachAttemptCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000029_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: BetterPartitionAttachAttemptCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: BetterPartitionAttachAttemptCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000030_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read ParentChangeCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read ParentChangeCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000031_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ParentChangeCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ParentChangeCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000032_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxTotalCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxTotalCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000033_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxTotalCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxTotalCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000034_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxUnicastCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxUnicastCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000035_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxUnicastCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxUnicastCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000036_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxBroadcastCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxBroadcastCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000037_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxBroadcastCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxBroadcastCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000038_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxNoAckRequestedCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxNoAckRequestedCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000039_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxNoAckRequestedCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxNoAckRequestedCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000040_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxDataCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxDataCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000041_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxDataCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxDataCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000042_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxDataPollCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxDataPollCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000043_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxDataPollCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxDataPollCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000044_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxBeaconCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxBeaconCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000045_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxBeaconCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxBeaconCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000046_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxBeaconRequestCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxBeaconRequestCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000047_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxBeaconRequestCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxBeaconRequestCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000048_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxOtherCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxOtherCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000049_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxOtherCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxOtherCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000050_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxRetryCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxRetryCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000051_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxRetryCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxRetryCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000052_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxDirectMaxRetryExpiryCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxDirectMaxRetryExpiryCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000053_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: TxDirectMaxRetryExpiryCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxDirectMaxRetryExpiryCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000054_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxIndirectMaxRetryExpiryCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxIndirectMaxRetryExpiryCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000055_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: TxIndirectMaxRetryExpiryCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxIndirectMaxRetryExpiryCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000056_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxErrCcaCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxErrCcaCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000057_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxErrCcaCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxErrCcaCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000058_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxErrAbortCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxErrAbortCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000059_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxErrAbortCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxErrAbortCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000060_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read TxErrBusyChannelCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read TxErrBusyChannelCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000061_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxErrBusyChannelCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: TxErrBusyChannelCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000062_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxTotalCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxTotalCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000063_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxTotalCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxTotalCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000064_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxUnicastCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxUnicastCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000065_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxUnicastCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxUnicastCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000066_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxBroadcastCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxBroadcastCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000067_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxBroadcastCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxBroadcastCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000068_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxDataCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxDataCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000069_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxDataCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxDataCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000070_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxDataPollCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxDataPollCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000071_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxDataPollCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxDataPollCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000072_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxBeaconCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxBeaconCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000073_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxBeaconCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxBeaconCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000074_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxBeaconRequestCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxBeaconRequestCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000075_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxBeaconRequestCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxBeaconRequestCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000076_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxOtherCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxOtherCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000077_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxOtherCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxOtherCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000078_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxAddressFilteredCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxAddressFilteredCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000079_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: RxAddressFilteredCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxAddressFilteredCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000080_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxDestAddrFilteredCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxDestAddrFilteredCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000081_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: RxDestAddrFilteredCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxDestAddrFilteredCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000082_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxDuplicatedCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxDuplicatedCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000083_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxDuplicatedCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxDuplicatedCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000084_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrNoFrameCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrNoFrameCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000085_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxErrNoFrameCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrNoFrameCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000086_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrUnknownNeighborCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrUnknownNeighborCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000087_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: RxErrUnknownNeighborCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrUnknownNeighborCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000088_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrInvalidScrAddrCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrInvalidScrAddrCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000089_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: RxErrInvalidSrcAddrCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrInvalidSrcAddrCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000090_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrSecCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrSecCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000091_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: RxErrInvalidSrcAddrCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrInvalidSrcAddrCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000092_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrFcsCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrFcsCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000093_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxErrFcsCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrFcsCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000094_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrOtherCount attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read RxErrOtherCount attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000095_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxErrOtherCount"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RxErrOtherCount Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000096_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read ActiveTimestamp attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read ActiveTimestamp attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000097_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ActiveTimestamp"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ActiveTimestamp Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000098_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read PendingTimestamp attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read PendingTimestamp attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000099_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: PendingTimestamp"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: PendingTimestamp Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000100_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read Delay attribute value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read Delay attribute value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000101_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: delay"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: delay Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_LC_1_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LC_1_2_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH1 reads LabelList attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads LabelList attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads NetworkInterface structure attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGeneralDiagnostics * cluster = [[CHIPTestGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads NetworkInterface structure attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads SecurityType attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads SecurityType attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads SecurityType attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads SecurityType attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads WiFiVersion attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeWiFiVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads WiFiVersion attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads ChannelNumber attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeChannelNumberWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads ChannelNumber attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads RSSI attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRssiWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads RSSI attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue charValue], -120); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue charValue], 0); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WIFIDIAG_3_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 5U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 200U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_1_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO mandatory global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:201U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 201U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 0UL); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 32768UL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_1_1_000006_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write the default value to optional global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:32769UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write the default value to optional global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_1_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back global attribute: FeatureMap Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedIntValue], 32769UL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the RO mandatory attribute default: Type"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO mandatory attribute default: Type Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000002_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3a: write a value into the RO mandatory attribute: Type"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id typeArgument; - typeArgument = [NSNumber numberWithUnsignedChar:250]; - [cluster writeAttributeTypeWithValue:typeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory attribute: Type Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back the RO mandatory attribute: Type"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO mandatory attribute: Type Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedCharValue], 250); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the RO mandatory attribute default: ConfigStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO mandatory attribute default: ConfigStatus Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 63); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000005_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO mandatory attribute: ConfigStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id configStatusArgument; - configStatusArgument = [NSNumber numberWithUnsignedChar:128]; - [cluster writeAttributeConfigStatusWithValue:configStatusArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory attribute: ConfigStatus Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back the RO mandatory attribute: ConfigStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO mandatory attribute: ConfigStatus Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedCharValue], 128); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO mandatory attribute default: OperationalStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO mandatory attribute default: OperationalStatus Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 63); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000008_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO mandatory attribute: OperationalStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id operationalStatusArgument; - operationalStatusArgument = [NSNumber numberWithUnsignedChar:128]; - [cluster - writeAttributeOperationalStatusWithValue:operationalStatusArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory attribute: OperationalStatus Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO mandatory attribute: OperationalStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO mandatory attribute: OperationalStatus Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedCharValue], 128); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000010_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO mandatory attribute default: EndProductType"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO mandatory attribute default: EndProductType Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 23); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000011_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO mandatory attribute: EndProductType"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id endProductTypeArgument; - endProductTypeArgument = [NSNumber numberWithUnsignedChar:250]; - [cluster - writeAttributeEndProductTypeWithValue:endProductTypeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO mandatory attribute: EndProductType Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000012_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO mandatory attribute: EndProductType"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO mandatory attribute: EndProductType Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedCharValue], 250); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2: read the RW mandatory attribute default: Mode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RW mandatory attribute default: Mode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 15); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000014_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3a: write a value into the RW mandatory attribute:: Mode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:8]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RW mandatory attribute:: Mode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3b: reads back the RW mandatory attribute: Mode"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RW mandatory attribute: Mode Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 8); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000016_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO optional attribute default: TargetPositionLiftPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: TargetPositionLiftPercent100ths Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000017_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO optional attribute: TargetPositionLiftPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id targetPositionLiftPercent100thsArgument; - targetPositionLiftPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; - [cluster writeAttributeTargetPositionLiftPercent100thsWithValue:targetPositionLiftPercent100thsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"TargetPositionLiftPercent100ths Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000018_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO optional attribute: TargetPositionLiftPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: TargetPositionLiftPercent100ths Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 20000U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000019_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO optional attribute default: TargetPositionTiltPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: TargetPositionTiltPercent100ths Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000020_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO optional attribute: TargetPositionTiltPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id targetPositionTiltPercent100thsArgument; - targetPositionTiltPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; - [cluster writeAttributeTargetPositionTiltPercent100thsWithValue:targetPositionTiltPercent100thsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"TargetPositionTiltPercent100ths Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000021_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO optional attribute: TargetPositionTiltPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: TargetPositionTiltPercent100ths Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 20000U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000022_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO optional attribute default: CurrentPositionLiftPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: CurrentPositionLiftPercent100ths Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000023_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO optional attribute: CurrentPositionLiftPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentPositionLiftPercent100thsArgument; - currentPositionLiftPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; - [cluster writeAttributeCurrentPositionLiftPercent100thsWithValue:currentPositionLiftPercent100thsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"CurrentPositionLiftPercent100ths Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000024_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO optional attribute: CurrentPositionLiftPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: CurrentPositionLiftPercent100ths Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 20000U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000025_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO optional attribute default: CurrentPositionTiltPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: CurrentPositionTiltPercent100ths Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000026_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO optional attribute: CurrentPositionTiltPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentPositionTiltPercent100thsArgument; - currentPositionTiltPercent100thsArgument = [NSNumber numberWithUnsignedShort:20000U]; - [cluster writeAttributeCurrentPositionTiltPercent100thsWithValue:currentPositionTiltPercent100thsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: " - @"CurrentPositionTiltPercent100ths Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000027_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO optional attribute: CurrentPositionTiltPercent100ths"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: CurrentPositionTiltPercent100ths Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 20000U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000028_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO optional attribute default: InstalledOpenLimitLift"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: InstalledOpenLimitLift Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000029_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO optional attribute: InstalledOpenLimitLift"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id installedOpenLimitLiftArgument; - installedOpenLimitLiftArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster - writeAttributeInstalledOpenLimitLiftWithValue:installedOpenLimitLiftArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: InstalledOpenLimitLift Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000030_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO optional attribute: InstalledOpenLimitLift"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: InstalledOpenLimitLift Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000031_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO optional attribute default: InstalledClosedLimitLift"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: InstalledClosedLimitLift Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000032_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO optional attribute: InstalledClosedLimitLift"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id installedClosedLimitLiftArgument; - installedClosedLimitLiftArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster writeAttributeInstalledClosedLimitLiftWithValue:installedClosedLimitLiftArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: InstalledClosedLimitLift " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000033_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO optional attribute: InstalledClosedLimitLift"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: InstalledClosedLimitLift Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000034_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO optional attribute default: InstalledOpenLimitTilt"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: InstalledOpenLimitTilt Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000035_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO optional attribute: InstalledOpenLimitTilt"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id installedOpenLimitTiltArgument; - installedOpenLimitTiltArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster - writeAttributeInstalledOpenLimitTiltWithValue:installedOpenLimitTiltArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: InstalledOpenLimitTilt Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000036_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO optional attribute: InstalledOpenLimitTilt"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: InstalledOpenLimitTilt Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000037_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2: read the RO optional attribute default: InstalledClosedLimitTilt"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2: read the RO optional attribute default: InstalledClosedLimitTilt Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000038_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: write a value into the RO optional attribute: InstalledClosedLimitTilt"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id installedClosedLimitTiltArgument; - installedClosedLimitTiltArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster writeAttributeInstalledClosedLimitTiltWithValue:installedClosedLimitTiltArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: write a value into the RO optional attribute: InstalledClosedLimitTilt " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000039_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: reads back the RO optional attribute: InstalledClosedLimitTilt"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: reads back the RO optional attribute: InstalledClosedLimitTilt Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000040_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"4: read the RO mandatory attribute default: SafetyStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO mandatory attribute default: SafetyStatus Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2047U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000041_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"5a: write a value into the RO mandatory attribute: SafetyStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id safetyStatusArgument; - safetyStatusArgument = [NSNumber numberWithUnsignedShort:4096U]; - [cluster writeAttributeSafetyStatusWithValue:safetyStatusArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO mandatory attribute: SafetyStatus Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000042_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"5b: reads back the RO mandatory attribute: SafetyStatus"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO mandatory attribute: SafetyStatus Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 4096U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000043_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"4: read the RO optional attribute default: CurrentPositionLift"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO optional attribute default: CurrentPositionLift Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000044_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"5a: write a value into the RO optional attribute: CurrentPositionLift"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentPositionLiftArgument; - currentPositionLiftArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster - writeAttributeCurrentPositionLiftWithValue:currentPositionLiftArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO optional attribute: CurrentPositionLift Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000045_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"5b: reads back the RO optional attribute: CurrentPositionLift"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO optional attribute: CurrentPositionLift Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000046_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"4: read the RO optional attribute default: CurrentPositionTilt"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO optional attribute default: CurrentPositionTilt Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000047_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"5a: write a value into the RO optional attribute: CurrentPositionTilt"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentPositionTiltArgument; - currentPositionTiltArgument = [NSNumber numberWithUnsignedShort:255U]; - [cluster - writeAttributeCurrentPositionTiltWithValue:currentPositionTiltArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO optional attribute: CurrentPositionTilt Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000048_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"5b: reads back the RO optional attribute: CurrentPositionTilt"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO optional attribute: CurrentPositionTilt Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000049_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"4: read the RO optional attribute default: CurrentPositionLiftPercentage"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO optional attribute default: CurrentPositionLiftPercentage Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000050_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"5a: write a value into the RO optional attribute: CurrentPositionLiftPercentage"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentPositionLiftPercentageArgument; - currentPositionLiftPercentageArgument = [NSNumber numberWithUnsignedChar:200]; - [cluster writeAttributeCurrentPositionLiftPercentageWithValue:currentPositionLiftPercentageArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO optional attribute: " - @"CurrentPositionLiftPercentage Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000051_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"5b: reads back the RO optional attribute: CurrentPositionLiftPercentage"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO optional attribute: CurrentPositionLiftPercentage Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedCharValue], 200); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000052_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"4: read the RO optional attribute default: CurrentPositionTiltPercentage"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"4: read the RO optional attribute default: CurrentPositionTiltPercentage Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000053_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"5a: write a value into the RO optional attribute: CurrentPositionTiltPercentage"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id currentPositionTiltPercentageArgument; - currentPositionTiltPercentageArgument = [NSNumber numberWithUnsignedChar:200]; - [cluster writeAttributeCurrentPositionTiltPercentageWithValue:currentPositionTiltPercentageArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"5a: write a value into the RO optional attribute: " - @"CurrentPositionTiltPercentage Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_1_000054_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"5b: reads back the RO optional attribute: CurrentPositionTiltPercentage"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: reads back the RO optional attribute: CurrentPositionTiltPercentage Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedCharValue], 200); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_2_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000001_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH set the Mode Attribute bit0 of the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"1a: TH set the Mode Attribute bit0 of the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"1b: TH reads ConfigStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1b: TH reads ConfigStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 4); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 127); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000003_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"1c: TH clear the Mode Attribute bit0 of the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"1c: TH clear the Mode Attribute bit0 of the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"1d: TH reads ConfigStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1d: TH reads ConfigStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 127); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000005_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH set the Mode Attribute bit1 of the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:2]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH set the Mode Attribute bit1 of the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull configStatusValA; -- (void)testSendClusterTest_TC_WNCV_2_3_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2b: TH reads ConfigStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2b: TH reads ConfigStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 127); - } - } - { - id actualValue = value; - configStatusValA = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000007_DownOrClose -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2c: If (ConfigStatus bit0 == 0) TH send DownOrClose command to the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2c: If (ConfigStatus bit0 == 0) TH send DownOrClose command to the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_FAILURE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000008_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2d: TH clear the Mode Attribute bit1 of the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2d: TH clear the Mode Attribute bit1 of the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2e: TH reads ConfigStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2e: TH reads ConfigStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 127); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2f: TH reads the Mode Attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2f: TH reads the Mode Attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 127); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000011_DownOrClose -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2g: TH send DownOrClose command to the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2g: TH send DownOrClose command to the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000012_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH set the Mode Attribute bit2 of the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:4]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: TH set the Mode Attribute bit2 of the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull configStatusValB; -- (void)testSendClusterTest_TC_WNCV_2_3_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3c: TH reads ConfigStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: TH reads ConfigStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 127); - } - } - { - id actualValue = value; - configStatusValB = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000014_DownOrClose -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3c: TH send DownOrClose command to the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"3c: TH send DownOrClose command to the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_BUSY); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000015_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3d: TH clear the Mode Attribute bit2 of the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id modeArgument; - modeArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeModeWithValue:modeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3d: TH clear the Mode Attribute bit2 of the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3e: TH reads ConfigStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3e: TH reads ConfigStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 127); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000017_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3f: TH reads the Mode Attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3f: TH reads the Mode Attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 127); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_3_000018_DownOrClose -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3g: TH send DownOrClose command to the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"3g: TH send DownOrClose command to the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_2_4_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_4_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads Type attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads Type attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_4_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads Type attribute constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads Type attribute constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_2_5_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_5_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads EndProductType attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads EndProductType attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_2_5_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads EndProductType attribute constraints from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads EndProductType attribute constraints from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 23); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_3_4_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_4_000001_DownOrClose -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_4_000002_WaitForMs -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1b: TH Waits for fastMotionDuration seconds movement(s) on the device"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 3000); - [self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_4_000003_UpOrOpen -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends UpOrOpen command to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_4_000004_WaitForMs -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2b: TH Waits for fullMotionDuration seconds movement(s) on the device"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 6000); - [self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_4_000005_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_4_000006_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_4_000007_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_4_000008_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_3_5_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_5_000001_UpOrOpen -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"1a: TH sends UpOrOpen command to preposition the DUT in the opposite direction Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_5_000002_WaitForMs -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1b: TH Waits for fastMotionDuration seconds movement(s) on the device"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 3000); - [self waitForExpectationsWithTimeout:(3000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_5_000003_DownOrClose -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends DownOrClose command to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_5_000004_WaitForMs -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2b: TH Waits for fullMotionDuration seconds movement(s) on the device"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 6000); - [self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_5_000005_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 10000U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_5_000006_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_5_000007_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 10000U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_3_5_000008_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3d: If (PA & TL) TH reads CurrentPositionTiltPercentage optional attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_4_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000001_DownOrClose -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000002_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"1b: TH waits for x seconds movement(s) on the DUT"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 6000); - [self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1c: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 0U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000004_GoToLiftPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2a: TH sends GoToLiftPercentage command with 25 percent to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:25]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:2500U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH sends GoToLiftPercentage command with 25 percent to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000005_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2b: DUT updates its attributes"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 2500U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000007_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH set a timeout of X minutes for failure"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 6000); - [self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3b: TH reads OperationalStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: TH reads OperationalStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000009_GoToLiftPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"4a: TH sends GoToLiftPercentage command with 75.20 percent to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:75]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:7520U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"4a: TH sends GoToLiftPercentage command with 75.20 percent to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000010_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"4b: DUT updates its attributes"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000011_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"5a: TH waits for x seconds movement(s) on the DUT"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 6000); - [self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_1_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"5b: TH reads OperationalStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: TH reads OperationalStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_4_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000001_DownOrClose -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"1a: TH sends DownOrClose command to preposition the DUT in the opposite direction Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000002_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"1b: TH waits for x seconds movement(s) on the DUT"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 6000); - [self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000003_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1c: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 0U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000004_GoToTiltPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2a: TH sends GoToTiltPercentage command with 30 percent to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:30]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:3000U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2a: TH sends GoToTiltPercentage command with 30 percent to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000005_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"2b: DUT updates its attributes"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000006_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"2c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 3000U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000007_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH set a timeout of X minutes for failure"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 6000); - [self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"3b: TH reads OperationalStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"3b: TH reads OperationalStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000009_GoToTiltPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"4a: TH sends GoToTiltPercentage command with 60.20 percent to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:60]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:6005U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"4a: TH sends GoToTiltPercentage command with 60.20 percent to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000010_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"4b: DUT updates its attributes"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000011_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"5a: TH waits for x seconds movement(s) on the DUT"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 6000); - [self waitForExpectationsWithTimeout:(6000 / 1000) + kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_2_000012_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"5b: TH reads OperationalStatus attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"5b: TH reads OperationalStatus attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_4_3_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nullable attrCurrentPositionLiftPercent100ths; -- (void)testSendClusterTest_TC_WNCV_4_3_000001_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1a: If (PA_LF & LF) TH reads CurrentPositionLiftPercent100ths from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); - } - } - { - id actualValue = value; - attrCurrentPositionLiftPercent100ths = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nullable attrCurrentPositionLiftPercentage; -- (void)testSendClusterTest_TC_WNCV_4_3_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100); - } - } - { - id actualValue = value; - attrCurrentPositionLiftPercentage = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_3_000003_GoToLiftPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2b: TH sends GoToLiftPercentage command with BadParam to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:63]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2b: TH sends GoToLiftPercentage command with BadParam to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_3_000004_GoToLiftPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: TH sends GoToLiftPercentage command with 10001 to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:100]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: TH sends GoToLiftPercentage command with 10001 to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_3_000005_GoToLiftPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:255]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_WNCV_4_4_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"0: Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nullable attrCurrentPositionTiltPercent100ths; -- (void)testSendClusterTest_TC_WNCV_4_4_000001_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1a: If (PA_TL & TL) TH reads CurrentPositionTiltPercent100ths from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); - } - } - { - id actualValue = value; - attrCurrentPositionTiltPercent100ths = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nullable attrCurrentPositionTiltPercentage; -- (void)testSendClusterTest_TC_WNCV_4_4_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1b: If (PA_TL & TL) TH reads CurrentPositionTiltPercentage from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100); - } - } - { - id actualValue = value; - attrCurrentPositionTiltPercentage = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_4_000003_GoToTiltPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"2b: TH sends GoToTiltPercentage command with BadParam to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:63]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:12288U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"2b: TH sends GoToTiltPercentage command with BadParam to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_4_000004_GoToTiltPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"3a: TH sends GoToTiltPercentage command with 10001 to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:100]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:10001U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"3a: TH sends GoToTiltPercentage command with 10001 to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_WNCV_4_4_000005_GoToTiltPercentage -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:255]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:65535U]; - [cluster goToTiltPercentageWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"4a: TH sends GoToTiltPercentage command with 0xFFFF to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestCluster_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000001_Test -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster testWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000002_TestNotHandled -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Not Handled Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster testNotHandledWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Not Handled Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_COMMAND); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000003_TestSpecific -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Specific Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster testSpecificWithCompletionHandler:^( - CHIPTestClusterClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Specific Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.returnValue; - XCTAssertEqual([actualValue unsignedCharValue], 7); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000004_TestAddArguments -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [NSNumber numberWithUnsignedChar:17]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.returnValue; - XCTAssertEqual([actualValue unsignedCharValue], 20); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000005_TestAddArguments -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send failing Test Add Arguments Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:250]; - params.arg2 = [NSNumber numberWithUnsignedChar:6]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send failing Test Add Arguments Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_COMMAND); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000007_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN True"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id booleanArgument; - booleanArgument = [NSNumber numberWithBool:1]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN True Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN True"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN True Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000009_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN False"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id booleanArgument; - booleanArgument = [NSNumber numberWithBool:0]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN False Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN False"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN False Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000012_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap8Argument; - bitmap8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 255); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000014_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap8Argument; - bitmap8Argument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000015_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000017_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap16Argument; - bitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 65535U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000019_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap16Argument; - bitmap16Argument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000020_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000021_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000022_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap32Argument; - bitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000023_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 4294967295UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000024_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap32Argument; - bitmap32Argument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000025_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000026_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000027_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap64Argument; - bitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000028_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551615ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000029_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap64Argument; - bitmap64Argument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000030_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000031_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000032_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int8uArgument; - int8uArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000033_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 255); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000034_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int8uArgument; - int8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000035_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000036_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000037_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int16uArgument; - int16uArgument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeInt16uWithValue:int16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000038_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 65535U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000039_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int16uArgument; - int16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeInt16uWithValue:int16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000040_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000041_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000042_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000043_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 4294967295UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000044_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000045_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000046_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000047_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int64uArgument; - int64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeInt64uWithValue:int64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000048_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551615ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000049_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int64uArgument; - int64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeInt64uWithValue:int64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000050_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000051_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000052_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:127]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000053_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], 127); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000054_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000055_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], -128); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000056_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:0]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000057_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000058_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000059_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:32767]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000060_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 32767); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000061_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:-32768]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000062_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], -32768); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000063_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:0]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000064_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000065_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue intValue], 0L); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000066_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:2147483647L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000067_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue intValue], 2147483647L); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000068_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:-2147483648L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000069_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue intValue], -2147483648L); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000070_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:0L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000071_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue intValue], 0L); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000072_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue longLongValue], 0LL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000073_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:9223372036854775807LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000074_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue longLongValue], 9223372036854775807LL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000075_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000076_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000077_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:0LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000078_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue longLongValue], 0LL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000079_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue floatValue], 0.0f); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000080_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute SINGLE medium Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:0.1f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE medium Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000081_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE medium Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE medium Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue floatValue], 0.1f); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000082_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute SINGLE large Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:17000000000.0f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE large Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000083_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE large Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE large Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue floatValue], 17000000000.0f); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000084_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute SINGLE small Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:1.7e-10f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE small Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000085_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE small Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE small Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue floatValue], 1.7e-10f); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000086_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute SINGLE Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id floatSingleArgument; - floatSingleArgument = [NSNumber numberWithFloat:0.0f]; - [cluster writeAttributeFloatSingleWithValue:floatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute SINGLE Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000087_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute SINGLE Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute SINGLE Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue floatValue], 0.0f); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000088_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue doubleValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000089_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute DOUBLE medium Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE medium Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000090_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE medium Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE medium Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue doubleValue], 0.1234567890123); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000091_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute DOUBLE large Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:1.7e+200]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE large Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000092_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE large Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE large Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue doubleValue], 1.7e+200); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000093_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute DOUBLE small Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:1.7e-200]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE small Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000094_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE small Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE small Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue doubleValue], 1.7e-200); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000095_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute DOUBLE Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id floatDoubleArgument; - floatDoubleArgument = [NSNumber numberWithDouble:0]; - [cluster writeAttributeFloatDoubleWithValue:floatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute DOUBLE Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000096_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute DOUBLE Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute DOUBLE Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue doubleValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000097_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000098_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id enum8Argument; - enum8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000099_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 255); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000100_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id enum8Argument; - enum8Argument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000101_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000102_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000103_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id enum16Argument; - enum16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000104_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 65535U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000105_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id enum16Argument; - enum16Argument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000106_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000107_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000108_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING with embedded null"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING with embedded null Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000109_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING with embedded null"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING with embedded null Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"Tes\000ti\000ng" length:9]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000110_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING with weird chars"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING with weird chars Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000111_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING with weird chars"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING with weird chars Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"\015\012\377\042\240" length:5]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000112_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000113_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"TestValue" length:9]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000114_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"TestValueLongerThan10" length:21]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000115_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"TestValue" length:9]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000116_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000117_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_OCTET_STRING Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000118_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id longOctetStringArgument; - longOctetStringArgument = [[NSData alloc] - initWithBytes:"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - length:300]; - [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000119_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue - isEqualToData:[[NSData alloc] - initWithBytes:"1111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "1111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "1111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111" - length:300]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000120_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id longOctetStringArgument; - longOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeLongOctetStringWithValue:longOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000121_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@""]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000122_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @"☉T☉"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000123_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@"☉T☉"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000124_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Value too long"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @"☉TestValueLongerThan10☉"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING - Value too long Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000125_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@"☉T☉"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000126_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Empty"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @""; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING - Empty Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000127_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_CHAR_STRING Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@""]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000128_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id longCharStringArgument; - longCharStringArgument - = @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"; - [cluster writeAttributeLongCharStringWithValue:longCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000129_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LONG_CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue - isEqualToString: - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - @"☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000130_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id longCharStringArgument; - longCharStringArgument = @""; - [cluster writeAttributeLongCharStringWithValue:longCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LONG_CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000131_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_LONG_OCTET_STRING (for chunked read)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 4); - XCTAssertTrue([actualValue[0] - isEqualToData: - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]]); - XCTAssertTrue([actualValue[1] - isEqualToData: - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]]); - XCTAssertTrue([actualValue[2] - isEqualToData: - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]]); - XCTAssertTrue([actualValue[3] - isEqualToData: - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000132_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write attribute LIST_LONG_OCTET_STRING (for chunked write)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id listLongOctetStringArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[1] = [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[2] = [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[3] = [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - temp_0[4] = [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]; - listLongOctetStringArgument = temp_0; - } - [cluster writeAttributeListLongOctetStringWithValue:listLongOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST_LONG_OCTET_STRING (for chunked write) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000133_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_LONG_OCTET_STRING (for chunked read)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST_LONG_OCTET_STRING (for chunked read) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 5); - XCTAssertTrue([actualValue[0] - isEqualToData: - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]]); - XCTAssertTrue([actualValue[1] - isEqualToData: - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]]); - XCTAssertTrue([actualValue[2] - isEqualToData: - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]]); - XCTAssertTrue([actualValue[3] - isEqualToData: - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]]); - XCTAssertTrue([actualValue[4] - isEqualToData: - [[NSData alloc] - initWithBytes:"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123" - "456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef" - length:512]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000134_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000135_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id epochUsArgument; - epochUsArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000136_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551615ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000137_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id epochUsArgument; - epochUsArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000138_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000139_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000140_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000141_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 4294967295UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000142_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000143_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000144_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute UNSUPPORTED"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeUnsupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute UNSUPPORTED Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000145_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Writeattribute UNSUPPORTED"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id unsupportedArgument; - unsupportedArgument = [NSNumber numberWithBool:0]; - [cluster writeAttributeUnsupportedWithValue:unsupportedArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writeattribute UNSUPPORTED Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain - && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000146_Test -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported endpoint"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster testWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Command to unsupported endpoint Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000147_Test -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported cluster"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster testWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Test Command to unsupported cluster Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000148_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000149_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute vendor_id"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id vendorIdArgument; - vendorIdArgument = [NSNumber numberWithUnsignedShort:17U]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000150_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 17U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000151_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Restore attribute vendor_id"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id vendorIdArgument; - vendorIdArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Restore attribute vendor_id Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000152_TestEnumsRequest -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send a command with a vendor_id and enum"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestEnumsRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedShort:20003U]; - params.arg2 = [NSNumber numberWithUnsignedChar:101]; - [cluster - testEnumsRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send a command with a vendor_id and enum Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.arg1; - XCTAssertEqual([actualValue unsignedShortValue], 20003U); - } - { - id actualValue = values.arg2; - XCTAssertEqual([actualValue unsignedCharValue], 101); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000153_TestStructArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With Struct Argument and arg1.b is true"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - - [cluster testStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Struct Argument and arg1.b is true Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], true); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000154_TestStructArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With Struct Argument and arg1.b is false"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0]; - - [cluster testStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Struct Argument and arg1.b is false Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], false); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000155_TestNestedStructArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With Nested Struct Argument and arg1.c.b is true"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - [cluster - testNestedStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct Argument and arg1.c.b is true Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], true); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000156_TestNestedStructArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With Nested Struct Argument arg1.c.b is false"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStruct alloc] init]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStruct *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).b = - [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStruct *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - [cluster testNestedStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct Argument arg1.c.b is false Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], false); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000157_TestNestedStructListArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - - temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedChar:0]; - temp_1[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; - } - - [cluster testNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct List Argument and all fields b of arg1.d " - @"are true Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], true); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000158_TestNestedStructListArgumentRequest -{ - XCTestExpectation * expectation = [self - expectationWithDescription:@"Send Test Command With Nested Struct List Argument and some fields b of arg1.d are false"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) params.arg1).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[0]).h = [NSNumber numberWithDouble:0]; - - temp_1[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_1[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) params.arg1).d = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_1[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_1[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).e = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_1[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_1[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).f = temp_1; - } - { - NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; - temp_1[0] = [NSNumber numberWithUnsignedChar:0]; - temp_1[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) params.arg1).g = temp_1; - } - - [cluster testNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct List Argument and some fields b of " - @"arg1.d are false Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], false); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000159_SimpleStructEchoRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With Struct Argument and see what we get back"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterSimpleStructEchoRequestParams alloc] init]; - params.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).a = [NSNumber numberWithUnsignedChar:17]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).g = [NSNumber numberWithFloat:0.1f]; - ((CHIPTestClusterClusterSimpleStruct *) params.arg1).h = [NSNumber numberWithDouble:0.1]; - - [cluster simpleStructEchoRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterSimpleStructResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With Struct Argument and see what we get back Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.arg1; - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).a unsignedCharValue], 17); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).b boolValue], false); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).c unsignedCharValue], 2); - XCTAssertTrue([((CHIPTestClusterClusterSimpleStruct *) actualValue).d - isEqualToData:[[NSData alloc] initWithBytes:"octet_string" length:12]]); - XCTAssertTrue( - [((CHIPTestClusterClusterSimpleStruct *) actualValue).e isEqualToString:@"char_string"]); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).f unsignedCharValue], 1); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).g floatValue], 0.1f); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).h doubleValue], 0.1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000160_TestListInt8UArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With List of INT8U and none of them is set to 0"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - temp_0[4] = [NSNumber numberWithUnsignedChar:5]; - temp_0[5] = [NSNumber numberWithUnsignedChar:6]; - temp_0[6] = [NSNumber numberWithUnsignedChar:7]; - temp_0[7] = [NSNumber numberWithUnsignedChar:8]; - temp_0[8] = [NSNumber numberWithUnsignedChar:9]; - params.arg1 = temp_0; - } - [cluster testListInt8UArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With List of INT8U and none of them is set to 0 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], true); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000161_TestListInt8UArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With List of INT8U and one of them is set to 0"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - temp_0[4] = [NSNumber numberWithUnsignedChar:5]; - temp_0[5] = [NSNumber numberWithUnsignedChar:6]; - temp_0[6] = [NSNumber numberWithUnsignedChar:7]; - temp_0[7] = [NSNumber numberWithUnsignedChar:8]; - temp_0[8] = [NSNumber numberWithUnsignedChar:9]; - temp_0[9] = [NSNumber numberWithUnsignedChar:0]; - params.arg1 = temp_0; - } - [cluster testListInt8UArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Command With List of INT8U and one of them is set to 0 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], false); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000162_TestListInt8UReverseRequest -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With List of INT8U and get it reversed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - temp_0[4] = [NSNumber numberWithUnsignedChar:5]; - temp_0[5] = [NSNumber numberWithUnsignedChar:6]; - temp_0[6] = [NSNumber numberWithUnsignedChar:7]; - temp_0[7] = [NSNumber numberWithUnsignedChar:8]; - temp_0[8] = [NSNumber numberWithUnsignedChar:9]; - params.arg1 = temp_0; - } - [cluster testListInt8UReverseRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of INT8U and get it reversed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.arg1; - XCTAssertEqual([actualValue count], 9); - XCTAssertEqual([actualValue[0] unsignedCharValue], 9); - XCTAssertEqual([actualValue[1] unsignedCharValue], 8); - XCTAssertEqual([actualValue[2] unsignedCharValue], 7); - XCTAssertEqual([actualValue[3] unsignedCharValue], 6); - XCTAssertEqual([actualValue[4] unsignedCharValue], 5); - XCTAssertEqual([actualValue[5] unsignedCharValue], 4); - XCTAssertEqual([actualValue[6] unsignedCharValue], 3); - XCTAssertEqual([actualValue[7] unsignedCharValue], 2); - XCTAssertEqual([actualValue[8] unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000163_TestListInt8UReverseRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With empty List of INT8U and get an empty list back"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - params.arg1 = temp_0; - } - [cluster testListInt8UReverseRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With empty List of INT8U and get an empty list back Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.arg1; - XCTAssertEqual([actualValue count], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000164_TestListStructArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With List of Struct Argument and arg1.b of first item is true"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"first_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - - temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"second_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - - params.arg1 = temp_0; - } - [cluster - testListStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog( - @"Send Test Command With List of Struct Argument and arg1.b of first item is true Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], true); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000165_TestListStructArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send Test Command With List of Struct Argument and arg1.b of first item is false"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).e = @"second_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[0]).h = [NSNumber numberWithDouble:0]; - - temp_0[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).e = @"first_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_0[1]).h = [NSNumber numberWithDouble:0]; - - params.arg1 = temp_0; - } - [cluster - testListStructArgumentRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog( - @"Send Test Command With List of Struct Argument and arg1.b of first item is false Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], false); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000166_TestListNestedStructListArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription: - @"Send Test Command With List of Nested Struct List Argument and all fields b of elements of arg1.d are true"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; - - temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedChar:0]; - temp_2[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; - } - - params.arg1 = temp_0; - } - [cluster testListNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With List of Nested Struct List Argument and all fields " - @"b of elements of arg1.d are true Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], true); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000167_TestListNestedStructListArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription: - @"Send Test Command With Nested Struct List Argument and some fields b of elements of arg1.d are false"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterNestedStructList alloc] init]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).a = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).a = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).b = - [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).c = - [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).d = - [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).e = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).f = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).g = - [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).c).h = - [NSNumber numberWithDouble:0]; - - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).a = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[0]).h = [NSNumber numberWithDouble:0]; - - temp_2[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).a = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).b = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).c = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).d = [[NSData alloc] initWithBytes:"nested_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).e = @"nested_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).f = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).g = [NSNumber numberWithFloat:0.0f]; - ((CHIPTestClusterClusterSimpleStruct *) temp_2[1]).h = [NSNumber numberWithDouble:0]; - - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).d = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedInt:1UL]; - temp_2[1] = [NSNumber numberWithUnsignedInt:2UL]; - temp_2[2] = [NSNumber numberWithUnsignedInt:3UL]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).e = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[NSData alloc] initWithBytes:"octet_string_1" length:14]; - temp_2[1] = [[NSData alloc] initWithBytes:"octect_string_2" length:15]; - temp_2[2] = [[NSData alloc] initWithBytes:"octet_string_3" length:14]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).f = temp_2; - } - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [NSNumber numberWithUnsignedChar:0]; - temp_2[1] = [NSNumber numberWithUnsignedChar:255]; - ((CHIPTestClusterClusterNestedStructList *) temp_0[0]).g = temp_2; - } - - params.arg1 = temp_0; - } - [cluster testListNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command With Nested Struct List Argument and some fields b of " - @"elements of arg1.d are false Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.value; - XCTAssertEqual([actualValue boolValue], false); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000168_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write attribute LIST With List of INT8U and none of them is set to 0"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id listInt8uArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:1]; - temp_0[1] = [NSNumber numberWithUnsignedChar:2]; - temp_0[2] = [NSNumber numberWithUnsignedChar:3]; - temp_0[3] = [NSNumber numberWithUnsignedChar:4]; - listInt8uArgument = temp_0; - } - [cluster writeAttributeListInt8uWithValue:listInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST With List of INT8U and none of them is set to 0 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000169_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST With List of INT8U"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST With List of INT8U Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 4); - XCTAssertEqual([actualValue[0] unsignedCharValue], 1); - XCTAssertEqual([actualValue[1] unsignedCharValue], 2); - XCTAssertEqual([actualValue[2] unsignedCharValue], 3); - XCTAssertEqual([actualValue[3] unsignedCharValue], 4); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000170_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LIST With List of OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id listOctetStringArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[NSData alloc] initWithBytes:"Test0" length:5]; - temp_0[1] = [[NSData alloc] initWithBytes:"Test1" length:5]; - temp_0[2] = [[NSData alloc] initWithBytes:"Test2" length:5]; - temp_0[3] = [[NSData alloc] initWithBytes:"Test3" length:5]; - listOctetStringArgument = temp_0; - } - [cluster writeAttributeListOctetStringWithValue:listOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST With List of OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000171_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST With List of OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeListOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST With List of OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 4); - XCTAssertTrue([actualValue[0] isEqualToData:[[NSData alloc] initWithBytes:"Test0" length:5]]); - XCTAssertTrue([actualValue[1] isEqualToData:[[NSData alloc] initWithBytes:"Test1" length:5]]); - XCTAssertTrue([actualValue[2] isEqualToData:[[NSData alloc] initWithBytes:"Test2" length:5]]); - XCTAssertTrue([actualValue[3] isEqualToData:[[NSData alloc] initWithBytes:"Test3" length:5]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000172_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write attribute LIST With List of LIST_STRUCT_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id listStructOctetStringArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedLongLong:0ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[0]).operationalCert = [[NSData alloc] initWithBytes:"Test0" length:5]; - - temp_0[1] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedLongLong:1ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[1]).operationalCert = [[NSData alloc] initWithBytes:"Test1" length:5]; - - temp_0[2] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedLongLong:2ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[2]).operationalCert = [[NSData alloc] initWithBytes:"Test2" length:5]; - - temp_0[3] = [[CHIPTestClusterClusterTestListStructOctet alloc] init]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).fabricIndex = [NSNumber numberWithUnsignedLongLong:3ULL]; - ((CHIPTestClusterClusterTestListStructOctet *) temp_0[3]).operationalCert = [[NSData alloc] initWithBytes:"Test3" length:5]; - - listStructOctetStringArgument = temp_0; - } - [cluster writeAttributeListStructOctetStringWithValue:listStructOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000173_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute LIST With List of LIST_STRUCT_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeListStructOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute LIST With List of LIST_STRUCT_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 4); - XCTAssertEqual( - [((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).fabricIndex unsignedLongLongValue], 0ULL); - XCTAssertTrue([((CHIPTestClusterClusterTestListStructOctet *) actualValue[0]).operationalCert - isEqualToData:[[NSData alloc] initWithBytes:"Test0" length:5]]); - XCTAssertEqual( - [((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).fabricIndex unsignedLongLongValue], 1ULL); - XCTAssertTrue([((CHIPTestClusterClusterTestListStructOctet *) actualValue[1]).operationalCert - isEqualToData:[[NSData alloc] initWithBytes:"Test1" length:5]]); - XCTAssertEqual( - [((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).fabricIndex unsignedLongLongValue], 2ULL); - XCTAssertTrue([((CHIPTestClusterClusterTestListStructOctet *) actualValue[2]).operationalCert - isEqualToData:[[NSData alloc] initWithBytes:"Test2" length:5]]); - XCTAssertEqual( - [((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).fabricIndex unsignedLongLongValue], 3ULL); - XCTAssertTrue([((CHIPTestClusterClusterTestListStructOctet *) actualValue[3]).operationalCert - isEqualToData:[[NSData alloc] initWithBytes:"Test3" length:5]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000174_TestNullableOptionalRequest -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command with optional arg set."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:5]; - [cluster testNullableOptionalRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command with optional arg set. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.wasPresent; - XCTAssertEqual([actualValue boolValue], true); - } - { - id actualValue = values.wasNull; - XCTAssertEqual([actualValue boolValue], false); - } - { - id actualValue = values.value; - XCTAssertEqual([actualValue unsignedCharValue], 5); - } - { - id actualValue = values.originalValue; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 5); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000175_TestNullableOptionalRequest -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command without its optional arg."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; - [cluster testNullableOptionalRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Send Test Command without its optional arg. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.wasPresent; - XCTAssertEqual([actualValue boolValue], false); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000176_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read list of structs containing nullables and optionals"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read list of structs containing nullables and optionals Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt == nil); - XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString == nil); - XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct == nil); - XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000177_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write list of structs containing nullables and optionals"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id listNullablesAndOptionalsStructArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPTestClusterClusterNullablesAndOptionalsStruct alloc] init]; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableInt = nil; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableString = nil; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableStruct = nil; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [NSNumber numberWithUnsignedChar:1]; - temp_3[1] = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterNullablesAndOptionalsStruct *) temp_0[0]).nullableList = temp_3; - } - - listNullablesAndOptionalsStructArgument = temp_0; - } - [cluster - writeAttributeListNullablesAndOptionalsStructWithValue:listNullablesAndOptionalsStructArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write list of structs containing nullables and optionals Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000178_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read list of structs containing nullables and optionals after writing"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read list of structs containing nullables and optionals after writing Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableInt == nil); - XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableString == nil); - XCTAssertTrue(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableStruct == nil); - XCTAssertFalse(((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList == nil); - XCTAssertEqual([((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList count], 2); - XCTAssertEqual( - [((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[0] unsignedCharValue], 1); - XCTAssertEqual( - [((CHIPTestClusterClusterNullablesAndOptionalsStruct *) actualValue[0]).nullableList[1] unsignedCharValue], 2); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000179_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BOOLEAN null"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBooleanArgument; - nullableBooleanArgument = nil; - [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BOOLEAN null Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000180_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BOOLEAN null"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BOOLEAN null Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000181_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BOOLEAN True"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBooleanArgument; - nullableBooleanArgument = [NSNumber numberWithBool:true]; - [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BOOLEAN True Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000182_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BOOLEAN True"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BOOLEAN True Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue boolValue], true); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000183_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP8 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap8Argument; - nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP8 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000184_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP8 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP8 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000185_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP8 Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap8Argument; - nullableBitmap8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster - writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP8 Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000186_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP8 unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP8 unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000187_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP8 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap8Argument; - nullableBitmap8Argument = nil; - [cluster writeAttributeNullableBitmap8WithValue:nullableBitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP8 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000188_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP8 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP8 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000189_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP16 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap16Argument; - nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP16 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000190_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP16 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP16 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 65534U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000191_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP16 Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap16Argument; - nullableBitmap16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster - writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP16 Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000192_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP16 unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP16 unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 65534U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000193_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP16 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap16Argument; - nullableBitmap16Argument = nil; - [cluster writeAttributeNullableBitmap16WithValue:nullableBitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP16 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000194_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP16 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP16 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000195_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP32 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap32Argument; - nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967294UL]; - [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP32 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000196_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP32 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP32 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000197_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP32 Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap32Argument; - nullableBitmap32Argument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster - writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP32 Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000198_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP32 unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP32 unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000199_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP32 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap32Argument; - nullableBitmap32Argument = nil; - [cluster writeAttributeNullableBitmap32WithValue:nullableBitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP32 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000200_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP32 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP32 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000201_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP64 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap64Argument; - nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP64 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000202_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP64 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP64 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000203_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP64 Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap64Argument; - nullableBitmap64Argument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster - writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP64 Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000204_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP64 unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP64 unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000205_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP64 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableBitmap64Argument; - nullableBitmap64Argument = nil; - [cluster writeAttributeNullableBitmap64WithValue:nullableBitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_BITMAP64 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000206_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP64 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_BITMAP64 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000207_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000208_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000209_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000210_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000211_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000212_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000213_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute NULLABLE_INT8U unchanged Value with constraint"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U unchanged Value with constraint Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000214_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt8uArgument; - nullableInt8uArgument = nil; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000215_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000216_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U null Value & range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U null Value & range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000217_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U null Value & not"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U null Value & not Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedCharValue], 254); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000218_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt8uArgument; - nullableInt8uArgument = [NSNumber numberWithUnsignedChar:128]; - [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8U Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000219_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U Value in range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U Value in range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000220_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U notValue OK"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8U notValue OK Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedCharValue], 129); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000221_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000222_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000223_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000224_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 65534U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000225_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster - writeAttributeNullableInt16uWithValue:nullableInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000226_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 65534U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000227_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt16uArgument; - nullableInt16uArgument = nil; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000228_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000229_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U null Value & range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U null Value & range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65534U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000230_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U null Value & not"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U null Value & not Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 65534U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000231_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt16uArgument; - nullableInt16uArgument = [NSNumber numberWithUnsignedShort:32000U]; - [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16U Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000232_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U Value in range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U Value in range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65534U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000233_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U notValue OK"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16U notValue OK Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedShortValue], 32001U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000234_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000235_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000236_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967294UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000237_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000238_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster - writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000239_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000240_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32uArgument; - nullableInt32uArgument = nil; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000241_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000242_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value & range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value & range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 0UL); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 4294967294UL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000243_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value & not"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value & not Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedIntValue], 4294967294UL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000244_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:2147483647UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000245_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U Value in range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Value in range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 0UL); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 4294967294UL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000246_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U notValue OK"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U notValue OK Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedIntValue], 2147483648UL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000247_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000248_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000249_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000250_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000251_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; - [cluster - writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000252_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000253_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt64uArgument; - nullableInt64uArgument = nil; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000254_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000255_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value & range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value & range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedLongLongValue], 0ULL); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000256_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value & not"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value & not Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000257_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18000000000000000000ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000258_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U Value in range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Value in range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedLongLongValue], 0ULL); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000259_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U notValue OK"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U notValue OK Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedLongLongValue], 18000000000000000001ULL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000260_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000261_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue charValue], -127); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000262_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000263_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue charValue], -127); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000264_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt8sArgument; - nullableInt8sArgument = nil; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000265_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000266_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value & range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value & range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue charValue], -127); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue charValue], 127); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000267_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value & not"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value & not Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue charValue], -127); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000268_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000269_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S Value in range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S Value in range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue charValue], -127); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue charValue], 127); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000270_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S notValue OK"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S notValue OK Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue charValue], -126); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000271_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000272_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], -32767); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000273_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32768]; - [cluster - writeAttributeNullableInt16sWithValue:nullableInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000274_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], -32767); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000275_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt16sArgument; - nullableInt16sArgument = nil; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000276_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000277_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value & range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value & range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -32767); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 32767); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000278_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value & not"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value & not Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue shortValue], -32767); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000279_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000280_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S Value in range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S Value in range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue shortValue], -32767); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue shortValue], 32767); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000281_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S notValue OK"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S notValue OK Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue shortValue], -32766); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000282_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000283_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue intValue], -2147483647L); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000284_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483648L]; - [cluster - writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000285_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue intValue], -2147483647L); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000286_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32sArgument; - nullableInt32sArgument = nil; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000287_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000288_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value & range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value & range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue intValue], -2147483647L); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue intValue], 2147483647L); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000289_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value & not"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value & not Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue intValue], -2147483647L); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000290_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000291_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S Value in range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S Value in range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue intValue], -2147483647L); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue intValue], 2147483647L); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000292_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S notValue OK"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S notValue OK Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue intValue], -2147483646L); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000293_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000294_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000295_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL - 1]; - [cluster - writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000296_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000297_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt64sArgument; - nullableInt64sArgument = nil; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000298_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000299_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value & range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value & range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue longLongValue], -9223372036854775807LL); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue longLongValue], 9223372036854775807LL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000300_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value & not"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value & not Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue longLongValue], -9223372036854775807LL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000301_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000302_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S Value in range"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S Value in range Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue longLongValue], -9223372036854775807LL); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue longLongValue], 9223372036854775807LL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000303_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S notValue OK"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S notValue OK Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue longLongValue], -9223372036854775806LL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000304_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE medium Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:0.1f]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE medium Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000305_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE medium Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE medium Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue floatValue], 0.1f); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000306_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE largest Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:INFINITY]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE largest Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000307_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE largest Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE largest Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue floatValue], INFINITY); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000308_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE smallest Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:-INFINITY]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE smallest Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000309_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE smallest Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE smallest Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue floatValue], -INFINITY); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000310_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatSingleArgument; - nullableFloatSingleArgument = nil; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000311_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000312_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE 0 Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:0.0f]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE 0 Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000313_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE 0 Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE 0 Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue floatValue], 0.0f); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000314_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE medium Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE medium Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000315_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE medium Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE medium Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue doubleValue], 0.1234567890123); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000316_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE largest Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:INFINITY]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE largest Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000317_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE largest Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE largest Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue doubleValue], INFINITY); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000318_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE smallest Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:-INFINITY]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE smallest Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000319_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE smallest Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE smallest Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue doubleValue], -INFINITY); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000320_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = nil; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000321_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000322_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE 0 Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:0]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE 0 Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000323_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE 0 Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE 0 Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue doubleValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000324_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000325_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000326_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000327_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000328_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000329_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000330_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnum8Argument; - nullableEnum8Argument = nil; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000331_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000332_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000333_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000334_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000335_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 65534U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000336_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster - writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000337_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 65534U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000338_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnum16Argument; - nullableEnum16Argument = nil; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000339_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000340_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnumAttrArgument; - nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000341_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM Min Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000342_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnumAttrArgument; - nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000343_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM Max Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000344_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM Invalid Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnumAttrArgument; - nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster - writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Invalid Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000345_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM unchanged Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000346_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableEnumAttrArgument; - nullableEnumAttrArgument = nil; - [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000347_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000348_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000349_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableOctetStringArgument; - nullableOctetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000350_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"TestValue" length:9]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000351_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableOctetStringArgument; - nullableOctetStringArgument = nil; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000352_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000353_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableOctetStringArgument; - nullableOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000354_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000355_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToString:@""]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000356_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableCharStringArgument; - nullableCharStringArgument = @"☉T☉"; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000357_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToString:@"☉T☉"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000358_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING - Value too long"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableCharStringArgument; - nullableCharStringArgument = nil; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING - Value too long Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000359_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000360_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING - Empty"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableCharStringArgument; - nullableCharStringArgument = @""; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING - Empty Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000361_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToString:@""]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000362_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute from nonexistent endpoint."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute from nonexistent endpoint. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000363_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute from nonexistent cluster."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute from nonexistent cluster. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000364_TestSimpleOptionalArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send a command that takes an optional parameter but do not set it."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; - [cluster - testSimpleOptionalArgumentRequestWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send a command that takes an optional parameter but do not set it. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_VALUE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000365_TestSimpleOptionalArgumentRequest -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Send a command that takes an optional parameter but do not set it."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithBool:1]; - [cluster - testSimpleOptionalArgumentRequestWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send a command that takes an optional parameter but do not set it. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -bool testSendClusterTestCluster_000366_WaitForReport_Fulfilled = false; -ResponseHandler test_TestCluster_list_int8u_Reported = nil; -- (void)testSendClusterTestCluster_000366_WaitForReport -{ - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Report: Subscribe to list attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 4); - XCTAssertEqual([actualValue[0] unsignedCharValue], 1); - XCTAssertEqual([actualValue[1] unsignedCharValue], 2); - XCTAssertEqual([actualValue[2] unsignedCharValue], 3); - XCTAssertEqual([actualValue[3] unsignedCharValue], 4); - } - - testSendClusterTestCluster_000366_WaitForReport_Fulfilled = true; - }; -} -- (void)testSendClusterTestCluster_000367_SubscribeAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Subscribe to list attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - uint16_t minIntervalArgument = 2U; - uint16_t maxIntervalArgument = 5U; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster subscribeAttributeListInt8uWithMinInterval:@(minIntervalArgument) - maxInterval:@(maxIntervalArgument) - params:params - subscriptionEstablished:^{ - XCTAssertEqual(testSendClusterTestCluster_000366_WaitForReport_Fulfilled, true); - [expectation fulfill]; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Subscribe to list attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - if (test_TestCluster_list_int8u_Reported != nil) { - ResponseHandler callback = test_TestCluster_list_int8u_Reported; - test_TestCluster_list_int8u_Reported = nil; - callback(value, err); - } - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000368_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write subscribed-to list attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id listInt8uArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedChar:5]; - temp_0[1] = [NSNumber numberWithUnsignedChar:6]; - temp_0[2] = [NSNumber numberWithUnsignedChar:7]; - temp_0[3] = [NSNumber numberWithUnsignedChar:8]; - listInt8uArgument = temp_0; - } - [cluster writeAttributeListInt8uWithValue:listInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write subscribed-to list attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000369_WaitForReport -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check for list attribute report"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check for list attribute report Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 4); - XCTAssertEqual([actualValue[0] unsignedCharValue], 5); - XCTAssertEqual([actualValue[1] unsignedCharValue], 6); - XCTAssertEqual([actualValue[2] unsignedCharValue], 7); - XCTAssertEqual([actualValue[3] unsignedCharValue], 8); - } - - [expectation fulfill]; - }; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000370_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted unsigned 8-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 70); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000371_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min value to a range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted unsigned 8-bit integer Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000372_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-below-range value to a range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; - [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a range-restricted unsigned 8-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000373_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-above-range value to a range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; - [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a range-restricted unsigned 8-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000374_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max value to a range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted unsigned 8-bit integer Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000375_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value has not changed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value has not changed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 70); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000376_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min valid value to a range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; - [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a range-restricted unsigned 8-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000377_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value is at min valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 20); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000378_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max valid value to a range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; - [cluster - writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a range-restricted unsigned 8-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000379_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value is at max valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000380_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write middle valid value to a range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; - [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted unsigned 8-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000381_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value is at mid valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 50); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000382_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted unsigned 16-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 200U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000383_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min value to a range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted unsigned 16-bit integer Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000384_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-below-range value to a range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; - [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write just-below-range value to a range-restricted unsigned 16-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000385_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-above-range value to a range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; - [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write just-above-range value to a range-restricted unsigned 16-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000386_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max value to a range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; - [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted unsigned 16-bit integer Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000387_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value has not changed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value has not changed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 200U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000388_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min valid value to a range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; - [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a range-restricted unsigned 16-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000389_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value is at min valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 100U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000390_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max valid value to a range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; - [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a range-restricted unsigned 16-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000391_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value is at max valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1000U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000392_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write middle valid value to a range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; - [cluster - writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted unsigned 16-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000393_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value is at mid valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 500U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000394_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted signed 8-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], -20); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000395_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min value to a range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted signed 8-bit integer Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000396_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-below-range value to a range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; - [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a range-restricted signed 8-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000397_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-above-range value to a range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; - [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a range-restricted signed 8-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000398_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max value to a range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; - [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted signed 8-bit integer Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000399_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value has not changed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value has not changed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], -20); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000400_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min valid value to a range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; - [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a range-restricted signed 8-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000401_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value is at min valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value is at min valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], -40); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000402_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max valid value to a range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; - [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a range-restricted signed 8-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000403_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value is at max valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value is at max valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], 50); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000404_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write middle valid value to a range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; - [cluster - writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted signed 8-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000405_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value is at mid valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 8-bit integer value is at mid valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], 6); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000406_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read range-restricted signed 16-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], -100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000407_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min value to a range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32768]; - [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a range-restricted signed 16-bit integer Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000408_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-below-range value to a range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a range-restricted signed 16-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000409_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-above-range value to a range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a range-restricted signed 16-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000410_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max value to a range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; - [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a range-restricted signed 16-bit integer Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000411_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value has not changed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value has not changed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], -100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000412_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min valid value to a range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a range-restricted signed 16-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000413_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value is at min valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value is at min valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], -150); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000414_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max valid value to a range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; - [cluster - writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a range-restricted signed 16-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000415_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value is at max valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value is at max valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 200); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000416_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write middle valid value to a range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; - [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a range-restricted signed 16-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000417_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value is at mid valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify range-restricted signed 16-bit integer value is at mid valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 7); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000418_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted unsigned 8-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 70); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000419_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min value to a nullable range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted unsigned 8-bit integer " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000420_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted unsigned " - @"8-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000421_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted unsigned " - @"8-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000422_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max value to a nullable range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted unsigned 8-bit integer " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000423_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value has not changed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value has not changed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 70); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000424_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min valid value to a nullable range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000425_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 20); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000426_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max valid value to a nullable range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000427_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000428_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write middle valid value to a nullable range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted unsigned 8-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000429_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 50); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000430_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write null value to a nullable range-restricted unsigned 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted unsigned 8-bit integer " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000431_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is null"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is null Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000432_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted unsigned 16-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 200U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000433_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min value to a nullable range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted unsigned 16-bit integer " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000434_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000435_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000436_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max value to a nullable range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted unsigned 16-bit integer " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000437_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value has not changed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value has not changed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 200U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000438_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min valid value to a nullable range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted unsigned 16-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000439_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 100U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000440_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max valid value to a nullable range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted unsigned 16-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000441_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 1000U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000442_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write middle valid value to a nullable range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted unsigned " - @"16-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000443_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 500U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000444_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write null value to a nullable range-restricted unsigned 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted unsigned 16-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000445_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is null"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is null Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000446_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted signed 8-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue charValue], -20); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000447_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min value to a nullable range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster - writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write min value to a nullable range-restricted signed 8-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000448_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted signed " - @"8-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000449_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted signed " - @"8-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000450_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max value to a nullable range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; - [cluster - writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write max value to a nullable range-restricted signed 8-bit integer Error: %@", - err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000451_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value has not changed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value has not changed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue charValue], -20); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000452_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min valid value to a nullable range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted signed 8-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000453_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at min valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at min valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue charValue], -40); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000454_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max valid value to a nullable range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted signed 8-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000455_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at max valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at max valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue charValue], 50); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000456_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write middle valid value to a nullable range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted signed 8-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000457_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at mid valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at mid valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue charValue], 6); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000458_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write null value to a nullable range-restricted signed 8-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument = nil; - [cluster - writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write null value to a nullable range-restricted signed 8-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000459_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at null"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at null Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000460_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read nullable range-restricted signed 16-bit integer Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], -100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000461_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min value to a nullable range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min value to a nullable range-restricted signed 16-bit integer " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000462_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-below-range value to a nullable range-restricted signed " - @"16-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000463_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write just-above-range value to a nullable range-restricted signed " - @"16-bit integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000464_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max value to a nullable range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max value to a nullable range-restricted signed 16-bit integer " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], - EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000465_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value has not changed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value has not changed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], -100); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000466_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write min valid value to a nullable range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write min valid value to a nullable range-restricted signed 16-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000467_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is at min valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at min valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], -150); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000468_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write max valid value to a nullable range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write max valid value to a nullable range-restricted signed 16-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000469_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is at max valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at max valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], 200); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000470_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write middle valid value to a nullable range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write middle valid value to a nullable range-restricted signed 16-bit " - @"integer Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000471_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is at mid valid"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at mid valid Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], 7); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000472_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write null value to a nullable range-restricted signed 16-bit integer"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument = nil; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write null value to a nullable range-restricted signed 16-bit integer " - @"Error: %@", - err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000473_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is null"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster - readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify nullable range-restricted signed 16-bit integer value is null Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000474_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute that returns general status on write"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id generalErrorBooleanArgument; - generalErrorBooleanArgument = [NSNumber numberWithBool:false]; - [cluster writeAttributeGeneralErrorBooleanWithValue:generalErrorBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute that returns general status on write Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000475_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write attribute that returns cluster-specific status on write"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterErrorBooleanArgument; - clusterErrorBooleanArgument = [NSNumber numberWithBool:false]; - [cluster writeAttributeClusterErrorBooleanWithValue:clusterErrorBooleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute that returns cluster-specific status on write Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_FAILURE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000476_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute that returns general status on read"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneralErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute that returns general status on read Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000477_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"read attribute that returns cluster-specific status on read"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read attribute that returns cluster-specific status on read Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_FAILURE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000478_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read AcceptedCommandList attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"read AcceptedCommandList attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 18); - XCTAssertEqual([actualValue[0] unsignedIntValue], 0UL); - XCTAssertEqual([actualValue[1] unsignedIntValue], 1UL); - XCTAssertEqual([actualValue[2] unsignedIntValue], 2UL); - XCTAssertEqual([actualValue[3] unsignedIntValue], 4UL); - XCTAssertEqual([actualValue[4] unsignedIntValue], 7UL); - XCTAssertEqual([actualValue[5] unsignedIntValue], 8UL); - XCTAssertEqual([actualValue[6] unsignedIntValue], 9UL); - XCTAssertEqual([actualValue[7] unsignedIntValue], 10UL); - XCTAssertEqual([actualValue[8] unsignedIntValue], 11UL); - XCTAssertEqual([actualValue[9] unsignedIntValue], 12UL); - XCTAssertEqual([actualValue[10] unsignedIntValue], 13UL); - XCTAssertEqual([actualValue[11] unsignedIntValue], 14UL); - XCTAssertEqual([actualValue[12] unsignedIntValue], 15UL); - XCTAssertEqual([actualValue[13] unsignedIntValue], 17UL); - XCTAssertEqual([actualValue[14] unsignedIntValue], 18UL); - XCTAssertEqual([actualValue[15] unsignedIntValue], 19UL); - XCTAssertEqual([actualValue[16] unsignedIntValue], 20UL); - XCTAssertEqual([actualValue[17] unsignedIntValue], 21UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000479_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read GeneratedCommandList attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"read GeneratedCommandList attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 8); - XCTAssertEqual([actualValue[0] unsignedIntValue], 0UL); - XCTAssertEqual([actualValue[1] unsignedIntValue], 1UL); - XCTAssertEqual([actualValue[2] unsignedIntValue], 4UL); - XCTAssertEqual([actualValue[3] unsignedIntValue], 5UL); - XCTAssertEqual([actualValue[4] unsignedIntValue], 6UL); - XCTAssertEqual([actualValue[5] unsignedIntValue], 9UL); - XCTAssertEqual([actualValue[6] unsignedIntValue], 10UL); - XCTAssertEqual([actualValue[7] unsignedIntValue], 11UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000480_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write struct-typed attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id structAttrArgument; - structAttrArgument = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).a = [NSNumber numberWithUnsignedChar:5]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).b = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).c = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).d = [[NSData alloc] initWithBytes:"abc" length:3]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).e = @""; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).f = [NSNumber numberWithUnsignedChar:17]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).g = [NSNumber numberWithFloat:1.5f]; - ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).h = [NSNumber numberWithDouble:3.14159265358979]; - - [cluster writeAttributeStructAttrWithValue:structAttrArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write struct-typed attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000481_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read struct-typed attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeStructAttrWithCompletionHandler:^( - CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read struct-typed attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).a unsignedCharValue], 5); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).b boolValue], true); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).c unsignedCharValue], 2); - XCTAssertTrue([((CHIPTestClusterClusterSimpleStruct *) actualValue).d isEqualToData:[[NSData alloc] initWithBytes:"abc" - length:3]]); - XCTAssertTrue([((CHIPTestClusterClusterSimpleStruct *) actualValue).e isEqualToString:@""]); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).f unsignedCharValue], 17); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).g floatValue], 1.5f); - XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).h doubleValue], 3.14159265358979); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestSaveAs_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull TestAddArgumentDefaultValue; -- (void)testSendClusterTestSaveAs_000001_TestAddArguments -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [NSNumber numberWithUnsignedChar:17]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.returnValue; - XCTAssertEqual([actualValue unsignedCharValue], 20); - } - { - id actualValue = values.returnValue; - TestAddArgumentDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000002_TestAddArguments -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [NSNumber numberWithUnsignedChar:17]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.returnValue; - XCTAssertEqualObjects(actualValue, TestAddArgumentDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000003_TestAddArguments -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Add Arguments Command"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; - params.arg1 = [NSNumber numberWithUnsignedChar:3]; - params.arg2 = [TestAddArgumentDefaultValue copy]; - [cluster testAddArgumentsWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Test Add Arguments Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.returnValue; - XCTAssertNotEqualObjects(actualValue, TestAddArgumentDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeBooleanDefaultValue; -- (void)testSendClusterTestSaveAs_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - { - id actualValue = value; - readAttributeBooleanDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000005_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id booleanArgument; - booleanArgument = [NSNumber numberWithBool:1]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeBooleanDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000007_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BOOLEAN DefaultValue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id booleanArgument; - booleanArgument = [readAttributeBooleanDefaultValue copy]; - [cluster writeAttributeBooleanWithValue:booleanArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BOOLEAN DefaultValue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BOOLEAN False"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BOOLEAN False Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeBooleanDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeBitmap8DefaultValue; -- (void)testSendClusterTestSaveAs_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = value; - readAttributeBitmap8DefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000010_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap8Argument; - bitmap8Argument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeBitmap8DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000012_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP8 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap8Argument; - bitmap8Argument = [readAttributeBitmap8DefaultValue copy]; - [cluster writeAttributeBitmap8WithValue:bitmap8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP8 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP8 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP8 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeBitmap8DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeBitmap16DefaultValue; -- (void)testSendClusterTestSaveAs_000014_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - { - id actualValue = value; - readAttributeBitmap16DefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000015_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap16Argument; - bitmap16Argument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000016_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeBitmap16DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000017_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP16 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap16Argument; - bitmap16Argument = [readAttributeBitmap16DefaultValue copy]; - [cluster writeAttributeBitmap16WithValue:bitmap16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP16 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP16 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP16 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeBitmap16DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeBitmap32DefaultValue; -- (void)testSendClusterTestSaveAs_000019_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - { - id actualValue = value; - readAttributeBitmap32DefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000020_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap32Argument; - bitmap32Argument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000021_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeBitmap32DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000022_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP32 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap32Argument; - bitmap32Argument = [readAttributeBitmap32DefaultValue copy]; - [cluster writeAttributeBitmap32WithValue:bitmap32Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP32 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000023_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP32 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP32 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeBitmap32DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeBitmap64DefaultValue; -- (void)testSendClusterTestSaveAs_000024_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - { - id actualValue = value; - readAttributeBitmap64DefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000025_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap64Argument; - bitmap64Argument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000026_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeBitmap64DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000027_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute BITMAP64 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bitmap64Argument; - bitmap64Argument = [readAttributeBitmap64DefaultValue copy]; - [cluster writeAttributeBitmap64WithValue:bitmap64Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute BITMAP64 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000028_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute BITMAP64 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute BITMAP64 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeBitmap64DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeInt8uDefaultValue; -- (void)testSendClusterTestSaveAs_000029_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = value; - readAttributeInt8uDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000030_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int8uArgument; - int8uArgument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000031_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeInt8uDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000032_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int8uArgument; - int8uArgument = [readAttributeInt8uDefaultValue copy]; - [cluster writeAttributeInt8uWithValue:int8uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000033_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeInt8uDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeInt16uDefaultValue; -- (void)testSendClusterTestSaveAs_000034_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - { - id actualValue = value; - readAttributeInt16uDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000035_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int16uArgument; - int16uArgument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeInt16uWithValue:int16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000036_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeInt16uDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000037_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int16uArgument; - int16uArgument = [readAttributeInt16uDefaultValue copy]; - [cluster writeAttributeInt16uWithValue:int16uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000038_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeInt16uDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeInt32uDefaultValue; -- (void)testSendClusterTestSaveAs_000039_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - { - id actualValue = value; - readAttributeInt32uDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000040_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000041_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeInt32uDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000042_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32uArgument; - int32uArgument = [readAttributeInt32uDefaultValue copy]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000043_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeInt32uDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeInt64uDefaultValue; -- (void)testSendClusterTestSaveAs_000044_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - { - id actualValue = value; - readAttributeInt64uDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000045_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int64uArgument; - int64uArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeInt64uWithValue:int64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000046_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeInt64uDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000047_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int64uArgument; - int64uArgument = [readAttributeInt64uDefaultValue copy]; - [cluster writeAttributeInt64uWithValue:int64uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000048_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64U Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64U Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeInt64uDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeInt8sDefaultValue; -- (void)testSendClusterTestSaveAs_000049_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue charValue], 0); - } - { - id actualValue = value; - readAttributeInt8sDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000050_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int8sArgument; - int8sArgument = [NSNumber numberWithChar:1]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000051_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeInt8sDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000052_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT8S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int8sArgument; - int8sArgument = [readAttributeInt8sDefaultValue copy]; - [cluster writeAttributeInt8sWithValue:int8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT8S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000053_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT8S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT8S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeInt8sDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeInt16sDefaultValue; -- (void)testSendClusterTestSaveAs_000054_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue shortValue], 0); - } - { - id actualValue = value; - readAttributeInt16sDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000055_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int16sArgument; - int16sArgument = [NSNumber numberWithShort:1]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000056_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeInt16sDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000057_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT16S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int16sArgument; - int16sArgument = [readAttributeInt16sDefaultValue copy]; - [cluster writeAttributeInt16sWithValue:int16sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT16S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000058_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT16S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT16S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeInt16sDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeInt32sDefaultValue; -- (void)testSendClusterTestSaveAs_000059_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue intValue], 0L); - } - { - id actualValue = value; - readAttributeInt32sDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000060_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32sArgument; - int32sArgument = [NSNumber numberWithInt:1L]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000061_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeInt32sDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000062_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32sArgument; - int32sArgument = [readAttributeInt32sDefaultValue copy]; - [cluster writeAttributeInt32sWithValue:int32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000063_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeInt32sDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeInt64sDefaultValue; -- (void)testSendClusterTestSaveAs_000064_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue longLongValue], 0LL); - } - { - id actualValue = value; - readAttributeInt64sDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000065_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INTS Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int64sArgument; - int64sArgument = [NSNumber numberWithLongLong:1LL]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INTS Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000066_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeInt64sDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000067_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT64S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int64sArgument; - int64sArgument = [readAttributeInt64sDefaultValue copy]; - [cluster writeAttributeInt64sWithValue:int64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT64S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000068_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT64S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT64S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeInt64sDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeEnum8DefaultValue; -- (void)testSendClusterTestSaveAs_000069_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = value; - readAttributeEnum8DefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000070_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id enum8Argument; - enum8Argument = [NSNumber numberWithUnsignedChar:1]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000071_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeEnum8DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000072_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM8 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id enum8Argument; - enum8Argument = [readAttributeEnum8DefaultValue copy]; - [cluster writeAttributeEnum8WithValue:enum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM8 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000073_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM8 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM8 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeEnum8DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeEnum16DefaultValue; -- (void)testSendClusterTestSaveAs_000074_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - { - id actualValue = value; - readAttributeEnum16DefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000075_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id enum16Argument; - enum16Argument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000076_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeEnum16DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000077_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute ENUM16 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id enum16Argument; - enum16Argument = [readAttributeEnum16DefaultValue copy]; - [cluster writeAttributeEnum16WithValue:enum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute ENUM16 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000078_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute ENUM16 Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute ENUM16 Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeEnum16DefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeEpochUSDefaultValue; -- (void)testSendClusterTestSaveAs_000079_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); - } - { - id actualValue = value; - readAttributeEpochUSDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000080_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id epochUsArgument; - epochUsArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000081_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeEpochUSDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000082_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id epochUsArgument; - epochUsArgument = [readAttributeEpochUSDefaultValue copy]; - [cluster writeAttributeEpochUsWithValue:epochUsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_US Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000083_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeEpochUSDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeEpochSDefaultValue; -- (void)testSendClusterTestSaveAs_000084_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 0UL); - } - { - id actualValue = value; - readAttributeEpochSDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000085_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id epochSArgument; - epochSArgument = [NSNumber numberWithUnsignedInt:1UL]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000086_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeEpochSDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000087_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id epochSArgument; - epochSArgument = [readAttributeEpochSDefaultValue copy]; - [cluster writeAttributeEpochSWithValue:epochSArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute EPOCH_S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000088_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeEpochSDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull readAttributeVendorIdDefaultValue; -- (void)testSendClusterTestSaveAs_000089_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - { - id actualValue = value; - readAttributeVendorIdDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000090_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute vendor_id Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id vendorIdArgument; - vendorIdArgument = [NSNumber numberWithUnsignedShort:1U]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000091_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeVendorIdDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000092_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute vendor_id Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id vendorIdArgument; - vendorIdArgument = [readAttributeVendorIdDefaultValue copy]; - [cluster writeAttributeVendorIdWithValue:vendorIdArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute vendor_id Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000093_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute vendor_id Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeVendorIdDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSString * _Nonnull readAttributeCharStringDefaultValue; -- (void)testSendClusterTestSaveAs_000094_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute char_string Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@""]); - } - { - id actualValue = value; - readAttributeCharStringDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000095_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute char_string Default Value and compare to saved value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Default Value and compare to saved value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeCharStringDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000096_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute char_string Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @"NotDefault"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute char_string Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSString * _Nonnull readAttributeCharStringNotDefaultValue; -- (void)testSendClusterTestSaveAs_000097_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute char_string Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@"NotDefault"]); - } - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeCharStringDefaultValue); - } - { - id actualValue = value; - readAttributeCharStringNotDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000098_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute char_string Not Default Value and compare to saved value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Not Default Value and compare to saved value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeCharStringNotDefaultValue); - } - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeCharStringDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000099_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write attribute char_string Not Default Value from saved value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = [readAttributeCharStringNotDefaultValue copy]; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute char_string Not Default Value from saved value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000100_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute char_string Not Default Value and compare to expected value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute char_string Not Default Value and compare to expected value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@"NotDefault"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000101_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute char_string Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = [readAttributeCharStringDefaultValue copy]; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute char_string Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSData * _Nonnull readAttributeOctetStringDefaultValue; -- (void)testSendClusterTestSaveAs_000102_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute octet_string Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]); - } - { - id actualValue = value; - readAttributeOctetStringDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000103_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute octet_string Default Value and compare to saved value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Default Value and compare to saved value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeOctetStringDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000104_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute octet_string Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id octetStringArgument; - octetStringArgument = [[NSData alloc] initWithBytes:"NotDefault" length:10]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_string Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSData * _Nonnull readAttributeOctetStringNotDefaultValue; -- (void)testSendClusterTestSaveAs_000105_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute octet_string Not Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Not Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"NotDefault" length:10]]); - } - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeOctetStringDefaultValue); - } - { - id actualValue = value; - readAttributeOctetStringNotDefaultValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000106_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute octet_string Not Default Value and compare to saved value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Not Default Value and compare to saved value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqualObjects(actualValue, readAttributeOctetStringNotDefaultValue); - } - { - id actualValue = value; - XCTAssertNotEqualObjects(actualValue, readAttributeOctetStringDefaultValue); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000107_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Write attribute octet_string Not Default Value from saved value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id octetStringArgument; - octetStringArgument = [readAttributeOctetStringNotDefaultValue copy]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_string Not Default Value from saved value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000108_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute octet_string Not Default Value and compare to expected value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute octet_string Not Default Value and compare to expected value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"NotDefault" length:10]]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSaveAs_000109_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute octet_string Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id octetStringArgument; - octetStringArgument = [readAttributeOctetStringDefaultValue copy]; - [cluster writeAttributeOctetStringWithValue:octetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute octet_string Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestConstraints_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000001_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:5UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value MinValue Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Value MinValue Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 5UL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value MaxValue Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Value MaxValue Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 5UL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute INT32U Value NotValue Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute INT32U Value NotValue Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertNotEqual([actualValue unsignedIntValue], 6UL); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000005_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute INT32U Value Back to Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id int32uArgument; - int32uArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeInt32uWithValue:int32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute INT32U Value Back to Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000006_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @"** Test **"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value MinLength Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value MinLength Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue length], 5); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value MaxLength Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value MaxLength Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertLessThanOrEqual([actualValue length], 20); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value StartsWith Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value StartsWith Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue hasPrefix:@"**"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value EndsWith Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value EndsWith Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue hasSuffix:@"**"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000011_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @"lowercase"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000012_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]]; - XCTAssertTrue(isLowerCase); - } - { - id actualValue = value; - BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]]; - XCTAssertFalse(isUpperCase); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000013_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @"UPPERCASE"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000014_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]]; - XCTAssertFalse(isLowerCase); - } - { - id actualValue = value; - BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]]; - XCTAssertTrue(isUpperCase); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000015_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @"lowUPPER"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000016_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]]; - XCTAssertFalse(isLowerCase); - } - { - id actualValue = value; - BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]]; - XCTAssertFalse(isUpperCase); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000017_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @"ABCDEF012V"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000018_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value isHexString Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - NSCharacterSet * chars = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet]; - BOOL isHexString = (NSNotFound == [actualValue rangeOfCharacterFromSet:chars].location); - XCTAssertFalse(isHexString); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000019_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @"ABCDEF0123"; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000020_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value isHexString Constraints"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - NSCharacterSet * chars = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet]; - BOOL isHexString = (NSNotFound == [actualValue rangeOfCharacterFromSet:chars].location); - XCTAssertTrue(isHexString); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestConstraints_000021_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value Back to Default Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id charStringArgument; - charStringArgument = @""; - [cluster writeAttributeCharStringWithValue:charStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute CHAR_STRING Value Back to Default Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestDelayCommands_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestDelayCommands_000001_WaitForMs -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 100ms"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForMs(expectation, queue, 100); - [self waitForExpectationsWithTimeout:(100 / 1000) + kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestDescriptorCluster_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestDescriptorCluster_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Device list"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeDeviceListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Device list Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual([((CHIPDescriptorClusterDeviceType *) actualValue[0]).type unsignedIntValue], 22UL); - XCTAssertEqual([((CHIPDescriptorClusterDeviceType *) actualValue[0]).revision unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestDescriptorCluster_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Server list"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Server list Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 25); - XCTAssertEqual([actualValue[0] unsignedIntValue], 3UL); - XCTAssertEqual([actualValue[1] unsignedIntValue], 4UL); - XCTAssertEqual([actualValue[2] unsignedIntValue], 29UL); - XCTAssertEqual([actualValue[3] unsignedIntValue], 30UL); - XCTAssertEqual([actualValue[4] unsignedIntValue], 31UL); - XCTAssertEqual([actualValue[5] unsignedIntValue], 40UL); - XCTAssertEqual([actualValue[6] unsignedIntValue], 42UL); - XCTAssertEqual([actualValue[7] unsignedIntValue], 43UL); - XCTAssertEqual([actualValue[8] unsignedIntValue], 44UL); - XCTAssertEqual([actualValue[9] unsignedIntValue], 45UL); - XCTAssertEqual([actualValue[10] unsignedIntValue], 46UL); - XCTAssertEqual([actualValue[11] unsignedIntValue], 48UL); - XCTAssertEqual([actualValue[12] unsignedIntValue], 49UL); - XCTAssertEqual([actualValue[13] unsignedIntValue], 50UL); - XCTAssertEqual([actualValue[14] unsignedIntValue], 51UL); - XCTAssertEqual([actualValue[15] unsignedIntValue], 52UL); - XCTAssertEqual([actualValue[16] unsignedIntValue], 53UL); - XCTAssertEqual([actualValue[17] unsignedIntValue], 54UL); - XCTAssertEqual([actualValue[18] unsignedIntValue], 55UL); - XCTAssertEqual([actualValue[19] unsignedIntValue], 60UL); - XCTAssertEqual([actualValue[20] unsignedIntValue], 62UL); - XCTAssertEqual([actualValue[21] unsignedIntValue], 63UL); - XCTAssertEqual([actualValue[22] unsignedIntValue], 64UL); - XCTAssertEqual([actualValue[23] unsignedIntValue], 65UL); - XCTAssertEqual([actualValue[24] unsignedIntValue], 1029UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestDescriptorCluster_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Client list"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Client list Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual([actualValue[0] unsignedIntValue], 41UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestDescriptorCluster_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute Parts list"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestDescriptor * cluster = [[CHIPTestDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute Parts list Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 2); - XCTAssertEqual([actualValue[0] unsignedShortValue], 1U); - XCTAssertEqual([actualValue[1] unsignedShortValue], 2U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestGroupsCluster_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000001_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 0 (invalid)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:0U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 0 (invalid) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 135); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000002_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (not found)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (not found) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 139); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000003_AddGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 1 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - params.groupName = @"Group #1"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 1 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000004_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #1"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000005_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (not found)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (not found) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 139); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000006_GetGroupMembership -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 1 (all)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - params.groupList = temp_0; - } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 1 (all) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.capacity; - XCTAssertTrue(actualValue == nil); - } - { - id actualValue = values.groupList; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual([actualValue[0] unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000007_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (not found)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (not found) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 139); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 32767U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000008_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (existing)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (existing) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #1"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000009_RemoveGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 0 (invalid)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:0U]; - [cluster removeGroupWithParams:params - completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove Group 0 (invalid) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 135); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000010_RemoveGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 4 (not found)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4U]; - [cluster removeGroupWithParams:params - completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove Group 4 (not found) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 139); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000011_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (not removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (not removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #1"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000012_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 139); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000013_GetGroupMembership -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 3"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; - temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; - temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; - temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; - params.groupList = temp_0; - } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 3 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.capacity; - XCTAssertTrue(actualValue == nil); - } - { - id actualValue = values.groupList; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual([actualValue[0] unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000014_RemoveAllGroups -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Remove All"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Remove All Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000015_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:1U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 1 (removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 139); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000016_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (still removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (still removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 139); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000017_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 139); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 32767U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000018_GetGroupMembership -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 4"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedShort:1U]; - temp_0[1] = [NSNumber numberWithUnsignedShort:2U]; - temp_0[2] = [NSNumber numberWithUnsignedShort:4369U]; - temp_0[3] = [NSNumber numberWithUnsignedShort:3U]; - temp_0[4] = [NSNumber numberWithUnsignedShort:32767U]; - params.groupList = temp_0; - } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 4 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.capacity; - XCTAssertTrue(actualValue == nil); - } - { - id actualValue = values.groupList; - XCTAssertEqual([actualValue count], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestGroupKeyManagementCluster_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read maxGroupsPerFabric"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read maxGroupsPerFabric Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 2U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read maxGroupKeysPerFabric"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read maxGroupKeysPerFabric Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 2U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000003_AddGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 1"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:257U]; - params.groupName = @"Group #1"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 1 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 257U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000004_AddGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 2"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:258U]; - params.groupName = @"Group #2"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 2 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 258U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000005_KeySetWrite -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Write 1"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; - params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:0]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = - [[NSData alloc] initWithBytes:"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = - [NSNumber numberWithUnsignedLongLong:1110000ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = - [[NSData alloc] initWithBytes:"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = - [NSNumber numberWithUnsignedLongLong:1110001ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = - [[NSData alloc] initWithBytes:"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = - [NSNumber numberWithUnsignedLongLong:1110002ULL]; - - [cluster keySetWriteWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Write 1 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000006_KeySetWrite -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Write 2"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; - params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:1]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = - [[NSData alloc] initWithBytes:"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = - [NSNumber numberWithUnsignedLongLong:2110000ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = - [[NSData alloc] initWithBytes:"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = - [NSNumber numberWithUnsignedLongLong:2110001ULL]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = - [[NSData alloc] initWithBytes:"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" length:16]; - ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = - [NSNumber numberWithUnsignedLongLong:2110002ULL]; - - [cluster keySetWriteWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Write 2 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000007_KeySetRead -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - [cluster - keySetReadWithParams:params - completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.groupKeySet; - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID unsignedShortValue], 417U); - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy unsignedCharValue], - 0); - XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0 == nil); - XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 == nil); - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 unsignedLongLongValue], - 1110000ULL); - XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1 == nil); - XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 == nil); - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 unsignedLongLongValue], - 1110001ULL); - XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2 == nil); - XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 == nil); - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 unsignedLongLongValue], - 1110002ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000008_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write Group Keys (invalid)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id groupKeyMapArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:258U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:0U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; - - groupKeyMapArgument = temp_0; - } - [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Group Keys (invalid) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000009_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write Group Keys"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id groupKeyMapArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:257U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; - - temp_0[1] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupId = [NSNumber numberWithUnsignedShort:258U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; - - groupKeyMapArgument = temp_0; - } - [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Group Keys Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read Group Keys"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeGroupKeyMapWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read Group Keys Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 2); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) - actualValue[0]).groupId unsignedShortValue], - 257U); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) - actualValue[0]).groupKeySetID unsignedShortValue], - 417U); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) - actualValue[0]).fabricIndex unsignedCharValue], - 1); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) - actualValue[1]).groupId unsignedShortValue], - 258U); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) - actualValue[1]).groupKeySetID unsignedShortValue], - 418U); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) - actualValue[1]).fabricIndex unsignedCharValue], - 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000011_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read GroupTable"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeGroupTableWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read GroupTable Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 2); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) - actualValue[0]).groupId unsignedShortValue], - 257U); - XCTAssertTrue([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName - isEqualToString:@"Group #1"]); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) - actualValue[0]).fabricIndex unsignedCharValue], - 1); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) - actualValue[1]).groupId unsignedShortValue], - 258U); - XCTAssertTrue([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupName - isEqualToString:@"Group #2"]); - XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) - actualValue[1]).fabricIndex unsignedCharValue], - 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000012_KeySetRemove -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Remove 1"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - [cluster keySetRemoveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Remove 1 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000013_KeySetRead -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:417U]; - [cluster - keySetReadWithParams:params - completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read (removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_NOT_FOUND); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000014_KeySetRead -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (not removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - [cluster - keySetReadWithParams:params - completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read (not removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.groupKeySet; - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID unsignedShortValue], 418U); - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy unsignedCharValue], - 1); - XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0 == nil); - XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 == nil); - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 unsignedLongLongValue], - 2110000ULL); - XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1 == nil); - XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 == nil); - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 unsignedLongLongValue], - 2110001ULL); - XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2 == nil); - XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 == nil); - XCTAssertEqual( - [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 unsignedLongLongValue], - 2110002ULL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000015_RemoveAllGroups -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Remove All"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Remove All Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000016_KeySetRemove -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Remove 2"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - [cluster keySetRemoveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"KeySet Remove 2 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupKeyManagementCluster_000017_KeySetRead -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (also removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:418U]; - [cluster - keySetReadWithParams:params - completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"KeySet Read (also removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_NOT_FOUND); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestIdentifyCluster_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestIdentifyCluster_000001_Identify -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Identify command and expect success response"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPIdentifyClusterIdentifyParams alloc] init]; - params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; - [cluster identifyWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Identify command and expect success response Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestLogCommands_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestLogCommands_000001_Log -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Log a simple message"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Log(expectation, queue, @"This is a simple message"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestLogCommands_000002_UserPrompt -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Do a simple user prompt message"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - UserPrompt(expectation, queue, @"This is a simple message"); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestOperationalCredentialsCluster_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestOperationalCredentialsCluster_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of supported fabrics"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read number of supported fabrics Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 4); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestOperationalCredentialsCluster_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of commissioned fabrics"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read number of commissioned fabrics Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -NSNumber * _Nonnull ourFabricIndex; -- (void)testSendClusterTestOperationalCredentialsCluster_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read current fabric index"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read current fabric index Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); - } - } - { - id actualValue = value; - ourFabricIndex = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestOperationalCredentialsCluster_000004_RemoveFabric -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Remove nonexistent fabric"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; - params.fabricIndex = [NSNumber numberWithUnsignedChar:243]; - [cluster - removeFabricWithParams:params - completionHandler:^(CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove nonexistent fabric Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.statusCode; - XCTAssertEqual([actualValue unsignedCharValue], 11); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestOperationalCredentialsCluster_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read fabric list before setting label"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeFabricsWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read fabric list before setting label Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertTrue([((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label - isEqualToString:@""]); - XCTAssertEqualObjects( - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, - ourFabricIndex); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestOperationalCredentialsCluster_000006_UpdateFabricLabel -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Set the fabric label"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; - params.label = @"Batcave"; - [cluster updateFabricLabelWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Set the fabric label Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.statusCode; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.fabricIndex; - XCTAssertEqualObjects(actualValue, ourFabricIndex); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestOperationalCredentialsCluster_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read fabric list after setting label"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeFabricsWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read fabric list after setting label Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertTrue([((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label - isEqualToString:@"Batcave"]); - XCTAssertEqualObjects( - ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, - ourFabricIndex); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestBinding_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBinding_000001_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write empty binding table"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write empty binding table Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBinding_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read empty binding table"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read empty binding table Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBinding_000003_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write invalid binding table"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).group = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write invalid binding table Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBinding_000004_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write binding table (endpoint 1)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).group = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[1] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).node = [NSNumber numberWithUnsignedLongLong:1ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).cluster = [NSNumber numberWithUnsignedInt:6UL]; - ((CHIPBindingClusterTargetStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - temp_0[2] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[2]).node = [NSNumber numberWithUnsignedLongLong:2ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[2]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write binding table (endpoint 1) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBinding_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read binding table (endpoint 1)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read binding table (endpoint 1) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 3); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).group unsignedShortValue], 1U); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex unsignedCharValue], 1); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).node unsignedLongLongValue], 1ULL); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint unsignedShortValue], 1U); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster unsignedIntValue], 6UL); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex unsignedCharValue], 1); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).node unsignedLongLongValue], 2ULL); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint unsignedShortValue], 1U); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBinding_000006_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write binding table (endpoint 0)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id bindingArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPBindingClusterTargetStruct alloc] init]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).node = [NSNumber numberWithUnsignedLongLong:3ULL]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).endpoint = [NSNumber numberWithUnsignedShort:1U]; - ((CHIPBindingClusterTargetStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; - - bindingArgument = temp_0; - } - [cluster writeAttributeBindingWithValue:bindingArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write binding table (endpoint 0) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBinding_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read binding table (endpoint 0)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read binding table (endpoint 0) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).node unsignedLongLongValue], 3ULL); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).endpoint unsignedShortValue], 1U); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBinding_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify endpoint 1 not changed"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinding * cluster = [[CHIPTestBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster - readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify endpoint 1 not changed Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 3); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).group unsignedShortValue], 1U); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[0]).fabricIndex unsignedCharValue], 1); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).node unsignedLongLongValue], 1ULL); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).endpoint unsignedShortValue], 1U); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).cluster unsignedIntValue], 6UL); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[1]).fabricIndex unsignedCharValue], 1); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).node unsignedLongLongValue], 2ULL); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).endpoint unsignedShortValue], 1U); - XCTAssertEqual([((CHIPBindingClusterTargetStruct *) actualValue[2]).fabricIndex unsignedCharValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestUserLabelCluster_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestUserLabelCluster_000001_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Clear User Label List"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id labelListArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - labelListArgument = temp_0; - } - [cluster writeAttributeLabelListWithValue:labelListArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear User Label List Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestUserLabelCluster_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read User Label List"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read User Label List Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestUserLabelCluster_000003_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write User Label List"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - id labelListArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[CHIPUserLabelClusterLabelStruct alloc] init]; - ((CHIPUserLabelClusterLabelStruct *) temp_0[0]).label = @"room"; - ((CHIPUserLabelClusterLabelStruct *) temp_0[0]).value = @"bedroom 2"; - - temp_0[1] = [[CHIPUserLabelClusterLabelStruct alloc] init]; - ((CHIPUserLabelClusterLabelStruct *) temp_0[1]).label = @"orientation"; - ((CHIPUserLabelClusterLabelStruct *) temp_0[1]).value = @"North"; - - temp_0[2] = [[CHIPUserLabelClusterLabelStruct alloc] init]; - ((CHIPUserLabelClusterLabelStruct *) temp_0[2]).label = @"floor"; - ((CHIPUserLabelClusterLabelStruct *) temp_0[2]).value = @"5"; - - temp_0[3] = [[CHIPUserLabelClusterLabelStruct alloc] init]; - ((CHIPUserLabelClusterLabelStruct *) temp_0[3]).label = @"direction"; - ((CHIPUserLabelClusterLabelStruct *) temp_0[3]).value = @"up"; - - labelListArgument = temp_0; - } - [cluster writeAttributeLabelListWithValue:labelListArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write User Label List Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestUserLabelCluster_000004_Reboot -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reboot target device"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - Reboot(expectation, queue, 3840); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestUserLabelCluster_000005_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestUserLabelCluster_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Verify"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestUserLabel * cluster = [[CHIPTestUserLabel alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue count], 4); - XCTAssertTrue([((CHIPUserLabelClusterLabelStruct *) actualValue[0]).label isEqualToString:@"room"]); - XCTAssertTrue([((CHIPUserLabelClusterLabelStruct *) actualValue[0]).value isEqualToString:@"bedroom 2"]); - XCTAssertTrue([((CHIPUserLabelClusterLabelStruct *) actualValue[1]).label isEqualToString:@"orientation"]); - XCTAssertTrue([((CHIPUserLabelClusterLabelStruct *) actualValue[1]).value isEqualToString:@"North"]); - XCTAssertTrue([((CHIPUserLabelClusterLabelStruct *) actualValue[2]).label isEqualToString:@"floor"]); - XCTAssertTrue([((CHIPUserLabelClusterLabelStruct *) actualValue[2]).value isEqualToString:@"5"]); - XCTAssertTrue([((CHIPUserLabelClusterLabelStruct *) actualValue[3]).label isEqualToString:@"direction"]); - XCTAssertTrue([((CHIPUserLabelClusterLabelStruct *) actualValue[3]).value isEqualToString:@"up"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_SWDIAG_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWDIAG_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads a list of ThreadMetrics struct non-global attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads a list of ThreadMetrics struct non-global attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWDIAG_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads CurrentHeapFree non-global attribute value from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapFree non-global attribute value from DUT Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWDIAG_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads CurrentHeapUsed non-global attribute value from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapUsed non-global attribute value from DUT Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWDIAG_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_SWDIAG_3_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWDIAG_3_1_000001_ResetWatermarks -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ResetWatermarks to DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster resetWatermarksWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ResetWatermarks to DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWDIAG_3_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentHeapUsed attribute value from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapUsed attribute value from DUT Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_SWDIAG_3_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentHeapHighWaterMark attribute value from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestSoftwareDiagnostics * cluster = [[CHIPTestSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapHighWaterMark attribute value from DUT Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTestSubscribe_OnOff_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSubscribe_OnOff_000001_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Set OnOff Attribute to false"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Set OnOff Attribute to false Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -bool testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = false; -ResponseHandler test_TestSubscribe_OnOff_OnOff_Reported = nil; -- (void)testSendClusterTestSubscribe_OnOff_000002_WaitForReport -{ - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Report: Subscribe OnOff Attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], false); - } - - testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = true; - }; -} -- (void)testSendClusterTestSubscribe_OnOff_000003_SubscribeAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Subscribe OnOff Attribute"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - uint16_t minIntervalArgument = 2U; - uint16_t maxIntervalArgument = 5U; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.fabricFiltered = [NSNumber numberWithBool:true]; - [cluster subscribeAttributeOnOffWithMinInterval:@(minIntervalArgument) - maxInterval:@(maxIntervalArgument) - params:params - subscriptionEstablished:^{ - XCTAssertEqual(testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled, true); - [expectation fulfill]; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Subscribe OnOff Attribute Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - if (test_TestSubscribe_OnOff_OnOff_Reported != nil) { - ResponseHandler callback = test_TestSubscribe_OnOff_OnOff_Reported; - test_TestSubscribe_OnOff_OnOff_Reported = nil; - callback(value, err); - } - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSubscribe_OnOff_000004_On -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn On the light to see attribute change"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn On the light to see attribute change Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSubscribe_OnOff_000005_WaitForReport -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check for attribute report"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check for attribute report Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], true); - } - - [expectation fulfill]; - }; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSubscribe_OnOff_000006_Off -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn Off the light to see attribute change"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn Off the light to see attribute change Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestSubscribe_OnOff_000007_WaitForReport -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Check for attribute report"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - test_TestSubscribe_OnOff_OnOff_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check for attribute report Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], false); - } - - [expectation fulfill]; - }; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - @end diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm index dfcc84369068fb..2d08885cf28f64 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm @@ -24,7 +24,7 @@ #import "CHIPDevice.h" #import "CHIPDevice_Internal.h" -#import "zap-generated/CHIPTestClustersObjc.h" +#import "zap-generated/cluster/CHIPTestClustersObjc.h" #import "zap-generated/tests/CHIPClustersTest.h" #include diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 9606506ee4f4dd..3ee27ca7befd90 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -47355,7 +47355,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - bool testSendClusterTest_TC_WNCV_3_1_000007_WaitForReport_Fulfilled = false; + bool testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled = false; ResponseHandler _Nullable test_Test_TC_WNCV_3_1_OperationalStatus_Reported = nil; CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() @@ -47370,7 +47370,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - testSendClusterTest_TC_WNCV_3_1_000007_WaitForReport_Fulfilled = true; + testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled = true; }; NextTest(); @@ -47390,8 +47390,8 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] params:params subscriptionEstablished:^{ - VerifyOrReturn(testSendClusterTest_TC_WNCV_3_1_000007_WaitForReport_Fulfilled, - SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + VerifyOrReturn( + testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); NextTest(); } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -48071,7 +48071,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - bool testSendClusterTest_TC_WNCV_3_2_000007_WaitForReport_Fulfilled = false; + bool testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled = false; ResponseHandler _Nullable test_Test_TC_WNCV_3_2_OperationalStatus_Reported = nil; CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_7() @@ -48086,7 +48086,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - testSendClusterTest_TC_WNCV_3_2_000007_WaitForReport_Fulfilled = true; + testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled = true; }; NextTest(); @@ -48106,8 +48106,8 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] params:params subscriptionEstablished:^{ - VerifyOrReturn(testSendClusterTest_TC_WNCV_3_2_000007_WaitForReport_Fulfilled, - SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + VerifyOrReturn( + testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); NextTest(); } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -48629,7 +48629,7 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { WaitForMs(2000); return CHIP_NO_ERROR; } - bool testSendClusterTest_TC_WNCV_3_3_000005_WaitForReport_Fulfilled = false; + bool testSendClusterTest_TC_WNCV_3_3_5_WaitForReport_Fulfilled = false; ResponseHandler _Nullable test_Test_TC_WNCV_3_3_OperationalStatus_Reported = nil; CHIP_ERROR TestReport2SubscribeToDutReportsOnOperationalStatusAttribute_5() @@ -48644,7 +48644,7 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - testSendClusterTest_TC_WNCV_3_3_000005_WaitForReport_Fulfilled = true; + testSendClusterTest_TC_WNCV_3_3_5_WaitForReport_Fulfilled = true; }; NextTest(); @@ -48664,8 +48664,8 @@ class Test_TC_WNCV_3_3 : public TestCommandBridge { maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] params:params subscriptionEstablished:^{ - VerifyOrReturn(testSendClusterTest_TC_WNCV_3_3_000005_WaitForReport_Fulfilled, - SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + VerifyOrReturn( + testSendClusterTest_TC_WNCV_3_3_5_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); NextTest(); } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -64617,7 +64617,7 @@ class TestCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - bool testSendClusterTestCluster_000366_WaitForReport_Fulfilled = false; + bool testSendClusterTestCluster_366_WaitForReport_Fulfilled = false; ResponseHandler _Nullable test_TestCluster_list_int8u_Reported = nil; CHIP_ERROR TestReportSubscribeToListAttribute_366() @@ -64640,7 +64640,7 @@ class TestCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("", actualValue[3], 4)); } - testSendClusterTestCluster_000366_WaitForReport_Fulfilled = true; + testSendClusterTestCluster_366_WaitForReport_Fulfilled = true; }; NextTest(); @@ -64661,7 +64661,7 @@ class TestCluster : public TestCommandBridge { params:params subscriptionEstablished:^{ VerifyOrReturn( - testSendClusterTestCluster_000366_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + testSendClusterTestCluster_366_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); NextTest(); } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -74254,7 +74254,7 @@ class TestSubscribe_OnOff : public TestCommandBridge { return CHIP_NO_ERROR; } - bool testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = false; + bool testSendClusterTestSubscribe_OnOff_2_WaitForReport_Fulfilled = false; ResponseHandler _Nullable test_TestSubscribe_OnOff_OnOff_Reported = nil; CHIP_ERROR TestReportSubscribeOnOffAttribute_2() @@ -74273,7 +74273,7 @@ class TestSubscribe_OnOff : public TestCommandBridge { VerifyOrReturn(CheckValue("OnOff", actualValue, false)); } - testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled = true; + testSendClusterTestSubscribe_OnOff_2_WaitForReport_Fulfilled = true; }; NextTest(); @@ -74293,8 +74293,8 @@ class TestSubscribe_OnOff : public TestCommandBridge { maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] params:params subscriptionEstablished:^{ - VerifyOrReturn(testSendClusterTestSubscribe_OnOff_000002_WaitForReport_Fulfilled, - SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + VerifyOrReturn( + testSendClusterTestSubscribe_OnOff_2_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); NextTest(); } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { From 18ce67c3aec82a20b9469f69d2670c0d8b8b1137 Mon Sep 17 00:00:00 2001 From: doru91 Date: Fri, 29 Apr 2022 17:43:20 +0300 Subject: [PATCH 49/59] Fix RAM0 overflow (#17899) Place BLE controller exchange buffer in RAM1. Signed-off-by: Doru Gucea --- .../nxp/k32w/k32w0/app/ldscripts/chip-k32w061-linker.ld | 3 ++- third_party/nxp/k32w0_sdk/k32w0_sdk.gni | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w061-linker.ld b/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w061-linker.ld index c880b29ec2b843..3bb149e142b48c 100644 --- a/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w061-linker.ld +++ b/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w061-linker.ld @@ -211,8 +211,9 @@ SECTIONS _etext = .; - .heap (COPY): + .heap_controller (COPY): { + *(.ll_exchange_mem) __HeapBase = .; _heap = .; KEEP(*(.heap*)) diff --git a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni index 2a2c122397c9a3..b9a9889e1f4a40 100644 --- a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni +++ b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni @@ -158,7 +158,7 @@ template("k32w0_sdk") { "USE_SDK_OSA=0", "gSerialManagerMaxInterfaces_c=2", "FSL_RTOS_FREE_RTOS=1", - "gTotalHeapSize_c=0xF000", + "gTotalHeapSize_c=0xDC00", "gUartDebugConsole_d=1", "DEBUG_SERIAL_INTERFACE_INSTANCE=0", "APP_SERIAL_INTERFACE_INSTANCE=1", @@ -189,7 +189,7 @@ template("k32w0_sdk") { "gEnableBleInactivityTimeNotify=1", "DUAL_MODE_APP=1", "gMainThreadStackSize_c=5096", - "HEAP_SIZE=0xF000", + "HEAP_SIZE=gTotalHeapSize_c", "gLoggingActive_d=0", "gLogRingPlacementOffset_c=0xF000", ] From da43e3f6361c10a5418fafc0a056ab0fbebbfa2b Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Fri, 29 Apr 2022 22:58:20 +0800 Subject: [PATCH 50/59] Remove unused SessionHolder (#17882) --- src/controller/CHIPDeviceController.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 07013eab5923f5..a2b18d9c4bd48b 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -538,7 +538,6 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re Messaging::ExchangeContext * exchangeCtxt = nullptr; Optional session; - SessionHolder secureSessionHolder; VerifyOrExit(mState == State::Initialized, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(mDeviceInPASEEstablishment == nullptr, err = CHIP_ERROR_INCORRECT_STATE); From e6178828449c85b887288e6ef5122246519ab7b2 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Fri, 29 Apr 2022 20:29:04 +0530 Subject: [PATCH 51/59] server: Fix log being printed as error (#17903) --- src/app/server/CommissioningWindowManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index f9e1c639ef598e..4fa210d1737515 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -68,7 +68,7 @@ void CommissioningWindowManager::OnPlatformEvent(const DeviceLayer::ChipDeviceEv else if (event->Type == DeviceLayer::DeviceEventType::kOperationalNetworkEnabled) { app::DnssdServer::Instance().AdvertiseOperational(); - ChipLogError(AppServer, "Operational advertising enabled"); + ChipLogProgress(AppServer, "Operational advertising enabled"); } } From d6088d19090813ea0f9c52299561d118c26b8505 Mon Sep 17 00:00:00 2001 From: krypton36 Date: Fri, 29 Apr 2022 07:59:26 -0700 Subject: [PATCH 52/59] Add clear command door lock (#17872) * Add clear command to all cluster app. * Generated code --- .../all-clusters-app.matter | 6 +++ .../all-clusters-common/all-clusters-app.zap | 8 ++++ .../zap-generated/IMClusterCommandHandler.cpp | 9 ++++ .../all-clusters-app/zap-generated/access.h | 3 ++ .../zap-generated/endpoint_config.h | 47 ++++++++++--------- 5 files changed, 50 insertions(+), 23 deletions(-) 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 ff166c7c5bfb31..45313f770c068a 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 @@ -1222,6 +1222,11 @@ server cluster DoorLock = 257 { INT16U userIndex = 1; } + request struct ClearWeekDayScheduleRequest { + INT8U weekDayIndex = 0; + INT16U userIndex = 1; + } + request struct SetYearDayScheduleRequest { INT8U yearDayIndex = 0; INT16U userIndex = 1; @@ -1299,6 +1304,7 @@ server cluster DoorLock = 257 { timed command UnlockWithTimeout(UnlockWithTimeoutRequest): DefaultSuccess = 3; command access(invoke: administer) SetWeekDaySchedule(SetWeekDayScheduleRequest): DefaultSuccess = 11; command access(invoke: administer) GetWeekDaySchedule(GetWeekDayScheduleRequest): GetWeekDayScheduleResponse = 12; + command access(invoke: administer) ClearWeekDaySchedule(ClearWeekDayScheduleRequest): DefaultSuccess = 13; command access(invoke: administer) SetYearDaySchedule(SetYearDayScheduleRequest): DefaultSuccess = 14; command access(invoke: administer) GetYearDaySchedule(GetYearDayScheduleRequest): GetYearDayScheduleResponse = 15; timed command access(invoke: administer) SetUser(SetUserRequest): DefaultSuccess = 26; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 0979e6a02c733d..d5c3674df04a5a 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -10800,6 +10800,14 @@ "incoming": 1, "outgoing": 0 }, + { + "name": "ClearWeekDaySchedule", + "code": 13, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, { "name": "SetYearDaySchedule", "code": 14, diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index 3ba344dc0e61b1..b3f1779b588ea7 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -436,6 +436,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } break; } + case Commands::ClearWeekDaySchedule::Id: { + Commands::ClearWeekDaySchedule::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfDoorLockClusterClearWeekDayScheduleCallback(apCommandObj, aCommandPath, commandData); + } + break; + } case Commands::SetYearDaySchedule::Id: { Commands::SetYearDaySchedule::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); diff --git a/zzz_generated/all-clusters-app/zap-generated/access.h b/zzz_generated/all-clusters-app/zap-generated/access.h index c0fd2b7226f698..90aa47805022ab 100644 --- a/zzz_generated/all-clusters-app/zap-generated/access.h +++ b/zzz_generated/all-clusters-app/zap-generated/access.h @@ -389,6 +389,7 @@ 60, /* Cluster: AdministratorCommissioning, Command: RevokeCommissioning, Privilege: administer */ \ 257, /* Cluster: Door Lock, Command: SetWeekDaySchedule, Privilege: administer */ \ 257, /* Cluster: Door Lock, Command: GetWeekDaySchedule, Privilege: administer */ \ + 257, /* Cluster: Door Lock, Command: ClearWeekDaySchedule, Privilege: administer */ \ 257, /* Cluster: Door Lock, Command: SetYearDaySchedule, Privilege: administer */ \ 257, /* Cluster: Door Lock, Command: GetYearDaySchedule, Privilege: administer */ \ 257, /* Cluster: Door Lock, Command: SetUser, Privilege: administer */ \ @@ -439,6 +440,7 @@ 2, /* Cluster: AdministratorCommissioning, Command: RevokeCommissioning, Privilege: administer */ \ 11, /* Cluster: Door Lock, Command: SetWeekDaySchedule, Privilege: administer */ \ 12, /* Cluster: Door Lock, Command: GetWeekDaySchedule, Privilege: administer */ \ + 13, /* Cluster: Door Lock, Command: ClearWeekDaySchedule, Privilege: administer */ \ 14, /* Cluster: Door Lock, Command: SetYearDaySchedule, Privilege: administer */ \ 15, /* Cluster: Door Lock, Command: GetYearDaySchedule, Privilege: administer */ \ 26, /* Cluster: Door Lock, Command: SetUser, Privilege: administer */ \ @@ -489,6 +491,7 @@ kMatterAccessPrivilegeAdminister, /* Cluster: AdministratorCommissioning, Command: RevokeCommissioning, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: SetWeekDaySchedule, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: GetWeekDaySchedule, Privilege: administer */ \ + kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: ClearWeekDaySchedule, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: SetYearDaySchedule, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: GetYearDaySchedule, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: SetUser, Privilege: administer */ \ 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 80f28b6e071c9f..323c49e63177e2 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -2263,6 +2263,7 @@ 0x00000003 /* UnlockWithTimeout */, \ 0x0000000B /* SetWeekDaySchedule */, \ 0x0000000C /* GetWeekDaySchedule */, \ + 0x0000000D /* ClearWeekDaySchedule */, \ 0x0000000E /* SetYearDaySchedule */, \ 0x0000000F /* GetYearDaySchedule */, \ 0x0000001A /* SetUser */, \ @@ -2926,7 +2927,7 @@ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayWindowCoveringServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 141 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 142 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2937,7 +2938,7 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 149 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 150 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2959,7 +2960,7 @@ .clusterSize = 34, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 152 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 153 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2992,7 +2993,7 @@ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 156 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 157 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3069,8 +3070,8 @@ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ .functions = chipFuncArrayIasZoneServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 176 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 178 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 177 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 179 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ @@ -3091,7 +3092,7 @@ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 181 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 182 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3102,7 +3103,7 @@ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 184 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 185 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3113,7 +3114,7 @@ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 186 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 187 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3124,7 +3125,7 @@ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 190 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 191 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3135,7 +3136,7 @@ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 195 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 196 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3146,7 +3147,7 @@ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 197 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 198 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3157,7 +3158,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 199 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 200 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3168,7 +3169,7 @@ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 202 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 203 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3179,7 +3180,7 @@ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 205 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 206 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3201,7 +3202,7 @@ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 207 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 208 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3212,8 +3213,8 @@ .clusterSize = 2285, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 209 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 228 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 210 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 229 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ @@ -3234,8 +3235,8 @@ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 237 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 244 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 238 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 245 ) ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ @@ -3245,7 +3246,7 @@ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 249 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 250 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -3278,8 +3279,8 @@ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 253 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 260 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 254 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 261 ) ,\ },\ } From 917142a4d01f8801d07bb869870064a7eb2a3df6 Mon Sep 17 00:00:00 2001 From: chulspro Date: Sat, 30 Apr 2022 00:17:02 +0900 Subject: [PATCH 53/59] Enable chip_enable_schema_check for android platform. (#17539) Signed-off-by: sanghyukko Signed-off-by: Charles Kim Co-authored-by: sanghyukko --- src/app/BUILD.gn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 6afe86d6446ba6..7ef2fd303ac445 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -21,7 +21,8 @@ import("common_flags.gni") declare_args() { # Enable strict schema checks. chip_enable_schema_check = - is_debug && (current_os == "linux" || current_os == "mac") + is_debug && + (current_os == "linux" || current_os == "mac" || current_os == "android") # Logging verbosity control for Access Control implementation # From fb6b456bf2efa566f9e94d22beefb0c5b687aec0 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Fri, 29 Apr 2022 08:37:43 -0700 Subject: [PATCH 54/59] deduplicate the concrete paths intersected with the other wildcard paths in server (#17719) --- src/app/InteractionModelEngine.cpp | 59 +++++++++ src/app/InteractionModelEngine.h | 4 + src/app/ReadHandler.cpp | 1 + src/app/tests/TestInteractionModelEngine.cpp | 128 +++++++++++++++++++ src/app/util/attribute-storage.cpp | 4 + src/app/util/mock/attribute-storage.cpp | 5 + src/darwin/Framework/CHIP/CHIPIMDispatch.mm | 5 + 7 files changed, 206 insertions(+) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 78c17ef2ccfabb..060016da49e4f6 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -24,10 +24,14 @@ */ #include "InteractionModelEngine.h" + #include #include +extern bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, + bool asServer); + namespace chip { namespace app { InteractionModelEngine sInteractionModelEngine; @@ -852,6 +856,61 @@ CHIP_ERROR InteractionModelEngine::PushFrontAttributePathList(ObjectList *& aAttributePaths) +{ + ObjectList * prev = nullptr; + auto * path1 = aAttributePaths; + + while (path1 != nullptr) + { + bool duplicate = false; + // skip all wildcard paths and invalid concrete attribute + if (path1->mValue.HasAttributeWildcard() || + !emberAfContainsAttribute(path1->mValue.mEndpointId, path1->mValue.mClusterId, path1->mValue.mAttributeId, true)) + { + prev = path1; + path1 = path1->mpNext; + continue; + } + + // Check whether a wildcard path expands to something that includes this concrete path. + for (auto * path2 = aAttributePaths; path2 != nullptr; path2 = path2->mpNext) + { + if (path2 == path1) + { + continue; + } + + if (path2->mValue.HasAttributeWildcard() && path2->mValue.IsAttributePathSupersetOf(path1->mValue)) + { + duplicate = true; + break; + } + } + + // if path1 duplicates something from wildcard expansion, discard path1 + if (!duplicate) + { + prev = path1; + path1 = path1->mpNext; + continue; + } + + if (path1 == aAttributePaths) + { + aAttributePaths = path1->mpNext; + mAttributePathPool.ReleaseObject(path1); + path1 = aAttributePaths; + } + else + { + prev->mpNext = path1->mpNext; + mAttributePathPool.ReleaseObject(path1); + path1 = prev->mpNext; + } + } +} + void InteractionModelEngine::ReleaseEventPathList(ObjectList *& aEventPathList) { ReleasePool(aEventPathList, mEventPathPool); diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index bb7072fa75586c..9344248a6f2995 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -157,6 +157,10 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, CHIP_ERROR PushFrontAttributePathList(ObjectList *& aAttributePathList, AttributePathParams & aAttributePath); + // If a concrete path indicates an attribute that is also referenced by a wildcard path in the request, + // the path SHALL be removed from the list. + void RemoveDuplicateConcreteAttributePath(ObjectList *& aAttributePaths); + void ReleaseEventPathList(ObjectList *& aEventPathList); CHIP_ERROR PushFrontEventPathParamsList(ObjectList *& aEventPathList, EventPathParams & aEventPath); diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 9c4d38748faf30..50ec6d08de5a43 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -473,6 +473,7 @@ CHIP_ERROR ReadHandler::ProcessAttributePathList(AttributePathIBs::Parser & aAtt // if we have exhausted this container if (CHIP_END_OF_TLV == err) { + InteractionModelEngine::GetInstance()->RemoveDuplicateConcreteAttributePath(mpAttributePathList); mAttributePathExpandIterator = AttributePathExpandIterator(mpAttributePathList); err = CHIP_NO_ERROR; } diff --git a/src/app/tests/TestInteractionModelEngine.cpp b/src/app/tests/TestInteractionModelEngine.cpp index 1d3f377b90b558..3c2e5cb075073d 100644 --- a/src/app/tests/TestInteractionModelEngine.cpp +++ b/src/app/tests/TestInteractionModelEngine.cpp @@ -24,6 +24,8 @@ #include #include +#include +#include #include #include #include @@ -44,6 +46,7 @@ class TestInteractionModelEngine { public: static void TestAttributePathParamsPushRelease(nlTestSuite * apSuite, void * apContext); + static void TestRemoveDuplicateConcreteAttribute(nlTestSuite * apSuite, void * apContext); static int GetAttributePathListLength(ObjectList * apattributePathParamsList); }; @@ -95,6 +98,130 @@ void TestInteractionModelEngine::TestAttributePathParamsPushRelease(nlTestSuite InteractionModelEngine::GetInstance()->ReleaseAttributePathList(attributePathParamsList); NL_TEST_ASSERT(apSuite, GetAttributePathListLength(attributePathParamsList) == 0); } + +void TestInteractionModelEngine::TestRemoveDuplicateConcreteAttribute(nlTestSuite * apSuite, void * apContext) +{ + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; + err = InteractionModelEngine::GetInstance()->Init(&ctx.GetExchangeManager(), &ctx.GetFabricTable()); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + ObjectList * attributePathParamsList = nullptr; + AttributePathParams attributePathParams1; + AttributePathParams attributePathParams2; + AttributePathParams attributePathParams3; + + // Three concrete paths, no duplicates + attributePathParams1.mEndpointId = Test::kMockEndpoint3; + attributePathParams1.mClusterId = Test::MockClusterId(2); + attributePathParams1.mAttributeId = Test::MockAttributeId(1); + + attributePathParams2.mEndpointId = Test::kMockEndpoint3; + attributePathParams2.mClusterId = Test::MockClusterId(2); + attributePathParams2.mAttributeId = Test::MockAttributeId(2); + + attributePathParams3.mEndpointId = Test::kMockEndpoint3; + attributePathParams3.mClusterId = Test::MockClusterId(2); + attributePathParams3.mAttributeId = Test::MockAttributeId(3); + + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams1); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams2); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams3); + InteractionModelEngine::GetInstance()->RemoveDuplicateConcreteAttributePath(attributePathParamsList); + NL_TEST_ASSERT(apSuite, GetAttributePathListLength(attributePathParamsList) == 3); + InteractionModelEngine::GetInstance()->ReleaseAttributePathList(attributePathParamsList); + + attributePathParams1.mEndpointId = kInvalidEndpointId; + attributePathParams1.mClusterId = kInvalidClusterId; + attributePathParams1.mAttributeId = kInvalidAttributeId; + + attributePathParams2.mEndpointId = Test::kMockEndpoint3; + attributePathParams2.mClusterId = Test::MockClusterId(2); + attributePathParams2.mAttributeId = Test::MockAttributeId(2); + + attributePathParams3.mEndpointId = Test::kMockEndpoint3; + attributePathParams3.mClusterId = Test::MockClusterId(2); + attributePathParams3.mAttributeId = Test::MockAttributeId(3); + + // 1st path is wildcard endpoint, 2nd, 3rd paths are concrete paths, the concrete ones would be removed. + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams1); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams2); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams3); + InteractionModelEngine::GetInstance()->RemoveDuplicateConcreteAttributePath(attributePathParamsList); + NL_TEST_ASSERT(apSuite, GetAttributePathListLength(attributePathParamsList) == 1); + InteractionModelEngine::GetInstance()->ReleaseAttributePathList(attributePathParamsList); + + // 2nd path is wildcard endpoint, 1st, 3rd paths are concrete paths, the latter two would be removed. + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams2); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams1); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams3); + InteractionModelEngine::GetInstance()->RemoveDuplicateConcreteAttributePath(attributePathParamsList); + NL_TEST_ASSERT(apSuite, GetAttributePathListLength(attributePathParamsList) == 1); + InteractionModelEngine::GetInstance()->ReleaseAttributePathList(attributePathParamsList); + + // 3nd path is wildcard endpoint, 1st, 2nd paths are concrete paths, the latter two would be removed. + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams2); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams3); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams1); + InteractionModelEngine::GetInstance()->RemoveDuplicateConcreteAttributePath(attributePathParamsList); + NL_TEST_ASSERT(apSuite, GetAttributePathListLength(attributePathParamsList) == 1); + InteractionModelEngine::GetInstance()->ReleaseAttributePathList(attributePathParamsList); + + attributePathParams1.mEndpointId = Test::kMockEndpoint3; + attributePathParams1.mClusterId = Test::MockClusterId(2); + attributePathParams1.mAttributeId = kInvalidAttributeId; + + attributePathParams2.mEndpointId = Test::kMockEndpoint2; + attributePathParams2.mClusterId = Test::MockClusterId(2); + attributePathParams2.mAttributeId = Test::MockAttributeId(2); + + attributePathParams3.mEndpointId = Test::kMockEndpoint2; + attributePathParams3.mClusterId = Test::MockClusterId(2); + attributePathParams3.mAttributeId = Test::MockAttributeId(3); + + // 1st is wildcard one, but not intersect with the latter two concrete paths, so the paths in total are 3 finally + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams1); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams2); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams3); + InteractionModelEngine::GetInstance()->RemoveDuplicateConcreteAttributePath(attributePathParamsList); + NL_TEST_ASSERT(apSuite, GetAttributePathListLength(attributePathParamsList) == 3); + InteractionModelEngine::GetInstance()->ReleaseAttributePathList(attributePathParamsList); + + attributePathParams1.mEndpointId = kInvalidEndpointId; + attributePathParams1.mClusterId = kInvalidClusterId; + attributePathParams1.mAttributeId = kInvalidAttributeId; + + attributePathParams2.mEndpointId = Test::kMockEndpoint3; + attributePathParams2.mClusterId = kInvalidClusterId; + attributePathParams2.mAttributeId = kInvalidAttributeId; + + attributePathParams3.mEndpointId = kInvalidEndpointId; + attributePathParams3.mClusterId = kInvalidClusterId; + attributePathParams3.mAttributeId = Test::MockAttributeId(3); + + // Wildcards cannot be deduplicated. + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams1); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams2); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams3); + InteractionModelEngine::GetInstance()->RemoveDuplicateConcreteAttributePath(attributePathParamsList); + NL_TEST_ASSERT(apSuite, GetAttributePathListLength(attributePathParamsList) == 3); + InteractionModelEngine::GetInstance()->ReleaseAttributePathList(attributePathParamsList); + + attributePathParams1.mEndpointId = kInvalidEndpointId; + attributePathParams1.mClusterId = Test::MockClusterId(2); + attributePathParams1.mAttributeId = Test::MockAttributeId(10); + + attributePathParams2.mEndpointId = Test::kMockEndpoint3; + attributePathParams2.mClusterId = Test::MockClusterId(2); + attributePathParams2.mAttributeId = Test::MockAttributeId(10); + + // 1st path is wildcard endpoint, 2nd path is invalid attribute + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams1); + InteractionModelEngine::GetInstance()->PushFrontAttributePathList(attributePathParamsList, attributePathParams2); + InteractionModelEngine::GetInstance()->RemoveDuplicateConcreteAttributePath(attributePathParamsList); + NL_TEST_ASSERT(apSuite, GetAttributePathListLength(attributePathParamsList) == 2); + InteractionModelEngine::GetInstance()->ReleaseAttributePathList(attributePathParamsList); +} + } // namespace app } // namespace chip @@ -104,6 +231,7 @@ namespace { const nlTest sTests[] = { NL_TEST_DEF("TestAttributePathParamsPushRelease", chip::app::TestInteractionModelEngine::TestAttributePathParamsPushRelease), + NL_TEST_DEF("TestRemoveDuplicateConcreteAttribute", chip::app::TestInteractionModelEngine::TestRemoveDuplicateConcreteAttribute), NL_TEST_SENTINEL() }; // clang-format on diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index ec2c0f12bc823f..88c2e2dc575fcd 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -650,6 +650,10 @@ EmberAfStatus emAfReadOrWriteAttribute(EmberAfAttributeSearchRecord * attRecord, // Dynamic endpoints are external and don't factor into storage size if (!isDynamicEndpoint) { + if (emAfEndpoints[ep].endpointType == nullptr) + { + return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE; + } attributeOffsetIndex = static_cast(attributeOffsetIndex + emAfEndpoints[ep].endpointType->endpointSize); } } diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp index 57c339504f3840..93c4dde20e76aa 100644 --- a/src/app/util/mock/attribute-storage.cpp +++ b/src/app/util/mock/attribute-storage.cpp @@ -164,6 +164,11 @@ uint16_t emberAfGetServerAttributeIndexByAttributeId(chip::EndpointId endpoint, return UINT16_MAX; } +bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, bool asServer) +{ + return !(emberAfGetServerAttributeIndexByAttributeId(endpoint, clusterId, attributeId) == UINT16_MAX); +} + chip::EndpointId emberAfEndpointFromIndex(uint16_t index) { VerifyOrDie(index < ArraySize(endpoints)); diff --git a/src/darwin/Framework/CHIP/CHIPIMDispatch.mm b/src/darwin/Framework/CHIP/CHIPIMDispatch.mm index b6abe8a34985a2..8be1bb2834d121 100644 --- a/src/darwin/Framework/CHIP/CHIPIMDispatch.mm +++ b/src/darwin/Framework/CHIP/CHIPIMDispatch.mm @@ -272,6 +272,11 @@ uint16_t emberAfGetServerAttributeIndexByAttributeId(EndpointId endpoint, Cluste return UINT16_MAX; } +bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, bool asServer) +{ + return false; +} + uint8_t emberAfClusterCount(EndpointId endpoint, bool server) { if (endpoint == kSupportedEndpoint && server) { From 0d3860e11509874a6c43410b01e7ba3904e5bbe4 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 29 Apr 2022 17:43:29 +0200 Subject: [PATCH 55/59] [YAML] Update WaitForMs signature to use a uint32_t (#17906) --- src/app/tests/suites/commands/delay/DelayCommands.cpp | 2 +- src/app/tests/suites/commands/delay/DelayCommands.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tests/suites/commands/delay/DelayCommands.cpp b/src/app/tests/suites/commands/delay/DelayCommands.cpp index 97a59c246c3c2b..96488174b071a8 100644 --- a/src/app/tests/suites/commands/delay/DelayCommands.cpp +++ b/src/app/tests/suites/commands/delay/DelayCommands.cpp @@ -26,7 +26,7 @@ const char * getScriptsFolder() } } // namespace -CHIP_ERROR DelayCommands::WaitForMs(uint16_t ms) +CHIP_ERROR DelayCommands::WaitForMs(uint32_t ms) { const auto duration = chip::System::Clock::Milliseconds32(ms); return chip::DeviceLayer::SystemLayer().StartTimer(duration, OnWaitForMsFn, this); diff --git a/src/app/tests/suites/commands/delay/DelayCommands.h b/src/app/tests/suites/commands/delay/DelayCommands.h index 8aaccd91f844a8..e6b57c0883823f 100644 --- a/src/app/tests/suites/commands/delay/DelayCommands.h +++ b/src/app/tests/suites/commands/delay/DelayCommands.h @@ -33,7 +33,7 @@ class DelayCommands virtual CHIP_ERROR WaitForCommissionee(chip::NodeId nodeId) { return CHIP_ERROR_NOT_IMPLEMENTED; }; virtual CHIP_ERROR WaitForCommissioning() { return CHIP_ERROR_NOT_IMPLEMENTED; }; - CHIP_ERROR WaitForMs(uint16_t ms); + CHIP_ERROR WaitForMs(uint32_t ms); CHIP_ERROR WaitForCommissionableAdvertisement(); CHIP_ERROR WaitForOperationalAdvertisement(); From a96005057499658a5d26ba1fbcc859646c192873 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 29 Apr 2022 18:59:35 +0200 Subject: [PATCH 56/59] [chip-tool] Revert commissioner-fabricid argument from #17309 (#17913) --- examples/chip-tool/commands/common/CHIPCommand.cpp | 1 - examples/chip-tool/commands/common/CHIPCommand.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index 72b1b2c602f9e4..5707496b85cec3 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -326,7 +326,6 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(std::string key, chip::FabricId f ReturnLogErrorOnFailure(ephemeralKey.Initialize()); chip::NodeId nodeId = mCommissionerNodeId.ValueOr(mCommissionerStorage.GetLocalNodeId()); - fabricId = mCommissionerFabricId.ValueOr(fabricId); ReturnLogErrorOnFailure(mCredIssuerCmds->GenerateControllerNOCChain( nodeId, fabricId, mCommissionerStorage.GetCommissionerCATs(), ephemeralKey, rcacSpan, icacSpan, nocSpan)); diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index 8df8f5b27f1a2a..c15b39588bafb4 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -62,7 +62,6 @@ class CHIPCommand : public Command AddArgument("paa-trust-store-path", &mPaaTrustStorePath); AddArgument("commissioner-name", &mCommissionerName); AddArgument("commissioner-nodeid", 0, UINT64_MAX, &mCommissionerNodeId); - AddArgument("commissioner-fabricid", 0, UINT64_MAX, &mCommissionerNodeId); #if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED AddArgument("trace_file", &mTraceFile); AddArgument("trace_log", 0, 1, &mTraceLog); @@ -119,7 +118,6 @@ class CHIPCommand : public Command static std::map> mCommissioners; chip::Optional mCommissionerName; chip::Optional mCommissionerNodeId; - chip::Optional mCommissionerFabricId; chip::Optional mBleAdapterId; chip::Optional mPaaTrustStorePath; From e4049f2581e276b1dc3f4add4e3da5056055bfee Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 29 Apr 2022 19:11:35 +0200 Subject: [PATCH 57/59] [Tests] Increase the tests timeout for darwin tests from 45 minutes to 50 minutes (#17916) --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ab937a941256a5..586ac52c89e0ac 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -184,7 +184,7 @@ jobs: --copy-artifacts-to objdir-clone \ " - name: Run Tests - timeout-minutes: 45 + timeout-minutes: 50 run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ From e32b7499277530a91d9037d340f25280bfa8de62 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Fri, 29 Apr 2022 10:47:58 -0700 Subject: [PATCH 58/59] Only Cache the path with wildcard attribute (#17887) --- src/app/AttributePathExpandIterator.cpp | 4 +- src/app/AttributePathParams.h | 2 +- src/app/ClusterStateCache.cpp | 2 +- src/app/InteractionModelEngine.cpp | 4 +- src/controller/tests/data_model/TestRead.cpp | 59 ++++++++++++++++---- 5 files changed, 55 insertions(+), 16 deletions(-) diff --git a/src/app/AttributePathExpandIterator.cpp b/src/app/AttributePathExpandIterator.cpp index 1a1d127dd64522..bd3e717cb46964 100644 --- a/src/app/AttributePathExpandIterator.cpp +++ b/src/app/AttributePathExpandIterator.cpp @@ -169,12 +169,12 @@ bool AttributePathExpandIterator::Next() { for (; mpAttributePath != nullptr; (mpAttributePath = mpAttributePath->mpNext, mEndpointIndex = UINT16_MAX)) { - mOutputPath.mExpanded = mpAttributePath->mValue.HasAttributeWildcard(); + mOutputPath.mExpanded = mpAttributePath->mValue.IsWildcardPath(); if (mEndpointIndex == UINT16_MAX) { // Special case: If this is a concrete path, we just return its value as-is. - if (!mpAttributePath->mValue.HasAttributeWildcard()) + if (!mpAttributePath->mValue.IsWildcardPath()) { mOutputPath.mEndpointId = mpAttributePath->mValue.mEndpointId; mOutputPath.mClusterId = mpAttributePath->mValue.mClusterId; diff --git a/src/app/AttributePathParams.h b/src/app/AttributePathParams.h index 786ed3e3fbc883..54803bf9bed828 100644 --- a/src/app/AttributePathParams.h +++ b/src/app/AttributePathParams.h @@ -49,7 +49,7 @@ struct AttributePathParams AttributePathParams() {} - bool HasAttributeWildcard() const { return HasWildcardEndpointId() || HasWildcardClusterId() || HasWildcardAttributeId(); } + bool IsWildcardPath() const { return HasWildcardEndpointId() || HasWildcardClusterId() || HasWildcardAttributeId(); } /** * SPEC 8.9.2.2 diff --git a/src/app/ClusterStateCache.cpp b/src/app/ClusterStateCache.cpp index 36d2631b42b9c7..48d27a7f76a9c8 100644 --- a/src/app/ClusterStateCache.cpp +++ b/src/app/ClusterStateCache.cpp @@ -452,7 +452,7 @@ CHIP_ERROR ClusterStateCache::OnUpdateDataVersionFilterList(DataVersionFilterIBs for (auto & attribute : aAttributePaths) { - if (attribute.HasAttributeWildcard()) + if (attribute.HasWildcardAttributeId()) { mRequestPathSet.insert(attribute); } diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 060016da49e4f6..55acf477b6694b 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -865,7 +865,7 @@ void InteractionModelEngine::RemoveDuplicateConcreteAttributePath(ObjectListmValue.HasAttributeWildcard() || + if (path1->mValue.IsWildcardPath() || !emberAfContainsAttribute(path1->mValue.mEndpointId, path1->mValue.mClusterId, path1->mValue.mAttributeId, true)) { prev = path1; @@ -881,7 +881,7 @@ void InteractionModelEngine::RemoveDuplicateConcreteAttributePath(ObjectListmValue.HasAttributeWildcard() && path2->mValue.IsAttributePathSupersetOf(path1->mValue)) + if (path2->mValue.IsWildcardPath() && path2->mValue.IsAttributePathSupersetOf(path1->mValue)) { duplicate = true; break; diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index c0c155afa51c8d..82d722b71092e2 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -383,7 +383,7 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&gTestReadInteraction); int testId = 0; - // Initial Read of E2C3A1, E2C3A2 and E3C2A2. + // Read of E2C3A1, E2C3A2 and E3C2A2. // Expect no versions would be cached. { testId++; @@ -419,7 +419,46 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit NL_TEST_ASSERT(apSuite, !version2.HasValue()); delegate.mNumAttributeResponse = 0; } - // Second read of E2C2A* and E3C2A2. We cannot use the stored data versions in the cache since there is no cached version from + + // Read of E*C2A2, E2C2A2 and E3C2A2 where 2nd, 3rd concrete paths are part of first wildcard path, would be deduplicate, + // E*C2A2 don't have wildcard attribute so no version would be cached. + // Expect no versions would be cached. + { + testId++; + ChipLogProgress(DataManagement, "\t -- Running Read with ClusterStateCache Test ID %d", testId); + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), + cache.GetBufferedCallback(), chip::app::ReadClient::InteractionType::Read); + chip::app::AttributePathParams attributePathParams1[3]; + attributePathParams1[0].mEndpointId = kInvalidEndpointId; + attributePathParams1[0].mClusterId = Test::MockClusterId(2); + attributePathParams1[0].mAttributeId = Test::MockAttributeId(2); + + attributePathParams1[1].mEndpointId = Test::kMockEndpoint2; + attributePathParams1[1].mClusterId = Test::MockClusterId(2); + attributePathParams1[1].mAttributeId = Test::MockAttributeId(2); + + attributePathParams1[2].mEndpointId = Test::kMockEndpoint3; + attributePathParams1[2].mClusterId = Test::MockClusterId(2); + attributePathParams1[2].mAttributeId = Test::MockAttributeId(2); + + readPrepareParams.mpAttributePathParamsList = attributePathParams1; + readPrepareParams.mAttributePathParamsListSize = 3; + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + ctx.DrainAndServiceIO(); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); + NL_TEST_ASSERT(apSuite, !delegate.mReadError); + Optional version1; + NL_TEST_ASSERT(apSuite, cache.GetVersion(Test::kMockEndpoint2, Test::MockClusterId(3), version1) == CHIP_NO_ERROR); + NL_TEST_ASSERT(apSuite, !version1.HasValue()); + Optional version2; + NL_TEST_ASSERT(apSuite, cache.GetVersion(Test::kMockEndpoint3, Test::MockClusterId(2), version2) == CHIP_NO_ERROR); + NL_TEST_ASSERT(apSuite, !version2.HasValue()); + delegate.mNumAttributeResponse = 0; + } + + // read of E2C2A* and E3C2A2. We cannot use the stored data versions in the cache since there is no cached version from // previous test. Expect cache E2C2 version { testId++; @@ -452,7 +491,7 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit delegate.mNumAttributeResponse = 0; } - // Third read of E2C3A1, E2C3A2, and E3C2A2. It would use the stored data versions in the cache since our subsequent read's C1A1 + // Read of E2C3A1, E2C3A2, and E3C2A2. It would use the stored data versions in the cache since our subsequent read's C1A1 // path intersects with previous cached data version Expect no E2C3 attributes in report, only E3C2A1 attribute in report { testId++; @@ -489,7 +528,7 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit delegate.mNumAttributeResponse = 0; } - // Fourth read of E2C3A* and E3C2A2. It would use the stored data versions in the cache since our subsequent read's C1A* path + // Read of E2C3A* and E3C2A2. It would use the stored data versions in the cache since our subsequent read's C1A* path // intersects with previous cached data version Expect no C1 attributes in report, only E3C2A2 attribute in report { testId++; @@ -523,7 +562,7 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit Test::BumpVersion(); - // Fifth read of E2C3A1, E2C3A2 and E3C2A2. It would use the stored data versions in the cache since our subsequent read's C1A* + // Read of E2C3A1, E2C3A2 and E3C2A2. It would use the stored data versions in the cache since our subsequent read's C1A* // path intersects with previous cached data version, server's version is changed. Expect E2C3A1, E2C3A2 and E3C2A2 attribute in // report, and invalidate the cached pending and committed data version since no wildcard attributes exists in mRequestPathSet. { @@ -561,7 +600,7 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit delegate.mNumAttributeResponse = 0; } - // Sixth read of E2C3A1, E2C3A2 and E3C2A2. It would use none stored data versions in the cache since previous read does not + // Read of E2C3A1, E2C3A2 and E3C2A2. It would use none stored data versions in the cache since previous read does not // cache any committed data version. Expect E2C3A1, E2C3A2 and E3C2A2 attribute in report { testId++; @@ -598,7 +637,7 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit delegate.mNumAttributeResponse = 0; } - // Seventh read of E2C3A* and E3C2A2, here there is no cached data version filter + // Read of E2C3A* and E3C2A2, here there is no cached data version filter // Expect E2C3A* attributes in report, and E3C2A2 attribute in report and cache latest data version { testId++; @@ -630,7 +669,7 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit delegate.mNumAttributeResponse = 0; } - // Eighth read of E2C3A* and E3C2A2, and inject a large amount of event path list, then it would try to apply previous cache + // Read of E2C3A* and E3C2A2, and inject a large amount of event path list, then it would try to apply previous cache // latest data version and construct data version list but no enough memory, finally fully rollback data version filter. Expect // E2C3A* attributes in report, and E3C2A2 attribute in report { @@ -671,7 +710,7 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit Test::BumpVersion(); - // Ninth read of E1C2A* and E2C3A* and E2C2A*, it would use C1 cached version to construct DataVersionFilter, but version has + // Read of E1C2A* and E2C3A* and E2C2A*, it would use C1 cached version to construct DataVersionFilter, but version has // changed in server. Expect E1C2A* and C2C3A* and E2C2A* attributes in report, and cache their versions { testId++; @@ -713,7 +752,7 @@ void TestReadInteraction::TestReadSubscribeAttributeResponseWithCache(nlTestSuit delegate.mNumAttributeResponse = 0; } - // Tenth read of E1C2A*(3 attributes) and E2C3A*(5 attributes) and E2C2A*(4 attributes), and inject a large amount of event path + // Read of E1C2A*(3 attributes) and E2C3A*(5 attributes) and E2C2A*(4 attributes), and inject a large amount of event path // list, then it would try to apply previous cache latest data version and construct data version list with the ordering from // largest cluster size to smallest cluster size(C2, C3, C1) but no enough memory, finally partially rollback data version // filter with only C2. Expect E1C2A*, E2C2A* attributes(7 attributes) in report, From 3ab44abc2c7d104f65ea90aca571d11d7a07697e Mon Sep 17 00:00:00 2001 From: kowsisoundhar12 <57476670+kowsisoundhar12@users.noreply.github.com> Date: Fri, 29 Apr 2022 23:51:18 +0530 Subject: [PATCH 59/59] Test added testscript id change (#17897) * Changed Manual testscripts id * Added Auto generated file * Restyled by clang-format * Added Auto generated file * Restyled by clang-format Co-authored-by: Restyled.io --- examples/chip-tool/templates/tests/tests.js | 46 ++-- ...est_TC_DL_1_1.yaml => Test_TC_DL_2_1.yaml} | 2 +- ...t_TC_DL_1_10.yaml => Test_TC_DL_2_10.yaml} | 2 +- ...t_TC_DL_1_11.yaml => Test_TC_DL_2_11.yaml} | 2 +- ...t_TC_DL_1_13.yaml => Test_TC_DL_2_13.yaml} | 4 +- ...t_TC_DL_1_14.yaml => Test_TC_DL_2_14.yaml} | 2 +- ...t_TC_DL_1_15.yaml => Test_TC_DL_2_15.yaml} | 2 +- ...t_TC_DL_1_16.yaml => Test_TC_DL_2_16.yaml} | 2 +- ...t_TC_DL_1_17.yaml => Test_TC_DL_2_17.yaml} | 2 +- ...est_TC_DL_1_2.yaml => Test_TC_DL_2_2.yaml} | 2 +- ...est_TC_DL_1_4.yaml => Test_TC_DL_2_4.yaml} | 3 +- ...est_TC_DL_1_5.yaml => Test_TC_DL_2_5.yaml} | 0 ...est_TC_DL_1_6.yaml => Test_TC_DL_2_6.yaml} | 2 +- ...est_TC_DL_1_7.yaml => Test_TC_DL_2_7.yaml} | 2 +- ...est_TC_DL_1_8.yaml => Test_TC_DL_2_8.yaml} | 2 +- ...LOG_1_1.yaml => Test_TC_Diag_Log_2_1.yaml} | 4 +- ...LOG_1_2.yaml => Test_TC_Diag_Log_2_2.yaml} | 2 +- ...LOG_1_3.yaml => Test_TC_Diag_Log_2_3.yaml} | 3 +- ...est_TC_GC_1_2.yaml => Test_TC_GC_2_2.yaml} | 2 +- ...est_TC_GC_1_3.yaml => Test_TC_GC_2_3.yaml} | 2 +- ...est_TC_GC_1_4.yaml => Test_TC_GC_2_4.yaml} | 2 +- .../suites/certification/Test_TC_LC_1_1.yaml | 2 +- ...est_TC_LC_1_3.yaml => Test_TC_LC_2_3.yaml} | 2 +- ...est_TC_LC_1_4.yaml => Test_TC_LC_2_4.yaml} | 2 +- ...est_TC_LC_1_5.yaml => Test_TC_LC_2_5.yaml} | 2 +- .../chip-tool/zap-generated/test/Commands.h | 236 +++++++++--------- 26 files changed, 168 insertions(+), 166 deletions(-) rename src/app/tests/suites/certification/{Test_TC_DL_1_1.yaml => Test_TC_DL_2_1.yaml} (99%) rename src/app/tests/suites/certification/{Test_TC_DL_1_10.yaml => Test_TC_DL_2_10.yaml} (96%) rename src/app/tests/suites/certification/{Test_TC_DL_1_11.yaml => Test_TC_DL_2_11.yaml} (96%) rename src/app/tests/suites/certification/{Test_TC_DL_1_13.yaml => Test_TC_DL_2_13.yaml} (95%) rename src/app/tests/suites/certification/{Test_TC_DL_1_14.yaml => Test_TC_DL_2_14.yaml} (98%) rename src/app/tests/suites/certification/{Test_TC_DL_1_15.yaml => Test_TC_DL_2_15.yaml} (96%) rename src/app/tests/suites/certification/{Test_TC_DL_1_16.yaml => Test_TC_DL_2_16.yaml} (96%) rename src/app/tests/suites/certification/{Test_TC_DL_1_17.yaml => Test_TC_DL_2_17.yaml} (98%) rename src/app/tests/suites/certification/{Test_TC_DL_1_2.yaml => Test_TC_DL_2_2.yaml} (96%) rename src/app/tests/suites/certification/{Test_TC_DL_1_4.yaml => Test_TC_DL_2_4.yaml} (93%) rename src/app/tests/suites/certification/{Test_TC_DL_1_5.yaml => Test_TC_DL_2_5.yaml} (100%) rename src/app/tests/suites/certification/{Test_TC_DL_1_6.yaml => Test_TC_DL_2_6.yaml} (97%) rename src/app/tests/suites/certification/{Test_TC_DL_1_7.yaml => Test_TC_DL_2_7.yaml} (95%) rename src/app/tests/suites/certification/{Test_TC_DL_1_8.yaml => Test_TC_DL_2_8.yaml} (96%) rename src/app/tests/suites/certification/{Test_TC_DIAG_LOG_1_1.yaml => Test_TC_Diag_Log_2_1.yaml} (99%) rename src/app/tests/suites/certification/{Test_TC_DIAG_LOG_1_2.yaml => Test_TC_Diag_Log_2_2.yaml} (97%) rename src/app/tests/suites/certification/{Test_TC_DIAG_LOG_1_3.yaml => Test_TC_Diag_Log_2_3.yaml} (98%) rename src/app/tests/suites/certification/{Test_TC_GC_1_2.yaml => Test_TC_GC_2_2.yaml} (98%) rename src/app/tests/suites/certification/{Test_TC_GC_1_3.yaml => Test_TC_GC_2_3.yaml} (98%) rename src/app/tests/suites/certification/{Test_TC_GC_1_4.yaml => Test_TC_GC_2_4.yaml} (99%) rename src/app/tests/suites/certification/{Test_TC_LC_1_3.yaml => Test_TC_LC_2_3.yaml} (95%) rename src/app/tests/suites/certification/{Test_TC_LC_1_4.yaml => Test_TC_LC_2_4.yaml} (95%) rename src/app/tests/suites/certification/{Test_TC_LC_1_5.yaml => Test_TC_LC_2_5.yaml} (95%) diff --git a/examples/chip-tool/templates/tests/tests.js b/examples/chip-tool/templates/tests/tests.js index 6e6eeeece2f40b..65e9a23f99fa2b 100644 --- a/examples/chip-tool/templates/tests/tests.js +++ b/examples/chip-tool/templates/tests/tests.js @@ -87,9 +87,9 @@ function getManualTests() ]; const DiagnosticsLogs = [ - 'Test_TC_DIAG_LOG_1_1', - 'Test_TC_DIAG_LOG_1_2', - 'Test_TC_DIAG_LOG_1_3', + 'Test_TC_Diag_Log_2_1', + 'Test_TC_Diag_Log_2_2', + 'Test_TC_Diag_Log_2_3', ]; const Descriptor = [ @@ -101,9 +101,9 @@ function getManualTests() ]; const GeneralCommissioning = [ - 'Test_TC_GC_1_2', - 'Test_TC_GC_1_3', - 'Test_TC_GC_1_4', + 'Test_TC_GC_2_2', + 'Test_TC_GC_2_3', + 'Test_TC_GC_2_4', ]; const GeneralDiagnostics = [ @@ -279,27 +279,27 @@ function getManualTests() ]; const DoorLock = [ - 'Test_TC_DL_1_1', - 'Test_TC_DL_1_2', - 'Test_TC_DL_1_4', - 'Test_TC_DL_1_5', - 'Test_TC_DL_1_6', - 'Test_TC_DL_1_7', - 'Test_TC_DL_1_8', - 'Test_TC_DL_1_10', - 'Test_TC_DL_1_11', - 'Test_TC_DL_1_13', - 'Test_TC_DL_1_14', - 'Test_TC_DL_1_15', - 'Test_TC_DL_1_16', - 'Test_TC_DL_1_17', + 'Test_TC_DL_2_1', + 'Test_TC_DL_2_2', + 'Test_TC_DL_2_4', + 'Test_TC_DL_2_5', + 'Test_TC_DL_2_6', + 'Test_TC_DL_2_7', + 'Test_TC_DL_2_8', + 'Test_TC_DL_2_10', + 'Test_TC_DL_2_11', + 'Test_TC_DL_2_13', + 'Test_TC_DL_2_14', + 'Test_TC_DL_2_15', + 'Test_TC_DL_2_16', + 'Test_TC_DL_2_17', ]; const UserLabel = [ 'Test_TC_LC_1_1', - 'Test_TC_LC_1_3', - 'Test_TC_LC_1_4', - 'Test_TC_LC_1_5', + 'Test_TC_LC_2_3', + 'Test_TC_LC_2_4', + 'Test_TC_LC_2_5', ]; const LocalizationConfiguration = [ diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_1.yaml similarity index 99% rename from src/app/tests/suites/certification/Test_TC_DL_1_1.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_1.yaml index 604f91ce8cebde..da0d604699fc0e 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_1.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 107.1. [TC-DL-1.1] Attributes check [DUT - Server] +name: 100.2.1. [TC-DL-2.1] Attributes check [DUT - Server] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_10.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_10.yaml similarity index 96% rename from src/app/tests/suites/certification/Test_TC_DL_1_10.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_10.yaml index d34e8ee71ac8ee..94e24e79547ec8 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_10.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.10. [TC-DL-1.10] Verification for the following Commands - Set User + 100.2.10. [TC-DL-2.10] Verification for the following Commands - Set User Type, Get User Type ,Get User Type Response [DUT-Server] config: diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_11.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_11.yaml similarity index 96% rename from src/app/tests/suites/certification/Test_TC_DL_1_11.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_11.yaml index 979f04f57fc89a..48f4fc956955ac 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_11.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_11.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.11. [TC-DL-1.11] Verification for the following Commands - Set Year + 100.2.11. [TC-DL-2.11] Verification for the following Commands - Set Year Schedule, Get Year Schedule, Get Year Day Schedule Response and Clear Year Day Schedule[DUT-Server] diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_13.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_13.yaml similarity index 95% rename from src/app/tests/suites/certification/Test_TC_DL_1_13.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_13.yaml index ea0458698cf4fe..75b10389614edf 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_13.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_13.yaml @@ -14,8 +14,8 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.13. [TC-DL-1.13] Verification for the following Commands - Set User, Get - User, Get User Response, Clear User [DUT-Server] + 100.2.13. [TC-DL-2.13] Verification for the following Commands - Set User, + Get User, Get User Response, Clear User [DUT-Server] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_14.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_14.yaml similarity index 98% rename from src/app/tests/suites/certification/Test_TC_DL_1_14.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_14.yaml index b8533871c48486..c724bbbd875c64 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_14.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_14.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.14. [TC-DL-1.14] Verification for the following Commands - Set + 100.2.14. [TC-DL-2.14] Verification for the following Commands - Set Credential , Set Credential Response, Get Credential Status, Get Credential Status Response, Clear Credential [DUT-Server] diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_15.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_15.yaml similarity index 96% rename from src/app/tests/suites/certification/Test_TC_DL_1_15.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_15.yaml index 75b0ced7601932..f24a42295ed1ba 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_15.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_15.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.15. [TC-DL-1.15] Verification for the Operation Event Notification + 100.2.15. [TC-DL-2.15] Verification for the Operation Event Notification Command [DUT-Server] config: diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_16.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_16.yaml similarity index 96% rename from src/app/tests/suites/certification/Test_TC_DL_1_16.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_16.yaml index 9519118a3ca4d8..0db620b3d41735 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_16.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_16.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.16. [TC-DL-1.16] Verification for the Programming Event Notification + 100.2.16. [TC-DL-2.16] Verification for the Programming Event Notification Command [DUT-Server] config: diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_17.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_17.yaml similarity index 98% rename from src/app/tests/suites/certification/Test_TC_DL_1_17.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_17.yaml index 588d2bbeac0ccd..d2848122bb68ad 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_17.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_17.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 104.18. [TC-DL-2.17] Verification for the Door Lock Events [DUT-Server] +name: 100.2.17. [TC-DL-2.17] Verification for the Door Lock Events [DUT-Server] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_2.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_2.yaml similarity index 96% rename from src/app/tests/suites/certification/Test_TC_DL_1_2.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_2.yaml index a73cb91c8025af..2e13d891f92ac1 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_2.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 107.2. [TC-DL-1.2] Verification for Door lock command[DUT-Server] +name: 100.2.2. [TC-DL-2.2] Verification for Door lock command[DUT-Server] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_4.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_4.yaml similarity index 93% rename from src/app/tests/suites/certification/Test_TC_DL_1_4.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_4.yaml index e14dfa409905f8..1c0940251bd30f 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_4.yaml @@ -14,7 +14,8 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.4. [TC-DL-1.4] Verification for Unlock with Timeout command [DUT-Server] + 100.2.4. [TC-DL-2.4] Verification for Unlock with Timeout command + [DUT-Server] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_5.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_5.yaml similarity index 100% rename from src/app/tests/suites/certification/Test_TC_DL_1_5.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_5.yaml diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_6.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_6.yaml similarity index 97% rename from src/app/tests/suites/certification/Test_TC_DL_1_6.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_6.yaml index cac9a308c1b18a..272ec4df2e7e09 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_6.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.6. [TC-DL-1.6] Verification for the following Commands - Set PIN Code, + 100.2.6. [TC-DL-2.6] Verification for the following Commands - Set PIN Code, Get PIN Code, Get PIN Code Response, Clear PIN Code, Clear All PIN Codes [DUT-Server] diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_7.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_7.yaml similarity index 95% rename from src/app/tests/suites/certification/Test_TC_DL_1_7.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_7.yaml index 4b81f856afec9f..93f608d8226b36 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_7.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.7. [TC-DL-1.7] Verification for the following Commands - Set User + 100.2.7. [TC-DL-2.7] Verification for the following Commands - Set User Status, Get User Status , Get User Status Response [DUT-Server] config: diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_8.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_8.yaml similarity index 96% rename from src/app/tests/suites/certification/Test_TC_DL_1_8.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_8.yaml index a8a9e4dd128225..941d89ba4e9836 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_8.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 107.8. [TC-DL-1.8] Verification for the following Commands - Set Week Day + 100.2.8. [TC-DL-2.8] Verification for the following Commands - Set Week Day Schedule, Get Week Day Schedule , Get Week Day Schedule Response, Clear Week Day Schedule [DUT-Server] diff --git a/src/app/tests/suites/certification/Test_TC_DIAG_LOG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_Diag_Log_2_1.yaml similarity index 99% rename from src/app/tests/suites/certification/Test_TC_DIAG_LOG_1_1.yaml rename to src/app/tests/suites/certification/Test_TC_Diag_Log_2_1.yaml index 955a7acb477104..579d1f19fea7f9 100644 --- a/src/app/tests/suites/certification/Test_TC_DIAG_LOG_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_Diag_Log_2_1.yaml @@ -14,8 +14,8 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 54.1. TC-Diag Log-1.1 Diagnostic Logs Cluster Commands Checks with BDX [DUT - Server] + 54.2. [TC-Diag Log-2.1] Diagnostic Logs Cluster Commands Checks with BDX + [DUT Server] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_DIAG_LOG_1_2.yaml b/src/app/tests/suites/certification/Test_TC_Diag_Log_2_2.yaml similarity index 97% rename from src/app/tests/suites/certification/Test_TC_DIAG_LOG_1_2.yaml rename to src/app/tests/suites/certification/Test_TC_Diag_Log_2_2.yaml index 770e624fae57b7..8540ed0e917ba4 100644 --- a/src/app/tests/suites/certification/Test_TC_DIAG_LOG_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_Diag_Log_2_2.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 54.2. TC-Diag Log-1.2 Diagnostic Logs Cluster Commands Checks without BDX + 54.3. [TC-Diag Log-2.2] Diagnostic Logs Cluster Commands Checks without BDX [DUT Server] config: diff --git a/src/app/tests/suites/certification/Test_TC_DIAG_LOG_1_3.yaml b/src/app/tests/suites/certification/Test_TC_Diag_Log_2_3.yaml similarity index 98% rename from src/app/tests/suites/certification/Test_TC_DIAG_LOG_1_3.yaml rename to src/app/tests/suites/certification/Test_TC_Diag_Log_2_3.yaml index f97e43c2c51878..d57c3a3aa10dd7 100644 --- a/src/app/tests/suites/certification/Test_TC_DIAG_LOG_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_Diag_Log_2_3.yaml @@ -13,7 +13,8 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 54.3. TC-Diag Log-1.3 Diagnostic Logs Cluster Commands Checks[DUT Client] +name: + 54.4. [TC-Diag Log-2.3] Diagnostic Logs Cluster Commands Checks[DUT Client] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_GC_1_2.yaml b/src/app/tests/suites/certification/Test_TC_GC_2_2.yaml similarity index 98% rename from src/app/tests/suites/certification/Test_TC_GC_1_2.yaml rename to src/app/tests/suites/certification/Test_TC_GC_2_2.yaml index acea32795a4f4c..846833fe7522f4 100644 --- a/src/app/tests/suites/certification/Test_TC_GC_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_GC_2_2.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 90.2. [TC-GC-1.2] ArmFailSafe command verification [DUT - Commissionee] +name: 88.3. [TC-GC-2.2] ArmFailSafe command verification [DUT - Commissionee] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_GC_1_3.yaml b/src/app/tests/suites/certification/Test_TC_GC_2_3.yaml similarity index 98% rename from src/app/tests/suites/certification/Test_TC_GC_1_3.yaml rename to src/app/tests/suites/certification/Test_TC_GC_2_3.yaml index 2e4b404a6262d9..2948982b79972b 100644 --- a/src/app/tests/suites/certification/Test_TC_GC_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_GC_2_3.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 90.3. [TC-GC-1.3] BUSY Status code verification [DUT - Commissionee] +name: 88.4. [TC-GC-2.3] BUSY Status code verification [DUT - Commissionee] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_GC_1_4.yaml b/src/app/tests/suites/certification/Test_TC_GC_2_4.yaml similarity index 99% rename from src/app/tests/suites/certification/Test_TC_GC_1_4.yaml rename to src/app/tests/suites/certification/Test_TC_GC_2_4.yaml index b9933ac414c56b..dc1f900eea9063 100644 --- a/src/app/tests/suites/certification/Test_TC_GC_1_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_GC_2_4.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 90.4. [TC-GC-1.4] Verification For ErrorCode message [DUT - Commissionee] +name: 88.5. [TC-GC-2.4] Verification For ErrorCode message [DUT - Commissionee] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_LC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LC_1_1.yaml index 052925f98e7b18..9ddb1becb0d93f 100644 --- a/src/app/tests/suites/certification/Test_TC_LC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LC_1_1.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 95.1. [TC-LC-1.1] Global Attributes [DUT-Server] +name: 92.1. [TC-LC-1.1] Global Attributes [DUT-Server] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_LC_1_3.yaml b/src/app/tests/suites/certification/Test_TC_LC_2_3.yaml similarity index 95% rename from src/app/tests/suites/certification/Test_TC_LC_1_3.yaml rename to src/app/tests/suites/certification/Test_TC_LC_2_3.yaml index aff522552ee595..380b952047e706 100644 --- a/src/app/tests/suites/certification/Test_TC_LC_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_LC_2_3.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 95.3. [TC-LC-1.3] User Label cluster write verification [DUT - Commissionee] + 92.4. [TC-LC-2.3] User Label cluster write verification [DUT - Commissionee] config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_LC_1_4.yaml b/src/app/tests/suites/certification/Test_TC_LC_2_4.yaml similarity index 95% rename from src/app/tests/suites/certification/Test_TC_LC_1_4.yaml rename to src/app/tests/suites/certification/Test_TC_LC_2_4.yaml index 3e362f04128d06..aeee2eaf6a4f47 100644 --- a/src/app/tests/suites/certification/Test_TC_LC_1_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_LC_2_4.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 95.4. [TC-LC-1.4]User Label cluster constraint_error verification [DUT - + 92.5. [TC-LC-2.4]User Label cluster constraint_error verification [DUT - Commissionee] config: diff --git a/src/app/tests/suites/certification/Test_TC_LC_1_5.yaml b/src/app/tests/suites/certification/Test_TC_LC_2_5.yaml similarity index 95% rename from src/app/tests/suites/certification/Test_TC_LC_1_5.yaml rename to src/app/tests/suites/certification/Test_TC_LC_2_5.yaml index 38fc4ee304b96b..c42c168d304912 100644 --- a/src/app/tests/suites/certification/Test_TC_LC_1_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_LC_2_5.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 95.5. [TC-LC-1.5] User Label cluster empty entry verification [DUT - + 92.6. [TC-LC-2.5] User Label cluster empty entry verification [DUT - Commissionee] config: diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 1a036738354409..65932f14937372 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -289,14 +289,14 @@ class ManualTestList : public Command printf("Test_TC_DM_2_4\n"); printf("Test_TC_DM_3_2\n"); printf("Test_TC_DM_3_4\n"); - printf("Test_TC_DIAG_LOG_1_1\n"); - printf("Test_TC_DIAG_LOG_1_2\n"); - printf("Test_TC_DIAG_LOG_1_3\n"); + printf("Test_TC_Diag_Log_2_1\n"); + printf("Test_TC_Diag_Log_2_2\n"); + printf("Test_TC_Diag_Log_2_3\n"); printf("Test_TC_DESC_1_1\n"); printf("Test_TC_ETHDIAG_1_2\n"); - printf("Test_TC_GC_1_2\n"); - printf("Test_TC_GC_1_3\n"); - printf("Test_TC_GC_1_4\n"); + printf("Test_TC_GC_2_2\n"); + printf("Test_TC_GC_2_3\n"); + printf("Test_TC_GC_2_4\n"); printf("Test_TC_GENDIAG_1_1\n"); printf("Test_TC_GENDIAG_1_2\n"); printf("Test_TC_GENDIAG_2_1\n"); @@ -412,24 +412,24 @@ class ManualTestList : public Command printf("Test_TC_CC_6_4\n"); printf("Test_TC_CC_7_5\n"); printf("Test_TC_CC_9_4\n"); - printf("Test_TC_DL_1_1\n"); - printf("Test_TC_DL_1_2\n"); - printf("Test_TC_DL_1_4\n"); - printf("Test_TC_DL_1_5\n"); - printf("Test_TC_DL_1_6\n"); - printf("Test_TC_DL_1_7\n"); - printf("Test_TC_DL_1_8\n"); - printf("Test_TC_DL_1_10\n"); - printf("Test_TC_DL_1_11\n"); - printf("Test_TC_DL_1_13\n"); - printf("Test_TC_DL_1_14\n"); - printf("Test_TC_DL_1_15\n"); - printf("Test_TC_DL_1_16\n"); - printf("Test_TC_DL_1_17\n"); + printf("Test_TC_DL_2_1\n"); + printf("Test_TC_DL_2_2\n"); + printf("Test_TC_DL_2_4\n"); + printf("Test_TC_DL_2_5\n"); + printf("Test_TC_DL_2_6\n"); + printf("Test_TC_DL_2_7\n"); + printf("Test_TC_DL_2_8\n"); + printf("Test_TC_DL_2_10\n"); + printf("Test_TC_DL_2_11\n"); + printf("Test_TC_DL_2_13\n"); + printf("Test_TC_DL_2_14\n"); + printf("Test_TC_DL_2_15\n"); + printf("Test_TC_DL_2_16\n"); + printf("Test_TC_DL_2_17\n"); printf("Test_TC_LC_1_1\n"); - printf("Test_TC_LC_1_3\n"); - printf("Test_TC_LC_1_4\n"); - printf("Test_TC_LC_1_5\n"); + printf("Test_TC_LC_2_3\n"); + printf("Test_TC_LC_2_4\n"); + printf("Test_TC_LC_2_5\n"); printf("Test_TC_LO_1_1\n"); printf("Test_TC_LVL_2_3\n"); printf("Test_TC_NC_1_1\n"); @@ -55362,11 +55362,11 @@ class Test_TC_DM_3_4Suite : public TestCommand } }; -class Test_TC_DIAG_LOG_1_1Suite : public TestCommand +class Test_TC_Diag_Log_2_1Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_1", 0, credsIssuerConfig) + Test_TC_Diag_Log_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_Diag_Log_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55374,7 +55374,7 @@ class Test_TC_DIAG_LOG_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DIAG_LOG_1_1Suite() {} + ~Test_TC_Diag_Log_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55419,11 +55419,11 @@ class Test_TC_DIAG_LOG_1_1Suite : public TestCommand } }; -class Test_TC_DIAG_LOG_1_2Suite : public TestCommand +class Test_TC_Diag_Log_2_2Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_2", 0, credsIssuerConfig) + Test_TC_Diag_Log_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_Diag_Log_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55431,7 +55431,7 @@ class Test_TC_DIAG_LOG_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DIAG_LOG_1_2Suite() {} + ~Test_TC_Diag_Log_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55476,11 +55476,11 @@ class Test_TC_DIAG_LOG_1_2Suite : public TestCommand } }; -class Test_TC_DIAG_LOG_1_3Suite : public TestCommand +class Test_TC_Diag_Log_2_3Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_3", 0, credsIssuerConfig) + Test_TC_Diag_Log_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_Diag_Log_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55488,7 +55488,7 @@ class Test_TC_DIAG_LOG_1_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DIAG_LOG_1_3Suite() {} + ~Test_TC_Diag_Log_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55646,10 +55646,10 @@ class Test_TC_ETHDIAG_1_2Suite : public TestCommand } }; -class Test_TC_GC_1_2Suite : public TestCommand +class Test_TC_GC_2_2Suite : public TestCommand { public: - Test_TC_GC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_2", 0, credsIssuerConfig) + Test_TC_GC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55657,7 +55657,7 @@ class Test_TC_GC_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GC_1_2Suite() {} + ~Test_TC_GC_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55702,10 +55702,10 @@ class Test_TC_GC_1_2Suite : public TestCommand } }; -class Test_TC_GC_1_3Suite : public TestCommand +class Test_TC_GC_2_3Suite : public TestCommand { public: - Test_TC_GC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_3", 0, credsIssuerConfig) + Test_TC_GC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55713,7 +55713,7 @@ class Test_TC_GC_1_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GC_1_3Suite() {} + ~Test_TC_GC_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55758,10 +55758,10 @@ class Test_TC_GC_1_3Suite : public TestCommand } }; -class Test_TC_GC_1_4Suite : public TestCommand +class Test_TC_GC_2_4Suite : public TestCommand { public: - Test_TC_GC_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_1_4", 0, credsIssuerConfig) + Test_TC_GC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_GC_2_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -55769,7 +55769,7 @@ class Test_TC_GC_1_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_GC_1_4Suite() {} + ~Test_TC_GC_2_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62259,10 +62259,10 @@ class Test_TC_CC_9_4Suite : public TestCommand } }; -class Test_TC_DL_1_1Suite : public TestCommand +class Test_TC_DL_2_1Suite : public TestCommand { public: - Test_TC_DL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_1", 0, credsIssuerConfig) + Test_TC_DL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62270,7 +62270,7 @@ class Test_TC_DL_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_1Suite() {} + ~Test_TC_DL_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62315,10 +62315,10 @@ class Test_TC_DL_1_1Suite : public TestCommand } }; -class Test_TC_DL_1_2Suite : public TestCommand +class Test_TC_DL_2_2Suite : public TestCommand { public: - Test_TC_DL_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_2", 0, credsIssuerConfig) + Test_TC_DL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62326,7 +62326,7 @@ class Test_TC_DL_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_2Suite() {} + ~Test_TC_DL_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62371,10 +62371,10 @@ class Test_TC_DL_1_2Suite : public TestCommand } }; -class Test_TC_DL_1_4Suite : public TestCommand +class Test_TC_DL_2_4Suite : public TestCommand { public: - Test_TC_DL_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_4", 0, credsIssuerConfig) + Test_TC_DL_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62382,7 +62382,7 @@ class Test_TC_DL_1_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_4Suite() {} + ~Test_TC_DL_2_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62427,10 +62427,10 @@ class Test_TC_DL_1_4Suite : public TestCommand } }; -class Test_TC_DL_1_5Suite : public TestCommand +class Test_TC_DL_2_5Suite : public TestCommand { public: - Test_TC_DL_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_5", 0, credsIssuerConfig) + Test_TC_DL_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62438,7 +62438,7 @@ class Test_TC_DL_1_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_5Suite() {} + ~Test_TC_DL_2_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62483,10 +62483,10 @@ class Test_TC_DL_1_5Suite : public TestCommand } }; -class Test_TC_DL_1_6Suite : public TestCommand +class Test_TC_DL_2_6Suite : public TestCommand { public: - Test_TC_DL_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_6", 0, credsIssuerConfig) + Test_TC_DL_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62494,7 +62494,7 @@ class Test_TC_DL_1_6Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_6Suite() {} + ~Test_TC_DL_2_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62539,10 +62539,10 @@ class Test_TC_DL_1_6Suite : public TestCommand } }; -class Test_TC_DL_1_7Suite : public TestCommand +class Test_TC_DL_2_7Suite : public TestCommand { public: - Test_TC_DL_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_7", 0, credsIssuerConfig) + Test_TC_DL_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62550,7 +62550,7 @@ class Test_TC_DL_1_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_7Suite() {} + ~Test_TC_DL_2_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62595,10 +62595,10 @@ class Test_TC_DL_1_7Suite : public TestCommand } }; -class Test_TC_DL_1_8Suite : public TestCommand +class Test_TC_DL_2_8Suite : public TestCommand { public: - Test_TC_DL_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_8", 0, credsIssuerConfig) + Test_TC_DL_2_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_8", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62606,7 +62606,7 @@ class Test_TC_DL_1_8Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_8Suite() {} + ~Test_TC_DL_2_8Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62651,10 +62651,10 @@ class Test_TC_DL_1_8Suite : public TestCommand } }; -class Test_TC_DL_1_10Suite : public TestCommand +class Test_TC_DL_2_10Suite : public TestCommand { public: - Test_TC_DL_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_10", 0, credsIssuerConfig) + Test_TC_DL_2_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_10", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62662,7 +62662,7 @@ class Test_TC_DL_1_10Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_10Suite() {} + ~Test_TC_DL_2_10Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62707,10 +62707,10 @@ class Test_TC_DL_1_10Suite : public TestCommand } }; -class Test_TC_DL_1_11Suite : public TestCommand +class Test_TC_DL_2_11Suite : public TestCommand { public: - Test_TC_DL_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_11", 0, credsIssuerConfig) + Test_TC_DL_2_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_11", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62718,7 +62718,7 @@ class Test_TC_DL_1_11Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_11Suite() {} + ~Test_TC_DL_2_11Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62763,10 +62763,10 @@ class Test_TC_DL_1_11Suite : public TestCommand } }; -class Test_TC_DL_1_13Suite : public TestCommand +class Test_TC_DL_2_13Suite : public TestCommand { public: - Test_TC_DL_1_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_13", 0, credsIssuerConfig) + Test_TC_DL_2_13Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_13", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62774,7 +62774,7 @@ class Test_TC_DL_1_13Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_13Suite() {} + ~Test_TC_DL_2_13Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62819,10 +62819,10 @@ class Test_TC_DL_1_13Suite : public TestCommand } }; -class Test_TC_DL_1_14Suite : public TestCommand +class Test_TC_DL_2_14Suite : public TestCommand { public: - Test_TC_DL_1_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_14", 0, credsIssuerConfig) + Test_TC_DL_2_14Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_14", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62830,7 +62830,7 @@ class Test_TC_DL_1_14Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_14Suite() {} + ~Test_TC_DL_2_14Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62875,10 +62875,10 @@ class Test_TC_DL_1_14Suite : public TestCommand } }; -class Test_TC_DL_1_15Suite : public TestCommand +class Test_TC_DL_2_15Suite : public TestCommand { public: - Test_TC_DL_1_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_15", 0, credsIssuerConfig) + Test_TC_DL_2_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_15", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62886,7 +62886,7 @@ class Test_TC_DL_1_15Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_15Suite() {} + ~Test_TC_DL_2_15Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62931,10 +62931,10 @@ class Test_TC_DL_1_15Suite : public TestCommand } }; -class Test_TC_DL_1_16Suite : public TestCommand +class Test_TC_DL_2_16Suite : public TestCommand { public: - Test_TC_DL_1_16Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_16", 0, credsIssuerConfig) + Test_TC_DL_2_16Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_16", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62942,7 +62942,7 @@ class Test_TC_DL_1_16Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_16Suite() {} + ~Test_TC_DL_2_16Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -62987,10 +62987,10 @@ class Test_TC_DL_1_16Suite : public TestCommand } }; -class Test_TC_DL_1_17Suite : public TestCommand +class Test_TC_DL_2_17Suite : public TestCommand { public: - Test_TC_DL_1_17Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_17", 0, credsIssuerConfig) + Test_TC_DL_2_17Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_17", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -62998,7 +62998,7 @@ class Test_TC_DL_1_17Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_17Suite() {} + ~Test_TC_DL_2_17Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -63099,10 +63099,10 @@ class Test_TC_LC_1_1Suite : public TestCommand } }; -class Test_TC_LC_1_3Suite : public TestCommand +class Test_TC_LC_2_3Suite : public TestCommand { public: - Test_TC_LC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_1_3", 0, credsIssuerConfig) + Test_TC_LC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -63110,7 +63110,7 @@ class Test_TC_LC_1_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LC_1_3Suite() {} + ~Test_TC_LC_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -63155,10 +63155,10 @@ class Test_TC_LC_1_3Suite : public TestCommand } }; -class Test_TC_LC_1_4Suite : public TestCommand +class Test_TC_LC_2_4Suite : public TestCommand { public: - Test_TC_LC_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_1_4", 0, credsIssuerConfig) + Test_TC_LC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_2_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -63166,7 +63166,7 @@ class Test_TC_LC_1_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LC_1_4Suite() {} + ~Test_TC_LC_2_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -63211,10 +63211,10 @@ class Test_TC_LC_1_4Suite : public TestCommand } }; -class Test_TC_LC_1_5Suite : public TestCommand +class Test_TC_LC_2_5Suite : public TestCommand { public: - Test_TC_LC_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_1_5", 0, credsIssuerConfig) + Test_TC_LC_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_2_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -63222,7 +63222,7 @@ class Test_TC_LC_1_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LC_1_5Suite() {} + ~Test_TC_LC_2_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -65144,14 +65144,14 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -65267,24 +65267,24 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig),